22 Commits

Author SHA1 Message Date
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
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
Daniel Agar
e03aef616c
ekf2: add terrain/dist_bottom reset deltas (vehicle_local_position/vehicle_global_position) 2024-07-15 10:25:42 -04: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
75c63aee2a Fix confusion between trajectory_setpoint and vehicle_local_postion_setpoint 2022-10-17 16:18:00 -04:00
Matthias Grob
8ca28f3796 Separate message for trajectory setpoint 2022-05-12 17:19:48 +02:00
bazooka joe
5d95cc001f small cleanup for FlightTask::_evaluateDistanceToGround if-else 2022-04-18 20:47:41 -04: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
bresch
f751dd2242 FlightTask: set yaw_setpoint to NAN when yaw should not be controlled 2021-11-16 18:09:37 -05:00
Matthias Grob
33e349d71e FlightTask: remove unused _time 2021-11-16 10:08:47 +01:00
Matthias Grob
7ec8dd9d23 vehicle_constraints: remove deprecated speed_xy constraint 2021-11-09 21:47:06 -05:00
Matthias Grob
a461bb971a FlightTask: preserve vertical velocity during reactivation
to allow descending by stick for reliable land detection.
Issue:
Stick smoothing gets completely reset to state when not taken off
-> downwards velocity setpoint is gone when not taken off
-> in_descend flag of land detection is never true when not taken off
-> when landing but falling out of landing it landing detection fails
bafore taking off and landing again
2021-10-06 11:25:51 -04:00
Daniel Agar
87610957a4 flight_mode_manager: pass deltas on estimator reset 2021-07-19 09:34:07 -04:00
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04:00
Matthias Grob
ee87257a8d FlightModeManager: move velocity control feedback into FlightTask
This was only handled outside because FlightTaks lived in the
multicopter position controller which produces the data that was
needed but now it doesn't make sense anymore to handle this
subscription separately.

It's better to have it inside the base task to have the data available
on task activation sucht that e.g. Altitude mode can take over smoothly
from Position mode.
2021-05-04 16:47:48 +02:00
mcsauder
4eb758edf0 Alphabetize flight_mode_manager CMakeLists.txt list, and group/format types in FlightTask.cpp/hpp. 2021-05-01 10:46:27 -04:00
Matthias Grob
6df299738e FlightTask: reactivate tasks on ground with empty setpoint
Such that they properly reset and don't try to take over smoothly from
their own setpoints generated in the last loop iteration.
2021-04-23 21:57:27 -04:00
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Daniel Agar
c891db19f9 Update src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2021-03-03 18:53:56 +01:00
Daniel Agar
266ea377da move takeoff state machine flight_mode_manager -> mc_pos_control 2021-03-03 18:53:56 +01:00
Matthias Grob
df54f938ef FlightModeManager: correct setpoint struct initialization
It is important that setpoints get initialized with NAN and not overwritten
if specifically set by a successful flight task execution. It's then
clear if any setpoints were intentionally and successfully set.
Crucial for the position controller's emergency failsafe and the
seamless setpoint handover to the next flight task.
2021-01-17 15:46:30 +01:00
Daniel Agar
4d7b875ee2 flight_mode_manager: merge with flight_tasks 2021-01-17 15:46:30 +01:00