240 Commits

Author SHA1 Message Date
Matthias Grob
925e776a00 FlightTaskAuto: use built in matrix comparison
which corresponds to fabsf(a(0) - b(0)) < 1e-4f for each element.
2024-10-13 16:35:45 +02:00
Matthias Grob
67fb4cfec8 FlightTaskAuto: purge separate triplet type enum
This allows for full text search of a type
to see all the cases it's used for.
2024-10-12 08:58:43 +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
muramura
f636414ca7 tuning_tools: Change 1G to a more accurate value 2024-02-09 10:26:57 -05:00
muramura
00a9e4c76b Auto: Change 1G to a more accurate value 2024-02-09 10:26:57 -05:00
Matthias Grob
97cb933cff FLightTaskAuto: limit nudging speed based on distance sensor 2024-02-07 11:23:55 +01:00
Silvan Fuhrer
7e22b47b85
Navigator/FlightTaskAuto yaw handling improvements/simplifications (#22532)
* PositionSetpoint: remove yaw_valid field

* Navigator: set yaw setpoint to NAN for Takeoff

Don't set a yaw setpoint for takeoff, as Navigator doesn't handle the yaw reset.
The yaw setpoint generation is handled by FlightTaskAuto.

* PositionSetpoint.msg: remove disable_weather_vane and instead only use the yaw field

Strictly follow the concept that if the position_setpoint.yaw is set, then
follow it the controller, and otherwise let the controller set it as it
thinks it's best.

* Navigator: remove logic that sets yaw to be accepted in TAKEOFF

No longer needed as during Takeoff we anyway don't set a yaw setpoint.

* PositionSetpoint.msg: remove yawspeed_valid

* PositionSetpoint.msg: remove yawspeed

* Navigator: set yaw setpoint to NAN instead of current

In set_takeoff and set_land_item, as well as for VTOL transition.
The flight tasks then set the yaw corresponding to the current yaw.

* Navigator: change get_yaw_acceptance into a bool

* PositionSetpoint.msg: improve comment for yaw

* MissionBlock: remove unnecessary code from set_vtol_transition_item

* Navigator: clean up calculate_breaking_stop(), set yaw to NAN

* Navigator: set yaw to NAN in variouls places where not specifc setpoint is desired

* Navigator: set yaw to NAN in reset_position_setpoint()

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-12-21 16:50:13 +01:00
Matthias Grob
ebae9ae3d7 FlightTaskManualAccelerationSlow: MC_ prefix for parameter names
As discussed in the maintainer call we should adhere to the
parameter naming scheme that makes it clear what vehicle type the
configuration is good for.
2023-12-08 21:17:59 +01:00
Matthias Grob
da24811ce1 SickAccelerationXY: fix comment typo brak{e}ing 2023-12-08 21:17:59 +01:00
Matthias Grob
54ce9813c8 FlightModeManager: Add task for position slow mode 2023-12-08 21:17:59 +01:00
Matthias Grob
dbbf585adb StickYaw: yaw rate limit interface 2023-12-08 21:17:59 +01:00
Matthias Grob
84220407ea FlightTaskManualAltitude: vertical velocity limit interface 2023-12-08 21:17:59 +01:00
Matthias Grob
bb617f6c4d FlightTaskManualAcceleration: horizontal velocity limit interface 2023-12-08 21:17:59 +01:00
Matthias Grob
77c06a9f9e Sticks: Provide auxiliary analog values from manual_control_setpoint 2023-12-08 21:17:59 +01:00
Matthias Grob
df41bc3d26 StickAccelerationXY: make sure speeds below 1m/s are exactly reached
by only applying the sqrt linear drag when brakeing.
It was originally not done this way to avoid discontinuities and
the exact speed bewlo 1m/s didn't matter. With the position slow mode
the exact slow speeds now matter. And the discontinuities are avoided by
reusing the brake boost filter.
2023-12-08 21:17:59 +01:00
Matthias Grob
8bb20db7da GotoControl: Save flash 2023-11-30 17:16:02 +01:00
Matthias Grob
3de6fee07f GotoControl: make interface over uORB 2023-11-30 17:16:02 +01:00
Matthias Grob
be05b3e8d7 helper_functions: include defines for M_PI_PRECISE
The defintion of the custom symbol M_PI_PRECISE
was not included in one of the only places it's used.
Looks like a mistake that happened in
34c852255e16bb62d2caf0c3be1f2fea660036ba
possibly because a lot of things are included
almost everywhere and if the include order
ligns up there are no compile errors.
2023-11-30 17:16:02 +01:00
Matthias Grob
efb325d25d motion_planning: remove deprecated separate test
It's functionality probably broke already in
befbb6b106c4c04933222ecb205f001fd77fa85f
and the tests are now covered by
VelocitySmoothingTest.cpp
2023-11-30 17:16:02 +01:00
Silvan Fuhrer
2734c44533 FlightTaskAuto: set state to None if prev and current sp are equal
Otherwise if is set to Offtrack, which in turn leads to weird behavior.
E.g. when triggering Land while flying fast forward, the vehcile doesn't
descned to the land point it keeps getting a velocity setpoint from the
smoother that pushes it away from the land point.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-27 18:01:47 +01:00
Matthias Grob
9bed8f48c7 Remove LNDMC_ALT_MAX
This should be replaced with the maximum geofence
altitude GF_MAX_VER_DIST. I'm not aware anyone is using
this functionality as is.
2023-11-20 14:52:35 +01:00
Matthias Grob
0dcecf0666 FlightModeManager: avoid internal flight task running concurrently with external mode 2023-11-15 13:18:58 +01:00
alexklimaj
de0910c767 flight mode manager: fix terrain hold 2023-11-07 12:00:14 -05:00
bresch
23b31cc5fd manual_yaw: compensate for yaw estimate convergence
When the yaw estimate is converging, the controller makes the drone yaw
in order to follow the current setpoint. This is unintuitive for the
pilot and it is preferable if the drone continues to fly towards the
same physical direction.
2023-08-30 09:56:19 +02:00
Matthias Grob
632596c1ea FlightTask: correct header comments 2023-07-13 12:00:35 +02:00
Matthias Grob
b7e2a9c320 FlightTaskAltitude: remove duplicate, deprecated yaw stick handling 2023-07-03 09:52:47 +02:00
Matthias Grob
4d465533b5 FlightTaskManualAcceleration: remove duplicate yaw stick handling
It's already instanciated and ran by FlightTaskManualAltitude
which FlightTaskManualAcceleration inherits from.
2023-07-03 09:52:47 +02:00
bresch
616a71a959 MC_auto: avoid yaw step if previous setpoint is NAN
A VTOL plane in MC mode has no yaw setpoint during takeoff because of
weather-vane. To align for the front transition, the yaw target jumps
and caused a step in the controller, making it reach saturation.

With this commit, the previous yaw setpoint is set to the current yaw
when no yaw setpoint is sent in order to create a smooth yaw trajectory
starting at the current orientation when yaw target is suddenly finite.

The yawspeed filter also now contains the yaw speed instead of dyaw in
order to prevent chattering due to dt jitter.
2023-05-12 13:42:09 +02:00
Matthias Grob
5c1e0ddd96 FlightTaskTransition: use new 2D rotation 2023-04-15 21:57:40 +02:00
Matthias Grob
7ebd6cc74f FlightTaskManualPosition: use existing stick library rotation 2023-04-15 21:57:40 +02:00
Matthias Grob
7b850a91b4 Sicks: use new 2D rotation 2023-04-15 21:57:40 +02:00
Matthias Grob
1e94ad19c0 FlightModeManager: rework task starting
with the goal to make it more clear and the error only appear when
armed but every time the running task doesn't actually match
the mapping inside the start_flight_task() function.
2023-04-15 16:45:32 +02:00
bresch
50b084cf17 MC auto: allow yawing during hold 2023-03-31 17:32:33 +02:00
bresch
c7bddda1db MC auto: add maximum RC assist distance during landing 2023-03-22 10:03:48 +01:00
Matthias Grob
b0189d95af Use new Vector4 class 2023-03-21 15:01:26 +01:00
Daniel Agar
9be8f81d75
flight_mode_manager: StickAccelerationXY protect from NAN velocity reset
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-03-10 08:17:20 -05:00
Matthias Grob
bd5838faf0 FlightTask: don't instaniate unused parameters 2023-03-09 17:40:55 +01:00
Silvan Fuhrer
16594bffa9 Rework landing gear logic
- remove deprecated actuator_controls[INDEX_LANDING_GEAR]
- remove dead code in mc rate controller that used to prevent it from being retracted
on the ground (anyway had no effect as it only affected the actuator_control[LANDING_GEAR]
which wasn't sent to the control allocation)
- for VTOLs handle deployment/retraction of landing gear in AUTO  as a MC (retract if
more than 2m above ground, deploy if WP is a landing WP), plus additionally when transition
flight task is called (ALTITUDE mode and higher)
- for FW in AUTO: add logic in FW Position Controller, depending on waypoint type mainly
- manual landing gear settings always come through (a manual command overrides a previous
auto command, and vice-versa)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-06 22:43:41 +01:00
Matthias Grob
0770478dc7 FlightTaskDescend: Enable nudging by sticks when it's enabled
and stick input is available.
2023-03-02 12:06:40 +01:00