Commit Graph

83 Commits

Author SHA1 Message Date
Matthias Grob fabf865411 Use backwards compatible manual_control_setpoint instead of manual_control_input 2021-11-09 16:05:25 +01:00
Julian Oes 6a6b8d49fc msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and
manual_control_setpoint.
2021-11-09 16:05:25 +01:00
RomanBapst 7cb99f521c moved ManualVelocitySmoothing to motion_planning lib
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Silvan Fuhrer f02786d112 Navigator/Commander: make GPS failsafe consitent: switch to Descend also for FW and VTOL
- remove GPS failsafe mode
- for VTOL: transition to hover in Descend (unless NAV_FORCE_VT is not set)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-05 12:09:39 +03:00
Matthias Grob f55590ce78 FlightTaskOrbit: remove duplicate newlines 2021-11-03 17:37:52 +01:00
Matthias Grob 6cea707330 FlightTaskOrbit: increase acceptance radius from 1 to 2m
to avoid reaproaching when tracking is not perfect while
acc/deccelerating by stick.
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
RomanBapst d84b0296d2 support orbit command in fixed wing mode
Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander: support orbit mode for fixed wings

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FwPositionControl: publish orbit status

Signed-off-by: RomanBapst <bapstroman@gmail.com>

commander:reject orbit mode while doing a vtol transition

Signed-off-by: RomanBapst <bapstroman@gmail.com>

FixedWingPositionControl: explicitly cast waypoint for Orbit status

FixedwingPositionControl: fill missing orbit_status fields

navigator_main: handle reposition/orbit corner cases

- set orbit rotation direction correctly
- send mavlink message when orbit is rejected

FixedWingPositionControl: correctly report rotation direction in orbit_status

navigator: hack to not break orbit while doing altitude changes

Signed-off-by: RomanBapst <bapstroman@gmail.com>

navigator: set cruise throttle for orbit command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-25 09:48:27 +02:00
RomanBapst af291e2040 FlightTaskTransition: Transition improvements
- use fw pitch setpoint offset during transition
- take over previous vertical velocity and smooth out over transition

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-15 09:58:48 +02:00
Thomas Debrunner fed234de81 flight_mode_manager: Extracted position trajectory motion planning into a library
Extract the functionality to plan smooth position motion trajectories into a
motion planning library, such that it can be used in other parts of the code as well.
2021-10-13 21:25:43 -04:00
Peter van der Perk d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
Matthias Grob b40dbd3d6f FlightTaskAuto: hotfix filter for yawspeed feed-forward
to get rid of derivative spikes when navigator is
continuously updating the yaw setpoint in the
triplet for a POI but is running at a lower rate.

The proper solution is to generate that yaw setpoint
with high rate in the flight task and have the triplet
just guid to the next waypoint at low rate.
2021-10-06 14:06:58 -04: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
Matthias Grob c20e5e3a00 FlightTaskManualAltitudeSmoothVel: remove separate reactivate handling
It was added before the activation was able to work with the previous
setpoint.
2021-10-06 11:25:51 -04:00
Matthias Grob 2edd97102b Sticks/StickYaw: refactor to use constructor properly 2021-10-05 18:05:54 -04:00
Matthias Grob 0cc13f0799 FlightTaskAutoMapper: add horizontal and yaw nudging during final descent 2021-10-05 18:05:54 -04:00
Matthias Grob bb9f167d79 StickAccelerationXY: add reseting position to specified coordinates 2021-10-05 18:05:54 -04:00
bresch e53d2907d7 AutoSmoothVel: adjust controller constraints in emergency braking
When engaging auto mode at high vertical speed, we don't want to cut the velocity
trajectory setpoint in order to create a smooth deceleration.
2021-09-23 09:22:32 +02:00
bresch 316e0dfeb5 AutoLineSmoothVel: add emergency braking mode
Currently only for the Z axis. If the current downward velocity is more
than twice the maximum allowed value, the emergency braking mode is
activated. In this mode, a higher vertical acceleration and jerk is used
until the vehicle stops moving.
2021-09-23 09:22:32 +02:00
Daniel Agar 68dcc25709 flight_mode_manager: ManualAcceleration support weathervane yaw handler
- fixes https://github.com/PX4/PX4-Autopilot/issues/17911
2021-08-12 09:58:29 -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
Daniel Agar b5430c22c4 AlphaFilter: move from ecl -> mathlib 2021-07-15 10:38:24 -04:00
Beat Küng e3972d563a cmake: ensure generated source files exist before extracting events
Only needed for Makefile-based builds:
gmake[3]: *** No rule to make target 'src/modules/flight_mode_manager/FlightTasks_generated.hpp', needed by 'events/px4.json'.  Stop.
2021-07-07 21:38:09 -04:00
Matthias Grob 5ac5399d83 Remove horizontal slow down close to ground
Because based on the numerous complaints it was disabled by default
(only velocities above 10m/s were limited)
and since then no one intentionally used it anymore. But
there were some minor investigations of drones not reaching
their maximum speed which always showed 10m/s.
2021-06-25 11:15:41 +02:00
David Sidrane 85f4f13e8a flight_mode_manager:Use inttypes 2021-06-16 17:07:47 +02:00
Jukka Laitinen ac6e7a1c6c FlightTaskManualAltitude: Fix double->float conversion in initialization
This gives an error on some new compilers, e.g. riscv64-unknown-elf 10.2.0

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-05-05 09:31:07 +02:00
Jukka Laitinen 532f370e7d Fix implicit float to double conversions
The both results of ?: should be of same type, and some compilers give error
on this:
	" implicit conversion from 'float' to 'double' to match other result of conditional"

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-05-05 09:31:07 +02: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
Matthias Grob 9e2375ab91 FlightTaskManualAcceleration: change reset order, check all components for NAN
Just cleanup and completeness.
2021-04-23 21:57:27 -04:00
Matthias Grob 5e75f17680 StickAccelerationXY: fix acceleration reset using x component instead of y
This entire feature only has an impact if the last mode set
a huge acceleration and we have to take over as smooth as possible.
But it's stil lworth fixing.
2021-04-23 21:57:27 -04:00
Matthias Grob fee4728b1f StickAccelerationXY: change function name feasibility limit -> jerk limit
for clarity because it's more accurate.
2021-04-23 21:57:27 -04:00
Matthias Grob 5e7ebbe47c FlightTask: correct comment about setpoints 2021-04-20 18:18:21 +02:00
Matthias Grob 4865d027f9 StickAccelerationXY: factor in stricter tilt limit on takeoff 2021-04-20 18:18:21 +02:00
Matthias Grob 34a5948692 Adapt SlewRate includes to convention 2021-03-31 10:03:08 +02:00
bresch 6fda6e43af StickAcceleration: synchronize XY acceleration profiles 2021-03-19 13:51:15 +01: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
Matthias Grob 8816601efb FlightTaskManualAcceleration: fix velocity setpoint initialization 2021-03-11 00:40:27 +01:00
Matthias Grob 89b502b9a0 FlightModeManager: remove switching out of a task for every mode change
This was an idea to be able to reinitialize on mode change e.g. from
Holde mode to Land mode which are currently all still handled by
FlightTaskAuto and don't require a task switch.

But I found out it leads to issues because the last setpoint and the
ekf reset counter state from the previous task are lost and as a result
the setpoint transition cannot be handled consistently anymore.
2021-03-11 00:40:27 +01:00
Matthias Grob 63a35ccabd StickAccelerationXY: fix losing the internal velocity setpoint state
because of a failing position unlock with NAN velocity setpoint feedback.
2021-03-11 00:40:27 +01:00
Matthias Grob 54fe0ae98c FlightModeManager: rename updateVelocityController{IO} to {Feedback} 2021-03-11 00:40:27 +01: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 d0c9a5fc93 OFFBOARD mode architecture overhaul (#16739)
- handle SET_POSITION_TARGET_LOCAL_NED and SET_POSITION_TARGET_GLOBAL_INT with ORB_ID(trajectory_setpoint)
 - FlightTaskOffboard not needed at all
 - bypass position_setpoint_triplet entirely (start removing extraneous fields)
 - simplify offboard_control_mode to map to supported control modes
2021-03-05 09:39:46 -05:00