242 Commits

Author SHA1 Message Date
Daniel Agar
dc435c4c90 commander: control_status_leds() use _armed directly 2020-12-02 10:20:50 +01:00
Daniel Agar
8ac2581d7b commander: handle_command() use _armed directly 2020-12-02 10:20:50 +01:00
Daniel Agar
741a0b43e8 commander: move mavlink_log_pub into class 2020-12-02 10:20:50 +01:00
Daniel Agar
a03b91c01e commander: move answer_command() to class 2020-12-02 10:20:50 +01:00
Daniel Agar
d5dc7e2873 commander: move actuator_armed state into class 2020-12-02 10:20:50 +01:00
Beat Küng
05a3492174 commander: remove low priority thread, run tasks in a worker thread on demand
- removes race conditions
- removes dependencies on static data & methods
- reduces RAM usage by ~3.8KB
2020-11-30 11:53:22 -05:00
Beat Küng
419b336a15 commander: fix ModuleBase usage, remove volatile flag 2020-11-30 11:53:22 -05:00
Ricardo Marques
3215c50660 commander: Fix comment typos.
Signed-off-by: Ricardo Marques <marques.ricardo17@gmail.com>
2020-11-27 10:25:32 +01:00
Daniel Agar
ec9f8998a7
commander: limit mode switch re-evaluation logic on estimate validity changes
- re-evaluating mode switches on altitude or position validity change can create confusing when also relying on mode changes via mavlink
 - limiting this logic to only apply when disarmed solves the original problem (respecting initial switch position) without introducing potential problems mid-flight
 - fixes https://github.com/PX4/PX4-Autopilot/issues/16235
2020-11-25 21:14:55 -05:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00
FengShun
eac9a6b68b Replace PublicationQueued with Publication to automatically configure ORB_QUEUE_LENGTH 2020-10-26 13:01:13 +01:00
Daniel Agar
945c17bc3f
move subsystem_info entirely into commander and remove from uORB
* HealthFlags: define bitfield using 1<<X

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2020-10-25 10:08:15 -04:00
Daniel Agar
8d1b99be31
mavlink: telemetry status only log simple HEARTBEAT validity
* delete telemetry_heartbeat msg
 * delete unused _telemetry_status_mutex
2020-10-13 13:37:10 -04:00
Beat Küng
274ccaf57c system: include shutdown lock to BOARD_INDICATE_ARMED_STATE
BOARD_INDICATE_ARMED_STATE was only set during arming, so an external
component might have reset the board during param save, leading to param
loss.

This extends the API to trigger the arming state also while the shutdown
lock is taken.
2020-10-09 08:23:47 +02:00
Daniel Agar
08bf71b73d
drivers/tone_alarm and tune_control small improvements/cleanup
- drivers/tone_alarm: move to ModuleBase and purge CDev (/dev/tone_alarm0)
 - drivers/tone_alarm: only run on tune_control publication (or scheduled note) rather than continuously
 - drivers/tone_alarm: use HRT to schedule tone stop (prevents potential disruption)
 - msg/tune_control: add tune_id numbering
 - systemcmds/tune_control: add "error" special case tune_id
 - move all tune_control publication to new uORB::PublicationQueued<>
 - start tone_alarm immediately after board defaults are loaded to fix potential startup issues
 - for SITL (or other boards with no TONE output) print common messages (startup, error, etc)
2020-10-05 21:39:26 -04:00
Nicolas MARTIN
967f741a0e
commander: add parameter COM_REARM_GRACE to optionally disable re-arming grace period 2020-10-01 11:20:08 -04:00
Julian Oes
b454095776 commander: fix switch to loiter
Sometimes, the mission_result timestamp is the same as the
internal_state timestamp which would meant that we would not switch to
LOITER even though the takeoff is clearly done at that point.
2020-09-30 08:23:16 -04:00
Daniel Agar
2ccf664e95 commander: disarm from safety relax land detector timeout
- ensure land detector is updated before safety is checked
2020-09-25 09:41:53 -04:00
Matthias Grob
5d47a4c9e0
Commander: fix rc override threshold scaling (#15807)
Improve parameter description for threshold
and lower the threshold a bit.
2020-09-24 14:52:19 +02:00
Julian Oes
a9c4f269bd simulator: use failure injection to block GPS
This uses the new failure injection system using vehicle_commands
instead of specific parameters. For now it implements GPS only.
2020-09-16 12:51:56 -04:00
Matthias Grob
5eba25d2b5 Commander: remove duplicate flag changes 2020-09-08 11:42:30 +02:00
Matthias Grob
390edb770d Commander: separate failure detector cases
One case could lead to the action for the other!
2020-09-08 11:42:30 +02:00
Matthias Grob
c9b81eaf08 FailureDetector: simplify updated/changed check 2020-09-08 11:42:30 +02:00
Matthias Grob
25cdb383c6 Commander: simplify main failure detector condition 2020-09-08 11:42:30 +02:00
Daniel Agar
ca9b6bc137
commander: quick mag cal with fixed heading use MAV_CMD_FIXED_MAG_CAL_YAW message
- use proper Mavlink MAV_CMD_FIXED_MAG_CAL_YAW command for initiating magnetometer quick cal
 - MAV_CMD_FIXED_MAG_CAL_YAW allows specifying the yaw and optionally latitude and longitude if the vehicle doesn't have GPS
2020-09-06 19:25:11 -04:00
Daniel Agar
1ac31100cc
commander: HITL skip auto disarm if lockdown
- auto disarm when locked down was added in #14766 to prevent user confusion in regular usage, but also breaks HITL where lockdown is enabled for safety
 - fixes #15686
2020-09-06 18:38:05 -04:00
Daniel Agar
6ff361479c
uORB: introduce SubscriptionMultiArray for working with multi-instances 2020-09-02 12:46:47 -04:00
Daniel Agar
c76cdaf8a8 commander: mag calibration add simple offset only quick cal using GPS & attitude 2020-08-21 10:12:13 -04:00
Daniel Agar
f6ad9bdb64 commander: don't set RC lost during calibration 2020-08-21 10:12:13 -04:00
Daniel Agar
e6fd5a43bc commander: magnetometer calibration automatically set the rotation of external magnetometers relative to the first internal
- see #15120 for more detail
2020-08-21 10:12:13 -04:00
Daniel Agar
d92ddffa5d commander: add simple accelerometer quick calibration 2020-08-21 10:12:13 -04:00
Daniel Agar
e3e8c55e82 accel & gyro calibration helpers 2020-08-21 10:12:13 -04:00
Julian Kent
7958586f35 Only use roll/pitch not centered for RC override, and increase override threshold 2020-08-20 11:50:16 -04:00
Daniel Agar
97fc1db768 vehicle_local_position: rename yaw -> heading and add reset logic
- vehicle_global_position yaw removed (redundant)
2020-08-10 11:42:03 +02:00
bresch
33fb9d0c62 Commander: update home position yaw in case of EKF yaw reset
This makes sure the drone lands in the correct orientation
during RTL even if the initial yaw at takeoff was wrong.
2020-08-10 11:42:03 +02:00
Daniel Agar
3002e74b4f
mavlink: publish telemetry_status per instance with all HEARTBEATS from the same system
- one telemetry_status publication per mavlink instance
 - each telemetry_status has an array of HEARTBEATS
2020-08-07 12:23:52 -04:00
Beat Küng
dfc2160489 commander: update vehicle_status with at least 2Hz
So we're sure it's logged.
2020-08-04 10:53:20 -04:00
Beat Küng
5f8c6512b3 vehicle_status: add latest arming/disarming reason
Makes it easier to debug.
2020-08-04 10:53:20 -04:00
Daniel Agar
c40cf9a626
uORB: remove lost message count per DeviceNode
- update 'uorb status' to print basic info for all advertised DeviceNodes
 - report vehicle_command gaps in commander, navigator, mavlink
2020-08-04 10:34:11 -04:00
Daniel Agar
f5f2897486
land_detector: multicopter ground contact fixes, improvements, and cleanup
- if "landed" and "maybe_landed" states are false then both the "hit_ground" and the "low_thrust" condition need to be true in order to detect landing
 - ground contact MC NAN setpoint workaround
 - ground contact additionally check acceleration setpoint
 - schedule with vehicle_local_position updates (most updates require valid local position)
 - don't allow LNDMC_Z_VEL_MAX to exceed MPC_LAND_SPEED
 - ground contact horizontal movement checks default to failed if estimates aren't available
2020-08-02 13:37:23 -04:00
Matthias Grob
40883a06cf Commader: save 53 unnecessary characters of output string 2020-07-13 10:34:17 -04:00
daniele
f01195c13f make kill switch engaged a warning only if the vehicle is flying 2020-07-13 10:34:17 -04:00
daniele
be043d24a0 commander: rephrase or change message importance for some errors/warnings that happen often 2020-07-13 10:34:17 -04:00
Thomas Stauber
6d1ce57362
Add Land as Geofence Action 2020-07-09 10:32:10 -04:00
Claudio Micheli
743898d574 Commander: failure detector, automatically disarm on a ESC failure
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-07-01 08:55:54 +02:00
Claudio Micheli
a7f2f2908b Commander: make optional tilt-check after takeoff (failure detector).
- Introduced COM_LKDOWN_TKO parameter
    - Introduced auto disarm for lockdown state
    - Do not trigger flight termiantion if system is in lockdown

Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-07-01 08:55:54 +02:00
Claudio Micheli
6358dd400a failure detector: added esc failures detection
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2020-07-01 08:55:54 +02:00
Matthias Grob
e9eae1bd76 Refactor: Name manual_control_setpoint the same way everywhere 2020-06-22 12:06:27 -04:00
Daniel Agar
ade8a13203 commander: CMD_COMPONENT_ARM_DISARM don't block disarm if maybe_landed 2020-05-25 11:43:14 -04:00
Daniel Agar
05886e053f mavlink_log_info: always print to console and merge with mavlink_and_console_log_info 2020-05-12 08:53:51 +02:00