564 Commits

Author SHA1 Message Date
David Sidrane
5a5cfdbbe3 mcu_version remove mcu_unique_id
Using board cvommon UUID api thefore Removed mcu_unique_id
2017-01-25 07:43:11 +01:00
David Sidrane
24f5461402 systemlib/board_serial uses common board api for UUID 2017-01-25 07:43:11 +01:00
David Sidrane
1abd629461 Move common macros to systemlib/px4_macros.h 2017-01-24 21:18:28 +01:00
David Sidrane
9665db3efc Use px4_config.h not board_config.h 2017-01-21 11:45:36 +01:00
Lorenz Meier
084e714f62 Mixer: Fix yaw throttle adjustment
When a motor hits a limit we only want to lower the collective throttle as much as the total limit, not per motor hitting the limit.
2017-01-21 08:33:51 +01:00
Lorenz Meier
fc2970b309 Helicopter mixer: Fix out of bounds checks 2017-01-14 07:47:03 -08:00
Stephan Brown
67a484ac34 Make parameter generation also depend on the scripts that run. Address some review comments. 2017-01-06 09:58:58 +01:00
Stephan Brown
92b2395ff6 param: Fix another off by 1 error and a formatting issue. 2017-01-06 09:58:58 +01:00
Stephan Brown
bf57e86dc2 param: Fix an off by 1 issue and some style fixes. 2017-01-06 09:58:58 +01:00
Stephan Brown
99228bdeb1 param: Use utarray_find when looking for changed parameters and use a binary search for finding param handles by name. 2017-01-06 09:58:58 +01:00
Lorenz Meier
b3ce3cbaff Simple mixer: Remove incorrect pre-parser and replace with fixed central implementation 2017-01-03 20:32:33 -05:00
Lorenz Meier
dd05ff5156 Multirotor mixer: Remove incorrect pre-parser and replace with fixed central implementation 2017-01-03 20:32:33 -05:00
Lorenz Meier
ff18140cf4 Mixer: add string wconditioning check.
This introduces a correctly designed pre-check for the input parsers. This fixes the mixer unit test and should fix all issues occuring on real hardware.
;
2017-01-03 20:32:33 -05:00
Lorenz Meier
2cfcf3402e Systemlib: Header cleanup 2016-12-27 21:00:51 +01:00
Lorenz Meier
5b70522541 Mixer: Make reset operation more robust
This change makes the operation more robust as it flags the whole group invalid in the first step. This should not be confused with being thread-safe - to be thread-safe, all accesses to _first and the following linked list need to be guarded by a mutex. This should be done outside of the mixer in the driver though, as the method depends on the board architecture.
2016-12-26 13:41:36 +01:00
Beat Küng
41dc34204c version cleanup: move all version information into version.c and use a common API
The provided versioning information is the same, except for some additions,
like OS version (which still need to be implemented on NuttX).
2016-12-21 11:35:10 +01:00
Mark Whitehorn
8962eaa944 add new asymmetric airframe for Spedix S250AQ 2016-12-21 11:00:29 +01:00
David Sidrane
3eee469fbc Display the irq stack usage on the for the init thread (pid = 0) 2016-12-21 08:34:22 +01:00
David Sidrane
1781801151 Scope irq_state to function using it 2016-12-21 08:34:22 +01:00
David Sidrane
056bd5527d New NuttX debug API 2016-12-21 08:34:21 +01:00
David Sidrane
5661370944 Changed to Upstream NuttX Instrumentation changes 2016-12-21 08:34:21 +01:00
David Sidrane
dc8c6ea5e5 White space fixes 2016-12-21 08:34:21 +01:00
David Sidrane
d09cd77777 Adding hardfault logging application 2016-12-21 08:34:20 +01:00
David Sidrane
0177e250f4 STM32 Serial Number location is defined in NuttX 2016-12-21 08:34:20 +01:00
Lorenz Meier
83b177c5ad DC mixer: Fix geometry for Iris 2016-12-19 20:39:48 +01:00
Lorenz Meier
dfed9a3f13 Fix nullptr access in mixer group. This was only ever an issue on booboot and not in flight. 2016-12-19 20:36:05 +01:00
Roman
d221313dfb implemented mapping between desired thrust and applied pwm in
multirotor mixer.

Signed-off-by: Roman <bapstroman@gmail.com>
2016-12-15 23:39:53 +01:00
Daniel Agar
bce7ecb0f6 Iridium driver and support
Mavlink module implement HIGH_LATENCY (Iridium)
2016-12-14 08:20:01 +01:00
Lorenz Meier
c23378e70d Update heli mixer, not reporting saturation yet 2016-12-13 16:14:15 +01:00
Paul Riseborough
8b55c8ec55 systemlib mixer: Add public method for multi_rotor saturation status 2016-12-13 16:14:15 +01:00
Paul Riseborough
c4ccfeae0d mixer: improve multirotor motor limits reporting 2016-12-13 16:14:15 +01:00
Lorenz Meier
d817d331fd Add set trim API for helicopter mixer 2016-12-10 14:45:49 +01:00
Bart Slinger
a7c8d77453 Generic helicopter mixer
fix code style
2016-12-10 14:45:49 +01:00
Mark Whitehorn
dbc149c224 change trim units from absolute usec to normalized values 2016-12-10 12:56:39 +01:00
Mark Whitehorn
009a413438 fix argument order in pwm_limit_calc call, clean up
note that FMU does not update AUX pwm outputs if no RC signal
2016-12-10 12:56:39 +01:00
Mark Whitehorn
a0c8a78a14 use trim values to set mixer:scaler.offset
clamp mixer output offset to [-.2,.2] ([-2000, 2000] in mixer file)

add 8 main PWM trim parameters

add long desc to parameters and bump minor parameter version
2016-12-10 12:56:39 +01:00
Bartosz Wawrzacz
619efa7b45 [PX4IO/PWM driver] Added trim values to the PWM output drivers 2016-12-10 12:56:39 +01:00
Andreas Antener
64778b9540 Load monitor: added parameter to disable stack check 2016-12-09 21:12:12 +01:00
Lorenz Meier
c53d828e09 Set EKF2 as default estimator 2016-12-02 21:13:34 +01:00
Beat Küng
b020be13f6 flashparams: fix memory leak when saving parameters
A large buffer on the heap was not deallocated when parameters were saved,
but there were no changes to the parameters. In that case
parameter_flashfs_write() was not called, which was previously responsible
for freeing the buffer.

This patch moves the responsibility of freeing the buffer to the calling
side, which already explicitly allocates the buffer.
2016-11-29 10:38:11 +01:00
Dennis Shtatnov
37641042cc Explicit internal battery resistance params 2016-11-19 14:55:52 +01:00
Dennis Shtatnov
a634c14582 Scale throttle outputs by battery level. Fixes #4751 2016-11-19 14:55:52 +01:00
Carlo Wood
de85fbe1dc Remaining fixes needed before running Tools/fix_headers.sh
<systemlib/err.h> --> "systemlib/err.h" that fix_headers.sh
would miss because it comes after code it doesn't understand.

Effectively remove the '__EXPORT extern perf_counter_t perf_alloc('
line, because currently perf_alloc is defined to be NULL, and
after running fix_headers.sh that happens *before* this header
is included (the order of headers will be changed).

Do not define NULL to be (void*)0: that only works for C.
In fact, the conversions needed for NULL are so full of exceptions
that standard C++ introduced a new *keyword*: nullptr.
That's what we really should be using for C++ code.
In this case I just include the correct header to define NULL
the correct way.

Not really related to the header line:
Removed an #include <time.h> because I noted that px4_time.h
was already included... and moved a #include <sys/time.h>
to the top of the file (not really a fan of including headers
in the middle unless absolutely necessary).
Removed a include of queue.h because I noted it wasn't used.
2016-11-13 19:36:27 +01:00
Carlo Wood
04aa2bb3a4 Add missing header files.
These headers files were missing from the header files that
I added them to; the fact that they were missing didn't
lead to compile errors because by coincidence the missing
headers are included in the source files before including
these headers. But, after the reordering of header inclusions
by Tools/fix_headers.sh, these cases will give rise to compiler
errors.
2016-11-13 19:36:27 +01:00
Beat Küng
66ffc834d3 startup scripts: remove INAV, start LPE if INAV selected 2016-11-08 11:17:07 +01:00
Henry Zhang
309c256e9e fix param interface (#5797)
* param: fix bug when param value is changed to 'zero' for the first time, it won't be saved.

* param: revert incorrectly removed code.
2016-11-06 14:45:17 +01:00
Carlo Wood
90f3e3b5d3 Do not include headers inside __BEGIN_DECLS ... __END_DECLS blocks.
We don't have C++ unsafe headers (anymore).

I added a test to fix_headers.sh that checks if certain "unsafe"
headers are ONLY included inside a __BEGIN_DECLS ... __END_DECLS
(because after all, they are unsafe), as well as checking that
no other header files are included inside such a block. The rationale
of the latter is that if a file is a C header and it declares
function prototypes (otherwise it doesn't matter) and is sometimes
included outside a __BEGIN_DECLS ... __END_DECLS block (from a C++
source file) then it has to be C++ safe and doesn't ever to be
included from inside such a block; while if a file is a C++ header
then obviously it should never be included from such a block.

fix_headers.sh subsequently found several safe headers to be
included from inside such a block, and those that were (apparently
in the past) unsafe were included only sometimes inside such a
block and often outside it. I had a look at those files and saw
that at least an attempt has been made to make them C++ safe,
but especially because they already are included OFTEN outside
a __BEGIN_DECLS ... __END_DECLS (from C++ source files) the
best decision seems to treat them as safe.

This is not risky: .c files that define such functions still
generate C-linkage for their functions. If a C++ unsafe C header
is included outside a __BEGIN_DECLS ... __END_DECLS block then
the only possible result would be an undefined reference to
a function with C++-linkage that will not exist. Aka, when
something links after this commit, then the commit was correct.
I did build all targets and they all linked.
2016-10-28 11:57:08 +02:00
Carlo Wood
baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Beat Küng
b2d45732c2 system_params: add missing crazyflie to the param description 2016-10-19 13:13:47 +02:00
David Sidrane
db44129ec0 Prevents the posibility of buffer overflow in mixer parsing.
The fix limits scanf from overwritting the geomname buffer local
variable. Thus preventing stack corruption as noted by chungkim.
2016-10-12 22:58:55 +02:00