75 Commits

Author SHA1 Message Date
Daniel Agar
3faab909d7 commander move most orb subscriptions to uORB::Subscription 2019-06-04 18:44:51 -04:00
bresch
2307c7c390 Geofence - Rename _warning_action_on to _geofence_warning_action_on
since it is only set by the geofence logic. Simplify conditions in IF
statements.
2019-06-04 08:35:56 +02:00
bresch
f8f967f073 Geofence - Change from "re-engage geofence failsafe every 10s when
outside the fence" to "engage geofence failsafe on transition". This
way, the pilot is not stucked in the non flight zone and can switch to
a manual mode and fly back or trigger RTL.
2019-06-04 08:35:56 +02:00
bresch
427b2e6636 Geofence - Do not trigger geofence failsafe while in low battery
failsafe action.
Also move geofence flags from static variables declared into the if
statement to private members of the class.
2019-06-04 08:35:56 +02:00
pedro-roque
a707403eaf mc_att_ctrl: added yawrate control from offboard.
This commit adds Roll Pitch Yawrate Thrust (RPYrT) setpoint control to the
PX4 stack, enabling the UAV to follow specific yawrates sent from
offboard. It also introduces individual body_rate flags, along the
lines of mavros.

Tested on a MoCap enabled flight arena in KTH Royal Institute of
Technology, Stockholm. The MAV receives RPYrT setpoints from an
external PID controller to stabilize around position setpoints.
The UAV is also externally disturbed to assess the stability to
external unmodeled events.

Fixed Kabir comments.

Removed deprecated ignore_bodyrate.

Fixed integration test.
2019-06-04 08:26:09 +02:00
Matthias Grob
ac002db25c MAVLink/Commander: @Pedro-Roque's offboard yawrate handling 2019-06-04 08:26:09 +02:00
Julian Oes
b29e5e3adb hysteresis: remove dependency/side effect on time 2019-05-27 09:57:50 +02:00
Oleg Kalachev
77097b6adc commander: update commander status when offboard control mode changed 2019-05-11 10:30:57 -04:00
bresch
02f0533ee9 Commander - Remove old code that overrides state_machine_helper logic 2019-05-07 17:45:28 +02:00
Daniel Agar
9bad61b86b
Improve robustness to bad and lost airspeed data (#11846) 2019-04-30 03:08:23 -04:00
Matthias Grob
56591954ad Commander: reevaluate RC mode on altitude lock 2019-04-29 13:24:29 -04:00
Matthias Grob
3bf5d6af12 commander: fix RC mode switch not getting applied after boot
the condition to enter the rc mode switch evaluation was neglecting
the first connection of an RC when "no RC switch changed". this means
depending on the actual initialization values of _last_sp_man and the
desired mode preselected on the RC while connecting it would not get
evaluated.
2019-04-26 21:04:10 +02:00
Matthias Grob
f177a68da9 commander: negate main_state_rc entering condition
pure refactor using De Morgan's law to make the condition more intuitive
since you think about when should I enter and not when should I skip
2019-04-26 21:04:10 +02:00
Matthias Grob
1f3ebd98b1 commander: split up set_main_state_rc entering condition
pure refactor of the huge condition into smaller const bool junks
2019-04-26 21:04:10 +02:00
Alessandro Simovic
4127adf73c addressing comments from #11796 2019-04-10 09:38:53 +02:00
Alessandro Simovic
482a46ab36 Standardising mavlink message strings 2019-04-10 09:38:53 +02:00
Julian Oes
95ab984f4c commander: fix toggling datalink lost and regained
When using QGC and/or the Dronecode SDK it was possible to get in a
state where the two mavlink instances were both publishing their last
heartbeat_time and cause commander to consistently toggle between
data link lost and regained. With this fix, we only ever look at the
very last heartbeat time and therefore seem to avoid this issue.
2019-04-05 09:25:40 -04:00
bresch
2ca8ddd8af Parameter update - Rename variables in modules/commander
using parameter_update.py script
2019-04-03 15:38:50 +02:00
Claudio Micheli
0eb4942f66 Commander: renamed print_msg_once variable into a more self-explanatory one.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
be6f753022 Fixed CI errors. changed _print_msg_once into private class member.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
e14e5b9d73 Commander: Changed COM_ONB_BOOT_T parameter to COM_OA_BOOT_T.
Since the time out is only Obstacle-Avoidance related, the new naming is more self explanatory.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
d937a5725b Commander: reset print once variable if OA is lost.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
9966a3d2f8 Commander: changed logic for checking OA at boot time.
With this commit the use cases will be:

Success case:
- booting, no messages about OA, pre-arm check would fail if you try to arm and OA is not yet running

Fail case:
- if OA takes longer than timeout time defined in COM_ONB_BOOT_T, then an error message is triggered.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
3b5ef82193 Commander: Added COM_ONB_BOOT_T parameter.
Since onboard controllers bootup times are hardware dependent, it makes sense to have the possibility to adapt timeout time according to the specific HW.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
7a8002fdab Commander: increased hardcoded timeout time for avoidance to start.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
f4a4dab65a Commander: Improved logic for OA prearm checks.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
977a4c8e9b Added status_change to force message updating.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Claudio Micheli
107746ded5 Added obstacle avoidance healthiness topic in vehicle status msg.
This allows to perform pre-arm checks and prevent arming if obstacle avoidance is enabled but not yet running.
Added a print once flag to prevent excessive message spamming in QGC.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-27 09:56:32 +01:00
Beat Küng
6672284871 commander: fix status init & some status update changes 2019-03-12 11:24:33 +01:00
Claudio Micheli
908cdaa574 Onboard controller loss parameter cleanup.
Since Timeout from onboard controller is something that does not require a lot of modifications there is no sense to having it parametrized.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
cd47cefb03 Some more code cleanup.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
fb990d7de3 Removed subscribtion to multiple _telemetry_status instances.
Since commander handles all telemetry_status the same there is no need to subscribe to multiple instances.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
a53594135b Commander: changed "datalink regain" logic.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
32e4baf6a0 Commander: some more cleanup. 2019-03-12 11:24:33 +01:00
Claudio Micheli
a84a1e1b5a Commander: mavlink messages cleanup. header variables refactoring.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
14415b29c1 Removed hardcoded onboard controller timeouts thresholds.
Added COM_ONB_LOSS_T and COM_ONB_REG_T parameters to specify thresholds that triggers "onboard link lost" and "onboard link regained".


Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
156317e546 Fixes for ONBOARD Controller lost & regain. 2019-03-12 11:24:33 +01:00
Claudio Micheli
1fc055a51f Fixed some issues for datalink loss & regain (GCS HEARTBEAT).
Major changes:
- Prevent  "HIGH LATENCY DATA LINK LOST" message to appear if iridium telemetry is not used.
- Prevent "DATA LINK LOSS" mavlink messages flooding when QGC is open and then closed.
- Changed "DATA LINK REGAINED" condition (use _datalink_last_heartbeat_gcs insthead of _datalink_lost)



Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
baumanta
d8bdc1b367 output a message if a previously lost connection is regained 2019-03-12 11:24:33 +01:00
baumanta
a98f5d2ab2 suggestion for treating obstacle avoidance heartbeats 2019-03-12 11:24:33 +01:00
Daniel Agar
6dec451bab HEARTBEAT and commander failsafe handling cleanup 2019-03-12 11:24:33 +01:00
David Sidrane
477152a96d Commander:Support BOARD_INDICATE_ARMED_STATE for HW that supports external armed indiction 2019-02-26 15:34:10 -05:00
Daniel Agar
88fd8147fd commander auto disarm if kill switch engaged for 5 seconds
- closes #10133
2019-02-20 18:37:20 +01:00
Alessandro Simovic
6e5bd1ad70 commander: remove duplicate includes 2019-01-28 12:05:36 +01:00
Alessandro Simovic
5bcd7c0a0d Capitalizing/improving warning messages 2019-01-25 11:58:17 -05:00
Daniel Agar
60f2a92e3d replace <cfloat> with <float.h>
- <cfloat> isn't available in the NuttX c++ library
2019-01-06 19:20:57 -05:00
Daniel Agar
3cd3856d32 commander set home position timestamp properly 2018-12-27 10:52:01 -05:00
Julian Oes
0e04d3e9a9 commander: remove lying comment 2018-12-22 10:32:18 +01:00
Julian Oes
5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Beat Küng
447ed18ab4 commander: use C API for MC_AIRMODE & RC_MAP_ARM_SW to remove multirotor modules dependency 2018-12-13 09:50:07 +01:00