2672 Commits

Author SHA1 Message Date
Matthias Grob
22e613a24a commander_params: more precise COM_FAIL_ACT_T description
regarding RC stick override
2023-08-21 16:39:10 +02:00
Daniel Agar
88e7452492
commander: collapse ArmStateMachine and simplify
- simplify vehicle_status.arming_state down to just armed and disarmed
    - ARMING_STATE_INIT doesn't matter
    - ARMING_STATE_STANDBY is effectively pre_flight_checks_pass
    - ARMING_STATE_STANDBY_ERROR not needed
    - ARMING_STATE_SHUTDOWN effectively not used (all the poweroff/shutdown calls loop forever in place)
    - ARMING_STATE_IN_AIR_RESTORE doesn't exist anymore
 - collapse ArmStateMachine into commander
     - all requests already go through Commander::arm() and Commander::dismarm()
 - other minor changes
     - VEHICLE_CMD_DO_FLIGHTTERMINATION undocumented (unused?) test command (param1 > 1.5f) removed
     - switching to NAVIGATION_STATE_TERMINATION triggers parachute command centrally (only if armed)

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-07-28 17:12:01 -04:00
Silvan Fuhrer
c0d9e2ac7a
commander: add warning for imminent navigation failure
Some system are able to dead-reckon for a while after losing GPS or
other sources providing positional feedback. If the estimated position
error grows above the failsafe threshold, the system enters a failsafe
mode. As the position error estimate is growing linerly over time, and
it is recommended to take action before entering the failsafe, we here
warn the user about the imminent failsafe and propose to take manual
control.

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-27 14:12:04 -04:00
Beat Küng
351a9050c3 commander: update param description for COM_MOT_TEST_EN 2023-07-27 09:39:24 -04:00
bresch
99309625e8 preflt-chk: report strength and inclination failure values 2023-07-25 11:21:05 -04:00
bresch
beb5fc5eb6 ekf-checks: set min and max values for required/failsafe eph 2023-07-24 15:10:07 -04:00
Silvan Fuhrer
88c5565a29 Commander: remove COM_ARM_ARSP_EN
Since we changed the threshold for allowing arming from TRIM/2 to AIRSPEED_MAX
is is very unlikely that one needs to disable this check.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Silvan Fuhrer
decf1ac0a8 Commander/Nav params: clean up descriptions
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-07-17 10:35:02 +02:00
Sergei Grichine
f000238987 SensorGps.msg: switch to double precision for lat/lon/alt
To match https://github.com/PX4/PX4-GPSDrivers/pull/132 - adding high precision RTK lat/lon/alt components
2023-07-13 07:50:09 +02:00
Matthias Grob
20d0661e87 HealthAndArmingChecks: disallow arming via parameter
COM_ARMABLE is set to "Disabled" will prevent arming.
 This allows to set the parameter when ground demoing a drone or
 if it's in maintenance for safety reasons.
2023-06-22 13:17:47 +02:00
Matthias Grob
173407581b HealthAndArmingChecks: reorder CMakeLists alphabetically 2023-06-22 13:17:47 +02:00
Thomas Debrunner
fd267fb9a5 param save: Add a blocking API for param saves to be used from shell. 2023-06-21 08:19:52 +02:00
Beniamino Pozzan
957a06a780 Fix enum for COM_RC_IN_MODE in failsafe
add enum RcInMode

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2023-06-19 08:04:43 +02:00
Matthias Grob
053d3020b0 esc_calibration: handle timeout wraps better
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2023-06-16 12:05:47 +02:00
Matthias Grob
cfb24869e9 esc_calibration: allow to calibrate ESCs without battery detection
Before this the ESC calibration aborts if battery detection doesn't work.
The problem is if the user still connects the battery as he gets instructed
and the calibration aborts then the ESCs are in calibration mode and
after abortion calibrate to the wrong value.

Also I realized there's no additional safety by aborting the calibration
if the battery cannot be detected during the timeout because a pixhawk
board without power module will report a battery status from the
ADC driverand in it that no battery is connected which is the best
it can do. In this situation the motors will still spin if the
ESCs are powered.
2023-06-16 12:05:47 +02:00
Matthias Grob
4396b6e9f6 esc_calibration: adjust timing to work with all tested ESCs
Some ESCs e.g. Gaui enter the menu relatively quickly if the
signal is high for too long. To solve that it's kept high shorter.
Also all tested ESCs detect the low signal within a shorter time
so no need to wait longer.
2023-06-16 12:05:47 +02:00
Matthias Grob
6929493134 esc_calibration: Improve readability and robustness
- Change timings for a more reliable calibration.
- Make sure there's an error message when battery measurement is not
available also when it gets disabled after system boot in the power
just above the calibration button.
- Safety check if measured electrical current goes up after issuing the
high calibration value for the case the user did not unplug power
and the detection either fails or is not enforced.
2023-06-16 12:05:47 +02:00
Beat Küng
7230a6dd8e commander: add option to exclude mag to param SYS_FAC_CAL_MODE 2023-06-09 21:05:40 -04:00
bresch
8b67fa91a1 factory cal: exclude _PRIO params 2023-06-09 21:05:40 -04:00
Silvan Fuhrer
459f9c5331 Commander: open up limits on TRIM_ROLL/PITCH/YAW to +/- 50%
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-06-02 10:23:46 +02:00
Eric Katzfey
d2011e99b2
commander: add Open Drone ID arming check (#21652) 2023-06-01 07:52:52 +02:00
Patrick José Pereira
ca1d32a29d HealthAndArmingChecks: Use snprintf over sprintf
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2023-05-22 07:46:54 +02:00
murata,katsutoshi
4bb4bc185b
commander: level calibration delete unused SENS_BOARD_ROT param access 2023-04-30 21:36:43 -04:00
Eric Katzfey
018ca6b49d
VOXL2 board support updates (#21426) 2023-04-19 11:21:02 -04:00
Beat Küng
aa5b9ae638 fix failsafe: correctly handle Hold RC loss action
Otherwise the additional mode check triggers an RTL which takes precedence
over Hold.
Introduced in 132e9d243966586d7aaf21d9600d9413993e5cc8
2023-04-04 07:03:42 +02:00
Silvan Fuhrer
07531d29b7 FailureDetector: fix attitude check for tailsitter
-set roll/pitch used for failure detection during transition to 0
-rotate estimated attitude 90° in FW flight

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-22 10:05:32 +01:00
Silvan Fuhrer
b16f16598b VTOL: remove virtual actuator_controls and instead use virtual torque/thrust topics
MC/FW rate controller and auto tuner: remove actuator_controls

AirshipAttControl: remove actuator_controls

MulticopterLandDetector: remove actuator_controls

mavlink streams vfr_hud and high_latency2: remove actuator_controls

RoverPositionController: remove actuator_controls

UUVAttitudeController: remove actuator_controls

battery: use length of thrust_setpoint for throttle compensation

VehicleMagnetometer: use length of thrust_setpoint for throttle compensation

Signed-off-by: Silvan Fuhrer
2023-03-16 11:55:45 +01:00
AlexKlimaj
e375e02974 Add GPS spoofing state 2023-03-14 20:28:32 -04:00
Matthias Grob
132e9d2439 modeCheck: add warning when RC enabled but not present 2023-03-08 09:32:56 +01:00
Matthias Grob
898c0ae5a8 mode_requirements: refactor order of setting flags 2023-03-08 09:32:56 +01:00
Matthias Grob
7fa8dfe2d2 rcAndDataLinkCheck: always update manual control availability
and remove duplicate manual control check
possibly it needs to be readded to give warning
about RC enabled but not present.
2023-03-08 09:32:56 +01:00
Matthias Grob
f498b90c41 mode_requirements: add manual control for manual modes 2023-03-08 09:32:56 +01:00
Eric Katzfey
daa302cdbe
Changes to allow the commander module to be built and run on Qurt (#21186)
* Changed exclusion to rely on the definition of PX4_STORAGEDIR
2023-03-06 09:49:07 -05:00
Tahsincan Köse
8737099a33
commander: failsafe framework fix missing return in actionStr function (#21245)
- there needs to be a default statement for the compiler to work when this function is called.
2023-03-06 09:21:20 -05:00
Tony Samaritano
2b73b6df70 commander: fixes valid mag count in HIL 2023-03-01 08:05:23 +01:00
Silvan Fuhrer
4259b5adac Commander: copy sensor_gps in HomePosition::update() and store relevant fields in separate variables
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
Silvan Fuhrer
006321e278 Commander: remove unused param COM_POS_FS_EPV
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
Silvan Fuhrer
526e066d9a Commander: rework GPS invalid warning to use estimator feedback instead of separate GPS quality thresholds
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
Silvan Fuhrer
e6af8b9aa6 Commander: Home Position: move gps checks on when to allow setting home pos inside HomePosition class
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
Beat Küng
83c8c79af5
commander failsafe: add API to defer failsafes 2023-02-07 19:27:51 -05:00
Jukka Laitinen
deb6053d56 Update status leds every time when prearm check status changes
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-02-07 08:02:32 +01:00
Silvan Fuhrer
d9a4d1d5c4 Commander: use FW_AIRSPD_MAX as threshold for airspeed preflight checks
Check fails if airspeed reading is above FW_AIRSPD_MAX.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 20:43:38 -05:00
Silvan Fuhrer
32cab66c44 Commander: hide hint to param in low position accuracy event for end users
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 16:47:11 +01:00
Silvan Fuhrer
9b3a28dff5 Commander: add local_position_accuracy_low flag, incl. warning and RTL
Set this flag to true if local position is valid but accuracy low, such that
the operator can be warned before system switches to position-failure failsafe.
Additionally, switch to RTL if currently in Mission or Loiter to try to reach home
or fly out of GNSS-denied area.

Set low accuracy threshold to 50m by default for FW and VTOL.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 16:47:11 +01:00
Silvan Fuhrer
3ca126cc46 Commander: improve description of COM_FS EPH, EPV, VEL_EVH params and increase FW and VTOL defaults
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 16:47:11 +01:00
Silvan Fuhrer
cbc4c35bcf Commander params: improve meta data for max flight time and wind
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 08:48:09 +01:00
Silvan Fuhrer
6d84da5cf1 Commander: add max flight time warning (starting at 90%)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-01 08:48:09 +01:00
Beat Küng
b1709743f7 commander: add wind or flight time limit exceeded mode requirement
This prevents switching into any of these modes once the condition is set.
2023-02-01 08:48:09 +01:00
Beat Küng
a8628c9d9c fix commander: clear takeoff_time only on disarm
Otherwise the flight time restriction flag gets cleared too early, before
disarming (which puts the vehicle into the previous mode and it might
take off again).
2023-02-01 08:48:09 +01:00
Beat Küng
8e4c5884ec fix commander: need to check for valid mode change even if already the same
Fixes the following case:
- user intention set to X
- failsafe triggers, mode = Y
- can_run for X becomes false
- user tries to switch to X
  -> need to re-evaluate can_run
2023-02-01 08:48:09 +01:00