162 Commits

Author SHA1 Message Date
Jaeyoung-Lim
bdec85fdd0 Disable local vehicle setpoints while in transition
This commit adds disabling vehicle setpoints while in transition
2022-01-03 11:09:06 +01:00
Jaeyoung-Lim
4127dfa791 Log vehicle local position setpoints
This commit enables the local position setpoints to be logged by publishing vehicle_local_position_setpoint
2022-01-03 11:09:06 +01:00
Jaeyoung Lim
52418f13b0 Use groundspeed for navigate heading 2022-01-03 10:52:34 +01:00
Jaeyoung-Lim
e66e82228f Add support for offboard velocity setpoints for fixedwing vehicles
This commit adds a velocity controller which the setpoint can be passed using offboard setpoints
2022-01-03 10:52:34 +01:00
Silvan Fuhrer
28e01c3510 FW Position controller: make loiter switching logic robust against pos_sp with loiter_rad=0
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-12-24 20:17:15 -05:00
Matthias Grob
68e2940f58 math: support max of three values additional to min and use it everywhere 2021-12-07 21:06:51 +01:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
Beat Küng
4ba84d56c9 logger: introduce optional topics
The current practice of adding topics to the default set isn't scalable,
as it affects all setups.
By making sure topics are advertised on init, logger can just discard
topics that don't exist. This does not work for all topics, so topics are
specifically marked as optional. It can be extended to more topics later
on though.

This reduces the list of topics by ~35 on a pixracer configured as quad,
and reduces RAM usage by ~1KB.
2021-11-15 09:02:03 -05:00
Jaeyoung-Lim
dd83ef1813 Fix fw position controller takeoff
This was introduced by a rebase
2021-11-09 10:30:28 -05:00
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
JaeyoungLim
031f7f831b
Fixedwing Pos Control: Handle vehicle transition waypoints outside controllers (#18503)
* Handle VTOL transition waypoints outside FW auto control modes
2021-11-08 11:21:08 +01:00
Jaeyoung-Lim
6a2ebfc0cc Handle setpoint types properly for fixedwing position control
Handle setpoint types properly for fixedwing position control
2021-11-07 19:21:00 -05:00
Silvan Fuhrer
dbd9b88bea FW position controller: only allow switching to AUTO_ALTITDUE or AUTO_CLIMBRATE if pos_sp_curr_valid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-07 23:31:21 +01:00
RomanBapst
924298e9c3 addressed review comments
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
RomanBapst
6e75b7cffd FixedWingPositionControl: push altitude setpoint locking into TECS
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-05 18:04:33 +01:00
Silvan Fuhrer
b77487d69c Fixed-wing Position controller: add modes for auto altitude and auto descend
- bit of clean up
- add GPS failsafe mode auto_altitude, that will keep current altitude with a fixed-bank angle
for some time, then switches to auto_descend that will descend with constant sink rate
of 0.5m/s
- params controlling GPS failsafe are not FW params: NAV_GPSF_R --> FW_GPSF_R and
NAV_GPSF_LT --> FW_GPSF_LT

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-11-05 12:09:39 +03:00
Silvan Fuhrer
e715e6c245 Fixed-wing position control: set yaw_sp to yaw_current instead of nav_bearing when not controlled
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 14:35:00 +03:00
Silvan Fuhrer
b53808d11b fixed-wing: set yaw_sp to yaw_current instead of 0 when not controlled
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 14:35:00 +03:00
Silvan Fuhrer
4b21c0c49e Fw Pos C: always reset pos_sp type from LOITER to POSITION if far away
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-27 11:01:13 +03: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
Jaeyoung-Lim
4535b18a80 Set setpoint type as const 2021-10-14 11:18:02 +02:00
Jaeyoung-Lim
07d72f8604 Fix comments 2021-10-14 11:18:02 +02:00
Jaeyoung-Lim
443666199e Move setmode outside of control_position
This commit moves the position controller mode handling outside of the control_position method.

The control_method is renamed to control_auto
2021-10-14 11:18:02 +02:00
Jaeyoung-Lim
ae9e91f90c FW Pos controller: fix format in new switch
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-14 11:18:02 +02:00
Silvan Fuhrer
c3e961a1ed FW Pos C: move setting of control_mode_current to separate function and minor clean ups
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-14 11:18:02 +02:00
Silvan Fuhrer
0cf3ef87e3 FW Position Controller: move nav_speed_2d calculation to function
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-14 11:18:02 +02:00
Jaeyoung-Lim
581ec224be Encapsulate loiter and position setpoint handling
This commit encapsulates the position setpoint and loiter setpoint handling into a single method, in order to make the code easier to understand
4be452
2021-10-14 11:18:02 +02:00
RomanBapst
8f8304f31e FixedWingPositionController: Set l1 variables to NAN if no l1 guidance
took place

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-10-11 16:41:42 +02:00
Daniel Agar
4be45229bf fw_pos_control_l1: fix launch detector dt update
- fixes https://github.com/PX4/PX4-Autopilot/issues/18354
2021-10-08 17:34:14 -04:00
Silvan Fuhrer
98c7f664c1 FW Position control: add roll slewrate also in manual Position flight mode
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-10-05 18:06:49 -04:00
Thomas Stauber
983dd4db29
don't switch to SETPOINT_TYPE_LOITER during transitions (#18350) 2021-10-05 14:40:14 +02:00
Beat Küng
5fb16e4395 fw_pos_control_l1: switch to events 2021-09-11 14:08:41 -04:00
Pieter-Jan Dewitte
155d3c7d36 FW pos control: fix airspeed input constaining 2021-06-21 10:55:21 +02:00
RomanBapst
ad9288536b TECS: enable direct height-rate control
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
f6de99d42e FixedWingPositionControl: control only height rate when using pitch stick
in manual altitude controlled modes

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
19449a4e75 FixedWingPositionControl: use target climb/sink rate parameters as maximum
rates in manual altitude controlled modes

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
a5cc449e69 tecs: propagate altitude setpoint based on target climb/sink rate
- avoids tecs always climbing and sinking and max rates and allows to fine tune these rates
- avoid numerical calculation of feedforward velocity using derivative, this
 was prone to jitter in dt

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-06-04 14:51:27 +02:00
RomanBapst
b06b46b224 log raw airspeed derivative, pitch setpoint and airspeed innovation for TECS
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-05-31 23:56:23 +02:00
Silvan Fuhrer
4b42a1639b TECS: in airspeed-less mode, set airspeed estimate to cruise airspeed
In airspeed-less mode, instead of the average of min/max airspeed, take the cruise
airspeed (from param) for current airspeed estimate. A diff of the airspeed setpoint
from this value results in increased enegery demand (incerase of throttle) even
in airspeed-less mode.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-28 14:25:53 +02:00
Silvan Fuhrer
bf311ed77d addressed review comments (fixes in error message and comments)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-10 13:43:05 +02:00
Silvan Fuhrer
63a53d48e7 FW Position controller: improve parameter sanity checks (provide more feedback)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-10 13:43:05 +02:00
Daniel Agar
29d4ad1848
fw_pos_control_l1: OFFBOARD fully populate position_setpoint_triplet 2021-03-16 00:58:04 -04:00
RomanBapst
82a2126f97 TECS: add feedforward gain for total energy balance rate
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-03-15 11:47:07 -04: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
Lorenz Meier
548e070b91 FW pos control: Robustify for throttle scaling
PX4 can support negative (reverse) throttle and the fixed wing controller is not expecting this input range. This hardens it against it.
2021-02-14 11:17:28 +01:00
Daniel Agar
1981519aad L1 position controller: use double precision floating point for all lat/lon 2021-02-12 21:59:56 +01:00
Silvan Fuhrer
31a6edff07 Fixed-wing: remove roll offset param (FW_RSP_OFF)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-02-12 13:57:15 -05:00
Silvan Fuhrer
a70cf950f4 fw_pos_control_l1: apply pitch setpoint offset centrally
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-02-12 13:57:15 -05:00
Daniel Agar
f61d8539cb fw_pos_control_l1: add takeoff minimum pitch parameter
- remove mavlink mechanism for setting minimum pitch
2021-02-12 13:57:15 -05:00