224 Commits

Author SHA1 Message Date
Thomas Stastny
9fab914687 fw pos ctrl: use max function for landing approach entrance rel alt 2022-07-19 22:37:09 -04:00
Thomas Stastny
217efcb12d fw pos ctrl: set idle throttle in landed conditions
also set the default idle throttle to zero as most PX4 applications use electric motors
2022-07-19 22:37:09 -04:00
Thomas Stastny
4b0a8565fe fw pos ctrl: lower underspeed detection bound for landing airspeed 2022-07-19 22:37:09 -04:00
Thomas Stastny
41b0a6c62c fw pos ctrl: open up desired max sink rate limits for landing slope
- the target_sink_rate param could possibly constrain the maximum commanded sink rate to something less than that of the landing glide slope, which would make it impossible to track. this commit allows opening up the desired max sink rate up to the performance limits of the aircraft, if necessary, for the landing case
2022-07-19 22:37:09 -04:00
Thomas Stastny
d1aca4032d mission feasibility / fw pos ctrl: add limited landing checks back, allow glide slopes below max 2022-07-19 22:37:09 -04:00
Thomas Stastny
87e09ad9f5 fw pos ctrl: auto landing refactor
- landing slope/curve library removed
- flare curve removed (the position setpoints will not be tracked during a flare, and were being ignored by open-loop maneuvers anyway)
- flare curve replaced by simply commanding a constant glide slope to the ground from the approach entrance, and commanding a sink rate once below flaring alt
- flare is now time-to-touchdown -based to account for differing descent rates (e.g. due to wind)
- flare pitch limits and height rate commands are ramped in from the previous iteration's values at flare onset to avoid jumpy commands
- TECS controls all aspects of the auto landing airspeed and altitude/height rate, and is only constrained by pitch and throttle limits (lessening unintuitive open loop manuever overrides)
- throttle is killed on flare
- flare is the singular point of no return during landing
- lateral manual nudging of the touchdown point is configurable via parameter, allowing the operator to nudge (via remote) either the touchdown point itself (adjusting approach vector) or shifting the entire approach path to the left or right. this helps when GCS map or GNSS uncertainties set the aircraft on a slightly offset approach"
2022-07-19 22:37:09 -04:00
Thomas Stastny
69bc5d37bc fw pos ctrl: mark completed manual takeoff true if rotary wing and armed 2022-07-18 10:49:27 -04:00
Thomas Stastny
b4e066f056 fw pos ctrl: use hardcoded buffer altitude instead of parameter for clearance altitude buffer 2022-07-18 10:49:27 -04:00
Thomas Stastny
7e12f6ba5a fw pos ctrl: dont use terrain alt for takeoff 2022-07-18 10:49:27 -04:00
Thomas Stastny
ec02413387 fw pos ctrl: remove vtol condition from manual takeoff completion 2022-07-18 10:49:27 -04:00
Thomas Stastny
c447064596 fw pos ctrl: rename position control mode variable 2022-07-18 10:49:27 -04:00
Thomas Stastny
5648deb5a1 fw pos ctrl: organize state variables 2022-07-18 10:49:27 -04:00
Thomas Stastny
2d5f1a5c6b fw pos ctrl: head straight for next waypoint after takeoff 2022-07-18 10:49:27 -04:00
Thomas Stastny
721131a135 fw pos/att ctrl: pass manual nose wheel increments during takeoff ground roll 2022-07-18 10:49:27 -04:00
Thomas Stastny
4d3f05479d fw pos ctrl: refactor takeoff mode
- post takeoff, the aircraft follows the infinite line sourced from the launch point in the direction of the takeoff waypoint
- takeoff waypoint altitude is used as a clearance altitude, set such that once above, the aircraft has cleared all ground occlusions and may proceed with the mission
- runway takeoff state machine simplified to throttle ramp, clamped to runway, climbout, and fly
- throttle ramp must complete before switching to next state to avoid a jump in throttle setpoint just after takeoff if the takeoff airspeed is reached before the ramp is complete
- roll constraints near ground post takeoff removed from runway takeoff class (handled externally now)
- minimum airspeed in TECS is reduced to takeoff speed (if necessary) to lower the underspeed detection bound
- lateral-directional guidance uses a different period parameter during ground roll
2022-07-18 10:49:27 -04:00
Thomas Stastny
7c6ce436ca fw pos ctrl: encapsulate wing tip strike constraint for roll angle
- apply constraint only for takeoff and landing modes
- add two params, wing span and wing height, to calculate a reasonable height at which roll limits can be opened
2022-07-18 10:49:27 -04:00
Thomas Stastny
5241f016f7 fw pos ctrl: rework manual takeoff aid
- takeoff situational knowledge removed from all other modes except manual (or actual takeoff mode)
- manual takeoff is marked complete if at a controllable airspeed
- minimum pitch bounds TECS until manual takeoff complete
- remove individual roll constraints during manual takeoff (ground proximity constraints coming in subsequent commit)
2022-07-18 10:49:27 -04:00
Thomas Stastny
eed073887d remove in air vs landed knowledge from TECS
- create integral and trajectory generator reset methods
- always run TECS unless in rotary-wing mode (or in transition)
- constantly reset TECS integrals and trajectory generators when landed
2022-07-18 10:49:27 -04:00
Thomas Stastny
ddeca2538c fw pos ctrl: handle takeoff detection when switching to takeoff mode while in air
- simplify takeoff reset method
- removes _last_manual variable in favor of _skipping_takeoff_detection, which is handled in the control mode setter
- takeoff detection (both launch and runway) is skipped if entering takeoff mode from any other mode while having already been in the air
- added method to runway takeoff class for force setting the fly state when we want to skip the takeoff detection
2022-07-18 10:49:27 -04:00
RomanBapst
b7d6e646cc FixedWingPositionControl: better naming for manual airspeed setpoint
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
c2f5ffdfcd log tecs trim throttle
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
6dbea21ef5 TECS: renamed airspeed cruse to airspeed trim & general cleanup
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
c05e0f076b FixedWingPositionControl: do not pass trim throttle via position setpoint triplet
- trim throttle is handled entirely by the position controller
- navigator should use speed setpoints
- added flag gliding_enabled in position setpoint to stills support gliding

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
RomanBapst
cae7e1b88b improved trim throttle compensation
- allow compensation based on vehicle weight (parameterized)
- use density for calculating trim throttle compensation instead of pressure
- removed parameter FW_THR_ALT_SCL

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-12 09:07:20 +02:00
Thomas Stastny
594a6d6e80 fw pos ctrl: some incremental clean up of the class
- documentation of units, params, returns, and descriptions for variables and methods
- rename ambiguous or erroneous state variables
- remove unused or unecessary input arguments to functions
- remove ugly header white space
2022-06-09 09:23:02 +02:00
Thomas Stastny
cbf0fe8803 fw pos ctrl: centralize parameter and state resets 2022-06-08 08:44:30 -05:00
Thomas Stastny
ccfbbb553a fw pos ctrl: only manipulate heading hold yaw in manual position control mode 2022-06-08 08:44:30 -05:00
Thomas Stastny
67d8dd359d fw pos ctrl: calculate control interval once
- Use the same time interval for all position control logic (including TECS)
- Sync naming in control methods
- Remove some unused input arguments
2022-06-08 08:44:30 -05:00
Matthias Grob
fad3d46907 Use signNoZero() where possible 2022-06-03 16:08:16 +02:00
Silvan Fuhrer
d8444df11c Set tailsitter flag via vehicle status
Removes the necessity of including vtol_type.h in other modules.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-18 10:01:04 +02:00
Matthias Grob
8ca28f3796 Separate message for trajectory setpoint 2022-05-12 17:19:48 +02:00
Alessandro Simovic
fb71e7587c failure_detector: add motor/ESC failure detection 2022-05-12 07:58:56 +02:00
Thomas Stastny
90789be68f fw pos ctrl: turn back to takeoff point with npfg 2022-05-06 16:36:03 +02:00
Thomas Stastny
3ef5f433b5 fw pos ctrl: add missing guidance control interval setting to control_manual_position() 2022-05-06 16:36:03 +02:00
Thomas Stastny
1ab9fb22ee fw pos ctrl: fix state switching logic for takeoff and landing 2022-05-06 16:36:03 +02:00
Silvan Fuhrer
138772386f FW Position control: explicitly set spoiler/flaps in every control mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
Silvan Fuhrer
4b8f93de5c FW: rework spoiler/flap control logic
- remove separate flaperon controls input to mixer instead enable spoiler support
- add slew rate limiting on both flap and spoiler controls
- add spoiler configuration for Landing and Descend
- add trimming from spoiler deflection
- FW Attitude control: remove FW_FLAPS_SCL param -->
    The flap settings for takeoff and landing are now specified relative to full range.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-05-03 15:11:21 +02:00
JaeyoungLim
c6ab4c466e
Separate takeoff and landing to individual fixed wing states for FW pos control (#19495) 2022-04-26 10:24:36 +02:00
Matthias Grob
f892a624b7 FlightModeManager/FixedwingPositionControl: robustify vehicle command parameter casting 2022-04-13 12:23:27 +03:00
RomanBapst
ca657f36ef FixedWingPositionControl: handle VEHICLE_CMD_DO_CHANGE_SPEED
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-04-13 12:23:27 +03:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04:00
Daniel Agar
f4c3084c26 init adjustments to ensure used topics are advertised early (primarily for logging)
- multi-EKF create each instance as soon as IMU & mag are advertised (before device id populated)
2022-03-23 16:51:16 -04:00
Jaeyoung-Lim
194a281fae Project local coordinates for all fw landing states 2022-03-23 13:34:13 +01:00
Jaeyoung-Lim
cb81c6ac8c Address review comments 2022-03-23 13:34:13 +01:00
Jaeyoung-Lim
71bfb9c0de Convert NPFG to local coordinates 2022-03-23 13:34:13 +01:00
Jaeyoung Lim
28d34bf095 Convert L1 controller to local coordinates 2022-03-23 13:34:13 +01:00
Silvan Fuhrer
81b08a0168 FW Pos C: set position_sp type to position during VTOL backtransition
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-02-09 11:39:47 -05:00
JaeyoungLim
f82c722653
Publish correct orbit status with goto (#19102)
For fixedwings, the orbit status was publishing zero radius when a goto waypoint was being passed.

This commit corrects this by passing the default loiter radius as the guidance logic was using
2022-02-03 10:16:39 +01:00
Jaeyoung Lim
2fc95bb369 Rebase fix
Use getnavspeed_2d for groundspeed
2022-02-02 17:16:19 +01:00
Jaeyoung Lim
3a9c5c3178 Use acceleration to pass path curvature 2022-02-02 17:16:19 +01:00