54 Commits

Author SHA1 Message Date
Silvan Fuhrer
acc0cd7e8a FW Position Control: disable underspeed handling during auto takeoff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-08-13 16:55:26 +02:00
Silvan Fuhrer
afc360d637 FW Position control: do not invalidate airspeed from negative readings
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-08-13 16:55:26 +02:00
Jaeyoung Lim
e008ca24f1
Remove euler angles from attitude setpoint (#23482)
* Remove euler angles from attitude setpoint message

* Remove usage of euler angles in attitude setpoint messages

This commit removes the usage of euler angles in the vehicle_attitude_setpoint messages

* Fix standard vtol
2024-08-12 16:42:51 +02:00
bresch
f04aa2494b FW pos control: do not requre global pos in manual position control 2024-08-09 12:51:09 +02:00
Silvan Fuhrer
876730a9be
FW Position Controller: enable flaps during hand/catapult launch (#23460)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-08-07 15:38:55 +02:00
Silvan Fuhrer
d841bf124f fw_position_control: use time literals 2024-07-26 18:01:44 +02:00
Marco Hauswirth
9d9d8aeb4c bugfix: wrong reset_counter used 2024-07-26 18:01:44 +02:00
Marco Hauswirth
5808dac4bc reset position-mode line following after position reset 2024-07-26 18:01:44 +02:00
Konrad
6a789b54c6 TECS: allow for fast descend up to maximum airspeed. Use pitch control loop to control max airspeed while giving minimal throttle. 2024-05-07 14:20:07 +02:00
Silvan Fuhrer
34cb69898e FW Position Controller: fix Altitude mode without valid z reference (e.g. no GPS)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-26 10:44:40 +02:00
Juyong Shin
c7725d74b4
fw offboard control mode: altitude control enabled (#23041) 2024-04-22 06:57:57 +02:00
Silvan Fuhrer
974ead4015 FW position control: catapult/hand-launch: enable without launch detection
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-11 10:42:59 +02:00
Silvan Fuhrer
6fec452c4b FW position control: catapult/hand-launch: do not cut throttle if not landed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-11 10:42:59 +02:00
Silvan Fuhrer
85a882e1ce
FW Position Control: control_backtransition(): always track line from start (#22853)
Remove option to track from previous wp to reduce complexity and fix
case where prev=current point and the line following broke down.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-03-08 19:11:08 +01:00
Silvan Fuhrer
f799141a19
FW Pos Controller: do not publish roll angle constrained warning if landed (#22850)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-03-08 09:40:43 +01:00
Silvan Fuhrer
c5835a48de
FW Position Controller: do not publish roll angle constrain warning in VTOL transition (#22842)
* FW Position Control: some cosmetical changes

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

* FW Position Control: disable roll constraining warning in VTOL transition

In transitions it is expected that the roll is constrained, and
instead of defining an aribitrary threshold let's rather disable
the user warning in that case.

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

* FW Pos C: define magic numbers for roll constraining warning as constants

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

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-03-06 15:51:54 +01:00
Konrad
cb09dde606 FixedwingPositionControl: Used corrected npfg roll output in path mode 2024-02-13 17:17:44 +01:00
Konrad
1a1891073e FixedwingPositionControl: Only warn user when roll is reduced for a longer period of time 2024-02-13 17:17:44 +01:00
KonradRudin
3576d513cd
battery: make time remaining estimation dependent on level flight cha… (#22401)
* battery: make time remaining estimation dependent on level flight characteristis for FW

* battery: fix that FW flight is also correctly detected when vehicle_status is not updated

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

* FixedwingPositionControl: Move constant to header file

* flight phase estimation: use tecs height rate reference to check for level flight

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-02-06 17:32:09 +01:00
Roman Bapst
077baeae52
Avoid waypoint following during backtransition which can lead to strong banking (#22642)
* avoid waypoint following during backtransition
- if vehicle overshoots transition, make controller track the prev/current
waypoint line, this avoids large banking maneuvers that delay the transition further

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

* navigator: use SETPOINT_TYPE_LAND as setpoint type for VTOL_LAND waypoints
such that fixed wing position controller can distinguish from other types

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

* FixedWingPositionControl: split vtol backtransition logic into separate method

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

* review changes

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

* prevent loiter when approaching vtol backtransition and invalidate previous waypoint during mission landing

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

* removed unused parameter

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

* small renaming of transition mode

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

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2024-01-29 09:45:40 +01:00
Silvan Fuhrer
a38abdbf9d
TECS throttle gains default reduction and transition values from previous PX4 version (#22548)
* TECS: reduce default of FW_T_I_GAIN_THR

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

* TECS: reduce default of FW_T_THR_DAMP

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

* TECS: improve param descriptions and meta data of some params

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

* FW Pos C: rename FW_T_THR_DAMP to FW_T_THR_DAMPING

Rename wihtout param translation as the interpretation of this param has changed
recently (a bug was fixed that caused the damping to have a much lower effect than
it should). We want to avoid that users keep the previously tuned value (with the bug)
and do not update the tuning when using the fixed version (v1.14.0 and later).

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

* FW Pos C: rename FW_T_I_GAIN_THR to FW_T_THR_INTEG

Rename wihtout param translation as the interpretation of this param has changed
recently (a bug was fixed that caused the damping to have a much lower effect than
it should). We want to avoid that users keep the previously tuned value (with the bug)
and do not update the tuning when using the fixed version (v1.14.0 and later).

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

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-01-12 10:25:53 +01:00
Jaeyoung Lim
c8e041a371
Add Fixedwing path following as a separate controller state (#21376)
* Separate offboard path setpoints as fixedwing pos control state

This commit separates offboard path following as a separate state inside the FW Poscontrol module.

This is a cleanup on clearly defining fw pos control behaviors

* Update src/modules/fw_pos_control/FixedwingPositionControl.cpp

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>

* Fix format

---------

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-01-09 16:35:50 +01:00
Silvan Fuhrer
9e0c8fd75e FW controllers: change param FW_ARSP_MODE to FW_USE_AIRSPD
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-21 11:34:28 +01:00
Silvan Fuhrer
5211c358aa FW Position Controller: change airspeed setpoint init
-remove dedicated vtol transition airspeed init logic
-init airspeed setpoint on first usage of tecs
-init to max of current airspeed and min airspeed

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-21 11:34:28 +01:00
Silvan Fuhrer
27957e1f2f FW Position Controller: set airspeed_valid flag to false if incoming data is not finite
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-21 11:34:28 +01:00
Silvan Fuhrer
589f0f1fc7 FW Position Controller: rename _airspeed to _airspeed_eas
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-21 11:34:28 +01:00
Silvan Fuhrer
f38fe24a98 FW Position Control: fix setting of _control_mode_current to AUTO in VTOL landing
The _control_mode_current wasn't updated otherwise, and only done so by luck
because we already set the current type to SETPOINT_TYPE_POSITION.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-16 16:37:51 -05:00
Silvan Fuhrer
60e2c6a5cb TECS: improve initialization
-remove external init, and instead always (but only) init when dt is too large
-init the controller params correctly

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-12-12 15:16:38 +01:00
Konrad
d1b8a2e8d5 fxedwingPositionControl: Add slew rate at the end for all mode instead inside each 2023-12-05 10:42:23 +01:00
Konrad
1d07697a9e NPFG: Add fallback for corner cases 2023-12-05 10:42:23 +01:00
Konrad
a73409c015 FigureEight: Refactor initialization 2023-11-28 10:06:01 +01:00
Roman Bapst
dd2322d622
Added PerformanceModel for fixed wing (#22091)
* created a Performance Model for fixed wing vehicle
- added compensation for maximum climbrate, minimum sinkrate, minimum airspeed and trim airspeed based on weight ratio and air density
- added atmosphere lib to standard atmosphere calculations


---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
2023-11-21 17:13:50 +01:00
Silvan Fuhrer
a47b684fd7 tecs_status.msg: directly add underspeed ratio to msg instead of boolean
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-07 12:18:06 -05:00
Silvan Fuhrer
8741a9784d TECS: remove TECS_MODE enum and instead add descriptive boolean flag to tecs_status
New flag: underspeed_mode_enabled.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-07 12:18:06 -05:00
Silvan Fuhrer
a6fcf7b48c TECS: remove airspeed adaption in case of underspeed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-07 12:18:06 -05:00
Konrad
1089079a32 Figure_of_eight: Make configuration dependent on defined mavlink_message_id. 2023-10-31 15:57:59 -04:00
Konrad
8edd7ce2c1 kconfig: Add option to enable figure of eight support 2023-10-31 15:57:59 -04:00
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