Commit Graph

19951 Commits

Author SHA1 Message Date
Henry Zhang
d8ac044414 MindPX: Support serial RC input. 2016-10-29 10:56:32 +02:00
Henry Zhang
5076ba0049 MindPX: Disable second CAN bus. 2016-10-29 10:56:32 +02:00
Henry Zhang
99ad8f464e MindPX: Update modules config. 2016-10-29 10:56:32 +02:00
Henry Zhang
93343487e7 MindPX: Harmonize with FMUv4. 2016-10-29 10:56:32 +02:00
Julian Oes
c9f0d1e645 rcS: move check for PWM input up
pwm_input was not working correctly (only after a pwm_input reset) on
Pixracer because fmu was started on all PWM output channels.

This moves the check if PWM input is needed up before the fmu start.
2016-10-29 10:52:44 +02:00
Lorenz Meier
b9cf679118 Update sitl_gazebo 2016-10-29 00:01:39 +02:00
Lorenz Meier
b3e948d28c Update simulators 2016-10-29 00:00:33 +02:00
Julian Oes
62603bee45 simulation: SITL outputs from 0..1
Instead of sending actuator controls from -1..1 for SITL, we should send
0..1 like we already do for HIL. This will enable negative thrust in the
future, e.g. for pusher props that spin backwards, or for vehicles with
variable pitch propellers.
2016-10-28 23:56:46 +02:00
Julian Oes
0a043365ec rename gazebo_tailsitter to tailsitter
This is currently broken anyway but the new name makes more sense.
2016-10-28 23:56:46 +02: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
Carlo Wood
e29b9b5d39 Remove fake config targets.
The "targets" posix_rpi_common, qurt_sdflight_default and
posix_sdflight_default are not real targets; they are
just files in cmake/configs that are included by other
targets.
2016-10-28 08:40:23 +02:00
Erik Jähne
ae2aeab5e4 HIL_STATE: publish control_state_msg when receive mavlink_hil_state_quaternion message 2016-10-28 08:38:18 +02:00
Carlo Wood
5b52cd0fe6 Compile fixes for old/unused targets.
These are some changes that I needed to compile
most of the unsupported targets.

After this all (make list_config_targets) compile
for me except: posix_eagle_muorb, posix_sdflight_default
and qurt_eagle_legacy_driver_default.
2016-10-26 14:00:52 +02:00
Andreas Antener
1999ed2601 Testing: use return value to check if controllib tests failed 2016-10-26 08:41:21 +02:00
Beat Küng
a2c493efc7 fix vmount: initialize manual control for mavlink inputs 2016-10-26 08:40:23 +02:00
Paul Riseborough
d37a927cdb ROMFS: enable use of px4flow sensor with pixracer 2016-10-25 20:31:46 +11:00
David Sidrane
7ae749090b Update NuttX submodule to use backport of ctype.h & cctype
This is the equivalent to Greg's upstream solution for ctype.h &
 cctype with the necessary shadow waning fix.
 It also deletes the Hack in pa4_defines.h
2016-10-25 08:39:09 +02:00
Mark Whitehorn
4cc97aa705 fix another bug in fmu mode 2016-10-24 18:22:18 +02:00
Beat Küng
95f5ba9635 fix mavlink_shell.py: python3 compat for octal numbers 2016-10-24 12:51:50 +02:00
Beat Küng
cbbee30e48 log_writer_file: add include px4_posix.h (needed for stack size macro)
Failed with GCC 6.0.1, don't know why it worked before...
2016-10-24 10:22:48 +02:00
Beat Küng
c8a79d2443 mc_pos_control_main: remove <functional> include
Avoid including <functional> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Beat Küng
3029555016 uORBUtils: remove #include <string>
Avoid including <string> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Beat Küng
d0dace7c23 uavcan: use math::min instead of std::min
Avoid including <memory> which can cause problems on NuttX
2016-10-24 10:22:48 +02:00
Lorenz Meier
f466913a32 Update MAVLink headers and adapter header to current master 2016-10-23 22:14:19 +02:00
Lorenz Meier
f9abe39c3a DSM parser: Keep local copy of channel data 2016-10-23 19:58:52 +02:00
Lorenz Meier
3bed398a1e FMU: scan longer 2016-10-23 19:58:52 +02:00
Lorenz Meier
8d51e4ade1 MAVLink shell: Fix OS X default path 2016-10-23 17:46:22 +02:00
Lorenz Meier
05bc9acfb7 navigator: Wrap get time inside into function call and set time inside to zero
This ensures that the dual-use of the pitch_min / time_inside field is handled
properly between takeoff and non-takeoff items. Flight tested in SITL.
2016-10-23 16:26:03 +02:00
Lorenz Meier
5ddd69c872 Dataman: Make versioning define more explicit 2016-10-23 16:26:03 +02:00
Lorenz Meier
c7cdef2a4b Clarify version flag for dataman 2016-10-23 16:26:03 +02:00
Lorenz Meier
0a4fedd778 Dataman: Use single method to infer file compatibility 2016-10-23 16:26:03 +02:00
Lorenz Meier
9e7d5f088e dataman: Ensure compat field is set and read correctly 2016-10-23 16:26:03 +02:00
Lorenz Meier
ff0d7613b1 Add manual seed to dataman hash to allow later incrementing the seed number for incompatible changes 2016-10-23 16:26:03 +02:00
Lorenz Meier
db774798fa Dataman: Store sizes of all containers and reset file if any of them changes. 2016-10-23 16:26:03 +02:00
Lorenz Meier
c340974991 Ensure pitch min param is correctly handled 2016-10-23 16:26:03 +02:00
Lorenz Meier
eaae1abdaf Simplify use of pitch_min 2016-10-23 16:26:03 +02:00
Lorenz Meier
9821499113 navigator / mission item: Compress fields into bitfield 2016-10-23 16:26:03 +02:00
Lorenz Meier
5899ce715d Navigator: Leverage overlapping fields in logic to save RAM by makeing them overlap in memory as well 2016-10-23 16:26:03 +02:00
Julian Oes
4160b65edb navigator: change default min takeoff alt to 2.5m
Fixedwing aircraft will override this with fw.defaults anyway.
2016-10-23 16:25:15 +02:00
Julian Oes
82f27884df navigator: fix wrong altitude after takeoff
This change fixes a wrong behaviour when a takeoff command is sent.

An example:
- MIS_TAKEOFF_ALT set to 10 meters
- Takeoff command with alt setpoint of 2 meters

Old behaviour:
1. Climb to 10 meters -> takeoff WP reached
2. Go to setpoint at 2 meters

New behaviour:
1. Climb to 10 meters and stay there but notify that altitude was
   overridden.
2016-10-23 16:25:15 +02:00
Julian Oes
032f4df3de mc_pos_control: revert gain change 2016-10-23 16:25:15 +02:00
Julian Oes
dcd0df7d02 navigator: fix typo 2016-10-23 16:25:15 +02:00
Julian Oes
4f5fa50efb navigator: fix takeoff jump edge case
In the normal sitl `commander takeoff` case, the takeoff jump was never
actually carried out because the default altitude radius is set to 3m
and the takeoff altitude to ~2m which means that the takeoff waypoint is
"reached" immediately.

This works around this edge case by using the altitude between the home
altitude and takeoff altitude divided by 2 as a acceptance radius.
2016-10-23 16:25:15 +02:00
Julian Oes
72e46e7ed0 mc_pos_control: jump quicker
In SITL, it still takes a while until a vehicle lifts off, so it seems
sensible to raise this jump gain a bit.
2016-10-23 16:25:15 +02:00
Julian Oes
ff415a4f1d mc_pos_control: correctly initialize landed state
Since orb_copy is guarded with a orb_check, we ended up not having the
corrent landed state in the beginning which could lead to some
unexpected behaviour on takeoff.
2016-10-23 16:25:15 +02:00
Pavel Kirienko
3a332bb11a Printing all online nodes within UAVCAN status output. This feature increased memory footprint by about 150 bytes. 2016-10-23 15:26:10 +02:00
Pavel Kirienko
9b0ab83f9b Fixed misuse of the preprocessor 2016-10-23 15:26:10 +02:00
Pavel Kirienko
eff6a7b5d0 get_next_active_node_id() - starting from 0 2016-10-23 15:26:10 +02:00
Beat Küng
9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00