276 Commits

Author SHA1 Message Date
DrinkingHook
70f32f4631 Clean up duplicate assignments in flight_mode_manager-task-auto 2025-11-19 20:44:22 -09:00
Marco Hauswirth
561a83cf6c
VTOL Backtransition lateral position control improvements (#25704)
During backtransition in gusty conditions the current "pitch-up to decelerate" strategy had deficiencies as the motion is not always purely in body-x direction. Thus we replace it here with a "tilt-up to decelerate" strategy.
Secondly, in GNSS-denied environments where the position error increases, tracking a precise landing point through position feedback is not reasonable, and we now instead discard the position feedback in cases where the position error exceeds 10m.

* add eph limit check for dist-to-target VT BT deceleration

* add alphafilter for acceleration estimate in VT BT, rename constants

* explicitly set yawspeed_setpoint to 0

* replace backtransition pitch-setpoint with tilt-setpoint

* blend vtol-backtransition roll vehicle_attitude_sp based on mc_weight

* remove memcpy for v_att_sp
2025-11-06 13:36:22 +01:00
Balduin
1c821cf83d
FlightTaskAuto: disable MPC_LAND_RADIUS by default with value -1 (#25275)
* FlightTaskAuto: disable MPC_LAND_RADIUS by default

* format & comment

* Remove position valididy check again

* clean up according to review
2025-10-23 17:36:46 +02:00
Jacob Dahl
2c62caeb7d
flight task auto: fix offtrack mission landing bug (#25725)
During a mission the last waypoint is often a LAND. If the previous waypoint is not directly above the land waypoint the offtrack calculation is incorrect. This regression was introduced when the offtrack calculation switched from 2D to 3D.
2025-10-13 19:56:23 -08:00
bresch
c06ba93175 mc-auto: handle EKF heading reset 2025-09-18 17:00:16 +02:00
Silvan Fuhrer
d2e4d85bce Add Altitude Cruise mode
-add new NAVIGATION_STATE_ALTITUDE_VOYAGER
-this mode does require manual control to enter
-but you can disable the manual control loss failsafe to continue
flying in case of manual control loss
-for MC: in throttle and yaw are controlled like in Altitude mode,
the tilt is controlled via integrated rate input (similar to Acro,
but with tilt limit)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-09-18 15:50:10 +02:00
Matthias Grob
2e910fe185 FlightTask{Altitude+Orbit}: use getter for specific stick value instead of entire array 2025-09-18 15:50:10 +02:00
mahima-yoga
a514289a68 Move Stick class into a globally available library 2025-09-18 15:50:10 +02:00
Pernilla
2cb97e79b9
FlightTaskManualAccelerationSlow: Acquire gimbal control until expected IDs are reported (#25565)
* Acquire control until expected id s are reported

* require an updated message and allow release in case early exit of FlightTask

* FlightTask Gimbal: acquiring logic simplification suggestion

* formatting

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2025-09-18 11:09:09 +02:00
Pernilla
b4395d5960
FlightTaskManualAcceleration: fix velocity constraint overwriting + altitude limit slow down
- The velocity constraint gets set from multiple places e.g. Position slow knob and altitude related slow down. Depending on the execution order it was overwritten with a higher value again not obeying a stricter limit.
- The slowdown used valocities as inputs instead of the ratio of available altitude.
2025-09-10 10:18:09 +02:00
Silvan Fuhrer
16f97635ce Separate RC and manual control terms
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-08-18 18:11:03 +02:00
bresch
61e741e7d0 FlightTask manual acc: handle ekf position reset properly 2025-07-29 14:29:19 +02:00
Matthias Grob
a4115db669
FlightTaskOrbit: replace hardcoded 10m/s maximum speed with multicopter speed configuration (#25192) 2025-07-10 11:16:11 -08:00
Matthias Grob
a8f5b6dc1b FlightTaskOrbit: also use HeadingSmoothing to avoid steps during the approach 2025-05-21 13:25:46 +02:00
Matthias Grob
70ad2e6fe5 FlightTaskAuto: Smooth yaw follow-up, bring back necessary previous yaw setpoint and reset smoothing when yaw is not locked 2025-05-21 13:25:46 +02:00
Dawid Rudy
508dc030b8 Smooth yaw by limiting acceleration 2025-05-21 13:25:46 +02:00
Matthias Grob
5f34474ecb FlightTaskAuto: clean up parameter description and internal variable naming 2025-04-25 15:32:47 +02:00
Matthias Grob
174147208e Move StickYaw class into a globally available library 2025-04-22 15:35:26 +02:00
Marco Hauswirth
283a69dedf enable terrain_hold when not moving vertically 2025-03-24 09:08:18 +01:00
Mathieu Bresciani
0ab3e45c13
MC auto: improve behavior of RC help during landing
Letting the autopilot set the heading during landing while the pilot is
nudging the vehile leads to a weird UX as the vehicle would make a turn
instead of translating.
With this modification, the initial land heading is immediately overridden when the pilot
begins to adjust the drone's position, providing the sensation of full control.
2025-03-05 16:37:26 +01:00
bresch
c09c63171c MC auto: fix land nudging
Revert removal of isTargetModified as this is required when the target
is changed by "RC help" (nudging) during landing.
2025-02-25 09:11:23 +01:00
Perre
412d4390a6
MC Slowmode: Yawstick for gimbal control, vehicle yaw follows gimbal (#24242)
* Yawsticks on gimbal, vehicle follows gimbal in slowmode, once vehicle has taken off

* Increase queue length to avoid automatically unadvertise queued publications with queue length 1

* Improve readability

---------

Co-authored-by: Pernilla <pernilla@auterion.com>
2025-02-18 14:38:11 +01:00
Silvan
04cd247c90 FlightTaskAuto: remove isTargetModified()
As it is no longer needed w/o avoidance.

Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Silvan
b7b6d45e18 lib: remove bezier
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Silvan
1f2dba68d2 remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Marco Hauswirth
61d595dc64 reset dist_to_ground_lock if dist_to_bottom is not valid. this avoids a reset to a previous dist_to_ground after a switch back to a valid measurement 2025-02-14 17:10:14 +01:00
bresch
8d296a50f9 FlightTask: properly initialize EKF reset counters
This fixes a race condition when switching from a flight mode that is
not a flight task (e.g.: stabilized). In this case, the reset counters
were initialized to 0 and deltas were applied to the first setpoints if
the EKF had any of its reset counters different from 0.
2025-02-05 13:21:32 -05:00
Matthias Grob
af062c85eb Revert "FLightTaskAuto: limit nudging speed based on distance sensor"
This reverts commit 97cb933cff6d837e59dd55123804cd78abdca22a.
2025-01-21 09:59:47 +01:00
Marco Hauswirth
4a5aa1e947
Fix max-hagl restriction to position/altitude control (#23667)
* fix max-hagl restriction to position/altitude control

* max hagl vel restriction in ManAcc position mode

* use interpolate func, change naming

* simplyfied vertical vel limitation

* move velocity-constraint adjustment to StickAccelXY
2025-01-20 15:50:21 +01:00
Matthias Grob
1239f0aaed FlightTaskTransition: Comment why using invalid horizontal velocity works 2024-12-19 16:00:21 +01:00
Matthias Grob
34bcc277a5 FlightTaskTransition: keep high decelration when overshooting the transition target 2024-12-19 16:00:21 +01:00
Matthias Grob
11d7dd41fd FlightTaskTransition: clean up and simplify 2024-12-19 16:00:21 +01:00
bresch
fa5a781e20 AlphaFilter: set time constant instead of alpha
Then the update function can set the dt at every iteration if needed
2024-12-18 14:11:08 +01:00
Matthias Grob
2ef2911c36 Remove FlightTaskManualPositionSmoothVel
The default implementation for multicopter Position mode is FlightTaskManualAcceleration.
The last missing piece was support for CollisionPrevention in this implementation.
2024-11-21 11:36:03 +01:00
Matthias Grob
079f3ca67c StickAccelerationXY: Simplify collision prevention call 2024-11-21 11:36:03 +01:00
Claudio Chies
0cd6a553b9 CollisionPrevention: rewrite for Acceleration based manual flight mode 2024-11-21 11:36:03 +01:00
Alvaro Fernandez
079b756f1b
VTOL: Added position feedback to backward transition braking controller(#23731)
Instead of tracking a fixed deceleration setpoint during the backtransition we added here position feedback,
such that the vehicle comes to a stop latest at the current position setpoint. This reduces the risk of 
overshooting the landing point.
If no position feedback/position setpoint is present the old logic still applies.
It further moves the braking controller to the FlightTaskTransition instad of doing it in
the VTOL attitude mode.

* vtol_type: added position feedback to backward transition

* FlgithTaskTransition: refactored backtransition deceleration/pitch setpoint computation

* FlightTaskTransition: minor improvements

* FlightTaskTransition: use .dot() consistently and remove unnecessary comments

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-11-11 11:53:28 +01:00
Matthias Grob
cac0133901 FlightTaskDescned: fix horizontal acceleration overriding vertical one
Also descend with more acceleration again to avoid the risk of ascending instead of descending because of a wrong hover thrust estimate.
2024-10-25 14:06:00 +02:00
Matthias Grob
fd04ece6d4 geo: remove dependency on drv_hrt time driver 2024-10-07 14:24:18 +02:00
Daniel Agar
ad28c5893b flight_mode_manager: invalidate dist to bottom/ground on terrain reset
- this allows the terrain hold to simply reset on the next valid update
   rather than trying to adjust the setpoints
2024-10-04 11:28:03 -04:00
BazookaJoe1900
4d83badba1
fix files tags on the header comments (#23564) 2024-09-19 09:25:18 +03:00
Claudio Chies
4ba4b340cc Reduce the orbit jerk by using a slew rate 2024-09-13 10:28:42 +02:00
Claudio Chies
e29a36adb4
Landing horizontal velocity compensation / unsteady landing (#23546)
* initial working

* implemented feedback
2024-08-19 08:01:43 +02:00
Matthias Grob
0381e14822 FlightTaskOrbit: Avoid sending NAN altitude in status telemetry while it's changed by stick 2024-08-08 10:53:18 -04:00
Claudio Chies
28a0de63c5
Orbit Yaw Vehicle Parameter (#23358) 2024-08-07 11:12:52 +02:00
Daniel Agar
e03aef616c
ekf2: add terrain/dist_bottom reset deltas (vehicle_local_position/vehicle_global_position) 2024-07-15 10:25:42 -04:00
Claudio Chies
33be5d8356
Survey - fix of survey tracking problem on steep slopes (#23371)
* initial working

* incoperated review
2024-07-11 14:54:22 +02:00
Daniel Agar
78fd9a15f8 flight_mode_manager: delete unused avoidance waypoint 2024-06-27 01:08:16 -04:00
murata,katsutoshi
ba448fb549
MC Auto: add fixed yaw mode 2024-04-25 13:53:05 +02:00
Matthias Grob
51fe4351c6 StickTiltXY: Fix too high maximum tilt problem
And add unit tests.
2024-02-20 14:27:49 +01:00