107 Commits

Author SHA1 Message Date
Julien Lecoeur
4c9288d993 Commander: cleanup COM_POSCTL_NAVL parameter
- move to px4::params
- use enum
2019-08-21 07:56:20 -07:00
Beat Küng
a7eed520b4 commander: refactor module usage output 2019-08-19 10:54:56 +02:00
Beat Küng
878ed8136c commander: add 'commander arm -f' command to force arming
This allows to bypass preflight and prearm checks.
During development there are regular cases where I just want to arm the
board/vehicle no matter what, and the preflight checks are guaranteed to
fail (e.g. sensors uncalibrated, inconsistent, powered via USB, etc.).
Allowing an easy and quick way to arm (assuming you know what you are
doing) helps to speed up development considerably and is less frustrating.
2019-08-19 10:54:56 +02:00
Jimmy Johnson
963467b4df splitting preflight and land disarm times into 2 parameters 2019-08-14 14:17:33 +02:00
Claudio Micheli
2eb9fb9ed6 Commander: move esc_status as local variable.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
09d79b221f Simplified esc_status healthiness logic.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
75c336c00c uavcan_main: replaced printf messages with PX4_INFO
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
187a025dfe Commander: added esc_status prearm checks
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Daniel Agar
a917f22b65
sensors: create vehicle_acceleration module (#12597) 2019-08-07 05:05:48 -04:00
Daniel Agar
8f5b7de498
uORB::Subscription minor API cleanup
* the forceInit() method was combined with the existing subscribe()
 * delete unused last_update()
2019-08-06 10:28:49 -04:00
Andrei Korigodski
4d5f922e7a commander: use shutdown_if_allowed() to check for shutdown safety
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski
5133453822 vehicle_status: replace ARMING_STATE_REBOOT with ARMING_STATE_SHUTDOWN
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski
4a330c6e0a commander: do not reboot on USB disconnect when armed
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Daniel Agar
e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
Matthias Grob
d0f1a551e9 manual_contol_setpoint: fix mode slot numbering (#12578)
* This fix is necessary because usually uORB structs get initialized with
all zeros and then get filled with the fields that are actually in use.
 * The number 0 for the mode slot was already commanding to switch to the
mode in slot one even though for example the joystick input via mavlink
does not use this mechanism at all.
2019-08-01 12:27:58 -04:00
Julian Oes
98dfa30838 commander: fix disarming for rovers
We have to ignore the landed flag for rovers, it doesn't really apply
for them.
2019-07-26 02:52:38 -07:00
Julian Oes
308d91e5ff commander: prevent potential disarms in-air
This fixes the terrifying case where the drone disarms in-air just
because it receives a MAVLink disarm command. We now check param2 for a
magic number which enforces arming/disarming.

This is added to the mavlink protocol in:
https://github.com/mavlink/mavlink/pull/1162
2019-07-26 02:52:38 -07:00
Matthias Grob
706500f19c Commander: make RC override multicopter only
AAs discussed in the devcall this functionality is only useful for
rotary-wing (multicopter) flying since it's a big safety hazard to
accidentally bring a fixed wing out of an auto mode e.g. a mission
and fly away in a straight line or into an obstacle.
2019-07-22 09:57:37 +02:00
Matthias Grob
5c1ab06343 Commander: pure refactor of RC override conditions 2019-07-22 09:57:37 +02:00
Daniel Agar
4e360064d9
commander refactor and cleanup offboard control mode 2019-06-15 20:45:26 -04:00
Timothy Scott
c4bb6b53e8 Changed soft stop check 2019-06-13 10:04:26 +02:00
Timothy Scott
21760a5856 Changed constant name to UNMANNED_GROUND_VEHICLE 2019-06-13 10:04:26 +02:00
Timothy Scott
714c90b9db Updated code style to fix confusing if conditions 2019-06-13 10:04:26 +02:00
Timothy Scott
a134da6e12 Removed is_rotor_wing, replaced with vehicle_type 2019-06-13 10:04:26 +02:00
Daniel Agar
6816f2a4ce
commander force offboard control update when first entering mode
- fixes #12241
2019-06-12 20:25:05 -04:00
bresch
33a94c8191 Failure detector - change snake_case function names to camelCase 2019-06-05 16:53:08 +02:00
bresch
03ad4ffd47 FailureDetector - Add is_failure() function to simplify the interface; the user does not need to check the bitmask 2019-06-05 16:53:08 +02:00
bresch
d3c9436f84 flight termination - rename in_flight_termination to flight_termination_triggered 2019-06-05 16:53:08 +02:00
bresch
59265f6663 Failure detector - Add flight termination comments, make format 2019-06-05 16:53:08 +02:00
bresch
81bb7888de Failure Detector - Add Failure Detector check to preflight checks 2019-06-05 16:53:08 +02:00
bresch
7b531bcaef Failure Detector - Play TONE_PARACHUTE_RELEASE_TUNE when force failsafe is set 2019-06-05 16:53:08 +02:00
bresch
ba93f9b983 FailureDetector - Update failure detector logic in commander. 2019-06-05 16:53:08 +02:00
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