869 Commits

Author SHA1 Message Date
Silvan Fuhrer
48f2b42e12 FWPositionController: remove factor of 2 for switching to LOITER if altitude is not reached
Instead check if system has previously switched into LOITER to acheive the current
WP of type POSITION, and in that case stay in LOITER until altitude is reached.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-27 16:51:30 +03:00
Silvan Fuhrer
88ec117e59 TECS: rename tecs_status.altitude_filtered to altitude_sp_ref
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
Silvan Fuhrer
e16f98c2b6 FW Position controller: remove unused climbout arguments
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-26 17:04:43 +01:00
JaeyoungLim
21e88f64b4
Add new fixed wing rate control module (fw_rate_control)
* Fixedwing rate control into a separate module
* Start fw_rate_control for vtol
* Move over airspeed related parameters to fw_rate_control

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2023-01-04 11:14:00 -05:00
Konrad
f5524fa605 TECS: Combine both airspeed and airspeed derivative filters in TECS into one MIMO filter using a steady state Kalman filter. 2022-12-21 09:04:19 +01:00
Konrad
7a3e0f53c2 TECS: Replaced old tecs by cleaned up version. 2022-12-21 09:04:19 +01:00
Konrad
991689d3cd TECS: Add new tecs library in parallel to old tecs in the position control library for comparison. 2022-12-21 09:04:19 +01:00
Silvan Fuhrer
2b8295e30f FW Position control: switch from L1 to NPFG guidance by default
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-12-06 12:54:58 -05:00
Jaeyoung Lim
65577a4f89 Fix invalid offboard setpoints for fw pos control
This commit fixes a regression that disables offboard control
2022-11-30 09:14:57 +01:00
Matthias Grob
331cb21dee manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.

I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.

While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
2022-11-28 19:25:55 +01:00
Matthias Grob
83246c84cf Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]
To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
2022-11-28 19:25:55 +01:00
Silvan Fuhrer
79c55614d8 FW PositionController: remove mavlink_log_pub, and only use events
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
3f773809c4 LaunchDetection: fix code style (name class members with trailing underscore)
And also align parameter handle name to real parameter name.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1d75138659 LaunchDetector: fix counter logic
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1400f81874 FW Pos C: rename LAUN_* param to FW_LAUN_* to be more explicit
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
5587a47471 Launch Detection: reduce user notification to info from warning
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
5a1adab6fb FW Position controller params: flaring params slight meta data adjustments
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
7fb70c55df FW Position controller: runway takeoff: track initial takeoff yaw if not in Mission Takeoff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1b89f26691 FW PosC: remove hack to force _landed to false if (not)launch_detected, as it is now handles in land detector
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
df1cd4f147 LaunchDetection: code style changes and fix info message.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
e6e2c889e0 FW Position controller: rename LAUN_ALL_ON to LAUN_DECTN_ON
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
c8129fd902 Launch Detection: add briefs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
59e5c68cb0 FW Position control: use yaw at launch detection as bearing setpoint during hand launch takeoff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
b2f21b956c FW Position control: move LAUN_ALL_ON param to FW Positon Control main params
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
7691e3ff32 FW Land Detector: force to landed if currently landed and in launch process
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
90e1f98c57 FW Launch Detection: refactor state machine and pubish launch_detection_status message
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
35da7f9bc4 Launch Detection: consolidate in single class (use the only existing method, catapult)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
b05878690d Launch Detector: remove LAUN_CAT_PMAX
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Thomas Stastny
263a1884b1 fixed-wing: explicitly define landing airspeed
landing airspeed was previously defined by a scale factor multiplied by minimum airspeed. this commit changes this parameter to an explicit speed, and when unspecified, defaults to the minimum airspeed
2022-11-22 13:46:25 -05:00
Silvan Fuhrer
49c363674a FW Position Control: only prevent automatic aborts if already flaring, but allow manual aborts
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-22 13:46:25 -05:00
Silvan Fuhrer
94d44c40a7 FW Position control: remove param FW_CLMBOUT_DIFF and instead use hardcoded 10m for clearing aborted flag
Use kClearanceAltitudeBuffer for it, which is also used to ensure that during takeoff an
altitude setpoint above the clearance altitdue is set.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-22 13:46:25 -05:00
Thomas Stastny
08ba5d762f fixed-wing takeoff: sync launch logic with newer runway takeoff modifications
- explicitly defined takeoff airspeed setpoint
- dont use climbout mode
- allow max climb on takeoff
- dont handle post clearance altitude case (navigator will switch anyway)
2022-11-22 13:46:25 -05:00
Silvan Fuhrer
6c611a7e8b VehicleAttitudeSetpoint: rename fw_control_yaw to fw_control_yaw_wheel to make usage clearer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-22 13:46:25 -05:00
Thomas Stastny
4b036e6723 fixed-wing landing: dont allow land abort while flaring 2022-11-22 13:46:25 -05:00
Thomas Stastny
a8c2eaf3e0 fixed-wing landing: add a touchdown time and subsequent ramp down to rwto pitch setpoint after the flare to keep wheels on ground 2022-11-22 13:46:25 -05:00
Thomas Stastny
1de1416773 fixed-wing landing: convert flare time pitch and throttle constraint ramps to sqrt function to make more aggressive 2022-11-22 13:46:25 -05:00
Thomas Stastny
f23328d14f fixed-wing landing: ramp in flaring throttle setpoints from last throttle state to keep control continuity
- also put flaring internal states into a struct to organize a bit
- one concern with blending the throttle setpoint like this with the flare time param is that folding prop belly landing airframes may want to have a separate param for shorter throttle kill and still use the flare time ramps for everything else
2022-11-22 13:46:25 -05:00
Thomas Stastny
68e1921f27 make FW_LND_FL_TIME min positive non-zero to protect dividing by zero 2022-11-22 13:46:25 -05:00
Thomas Stastny
928be2958d fixed-wing landing: continue to follow path throughout flare
abruptly changing to a heading setpoint on flare can cause the aircraft to roll and deviate from the runway, this commit
- maintains path following control during the flare not to disrupt the tracking just before touchdown
- (unfortunately for crosswind landing) removes the body axis alignment for runway bearing - this is a compromise

to achieve both runway bearing body axis alignment AND a specific touchdown point, either
1. the wind would need to be considered, and an appropriate diagonal approach (obstructions allowing)  defined to the runway
2. slip control added, keeping path following outputs only commanding roll (controlling airspeed vector) and using yaw-rate command (only actuated by e.g. rudder) to align body axis with the runway
2022-11-22 13:46:25 -05:00
Thomas Stastny
e5a9a57d79 fixed-wing landing: ramp in throttle constraints during flare 2022-11-22 13:46:25 -05:00
Thomas Stastny
4fbfc42805 fixed-wing runway takeoff: ramp in pitch constraints and throttle setpoint on takeoff rotation
- consolidate takeoff rotation transition times for pitch constraints and throttle setpoint with a single param
- consolidate pitch takeoff constraint parameters (remove rwto_max_pitch, use nominal max)
- input correct units to rwto pitch constraint getters
- encapsulate absolute time interpolator method for transitions
- start runway ops from idle throttle
2022-11-22 13:46:25 -05:00
Thomas Stastny
a4349193b5 fixed-wing runway takeoff: climbout at specified takeoff airspeed and max climb rate
TECS climbout mode was used for takeoff climbout, which puts throttle to full and does not regulate a specific airspeed.
This commit sets the desired takeoff airspeed explicitly and allows max climb rate to track the ascent.
2022-11-22 13:46:25 -05:00
Thomas Stastny
47963b5b67 fixed-wing runway takeoff: define explicit takeoff speeds
previously a scale factor param on min airspeed was used to define the climbout airspeed for runway takeoff
additionally, the rotation speed was defined by another hardcoded scale on top of the previously scaled min airspeed
this commit explicitly defines a takeoff speed and rotation speed for runway takeoff in params, with option to disable
2022-11-22 13:46:25 -05:00
JaeyoungLim
2586900c26
Log local position setpoint reference for fixedwings when running NPFG (#20512)
* Log position setpoint reference of npfg

This commit logs the local position setpoint reference when using NPFG

* Address review comments

This commit address review comments from @tstastny
2022-11-22 08:19:38 +01:00
Silvan Fuhrer
b36758b1a0 Update src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp
fix typo

Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
2022-11-18 17:35:34 +01:00
Silvan Fuhrer
c4c94febfa FW Pos C: clearly define FW_AIRSPD_MIN as stall+margin, and automatically increase f(load_factor)
Previously the minimum airspeed setpoint was adjusted to the load_factor compensated
stall speed, which, when the stall speed was set without margin, gave the controller
no room for error (the vehicle would stall if the controller has even a small airspeed
error).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-18 17:35:34 +01:00
Silvan Fuhrer
f2ca9387cf FW Position Control: also run airspeed adaptions based on wind, accelerated stall etc. in manual modes
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-18 17:35:34 +01:00
Silvan Fuhrer
8b7c074680 FW Position Control: remove 0.9 mergin factor on stall vs min param comparison
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-17 13:33:10 +01:00
Silvan Fuhrer
2e0c8da7ef FW Position Control: fix load factor calculation
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-17 13:33:10 +01:00
Silvan Fuhrer
a018debd37 FW Position controller: fix some parameter meta data
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00