59 Commits

Author SHA1 Message Date
Silvan
1f2dba68d2 remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01: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
Matthias Grob
fd04ece6d4 geo: remove dependency on drv_hrt time driver 2024-10-07 14:24:18 +02:00
Claudio Chies
e29a36adb4
Landing horizontal velocity compensation / unsteady landing (#23546)
* initial working

* implemented feedback
2024-08-19 08:01:43 +02: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
murata,katsutoshi
ba448fb549
MC Auto: add fixed yaw mode 2024-04-25 13:53:05 +02: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
8bb20db7da GotoControl: Save flash 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
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
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
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
728570828f FlightTaskManualAltitude: use StickTiltXY for horizontal stick mapping 2023-03-02 12:06:40 +01:00
Matthias Grob
21d580293a StickYaw: use consistently for all flight tasks
- Switching to the first order filter that was previously
only in FlightTaskManualAltitude.
- Moving the scaling of full stick deflection to
radians per second into the class.
2023-03-02 12:06:40 +01:00
alessandro
3e149ee6c5
FlightTaskAuto: landing position updates for precision landing (#20951)
- precision landing works incorrectly, target position is not updated during the descent above target
 - _prepareLandSetpoints needs to update _land_position continuously

Co-authored-by: kapacheuski <kapacheuski@gmail.com>
2023-02-07 12:07:26 -05:00
Matthias Grob
5ca28dd6dc Use isAllFinite() in all places that check finiteness on entire vectors or matrices 2022-10-19 19:09:20 +02:00
Silvan Fuhrer
5ea8c6e507 FlightTaskAuto: remove unused _getTargetVelocityXY()
Inclusive velocity_valid field in position_setpoint message that's then
no longer needed.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-10-17 16:12:15 -04:00
Daniel Agar
0a5c9d4951 position_setpoint delete unused landing_gear 2022-09-19 11:16:45 -04:00
Daniel Agar
11dd924bd4 position_setpoint delete unused SETPOINT_TYPE_FOLLOW_TARGET 2022-09-19 11:16:45 -04:00
mcsauder
87a5705960 Rename math::gradual() to math::interpolate() and add unit tests to cover additional corner cases. 2022-08-18 14:18:02 +02:00
Silvan Fuhrer
55f395a7e9
FlightTaskAuto: apply cruise speed from position triplet also when negative (#20006)
Navigator sets the cruise_speed to -1 if the controller shouldn't listen to
it and instead use the default speed (for MC: MPC_XY_CRUISE). This is for
example for RTL the case, where we want to return at the default speed,
independetly of what the mission speed before was.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-08-04 13:36:15 +02:00
Daniel Agar
a73efd9c4f NuttX carry minimal c++ cmath (replacing Matrix stdlib_imports.hpp) 2022-07-12 08:05:06 -04:00
RomanBapst
42cd0b4ce0 FlightTaskAuto: don't override landing gear state for takeoff
- this allows landing gear to retract automatically when doing a takeoff
and the vehicle is considered high enough

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-06 11:11:14 +02:00
Matthias Grob
54145cedc7 FlightTask: Weather vane cleanup
Remove the entire external yaw handler, dynamic memory allocation,
pointer passing logic. Directly instanciate the weather vane instance
in the flight tasks that support it.
2022-06-22 14:19:28 +02:00
Matthias Grob
8ca28f3796 Separate message for trajectory setpoint 2022-05-12 17:19:48 +02: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
Matthias Grob
97b2947416 FlightTaskAuto: refactor _commanded_speed_ts -> _time_last_cruise_speed_override 2022-04-13 12:23:27 +03:00
Matthias Grob
68cf686892 FlightTask: rename and move setCruisingSpeed() -> overrideCruiseSpeed() 2022-04-13 12:23:27 +03:00
RomanBapst
d41de33a85 FlightModeManager: handle MAV_CMD_DO_CHANGE_SPEED
- support setting the cruise speed of the auto flight task via command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
Junwoo Hwang
f78465428c Stick Verbose Functions : Edit other FlightTasks using checkAndUpdateStickInputs() functions and correct Throttle returned value inverse issue 2022-03-23 11:54:05 +01:00
Silvan Fuhrer
f4c300af25 FlightTaskAuto: Nudging: only set yawrate_sp if WV is disabled or stick out of dead-zone
Otherwise the setpoint from weather vane is constantly overwritten by it,
even if the yaw stick is not moved.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-03-11 09:18:31 +01:00
bresch
a3b2550f07 mc_auto: only check for offtrack, infront and behind in XY-plane
This fixes the issue when changing the altitude during a goto for
example, where the vehicle was going backwards and upwards to reach the
closest point to the line. Now the vehicle simply goes towards the
target waypoint.
2022-02-11 16:14:48 +01:00
Thomas Debrunner
fb8b9b647a land-detector: switch to crawl speed for intent detection 2022-02-04 21:56:20 -05:00
Thomas Debrunner
2a6d9bc1dd fligh-mode-manager: First implementation of a three-stage-landing for multirotos, in case LIDAR is available 2022-02-04 21:56:20 -05:00
Matthias Grob
8525a8e520 FlightTaskAuto: fix typo pos(i)tion 2022-01-25 11:45:31 +01:00
Matthias Grob
443406ea2b FlightTaskAuto: use longerThan() when possible in vector calculations 2022-01-12 15:12:24 +01:00
bresch
4fc7348582 mpc: leave room for altitude error control during descent and descent
Since the same parameter is used to generate the trajectory and to
saturate the controller, there is no additional space for the output of
the position controller once it is filled with the feedforward, letting
the altitude grow uncontrolled.
2022-01-12 13:33:48 +01:00
bresch
ea7d2334c9 mpc: add parameter for ascent/descent speed in auto modes 2022-01-12 13:33:48 +01:00
Matthias Grob
bbad4a5397 FlightTaskAuto: Respect altitude with offtrack state
To avoid weird cases where the altitude is different enough and
the offtrack state flies to the target altitude instead of the closest
point on the track between the waypoints.
2022-01-07 10:30:39 -05:00
Silvan Fuhrer
b00ebe53bb FlightTaskAuto: use MPC_VEL_MAX instead of MPC_XY_CRUISE for emergency braking thresholds
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-08 09:13:01 +01:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
Thomas
9345f68a93 reapply PR 18614 to refactored FlightTaskAuto 2021-11-30 14:52:16 +01:00
Matthias Grob
35d4986ea7 FlightTasks: remove updateFinalize() concept because it got obsolete 2021-11-18 19:12:44 -05:00
Matthias Grob
9eac0edbc0 FlightTaskAuto: remove generateSetpoints function, replace by implementation 2021-11-18 19:12:44 -05:00
Matthias Grob
ece8fdddec FlightTaskAuto: simplify early setpoint preparation based on triplet type 2021-11-18 19:12:44 -05:00
bresch
4a14a8bc7f AutoLineSV: Always publish a valid yaw setpoint
In MPC_YAW_MODE 3 (along trajectory), the flight task is asked to
produce a yaw setpoint. If the previous yaw value was NAN (e.g.: during
early takeoff), the setpoint should then be reset to the current
estimate.
2021-11-16 18:09:37 -05:00