24639 Commits

Author SHA1 Message Date
Beat Küng
0f860045f7 failure_detector: add failure injector class for motor telemetry
This allows to test motor failures via 'failure motor off -i 1' on a real
system.
2022-05-12 07:58:56 +02:00
Alessandro Simovic
4640f395d7 simulator_mavlink: Add ESC telemetry 2022-05-12 07:58:56 +02:00
Alessandro Simovic
20ccfbb719 control_allocator: remove failed motor from effectiveness
- limit to handling only 1 motor failure
- Log which motor failures are handled
- Remove motor from effectiveness matrix without
  recomputing the scale / normalization
2022-05-12 07:58:56 +02:00
Alessandro Simovic
fb71e7587c failure_detector: add motor/ESC failure detection 2022-05-12 07:58:56 +02:00
Beat Küng
dfd934fbdb esc_report: add actuator_function 2022-05-12 07:58:56 +02:00
Hamish Willee
aab2feb8f5
pwm.cpp: remove the test example (#19587) 2022-05-12 07:56:13 +02:00
alexklimaj
0f69f8ced8 Fix uavcan battery causing immediate RTL time remaining low 2022-05-11 21:48:12 -04:00
Daniel Agar
fba7c972d1
drivers/rc_input: ensure RC inversion is disabled initially and latch RC_INPUT_PROTO conservatively
- this allows jumping straight to a non-SBUS RC protocol
 - increased the scan time per protocol 300->500 ms, which the newer DSM parser seems to need in some cases.
 - only set RC_INPUT_PROTO if we've had a successful RC lock for > 3 seconds
2022-05-11 14:30:41 -04:00
Daniel Agar
c772e5230f
commander: remove compile time dependencies on non-commander parameters
- this allows builds with mavlink fully disabled
 - move commander MAN_ARM_GESTURE, RC_MAP_ARM_SW, MC_AIRMODE checks to manual_control
2022-05-11 10:14:23 -04:00
Beat Küng
8d36ba6727 log_writer_file: fix corner case when mission log is enabled
Normally _should_run for mission is only ever true if _should_run for the
normal log is. There are exceptions though:
- the log buffer fails to allocate
- there was a write failure (e.g. due to SD card removal)
In that situation, the writer would not wait anymore but busy-loop.
2022-05-11 10:06:35 -04:00
Beat Küng
ebbe08bc86 log_writer_file: protect access to _should_run, use px4::atomicbool for _exit_thread 2022-05-11 10:06:35 -04:00
Peter van der Perk
0053aeec97 Cyphal restore O1Heap statistics 2022-05-11 09:49:18 -04:00
Silvan Fuhrer
866f9fa95b Control Allocation: add option to disable yaw by differential thrust
This replaces the propeller_torque_disabled flag to disable yaw by differential thrust
for tiltrotor and tailsitter VTOLs, as propeller_torque_disabled is not enough to set
effectiveness of an acutator in the yaw axis to 0 in case it's tilted.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-11 10:19:37 +02:00
Silvan Fuhrer
46179586fb Control Allocation: Tiltrotor: pass only thrust magnitude instead of 3D thrust to allocator
Special case tiltrotor: instead of passing a 3D thrust vector (that would mostly have a x-component in FW, and z in
MC), pass the vector magnitude as z-component, plus the collective tilt. Passing 3D thrust plus tilt is not feasible as they
can't be allocated independently, and with the current controller it's not possible to have collective tilt calculated
by the allocator directly.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-11 10:19:37 +02:00
Daniel Agar
45e3fad3e0
Update submodule GPSDrivers to latest Tue May 10 12:38:49 UTC 2022
- GPSDrivers in PX4/Firmware (3ac8fdbe2901dcd812c8e1944f72765ddff4c022): 6534b050ee
    - GPSDrivers current upstream: 58968922b7
    - Changes: 6534b050ee...58968922b7

    5896892 2022-04-26 Seppe Geuens - sbf: add heading support (#100)

Co-authored-by: PX4 BuildBot <bot@px4.io>
2022-05-10 11:38:52 -04:00
PX4 BuildBot
4b7b7dfa8d Update submodule mavlink to latest Tue May 10 12:39:00 UTC 2022
- mavlink in PX4/Firmware (d6dff7daa984514185a8f31f6e653a69a278ded8): 3b52eac09c
    - mavlink current upstream: a1cb2c0e71
    - Changes: 3b52eac09c...a1cb2c0e71

    a1cb2c0e 2022-05-05 KonradRudin - Figure eight MAV_CMD (#1831)
0ebdf846 2022-04-28 Hamish Willee - common.xml: Deprecate MAV_CMD_GET_MESSAGE_INTERVAL for MAV_CMD_REQUEST_MESSAGE. (#1835)
f357fc78 2022-04-27 Hamish Willee - Deprecate MAV_CMD_GET_HOME_POSITION for MAV_CMD_REQUEST_MESSAGE (#1834)
2022-05-10 11:37:55 -04:00
Peter van der Perk
b1ad4e8864 Upgrade libcanard to 3.0 and rename uavcan_v1 to cyphal
Did some prep work for redundant interfaces by introducing CanardHandle class to decouple physical interfaces from cyphal.cpp
2022-05-10 09:46:18 -04:00
Konrad
0e464a91be Remove contradicting geofence parameter description
The flight termination action on geofence violation is described as only trigger, when the corresponding circuit breaker is not disabled. However, the description of the circuit breaker states, that the geofence action is not depedning on this circuit breaker. The implementation follows the description of the circuit breaker. Hence the GF_ACTION description is adapted.
2022-05-10 09:01:12 +02:00
Beat Küng
5cdb6fbd8e control_allocator: add helicopter mixer
Same logic as the existing mixer.
Untested.
2022-05-10 08:57:39 +02:00
Beat Küng
32402f31df control_allocator: increase max num motors to 12 2022-05-10 08:57:39 +02:00
Beat Küng
9f5c5591a2 ActuatorEffectivenessRotors: fix motor count check
Check during init to avoid out-of-bound access.
2022-05-10 08:57:39 +02:00
Silvan Fuhrer
5d6c8c986d Commander: high wind speed handling updates
- add logic for detecting high wind speed in Commander,
and handle it toghether with wind speed warning
- trigger and enforce RTL if COM_WIND_MAX is breached

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
Silvan Fuhrer
1aad82f87d Commander: add max flight time RTL
Adds COM_FLT_TIME_MAX param and logic in Commander to enforce RTL when
flight time is above this value. User can only override to LAND mode,
but not proceed flight beyond that.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-09 19:09:40 +02:00
Igor Mišić
ce4e9f6690
uavcan: use timer 6 by default on stm32f7 2022-05-06 19:45:53 -04:00
Thomas Stastny
90789be68f fw pos ctrl: turn back to takeoff point with npfg 2022-05-06 16:36:03 +02:00
Thomas Stastny
3ef5f433b5 fw pos ctrl: add missing guidance control interval setting to control_manual_position() 2022-05-06 16:36:03 +02:00
Thomas Stastny
1ab9fb22ee fw pos ctrl: fix state switching logic for takeoff and landing 2022-05-06 16:36:03 +02:00
Matthias Grob
b3776134b8 Commander: ensure diconnected battery is cleared from bit field 2022-05-06 10:32:27 -04:00
Beat Küng
113982e3e7 commander: fix incorrect return in set_link_loss_nav_state()
If both local position and altitude were not valid, then both RC loss and
datalink loss would not trigger any failsafe at all, independently from
the configured action.
2022-05-06 10:14:13 -04:00
Matthias Grob
843c814fb8 MulticopterPositionControl: allow offboard takeoff also when not landed 2022-05-06 04:12:18 -07:00
Matthias Grob
fbc109436f MultiCopterRateControl: refactor setpoint naming 2022-05-06 04:12:18 -07:00
Matthias Grob
1211a457d7 MulticopterPositionControl: Overwrite vertical acceleration during takeoff rampup only 2022-05-06 04:12:18 -07:00
Matthias Grob
d9a2fe5226 Revert "MCPosControl: fix invalid setpoint race condition"
This reverts commit e7a2c1d88e1bad6c07805aa52c7500d18dbe84d8.
2022-05-06 04:12:18 -07:00
mcsauder
2a66be4899 Colocate struct stateSample with other instances of *Sample structs. 2022-05-05 18:41:50 -04:00
mcsauder
a0d9687409 Add c++ style initializers where missing in EKF/common.cpp, standardize tab/space indentation, align comments and format whitespace. 2022-05-05 18:41:50 -04:00
bresch
cab477d715 ekf2: optimize KHP computation
Calculating K(HP) takes less operations than (KH)P because K and H are
vectors.

Without considering the sparsity optimization:
- KH (24*24 operations) is then a 24x24 matrix an it takes
24^3 operations to multiply it with P. Total: 14400 op

- HP (24*(24+24-1) operations) is a row vector
and it takes 24 operations to left-multiply it by K. Total:1152 op
2022-05-05 10:34:17 -04:00
bresch
c890e8bf99 WindEstimator: fix state covariance prediction
All the states are stationary so the discrete-time process noise Qk can
be directly added to the state covariance matrix P
2022-05-05 11:53:33 +02:00
Konrad
14a2fdfe55 Removed l1 control slope angle limitation. The maximal approach angle to the line was set to 45°, no the approach angle can be up to 90°. 2022-05-04 21:23:22 -04:00
Matthias Grob
46fdc28cf8 MulticopterPositionControl: fix typo "descen{d/t}" 2022-05-04 02:22:18 -07:00
Daniel Agar
7f1bb556e9 Update src/modules/mc_pos_control/MulticopterPositionControl.cpp
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2022-05-04 02:22:18 -07:00
Matthias Grob
3fb4889ab9 MultcopterPositionControl: fix executing a zero setpoint for 200ms
This is a combination of the originally introduced delay:
06c10f61c1401d448979c65c2250afde42b99522
then the emergency failsafe being changed to not just land,
position control being rescheduled to not overwrite every setpoint in:
e502214429576ce68ac3fee9d2db19112f4604b9
and it being fixed by overwriting the setpoint but not removing
the long obsolete hystersis here:
114e85d260d4acb157e191fd8cfc1f58c9c73e4e
2022-05-04 02:22:18 -07:00
Matthias Grob
cb484c5ac7 PositionControl: publish NAN jerk
because the controller does not read or write jerk
2022-05-04 02:22:18 -07:00
Matthias Grob
5055fec796 MulticoperPositionControl: explicitly overwrite setpoint timestamp when setpoint is reset 2022-05-04 02:22:18 -07:00
Matthias Grob
424fd8b304 MulticoperPositionControl: remove time_stamp_now alias for timestamp_sample of the local position
to make it explicit what is used is not a fresh hrt_absolute_time() call
by this module.
2022-05-04 02:22:18 -07:00
Matthias Grob
8180f931de MulticopterPositionControl: rename local_pos -> vehicle_local_position 2022-05-04 02:22:18 -07:00
Matthias Grob
4ffe796b4d MulticopterPositionControl: clarify previous position control naming 2022-05-04 02:22:18 -07:00
Daniel Agar
ad6592f669 mc_pos_control: require current trajectory setpoint to run controller 2022-05-04 02:22:18 -07:00
Silvan Fuhrer
138772386f FW Position control: explicitly set spoiler/flaps in every control mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Silvan Fuhrer
089673ff35 only allow positive spoiler and flap controls
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Silvan Fuhrer
64ff31aa08 VTOL: add flap and spoiler support
- including slew rate limiting
- adds option to set spoiler setting during the Land phase (hover)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00