Commit Graph

1361 Commits

Author SHA1 Message Date
Siddharth Bharat Purohit 2c831c314e commander: correct mag cal offset direction 2017-02-01 08:38:26 +01:00
Siddharth Bharat Purohit c6f8bcf8b3 commander: use mathlib matrix_alg functions 2017-02-01 08:38:26 +01:00
Siddharth Bharat Purohit 78b8deda15 commander: add ellipsoid 9 param fit for magnetometer corrections 2017-02-01 08:38:26 +01:00
Siddharth Bharat Purohit c9ac15f0dd commander: fix code style 2017-02-01 08:38:26 +01:00
Siddharth Bharat Purohit f811777789 commander: add new math for sphere fit for compass calibration 2017-02-01 08:38:26 +01:00
Beat Küng c1e2aeff0b commander: ignore PREFLIGHT_CALIBRATION for temperature calibration param 2017-01-25 22:43:29 +01:00
David Sidrane 63e3bbde07 gyro_calibration is using board_get_uuid_raw32 instead of mcu_unique_id 2017-01-25 07:43:11 +01:00
Julian Oes 4ceba407f2 commander: raise stack size
A stack usage of 3000 bytes was observed, therefore it's safer to raise
the commander's stack size by 400 bytes.
2017-01-21 16:04:43 +01:00
David Sidrane 1c3ebadb85 Removed unused defines AVIONICS_ERROR_VOLTAGE and AVIONICS_WARN_VOLTAGE 2017-01-21 11:45:36 +01:00
Chris Lovett 33a307873a Enable rc mode change switch to override offboard mode. This is a safety feature, in case offboard control goes crazy, user can always regain control by switching modes to stabilize, or alt hold or position hold, however they have configured the mode change RC switch. 2017-01-18 18:15:58 +01:00
Lorenz Meier a13082bfed commander: Widen pre-flight check for airspeed 2017-01-16 08:26:37 -08:00
wangxdflight b693e29d64 enable px4 flight for excelsior(legacy) 2017-01-16 08:25:58 -08:00
Daniel Agar df5d0ba8b9 airspeed cal more descriptive error message (#6324) 2017-01-13 17:26:27 -05:00
Beat Küng 48c5ec54bb commander: make sure all code paths return an (n)ack to MAV_CMD_PREFLIGHT_CALIBRATION 2017-01-11 16:25:04 +01:00
Daniel Agar 5ec546f735 Makefile add scan-build target 2017-01-02 10:14:41 +01:00
Lorenz Meier 8416505a67 Commander: Header cleanup 2016-12-27 21:00:51 +01:00
Anton Matosov 3a17c07b1e Implement RC and DL failsafe action handling for multirotors
Move RC and DL failsafe actions handling from navigator to commander (credits to @AndreasAntener)
Separate manual kill switch handling via manual_lockdown to prevent override and release of software lockdown by RC switch

Other changes:
Add failsafe tune
Fix LED blinking for Pixracer
Return back support for rc inputs in simulator but now it is configurable via cmake
2016-12-27 00:38:13 +01:00
Lorenz Meier fff35fe34b Commander: Improve preflight check experience
* Loosen thresholds for gyro consistency check until temperature compensated units are the norm
  * Cut down string lengths so they make it through the MAVLink transport as a whole
2016-12-26 14:04:30 +01:00
Lorenz Meier 5d7d26531c Commander: Acknowledge pair commands 2016-12-23 17:40:11 +01:00
Beat Küng db2efa79da fix commander: remove unused variable rtl_on 2016-12-21 14:09:41 +01:00
Lorenz Meier 9ae2376d1c Commander: Indicate overload on the ground only if not transient. Adjust max CPU load to 80%. Indicate overload in air immediatley 2016-12-21 11:44:47 +01:00
Matthias Grob 0dbdde3404 Arming: made flags more understandable, added error message for rejected disarm 2016-12-20 09:46:36 +01:00
Matthias Grob f6282f5b3d Arm button fix: include the arm switch into the structure of all the checks for RC arming 2016-12-20 09:46:36 +01:00
Matthias Grob 94c8371ffe Arm button fix: toggle arming state only once per arm button press 2016-12-20 09:46:36 +01:00
Matthias Grob 8a75827d6a fixed all comments of arm button review 2016-12-20 09:46:36 +01:00
Matthias Grob aa984edd90 added an rc switch for arming and disarming with the option to use it as a button 2016-12-20 09:46:36 +01:00
Julian Oes e3aecc0762 state_machine_helper: remove unused const var 2016-12-15 10:17:03 +01:00
Julian Oes 0b02a6e0f7 state_machine_helper: warn about offboard lost, not RC
When offboard input stops and we're in OFFBOARD mode, we should complain
about offboard being lost and not RC because we probably never even had RC.
2016-12-15 10:17:03 +01:00
Lorenz Meier 4b0647d9c0 Condition the GPS check always on the commander GPS prearm check param (#6055) 2016-12-14 15:30:24 +01:00
Julian Oes adc9ed61b8 commander: ignore arm/disarm in DO_SET_MODE cmd
According to https://github.com/mavlink/mavlink/pull/629 the mavlink
command DO_SET_MODE should only determine the mode but not the
armed/disarmed state, so the MAV_MODE_FLAG_SAFETY_ARMED bit should be
ignored.
Instead the mavlink command COMPONENT_ARM_DISARM should be used instead.

Therefore, the commander now ignores the arm/disarm bit.
2016-12-11 17:00:09 +01:00
Paul Riseborough 1fbc688757 Commander: Fix pre-flight EKF check errors 2016-12-09 17:58:23 +01:00
Andreas Antener ef495d26b8 Airspeed calibration: wait on filter before preflight check 2016-12-02 22:56:48 +01:00
Andreas Antener e9737d6f7a Preflight checks: made sure pre-flight check results are always reported first thing on the console and always on new or re-established telemetry links AFTER waiting for the hotplug timeout
(leads to double publishing on the console when a new link is established, but this is the best compromise between fixing and completely restructuring)
2016-12-02 22:56:48 +01:00
Andreas Antener c069264752 Preflight check: initialize VTOL flag before it is used 2016-12-02 22:56:48 +01:00
Andreas Antener b531e65f6a Airspeed check: updated message and explained test parameters 2016-12-02 22:56:48 +01:00
Andreas Antener f772fc2d02 Airspeed: preflight check for bad offset, fixed calls to preflight checks (vtol & airspeed) 2016-12-02 22:56:48 +01:00
Daniel Agar c17c8884d1 implement MAV_CMD_DO_LAND_START 2016-11-19 15:48:10 +01:00
Daniel Agar 9e589cef48 airspeed calibration fail with any errors 2016-11-19 15:15:36 +01:00
Paul Riseborough 983cfb8fdd commander: Add preflight checking for EKF health and IMU sensor consistency 2016-11-19 15:12:08 +01:00
Daniel Agar 8ac4dd04ae implement MAV_CMD_MISSION_START 2016-11-06 15:24:34 +01:00
Daniel Agar cdd317ba38 commander arm check throttle include rattitude 2016-11-01 22:51:51 +01:00
Daniel Agar 2908f1c16d commander allow disarm command with throttle 2016-10-31 09:15:06 +01:00
Daniel Agar 27a50275b6 commander NAV_RETURN_TO_LAUNCH change mode to RTL 2016-10-30 21:41:43 +01: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 f29a50df31 logger: add support for mavlink backend in Logger class, handle start/stop 2016-10-19 13:13:47 +02:00
Michael Schaeuble 062df05865 Add __PX4_POSIX_BEBOP define to PreflightCheck.cpp 2016-10-18 20:48:17 +02:00
Roman 3faaeb06d1 attitude setpoint topic: cleanup of matrix class usage
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
tumbili 5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
James Goppert dbd94907c4 Only send failsafe info messages on state change. 2016-10-13 01:57:00 -04:00
James Goppert 43b665ae01 Fix gps circuit breaker logic in state machine. 2016-10-12 23:07:26 -05:00