2157 Commits

Author SHA1 Message Date
Daniel Agar
c305774fae commander: move vehicle_status into class 2020-12-02 10:20:50 +01:00
Daniel Agar
b7de10fca3 commander: move vehicle_status_flags to class 2020-12-02 10:20:50 +01:00
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
5e855c6747 commander: preflightcheck and calibration remove hash (#) from mavlink message
- QGroundControl is reading these as "Hash" and I don't think it's ambiguous if removed
2020-11-23 21:56:23 -05:00
Daniel Agar
d14b4221f1
sensor calibration: apply board level adjustment to external sensors (#16127)
- apply SENS_BOARD_{X,Y,Z}_OFF to external sensors to prevent unnecessary misalignment with internal IMU
2020-11-12 10:37:30 -05:00
Nicolas MARTIN
8b96ff57d7 arm auth: split COM_ARM_AUTH in 3 parameters
new params are:
- COM_ARM_AUTH_ID
- COM_ARM_AUTH_MET
- COM_ARM_AUTH_TO
2020-11-10 09:03:59 +01:00
Nicolas MARTIN
6579544fca arm_auth: use ack reception timestamp to compute authorization timeout 2020-11-10 09:03:59 +01:00
Nicolas MARTIN
e89c21155a arm_auth: check authorization timestamp to skip old commands 2020-11-10 09:03:59 +01:00
Daniel Agar
817285ec64 commander: gyro calibration use MedianFilter 2020-11-02 12:58:46 -05:00
Daniel Agar
69986affbf commander: calibration restore sleep after CAL_QGC_DONE_MSG/CAL_QGC_FAILED_MSG 2020-10-27 18:54:16 -04: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
81765bc06a commander: PreFlightCheck remove HIL special cases
- skipping these sensor checks in HIL no longer makes sense as each
sensor has a normal publication (sensor_accel/gyro/etc) regardless of
simulation
2020-10-23 11:25:50 -04:00
Daniel Agar
be0f884dde
commander: preflight check don't read mag device_id 2020-10-19 23:01:02 -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
ff3008c051 calibration: add SYS_FAC_CAL_MODE parameter
If set, stores calibration parameters in separate storage /fs/mtd_caldata.
2020-10-12 15:22:26 +02: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
eecf2e7a1e
sensors: allow up to 4 accels, gyros, and baros and add configurable rotations for accel & gyro 2020-10-08 19:01:44 -04: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
Daniel Agar
eabbd19c1c commander: PreFlightCheck param_find all parameters immediately
- this ensures the relevant parameters are marked active immediately
before parameter sync
 - fixes https://github.com/PX4/Firmware/issues/15872
2020-10-03 14:43:21 -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
Daniel Agar
c1936dab1f commander: accel & gyro subsystem health set within IMU check 2020-09-30 12:17:48 -04:00
Daniel Agar
25c537bae9 commander: don't impose additional timeouts in sensor checks
- the sensors hub is responsible for sensor timeouts
2020-09-30 12:17:48 -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
Daniel Agar
0dc8bb9c86
uORB: increase ORB_MULTI_MAX_INSTANCES 4 -> 10
- put more realistic bounds on maximum number of battery instances, gps, etc
2020-09-24 11:01:28 -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
Daniel Agar
00e955cc3e rotations: sync rotation enum, SENS_BOARD_ROT, CAL_MAGx_ROT with MAV_SENSOR_ORIENTATION 2020-09-22 11:10:31 -04:00
Daniel Agar
09af5e0637
commander: mag calibration use expected WMM sphere radius to reject samples if GPS is available 2020-09-20 12:22:56 -04: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
Nicolas MARTIN
504730386a fix COM_ARM_AUTH comment 2020-09-15 22:12:55 -04:00
Daniel Agar
13db2ebb2b
accel/gyro/mag calibration set default priority uninitialized
- this allows the default priority to be set differently for internal/external sensors
 - accel and gyro initialize default priority like mag in preparation for fully supporting external sensors
 - fixes #15652
2020-09-13 21:02:53 -04:00
Daniel Agar
d70e183f5b commander: sensor calibration check parameter save success 2020-09-13 21:00:40 -04:00
Quentin PERROT
9116acc431 change message critical state for arm authorization 2020-09-09 08:59:21 +02:00
Matthias Grob
f70dda12a6 failureDetectorCheck: remove string manipulation 2020-09-08 11:42:30 +02:00
Matthias Grob
5eba25d2b5 Commander: remove duplicate flag changes 2020-09-08 11:42:30 +02:00
Matthias Grob
ab17b6bad4 failureDetectorCheck: revise messageing 2020-09-08 11:42:30 +02:00
Matthias Grob
981e05c633 FailureDetector: move esc topic check into esc status update 2020-09-08 11:42:30 +02:00
Matthias Grob
c180e09b9a FailureDetector: replace resetAttitudeStatus 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
f47bb95b26 FailureDetector: remove obsolete bit switch checks 2020-09-08 11:42:30 +02:00