22 Commits

Author SHA1 Message Date
Matthias Grob
3de6fee07f GotoControl: make interface over uORB 2023-11-30 17:16:02 +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
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
Beat Küng
b0e1cc72f7 fix orbit for mc: handle VEHICLE_CMD_DO_ORBIT command and avoid race condition
Fixes a regression from 8bae4e5c0e29f70d5d1d2427ffdef97092be939c, where
the orbit flight task wasn't an extra task (flight_tasks_to_add) anymore
and therefore the command handling wasn't generated.

There was a race condition that could cause several outcomes. The most severe
was that flight_mode_manager gets the command, switches to orbit and then
in the next iteration switches back because commander did not change
nav_state yet. When commander then switches, flight_mode_manager would still
be in the old mode.
This is prevented by storing the command (allowing it to arrive before or
after mode switch), and then apply it after the switch happens.
2022-11-14 17:31:35 +01:00
Beat Küng
c1f9824396 flight_mode_manager: remove command ack for VEHICLE_CMD_DO_ORBIT
Already acked in commander
2022-11-14 17:31:35 +01:00
Beat Küng
57c7b5e843 flight_mode_manager: reduce error verbosity & remove mode switching
While disarmed, commander allows to be in any mode now.
2022-10-11 22:31:20 -04: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
Matthias Grob
bbb04ab4b8 Remove relaying of maximum altitude through land detector 2022-01-05 14:54:59 +01: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
Daniel Agar
87f835710b Update src/modules/flight_mode_manager/FlightModeManager.hpp
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
fbd64fbdd8 FlightModeManager: publish takeoff status 2021-01-31 11:37:00 +01:00
Matthias Grob
031bbb7f3e FlightModeManager: handle commands all the time
Moving the command handling to a separate function that gets called
whenever a vehicle command is available to always react on commands
and not just when already a task is running.

This solves e.g. commanding an Orbit when in Staibilized.
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
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
Matthias Grob
7de288877a MulticoperPositionControl: 3rd pass get rid of zombie members 2020-12-30 10:25:08 -05:00
Matthias Grob
62ada2e2dc FlightModeManager: restore weathervane calls
I had to do an extra subscription to the vehicle attitude.
I don't know how to test this.
2020-12-30 10:25:08 -05:00
Matthias Grob
8329208b84 FlightModeManager: fix takeoff ramp from zero 2020-12-30 10:25:08 -05:00
Matthias Grob
88c274b3cd MulticopterPositionControl: 2nd pass to move to FlightModeManager 2020-12-30 10:25:08 -05:00
Matthias Grob
f52bad87e2 mc_pos_control: separate out flight_tasks (into FlightModeManager) 2020-12-30 10:25:08 -05:00
Matthias Grob
fa7170bc4f Add FlightModeManager
to separate out setpoint generation from controllers
2020-12-30 10:25:08 -05:00