41 Commits

Author SHA1 Message Date
Ramon Roche
5d151c54a4 flight_mode_manager: call direct parent instead of grandparent
FlightTaskManualAcceleration and FlightTaskOrbit both inherit from
FlightTaskManualAltitudeSmoothVel but were calling FlightTask and
FlightTaskManualAltitude respectively, skipping the intermediate
parent's overrides (smoothing velocity init, parameter chain).

Fix the DEFINE_PARAMETERS_CUSTOM_PARENT macro argument and the
activate() call to use FlightTaskManualAltitudeSmoothVel.

Fixes bugprone-parent-virtual-call clang-tidy diagnostic.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 21:20:27 -08: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
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
Claudio Chies
4ba4b340cc Reduce the orbit jerk by using a slew rate 2024-09-13 10:28:42 +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
Matthias Grob
8bb20db7da GotoControl: Save flash 2023-11-30 17:16:02 +01: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
Matthias Grob
5ca28dd6dc Use isAllFinite() in all places that check finiteness on entire vectors or matrices 2022-10-19 19:09:20 +02:00
Matthias Grob
87cbda1992
FlightTaskOrbit: parameterize hardcoded maximum radius (#20012) 2022-08-05 09:19:32 +02:00
Hamish Willee
e6eed43648
Spelling errors (#19935) 2022-07-27 14:33:16 +10:00
Matthias Grob
8ca28f3796 Separate message for trajectory setpoint 2022-05-12 17:19:48 +02:00
Matthias Grob
7cd57b4415 FlightTaskOrbit: alert user about exceeded radius (mavlink_log) 2022-03-29 18:46:37 +02:00
Matthias Grob
3e8d2fea94 FlightTaskOrbit: alert user about exceeded radius (events) 2022-03-29 18:46:37 +02:00
Matthias Grob
d0794c1189 FlightTaskOrbit: don't start Orbit if radius is not in range 2022-03-28 17:57:56 +02:00
Matthias Grob
18629bb535 FlightTaskOrbit: fix tangential yaw stick input for rotation direction changes 2022-03-23 10:51:45 +01:00
Matthias Grob
e03585ca06 FlightTaskOrbit: remap stick input when vehicle faces tangential 2022-03-23 10:51:45 +01:00
Matthias Grob
42404ade77 FlightTaskOrbit: Use cruise speed and manual acceleration for radius and velocity changes
instead of arbitrary fractions of the maximum radius and velocity.
2022-01-25 11:45:31 +01:00
Matthias Grob
7c55229db7 FlightTaskOrbit: Fix altitude adjustment by stick
This is done by inheriting from FlightTaskManualAltitudeSmoothVel again.
The altitude change by command is taken care of by switching
to the apporach when the altitude difference is big enough and
switching back once the altitude is close enough.

The altitude of the command is not perfectly reached but this can
only be done smoothly when the Orbit has full control over the
altitude smoothing. The independent altitude smoothing is not kept
because it was lacking stick handling like altitude lock and smooth
transitions when opening and closing the vertical position loop.
2022-01-25 11:45:31 +01:00
Matthias Grob
d73d8f390b FlightTaskOrbit: Fix vertical speed limit 2022-01-25 11:45:31 +01:00
Matthias Grob
38de07186d FlightTaskOrbit: include acceleration and jerk in approach setpoint publishing
I think they were forgotten and it leads to side effects:
- The acceleration feed-forward does not get executed
- The acceleration setpoint is NAN when initializing the altitude
  smoothing when arriving at the circle
2022-01-25 11:45:31 +01:00
Matthias Grob
b9fb8490ba FlightTaskOrbit: initialize position smoothing with previous setpoints instead of current state 2022-01-25 11:45:31 +01:00
Matthias Grob
e0337a484b FlightTaskOrbit: remove unnecessary _sanitizeParams() in activation
the parameters are anyways sanitized on every update so even if activate()
sets unfeasible one's they get adjusted on the first update.
2022-01-25 11:45:31 +01:00
Matthias Grob
661496ab24 FlightTaskOrbit: improved naming in applyCommandParameters() 2022-01-25 11:45:31 +01:00
Thomas Debrunner
4671a741dc FlightTaskOrbit: Do not switch out of circle orbit control logic on radius change. 2022-01-25 11:45:31 +01:00
bresch
ea7d2334c9 mpc: add parameter for ascent/descent speed in auto modes 2022-01-12 13:33:48 +01:00
Thomas Debrunner
ade4a1930c trajectory-planning: Added option for PositionSmoothing library with single target waypoint that disables L1 guidance 2021-12-09 20:51:39 -05: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
Matthias Grob
f55590ce78 FlightTaskOrbit: remove duplicate newlines 2021-11-03 17:37:52 +01:00
Matthias Grob
eda9dce033 FlightTaskOrbit: fix direction change via MAVLink command 2021-11-03 17:37:52 +01:00
Thomas Debrunner
d450afead6 FlightTaskOrbit: Direct orbit approach with slowdown at intersection point 2021-11-03 17:37:52 +01:00
Thomas Debrunner
0d0b87e193 Update src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2021-11-03 17:37:52 +01:00
Thomas Debrunner
9bd46be124 Orbit: Switch to PositionSmoothing library.
This also fixes the bug with altitude not follows and smoothes orbit approach trajectory
2021-11-03 17:37:52 +01:00
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04:00
Matthias Grob
25dd12382a FlightTaskOrbit: default center at exact vehicle location 2021-03-17 09:50:11 -04:00
Matthias Grob
ef774578e1 FlightTaskOrbit: NACK command if coordinates could not get applied 2021-03-17 09:50:11 -04:00
Daniel Agar
0eac534b80
geo: purge globallocal_converter 2021-03-15 16:16:19 -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
Matthias Grob
82d6cc3dba FlightTasks: use .xy() where possible
to take the first two elements of a Vector3f.
2021-02-10 15:56:58 +01:00
Daniel Agar
4d7b875ee2 flight_mode_manager: merge with flight_tasks 2021-01-17 15:46:30 +01:00