Commit Graph

16111 Commits

Author SHA1 Message Date
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
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 e7a2c1d88e.
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
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:
06c10f61c1
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:
114e85d260
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
Silvan Fuhrer 4b8f93de5c FW: rework spoiler/flap control logic
- remove separate flaperon controls input to mixer instead enable spoiler support
- add slew rate limiting on both flap and spoiler controls
- add spoiler configuration for Landing and Descend
- add trimming from spoiler deflection
- FW Attitude control: remove FW_FLAPS_SCL param -->
    The flap settings for takeoff and landing are now specified relative to full range.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Silvan Fuhrer 21a2892f47 use actuator_controls[8] for collective tilt for tiltrotor VTOL, instead of [4]
[4] is reserved for Flaps, so also having the tilt on it was preventing us from
using flaps on tiltrotors, and other ripple effects.
By using [8] the tilt is separated from all other channels - it requires to increase the size of
actuator_controls by 1 to 9.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Peter van der Perk 108c98a691 Added experimental LTO kconfig option 2022-05-02 10:07:54 -04:00
Daniel Agar 6fc857772d ekf2: remove unnecessary const references 2022-04-29 21:39:02 -04:00
Beat Küng d94ec84e46 logged_topics: remove unused vehicle_angular_acceleration_setpoint, extend add_high_rate_topics 2022-04-28 19:51:28 -04:00
Beat Küng 4338976247 ActuatorEffectivenessRotors: add missing getEffectivenessMatrix
Fixes MOTORS_6DOF
2022-04-28 19:51:28 -04:00
Beat Küng a9129ea003 logger watchdog: also check main thread
There was a time window where if a task with higher priority than the main
logger thread would busy-loop, it would block both logging threads and the
watchdog would not trigger if the writer was in idle state.
This can happen for fast SD card writes.
2022-04-28 19:49:24 -04:00
Daniel Agar f390f52058 drivers/differential_pressure: remove lib/drivers/airspeed dependency and cleanup
- split ms4525_airspeed into separate ms4515 and ms4525 drivers
2022-04-26 08:39:19 -04:00
Daniel Agar d1d15a6f6d differential pressure remove filters from drivers and average in sensors/airspeed 2022-04-26 08:39:19 -04:00
Daniel Agar 258f558fea apply differential pressure calibration (SENS_DPRES_OFF) centrally
- remove drv_airspeed.h and ioctls
2022-04-26 08:39:19 -04:00
JaeyoungLim c6ab4c466e Separate takeoff and landing to individual fixed wing states for FW pos control (#19495) 2022-04-26 10:24:36 +02:00
Daniel Agar 3d7a6b4021 mc_pos_control: silence invalid setpoint warning when disarmed 2022-04-26 01:37:37 -04:00
Daniel Agar 3d590af115 mc_att_control: only apply quat reset if estimate is newer than setpoint 2022-04-25 21:25:29 -04:00
bresch e32a484906 [AUTO COMMIT] update change indication 2022-04-25 12:58:18 -04:00
bresch db0274e19b ekf: robustify bad_acc_vertical check
when the vertical pos or vel innov ratio is above the threshold, the
other one needs to be significant too and not just positive to trigger
the failure
2022-04-25 12:58:18 -04:00
Daniel Agar 980f696023 commander: mag calibration tolerate fit failure if sensor disabled 2022-04-25 12:41:20 -04:00
Daniel Agar 89374b2e1d mavlink: delete Mavlink instance if early startup fails 2022-04-25 12:38:28 -04:00
Alex Mikhalev 45dff7f71a commander: Add prearm check for flight termination 2022-04-25 11:57:37 -04:00
Daniel Agar 6359c8c008 mavlink: shell expand locking (#19308)
- on some H7 boards (cuav x7pro tested) there's an occasional hard fault when starting the mavlink shell that is no longer reproducible with the slightly expanded locking
 - this is likely just changing the timing (holding the sched lock for longer), but this should be harmless for now until we can identify the root cause
2022-04-25 11:53:22 -04:00
Junwoo Hwang af839c828d Set Tune's Volume for Power-Off in Commander to default volume of tune_control message 2022-04-25 11:47:43 -04:00
Daniel Agar 503f97c8bc logger: add default ground truth logging for HITL/SITL 2022-04-24 12:45:23 -04:00
Silvan Fuhrer 680fe86c05 FlightTaskAuto: fix Weather Vane during landing
Weather vane should only set a yawrate setpoint, but no yaw setpoint.
Setting it to NAN when WV is active makes sure that whatever _yaw_setpoint
is set previously (e.g. through Waypoint) is not used.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-04-23 18:14:42 +02:00
Silvan Fuhrer bd1b0cab73 Mission: don't do anything in set_current_mission_index() when index=current already
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-04-22 22:32:06 -04:00
bresch e9c07fac6f EKF: move python tuning tools to EKF module 2022-04-21 13:39:26 +02:00
bresch 3c6b72c33b commander: improve set_in_air_position
- set local home using global pos and global home
- set local home using GNSS pos and global home
- set global home using global ref of local frame and local home
2022-04-19 15:29:25 +02:00