17 Commits

Author SHA1 Message Date
Konrad
e5e66370e7 FixedwingPositionControl: Add support for figure 8 loitering.
The command is sent by a dedicated mavlink command and forwarded to the fixed wing position controller.

The pattern is defined by the radius of the major axis, the radius of the minor axis and the orientation. The pattern is then defined by:
The upper part of the pattern consist of a clockwise circle with radius defined by the minor axis. The center of the circle is defined by the major axis minus the minor axis away from the pattern center.
The lower part of the pattern consist of a counter-clockwise circle with the same definitions as above.
In between, the circles are connected with straight lines in a cross configuration. The lines are always tangetial to the circles.
The orientation rotates the major axis around the NED down axis.

The loitering logic is defined inside its own class used by the fixed wing position control module. It defines which segment (one of the circles or lines) is active and uses the path controller (npfg or l1-control) to determine the desired roll angle.

A feedback mavlink message is send with the executed pattern parameters.
2023-10-31 15:57:59 -04:00
Silvan Fuhrer
5590ab3caa
FW Position Controller: handle IDLE waypoints in FW_POSCTRL_MODE_AUTO, also with NAN setpoints (#22114)
A setpoint of type IDLE can be published by Navigator without a valid position,
and should be handled in the auto function in FW_POSCTRL_MODE_AUTO. If it wouldn't be
handled there the controller would switch to mode FW_POSCTRL_MODE_OTHER, in which case
no attitude setpoint is published and the lower controllers would be stuck with the
last published value (incl. thrust).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-21 17:27:54 +02:00
Silvan Fuhrer
ec7db4b30d
FW Positon Controller: set references to 0 if not provided by local_position (#22101)
* FW Positon Controller: set altitude_ref to 0 if not provided by GPS

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* FW Positon Controller: set lat/lon reference to 0 if not provided in local_position

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-20 15:45:32 +02:00
Thomas Stastny
28fe15d829 FixedwingPositionControl: initialize the airspeed slew rate controller with trim airspeed in the constructor 2023-09-13 16:18:16 -04:00
Thomas Stastny
4ec4ce5fa9 FixedwingPositionControl: rework airspeed slew controller handling
- force initialize takeoff airspeed setpoint at start of takeoff modes
- force set airspeed constraints if slewed value is out of bounds
- always slew airspeed setpoints as long as inside constraints
- move target airspeed setpoint calculation into mode specific logic regions (hand vs runway)
2023-09-13 09:50:41 +02:00
Silvan Fuhrer
f1b47b14b8 FW Pos Control: add in_takeoff_situation argument to adapt_airspeed_setpoint()
when we're in a takeoff situation, we only want to adapt the airspeed to
avoid accelerated stall due to load factor changes. Disable othre logic
like minimum ground speed, wind based adaption and airspeed slew rating.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-13 09:50:41 +02:00
Thomas Stastny
def4ce6ba8 FixedwingPositionControl: slightly simplify manual position control (use navigateLine() to be sure no turnaround)
make notes on odd things that are likely still wrong
2023-09-08 16:08:38 +02:00
Thomas Stastny
e71804d976 FixedwingPositionControl: reuse line() and waypoint() methods in navigateWaypoints() method 2023-09-08 16:08:38 +02:00
Thomas Stastny
ad9e3d72d9 FixedwingPositionControl: split out single waypoint following method
makes more clearly defined interfaces and behaviors. also cleaned up the controlAutoPosition() method
2023-09-08 16:08:38 +02:00
Thomas Stastny
c3012a551f FixedwingPositionControl: track single point when no prev point exists for waypoint following
make sure correct local position setpoint output is logged
2023-09-08 16:08:38 +02:00
Thomas Stastny
3047cad05d FixedwingPositionControl: follow (infinite) lines instead of waypoints during takeoff and landing 2023-09-08 16:08:38 +02:00
Thomas Stastny
3ffb57bcce FixedwingPositionControl: handle degenerate tangent setpoint in navigatePathTangent() 2023-09-08 16:08:38 +02:00
Thomas Stastny
b11ff06798 FixedwingPositionControl: fix / clarify navigate waypoint logic 2023-09-08 16:08:38 +02:00
Silvan Fuhrer
bd182ecf70
FWPositionControl: navigateWaypoints: fix logic if already past waypoint and need to turn back (#21635)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-05-26 15:12:42 +02:00
Silvan Fuhrer
951f89c8a8 FWPosControl: constrain min pitch to FW_TKO_PITCH_MIN in takeoff state
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-05-10 14:23:12 +02:00
Silvan Fuhrer
da519573d4
FWPositionControl: trim throttle calc: guard against min/max=trim airspeed (#21469)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-04-14 11:55:23 +02:00
Thomas Stastny
82fd2987c9
fw pos control: revert name until we delineate this module a bit more (#21442) 2023-04-13 17:00:04 +02:00