907 Commits

Author SHA1 Message Date
Lorenz Meier
c94e54bbab Commander: Handle HITL state in all places consistently 2017-08-02 15:12:25 +02:00
Beat Küng
007b6dd8d7 commander: make sure the power_button_state topic is advertised on startup
Otherwise the publication from IRQ context won't work
2017-07-29 23:10:47 +02:00
Beat Küng
2815c62acf fix power button shutdown: use an orb topic instead of a work queue call
px4_shutdown_request() was called from the power button IRQ callback, which
invoked a work queue callback. But on NuttX, the work queue uses a
semaphore, and thus it cannot be called from IRQ context.
This patch switches to publishing an uORB msg instead, which is handled in
the commander main thread.

To increase failure resistance, we could subscribe to the same topic in
another module for redundancy, in case commander runs wild.
2017-07-29 23:10:47 +02:00
Lorenz Meier
61b0a81bf9 HITL startup: Further simplification of boot logic in commander 2017-07-29 23:06:50 +02:00
Lorenz Meier
5838556742 HITL handling: Enforce the use of the activation parameter for HITL configuration 2017-07-29 23:06:50 +02:00
Lorenz Meier
4ca7187e42 Commander: Do not allow to set mission mode if the mission is failing feasibility checks. Provide clear feedback if telemetry is online and home is set about an invalid mission state. 2017-07-09 14:43:24 +02:00
Daniel Agar
1a6a871689 commander properly set boot timestamp 2017-07-08 21:54:04 +02:00
Daniel Agar
f11bb401f4 CMD_MISSION_START allow first_item=-1 to leave index unchanged 2017-07-08 19:49:52 +02:00
Julian Oes
9854fc0d84 Set timestamp with vehicle commands
The vehicle_command uORB messages had the timestamp unset at 0.
2017-07-08 11:52:23 +02:00
Lorenz Meier
13bf312263 Commander: Be less verbose 2017-06-21 21:43:28 +02:00
Lorenz Meier
7d23a52871 Commander: Remove debug output 2017-06-19 09:28:38 +02:00
Matthias Grob
e28f8bff67 commander: make commonly spoken strings more user friendly
these technical messages might not be suitable for the user of a product
2017-06-15 07:50:41 +02:00
Lorenz Meier
a1a0dd37dc Commander: Only report GPS lost errors if armed 2017-06-11 11:19:25 +02:00
Daniel Agar
8d5c955af4 remove partial CMD_OVERRIDE_GOTO implementation (#7356)
- closes #7326
2017-06-08 22:03:50 -04:00
Mohammed Kabir
ad5fe5f44a Add support for SET_CAMERA_MODE command; Not used yet. 2017-05-12 22:11:17 +02:00
Mohammed Kabir
2e92a3946d camera_trigger : completely refactor state handling 2017-05-12 22:11:17 +02:00
Paul Riseborough
341bd6e836 commander: add timeout test for global position data 2017-05-08 09:21:38 +02:00
Paul Riseborough
00a42abc69 commander: Add parameter to control postal fallback after loss of navigation accuracy
Also remove else if branch that cannot be accessed.
2017-05-08 09:21:38 +02:00
Paul Riseborough
b85c8fa135 commander: fix bug in pos vel validity transition
This ensures that a mode change will occur immediately when the EKF reports the solution as invalid.
2017-05-08 09:21:38 +02:00
Paul Riseborough
1a2ef45a4b commander: remove unused pos vel validity check functions 2017-05-03 08:37:14 +02:00
Paul Riseborough
625cc4aa83 commander: Use generic function for checking position and velocity validity 2017-05-03 08:37:14 +02:00
Paul Riseborough
8421ad3dfd commander: Changes following code review 2017-05-03 08:37:14 +02:00
priseborough
8ea0b2d3c5 commander: rework posvel validity checks
Move into functions.
Reset probation time and recalculate checks if a mode change is demanded to give the operator ability to regain control as soon as possible after nav performance is regained. (+11 squashed commits)
Squashed commits:
[a4bb800] commander: enable pilot to quickly recover from loss of position accuracy
[19e16a0] commander: rework postal probation time
[f96284e] commander: rework bad pos and vel test probation time
[00d5f0c] commander: Allow EKF preflight checks to pass with moving vehicle

Separates the 'is using GPS' and the GPS quality checks.
Uses a reasonable subset of the GPS quality checks which allows checks to pass if the vehicle is moving.
[4cdfb5c] commander: remove unused variable
[349385a] commander: add EKF GPS quality checks to pre-arm checking

Only perform check if GPs checking is activated by parameter setting.
Display fault messages that makes it clear if EKF quality checks are failing or the EKF is not using GPS for another reason. We do not want to confuse this with GPS lock.
[340ae29] commander: make position invalid fail-safe more sticky

Require check to pass for 7 seconds before exiting failsafe. This is required because if GPs is failing innovation tests for a prolonged period, the EKF will periodically reset to the GPS and report good accuracy at the time of reset.
Adding this delay gives time for an underlying error condition (eg bad IMU or compass) to be re-detected.
[b04ac95] commander: Increase RAM allocation to eliminate low stack warnings
[9dca12f] commander: add missing position invalid fail-safe responses
[69f264d] commander: Update position invalid fail-safe responses

Replace separate logic for each case with a generic function
Add velocity checks.
[8e8cef1] commander: rework position validity checks

Consolidate existing checks for global and local position validity and add checking of velocity accuracy.
Enable checks to be bypassed using the CBRK_VELPOSERR parameter.
2017-05-03 08:37:14 +02:00
Andreas Antener
00efbffea9 UAVCAN: disable ESCs when in VTOL fixed-wing 2017-04-23 14:59:24 +02:00
Andrew C. Smith
d21b6655d2 Add the Gumstix AeroCore2 to the build system. 2017-04-20 12:24:27 -10:00
Daniel Agar
ed1b442065 mission require valid landing after DO_LAND_START 2017-04-20 14:41:01 -04:00
Daniel Agar
c1d9972244 commander add parameter COM_ARM_MIS_REQ
- arm without mission on by default
2017-04-20 11:18:32 -04:00
Beat Küng
73cb423db6 commander: add power button notification callback 2017-04-20 10:01:51 +02:00
Beat Küng
0165633bf3 board_config: remove px4_board_pwr, use px4_shutdown_request instead
px4_board_pwr has become obsolete with the addition of board_shutdown
2017-04-20 10:01:51 +02:00
Don Gagne
96458d3184 Support for RTL and Delay mission commands 2017-04-18 08:56:01 +02:00
Andreas Daniel Antener
18293875b7 Old style switches: changed the loiter switch to have priorit over main switch (#6764) 2017-04-16 10:10:31 -04:00
Sander Smeets
128f726cd9 Add paramter to enable rc stick override 2017-04-14 10:01:36 +02:00
Mohammed Kabir
7fcb3b4f93 camera_trigger : add support for sending ACKs for trigger commands 2017-04-13 20:21:40 +02:00
Lorenz Meier
08cf97c687 Commander: indicate failsafe reasons more clearly 2017-04-09 12:40:34 +02:00
Beat Küng
43afb8d41e sensor calibration: remove param_save_default() calls 2017-04-06 11:49:03 +02:00
Beat Küng
7c43689ddc commander: remove param autosave 2017-04-06 11:49:03 +02:00
Henry Zhang
982fe91fa8 Commander: fix LED status bug when system is armed 2017-04-01 11:39:05 +02:00
Lorenz Meier
10dcb90d52 Commander: Store last manual stick setpoints only when actually in manual control mode 2017-03-13 21:08:17 +01:00
Lorenz Meier
1a3317ebab Commander: Do not abort low battery handling due to stick motion. 2017-03-13 08:42:51 +01:00
Beat Küng
95e8e26ae0 commander: use led_control uorb topic 2017-03-12 00:08:35 +01:00
Beat Küng
b0439836f6 refactor drv_led.h: rename to drv_board_led.h
This makes it clear that it's used to control the board LED's, not external
LED's.
2017-03-12 00:08:35 +01:00
Julian Oes
404719953c commander: fix abs bug / trigger POSCTL both ways
The check if stick were touched was only working in one direction (per
axis) because fabsf was used incorrectly.

However, this check is still only a differential check triggered by
fast movement and does not trigger if someone slowly moves a stick to
the side. Also, the sensitivity depends on the rate of the commander
loop and/or the RC update loop. The correct solution would be a proper
filtering and trigger for movement.
2017-03-11 22:41:23 +01:00
Beat Küng
54c8e3b26b commander: fix excessive orb_advertise calls for vehicle_status_flags
vehicle_status_flags_pub passed to publish_status_flags() was always null,
thus orb_advertise() was called each time.

Note that it did not produce a memory leak.
2017-03-04 17:44:47 +08:00
Lorenz Meier
16530e15db Commander: Differentiate between emergency battery level and critical battery level 2017-02-27 09:03:20 +01:00
Beat Küng
058bc97c83 commander preflight calibration: accept param6 == 2 for airspeed calibration as well
This is according to the updated mavlink spec to deconflict the definition
with APM.
2017-02-24 08:24:53 +01:00
Lorenz Meier
7fc8ee85fa Commander: Do not break out of RTL on stick input change 2017-02-21 13:56:31 +01:00
Andreas Antener
44d05bac55 Rattitude: enable for FW in old style switch mapping 2017-02-18 08:03:19 +01:00
Daniel Agar
e81e6a8296 fw_att_control add rattitude mode 2017-02-18 08:03:19 +01:00
Andreas Antener
a5f3f65c2b Switch assignment: added manual and stabilized switch for a default stabilized switch scheme, let FW go into Acro 2017-02-18 08:03:19 +01:00
Beat Küng
1a81b64d49 VEHICLE_CMD_PREFLIGHT_CALIBRATION: update temperature_calibration param definition 2017-02-17 23:01:25 +01:00