fix(navigator): use "Return" instead of "RTL" in user-facing text (#28543)

This commit is contained in:
Andrea Bernasconi authored and GitHub committed 2026-09-26 12:40:56 +10:00
1 parent bd7d86e141
commit b38dcb1f6c
88 files changed
+259 -258

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ In addition to the core code review guidelines:
- Race conditions and concurrency: no partial fixes, demand complete solutions
- Semaphore/scheduling edge cases; understand RTOS guarantees
- State machine sequential-logic bugs (consecutive RTL, armed/disarmed alternation)
- State machine sequential-logic bugs (consecutive Return, armed/disarmed alternation)
- Use uORB-driven scheduling (`SubscriptionCallback`), not extra threads
- `param_set` triggers auto-save; no redundant `param_save_default`
- Flash/memory efficiency: avoid `std::string` on embedded, minimize SubscriptionData usage
+2 -2
View File
@@ -66,7 +66,7 @@ The scope identifies which part of PX4 is affected. Common scopes:
| `ekf2` | Extended Kalman Filter (state estimation) |
| `mavlink` | MAVLink messaging protocol |
| `commander` | Commander and mode management |
| `navigator` | Mission, RTL, Land, and other navigation modes |
| `navigator` | Mission, Return, Land, and other navigation modes |
| `sensors` | Sensor drivers and processing |
| `drivers` | Hardware drivers |
| `boards/px4_fmu-v6x` | Board-specific changes (use the board name) |
@@ -99,7 +99,7 @@ feat(ekf2)!: remove deprecated height fusion API
```
feat(ekf2): add height fusion timeout
fix(mavlink): correct BATTERY_STATUS_V2 parsing
refactor(navigator): simplify RTL altitude logic
refactor(navigator): simplify return altitude logic
ci(workflows): migrate to reusable workflows
docs(ekf2): update tuning guide
feat(boards/px4_fmu-v6x)!: remove deprecated driver API
@@ -75,7 +75,7 @@ param set-default CP_GO_NO_DATA 1
# Navigator Parameters
param set-default NAV_ACC_RAD 2
# RTL Parameters
# Return Parameters
param set-default RTL_DESCEND_ALT 5
param set-default RTL_RETURN_ALT 5
@@ -73,7 +73,7 @@ param set-default CP_GO_NO_DATA 1
# Navigator Parameters
param set-default NAV_ACC_RAD 2
# RTL Parameters
# Return Parameters
param set-default RTL_DESCEND_ALT 5
param set-default RTL_RETURN_ALT 5
@@ -74,7 +74,7 @@ param set-default CP_GO_NO_DATA 1
# Navigator Parameters
param set-default NAV_ACC_RAD 2
# RTL Parameters
# Return Parameters
param set-default RTL_DESCEND_ALT 5
param set-default RTL_RETURN_ALT 5
+2 -2
View File
@@ -196,7 +196,7 @@ why the stress tests loop.
| bench/storage_stress | SD card and FAT filesystem under the logger's feet | Sequential write/read below the floor, fsync latency spikes that cause log dropouts, or file churn failures |
| bench/log_transfer | logger + MAVFTP (FILE_TRANSFER_PROTOCOL replies are nested sends) | A burst-read download that stops mid-file, or a ULog that fails integrity checks |
| bench/serial_loopback | UART driver TX/RX path through a physical loopback jumper (fixture) | Lost or corrupted bytes through the jumper, or a port that cannot sustain the byte rate |
| sih/flight_mission | commander/navigator/land-detector flight logic on real NuttX scheduling | Arming, takeoff, waypoint progression, RTL, land detection or auto-disarm failing per-phase timeouts |
| sih/flight_mission | commander/navigator/land-detector flight logic on real NuttX scheduling | Arming, takeoff, waypoint progression, Return, land detection or auto-disarm failing per-phase timeouts |
## Bench tests (real firmware, no simulation)
@@ -339,7 +339,7 @@ Skips with a warning when the firmware lacks `serial_test`
Switches the board to a SIH airframe (`SYS_AUTOSTART=1100`, `SYS_HITL=2`,
physics simulated on the FMU, `pwm_out_sim` in place of real outputs), flies
takeoff, a 3-waypoint square, and RTL as an auto mission with per-phase
takeoff, a 3-waypoint square, and Return as an auto mission with per-phase
timeouts (arming, airborne, waypoint progression, touchdown, auto-disarm),
downloads the flight ULog, and restores the original configuration even on
failure.
+4 -4
View File
@@ -5,7 +5,7 @@ Scripted SIH flight on real hardware: switch the board to a SIH airframe
restore the original configuration.
Covers the flight-logic paths the rest of the bench suite cannot: commander
arming, navigator/mission progression, auto takeoff, RTL, land detection and
arming, navigator/mission progression, auto takeoff, Return, land detection and
auto-disarm, all on real NuttX scheduling. The physics is simulated; real
sensor drivers and real outputs are not exercised (pwm_out_sim replaces them,
so nothing on the output rails is ever driven).
@@ -48,7 +48,7 @@ WP_OFFSET_DEG = 0.0005 # ~55 m legs
def build_flight_mission(alt):
"""Takeoff, 3-waypoint square leg, RTL. Reuses px4bench.missions.Item."""
"""Takeoff, 3-waypoint square leg, Return. Reuses px4bench.missions.Item."""
home_lat = int(BASE_LAT * 1e7)
home_lon = int(BASE_LON * 1e7)
off = int(WP_OFFSET_DEG * 1e7)
@@ -65,7 +65,7 @@ def build_flight_mission(alt):
rtl = Item(len(items), 0, 0, 0, 0)
rtl.command = MAV_CMD_NAV_RETURN_TO_LAUNCH
# RTL carries no coordinates; the position frame would (correctly) fail
# Return carries no coordinates; the position frame would (correctly) fail
# the parameter validation added in #27541 with INVALID_PARAM5_X.
rtl.frame = mavutil.mavlink.MAV_FRAME_MISSION
rtl.param2 = 0.0
@@ -285,7 +285,7 @@ def fly(report, mav, shell, alt, report_dir):
f.write(out)
report.info('captured in-flight uorb top')
report.check('waypoints', len(reached) >= n_wp - 2,
'reached {} of {} pre-RTL items'.format(len(reached), n_wp - 2))
'reached {} of {} pre-Return items'.format(len(reached), n_wp - 2))
if len(reached) < n_wp - 2:
return False
@@ -866,8 +866,8 @@ Under those assumptions, the expected operator-visible messages for each scenari
- Hold triggered on augmented WC breach: `DAA 9F3FA3: Hold! lvl 1. 2366 m.`
- `DAA Main: 9F3FA3 lvl UP 2. 1773 m.`
- Return triggered on augmented NMAC breach: `DAA 9F3FA3: Return! lvl 2. 1773 m.`
- `[commander] Returning to launch`
- `[navigator] RTL: start return at 519 m (30 m above destination)`
- `[commander] Switching to Return`
- `[navigator] Return: start return at 519 m (30 m above destination)`
- `DAA Main: 9F3FA3 lvl 2. 849 m.` (the periodic most-urgent status, emitted because the level held at 2 for [DAA_NOTIF_STATE](../advanced_config/parameter_reference.md#DAA_NOTIF_STATE) since the previous `9F3FA3` message)
- `DAA Main: 9F3FA3 lvl UP 3. 527 m.`
- Land triggered on WC breach: `DAA 9F3FA3: Land! lvl 3. 527 m.`
+1 -1
View File
@@ -196,7 +196,7 @@ Some of the most useful ones are listed below.
| <a id="PLD_FAPPR_ALT"></a>[PLD_FAPPR_ALT](../advanced_config/parameter_reference.md#PLD_FAPPR_ALT) | Final approach altitude. Default is 0.1 metres. |
| <a id="PLD_MAX_SRCH"></a>[PLD_MAX_SRCH](../advanced_config/parameter_reference.md#PLD_MAX_SRCH) | Maximum number of search attempts in a required landing. |
| <a id="PLD_YAW_EN"></a>[PLD_YAW_EN](../advanced_config/parameter_reference.md#PLD_YAW_EN) | Enable yaw alignment during precision landing when target orientation is available. |
| <a id="RTL_PLD_MD"></a>[RTL_PLD_MD](../advanced_config/parameter_reference.md#RTL_PLD_MD) | RTL precision land mode. `0`: disabled, `1`: [Opportunistic](#opportunistic-mode), `2`: [Required](#required-mode). |
| <a id="RTL_PLD_MD"></a>[RTL_PLD_MD](../advanced_config/parameter_reference.md#RTL_PLD_MD) | Return precision land mode. `0`: disabled, `1`: [Opportunistic](#opportunistic-mode), `2`: [Required](#required-mode). |
### IR Beacon Scaling
@@ -144,7 +144,7 @@ With Alfa AWU036ACH and 20dBi patch antenna on the ground ~20km is possible.
:::warning
Don't use band that the RC TX operates on!
Or setup RTL properly to avoid model loss.
Or set up Return mode properly to avoid model loss.
:::
**Q:** _Is only Raspberry PI supported?_
+1 -1
View File
@@ -94,7 +94,7 @@ Explanations and requirements:
- Above we specify a separate external and internal log level, which are the levels displayed to GCS users and in the log file, respectively: `{events::Log::Error, events::LogInternal::Info}`.
For the majority of cases you can pass a single log level, and this will be used for both external and internal cases.
There are cases it makes sense to have two different log levels.
For example an RTL failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
For example a Return failsafe action: the user should see it as Warning/Error, whereas in the log, it is an expected system response, so it can be set to `Info`.
- **Event Message**:
- Single-line, short message of the event.
+1 -1
View File
@@ -141,7 +141,7 @@ Additional (and underlying) parameter settings are shown below.
| Parameter | Setting | Description |
| ----------------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="COM_RC_LOSS_T"></a>[COM_RC_LOSS_T](../advanced_config/parameter_reference.md#COM_RC_LOSS_T) | Manual Control Loss Timeout | Time after last setpoint received from the selected manual control source after which manual control is considered lost. This must be kept short because the vehicle will continue to fly using the last known stick position until the timeout triggers. |
| <a id="COM_FAIL_ACT_T"></a>[COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) | Failsafe Reaction Delay | Delay in seconds between failsafe condition being triggered (`COM_RC_LOSS_T`) and failsafe action (RTL, Land, Hold). In this state the vehicle waits in hold mode for the manual control source to reconnect. This might be set longer for long-range flights so that intermittent connection loss doesn't immediately invoke the failsafe. It can be to zero so that the failsafe triggers immediately. |
| <a id="COM_FAIL_ACT_T"></a>[COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) | Failsafe Reaction Delay | Delay in seconds between failsafe condition being triggered (`COM_RC_LOSS_T`) and failsafe action (Return, Land, Hold). In this state the vehicle waits in hold mode for the manual control source to reconnect. This might be set longer for long-range flights so that intermittent connection loss doesn't immediately invoke the failsafe. It can be to zero so that the failsafe triggers immediately. |
| <a id="NAV_RCL_ACT"></a>[NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) | Failsafe Action | Disabled, Loiter, Return, Land, Disarm, Terminate, Hold mode (no failsafe). |
| <a id="COM_RCL_EXCEPT"></a>[COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | RC Loss Exceptions | Set modes in which manual control loss is ignored. |
+6 -6
View File
@@ -228,7 +228,7 @@ Things like path tracking error, wind and other disturbances may cause temporary
It is therefore very important to consider this possibility and especially to review the geofence breach action (e.g. [GF_ACTION](../advanced_config/parameter_reference.md#GF_ACTION)).
:::
### RTL-types with Geofence-Awareness
### Return Types with Geofence Awareness
The following table shows which return types currently support geofence awareness:
@@ -321,7 +321,7 @@ For this reason fixed-wing vehicles are configured to use [Mission landing/reall
## Parameters
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below).
The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode) (and summarised below).
| Parameter | Description |
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -330,10 +330,10 @@ The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Altitude above the destination used for the final descent before landing or loitering (default: 30m). |
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to wait at `RTL_DESCEND_ALT` before landing (default: 0.5s) - by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically). |
| <a id="RTL_MIN_DIST"></a>[RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Within this distance from the return destination, the return altitude is calculated from the "cone" rather than directly from `RTL_RETURN_ALT`. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. |
| <a id="RTL_APPR_FORCE"></a>[RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, home or rally-point RTL destinations are only considered when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. |
| <a id="RTL_APPR_FORCE"></a>[RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, home or rally-point return destinations are only considered when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. |
| <a id="MAN_OVERRIDE_SPD"></a>[MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. <Badge type="tip" text="PX4 v1.18" /> |
| <a id="RTL_LOITER_RAD"></a>[RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY)). |
| <a id="MIS_TKO_LAND_REQ"></a>[MIS_TKO_LAND_REQ](../advanced_config/parameter_reference.md#MIS_TKO_LAND_REQ) | Specify whether a mission landing or takeoff pattern is _required_. Generally fixed-wing vehicles set this to require a landing pattern but VTOL do not. |
| <a id="RTL_TIME_FACTOR"></a>[RTL_TIME_FACTOR](../advanced_config/parameter_reference.md#RTL_TIME_FACTOR) | RTL time estimate safety factor. |
| <a id="RTL_TIME_MARGIN"></a>[RTL_TIME_MARGIN](../advanced_config/parameter_reference.RTL_TIME_MARGIN) | RTL time estimate safety margin. |
| <a id="RTL_TIME_FACTOR"></a>[RTL_TIME_FACTOR](../advanced_config/parameter_reference.md#RTL_TIME_FACTOR) | Return time estimate safety factor. |
| <a id="RTL_TIME_MARGIN"></a>[RTL_TIME_MARGIN](../advanced_config/parameter_reference.md#RTL_TIME_MARGIN) | Return time estimate safety margin. |
+1 -1
View File
@@ -99,7 +99,7 @@ A subset of the most important checks are listed below:
- Any mission item conflicts with a plan or safety geofence
- More than one land start mission item defined ([MAV_CMD_DO_LAND_START](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_LAND_START))
- A fixed-wing landing has an infeasible slope angle ([FW_LND_ANG](#FW_LND_ANG))
- Land start item (`MAV_CMD_DO_LAND_START`) appears in mission before an RTL item ([MAV_CMD_NAV_RETURN_TO_LAUNCH](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH))
- Land start item (`MAV_CMD_DO_LAND_START`) appears in mission before an RTL ("Return") item ([MAV_CMD_NAV_RETURN_TO_LAUNCH](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_RETURN_TO_LAUNCH))
- Missing takeoff and/or land item when these are configured as a requirement ([MIS_TKO_LAND_REQ](#MIS_TKO_LAND_REQ))
Additionally there is a check if the first waypoint is too far from the Home position ([MIS_DIST_1WP](#MIS_DIST_1WP)).
+1 -1
View File
@@ -65,7 +65,7 @@ The following requirements must be met to arm in this mode, or to switch to this
## Parameters
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
If using a mission landing, only the [RTL_RETURN_ALT](#RTL_RETURN_ALT) and [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) are relevant.
The others are relevant if the destination is a rally point or the home location.
+2 -2
View File
@@ -73,7 +73,7 @@ For more information on this return type see [Home/Rally Point Return Type (RTL_
## Parameters
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
The parameters that are relevant to multicopter (assuming the [RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) is set to 0) are listed below.
@@ -83,7 +83,7 @@ The parameters that are relevant to multicopter (assuming the [RTL_TYPE](../adva
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Altitude above the destination used for the final descent before landing or loitering (default: 30m). |
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to hover at `RTL_DESCEND_ALT` before landing (default: 0.5s) - by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically). |
| <a id="RTL_MIN_DIST"></a>[RTL_MIN_DIST](../advanced_config/parameter_reference.md#RTL_MIN_DIST) | Within this distance from the home position, the return altitude is calculated from the "cone" rather than directly from `RTL_RETURN_ALT`. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. Values (in degrees): `0`, `25`, `45`, `65`, `80`, `90`. Note that `0` is "no cone" (always return at `RTL_RETURN_ALT` or higher), while `90` indicates an almost vertical cone, so the vehicle generally returns at its current altitude when close to the destination. The return altitude may still be constrained to avoid flying too low while approaching the destination. |
| <a id="MAN_OVERRIDE_SPD"></a>[MAN_OVERRIDE_SPD](../advanced_config/parameter_reference.md#MAN_OVERRIDE_SPD) | Speed (normalized stick travel per second) above which moving the sticks controlling a multicopter (or VTOL in hover) gives control back to the pilot by switching to [Position mode](../flight_modes_mc/position.md) (or Altitude mode if position is unavailable). At the default value of 1 a half-stick movement in ~0.5 s triggers it; lower is more sensitive. A stick held statically has zero speed and will not trigger. Set to -1 to disable. <Badge type="tip" text="PX4 v1.18" /> |
## See Also
+4 -4
View File
@@ -75,7 +75,7 @@ When uploading VTOL approach loiters through MAVLink, [upload them as rally/safe
The `MAV_CMD_NAV_RALLY_POINT` item must come first, followed by one or more `MAV_CMD_NAV_LOITER_TO_ALT` items that define the approach loiters for that rally point.
The next `MAV_CMD_NAV_RALLY_POINT` starts a new landing-location block.
For each `MAV_CMD_NAV_LOITER_TO_ALT` item, `x/y/z` define the loiter center and approach altitude, and `param2` defines the loiter radius used by RTL.
For each `MAV_CMD_NAV_LOITER_TO_ALT` item, `x/y/z` define the loiter center and approach altitude, and `param2` defines the loiter radius used by Return mode.
If `param2` is unset or zero, PX4 falls back to [RTL_LOITER_RAD](#RTL_LOITER_RAD).
For example, a rally upload with one rally point and two possible approach loiters would use:
@@ -99,16 +99,16 @@ If returning as a multicopter:
## Parameters
The RTL parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
The Return parameters are listed in [Parameter Reference > Return Mode](../advanced_config/parameter_reference.md#return-mode).
If using a mission landing, only the [RTL_RETURN_ALT](#RTL_RETURN_ALT) and [RTL_DESCEND_ALT](#RTL_DESCEND_ALT) are relevant.
The others are relevant if the destination is a rally point or the home location.
| Parameter | Description |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="RTL_TYPE"></a>[RTL_TYPE](../advanced_config/parameter_reference.md#RTL_TYPE) | Return type. |
| <a id="RTL_APPR_FORCE"></a>[RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, PX4 only considers home or rally-point RTL destinations when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. |
| <a id="RTL_APPR_FORCE"></a>[RTL_APPR_FORCE](../advanced_config/parameter_reference.md#RTL_APPR_FORCE) | [VTOL FW only] If set, PX4 only considers home or rally-point return destinations when a valid VTOL approach loiter is defined for that landing location. Mission landing patterns are unaffected. |
| <a id="RTL_RETURN_ALT"></a>[RTL_RETURN_ALT](../advanced_config/parameter_reference.md#RTL_RETURN_ALT) | Return altitude in meters (default: 60m)If already above this value the vehicle will return at its current altitude. |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle RTL return altitude. Values (in degrees): 0, 25, 45, 65, 80, 90. Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). |
| <a id="RTL_CONE_ANG"></a>[RTL_CONE_ANG](../advanced_config/parameter_reference.md#RTL_CONE_ANG) | Half-angle of the cone that defines the vehicle return altitude. Values (in degrees): 0, 25, 45, 65, 80, 90. Note that 0 is "no cone" (always return at `RTL_RETURN_ALT` or higher), while 90 indicates that the vehicle must return at the current altitude or `RTL_DESCEND_ALT` (whichever is higher). |
| <a id="RTL_DESCEND_ALT"></a>[RTL_DESCEND_ALT](../advanced_config/parameter_reference.md#RTL_DESCEND_ALT) | Minimum return altitude and altitude at which the vehicle will slow or stop its initial descent from a higher return altitude (default: 30m) |
| <a id="RTL_LAND_DELAY"></a>[RTL_LAND_DELAY](../advanced_config/parameter_reference.md#RTL_LAND_DELAY) | Time to hover at `RTL_DESCEND_ALT` before landing (default: 0.5s) -by default this period is short so that the vehicle will simply slow and then land immediately. If set to -1 the system will loiter at `RTL_DESCEND_ALT` rather than landing. The delay is provided to allow you to configure time for landing gear to be deployed (triggered automatically). |
| <a id="RTL_LOITER_RAD"></a>[RTL_LOITER_RAD](../advanced_config/parameter_reference.md#RTL_LOITER_RAD) | [Fixed-wing Only] The radius of the loiter circle (at [RTL_LAND_DELAY](#RTL_LAND_DELAY). |
+4 -4
View File
@@ -24,7 +24,7 @@ Whether or not you `Land` depends on whether the package can safely be deployed
Since a gripper cannot lower packages safely, multicopter and VTOL vehicles will often land to deploy packages when using a gripper.
After the deployment device [indicates completion](#package-release-feedback), the vehicle will proceed to the next waypoint.
Note that if landed, the next mission item after deployment should be another `Waypoint` or a `Takeoff` mission item ([it must not be a `RETURN`](#rtl-waypoint-for-package-delivery-with-landing).)
Note that if landed, the next mission item after deployment should be another `Waypoint` or a `Takeoff` mission item ([it must not be a `RETURN`](#return-waypoint-for-package-delivery-with-landing).)
## Creating a Package Delivery Mission
@@ -74,12 +74,12 @@ Note how the altitude graph shows the `Land` item.
### Notes
#### RTL Waypoint for Package Delivery with Landing
#### Return Waypoint for Package Delivery with Landing
Do not plan a mission with a delivery like this: `LAND` > `GRIPPER` > `RETURN TO LAUNCH`.
For safety reasons "Return To Launch" is disabled when vehicle is landed ([related issue](https://github.com/PX4/PX4-Autopilot/pull/20044)).
So if you land, release the cargo, then have an RTL waypoint, the vehicle will idle at the landing coordinate.
For safety reasons Return mode is disabled when the vehicle is landed ([related issue](https://github.com/PX4/PX4-Autopilot/pull/20044)).
So if you land, release the cargo, then have a `Return` (`MAV_CMD_NAV_RETURN_TO_LAUNCH`) mission item, the vehicle will idle at the landing coordinate.
#### Manual Control of Gripper in Missions
+3 -3
View File
@@ -59,7 +59,7 @@ A mode defined using the interface library has the following properties:
#### Mode Executor
A mode executor is an optional component for scheduling modes.
For example, the mode executor for a custom payload delivery or survey mode might first trigger a take-off, then switch to the custom mode, and when that completes trigger an RTL.
For example, the mode executor for a custom payload delivery or survey mode might first trigger a take-off, then switch to the custom mode, and when that completes trigger a Return.
Specifically, it has the following properties:
@@ -733,8 +733,8 @@ This makes it independent of startup ordering in case of multiple external modes
### Replacing an Internal Mode
An external mode can replace an existing internal mode, such as [Return](../flight_modes/return.md) mode (RTL).
By doing so, whenever RTL gets selected (through the user or a failsafe situation), the external mode is used instead of the internal one.
An external mode can replace an existing internal mode, such as [Return](../flight_modes/return.md) mode.
By doing so, whenever it gets selected (through the user or a failsafe situation), the external mode is used instead of the internal one.
The internal one is only used as a fallback when the external one becomes unresponsive or crashes.
The replacement mode can be set in the settings of the `ModeBase` constructor:
+3 -3
View File
@@ -11,7 +11,7 @@ They completely bypass the existing PX4 mission mode and waypoint logic, and can
:::
ROS 2 waypoint missions are effectively special PX4 ROS 2 custom modes that are run based on the content of a [JSON mission definition](#mission-definition).
Mission definitions can contain actions that reference existing PX4 modes, such as Takeoff mode or RTL, and can also be extended with arbitrary custom actions written in ROS.
Mission definitions can contain actions that reference existing PX4 modes, such as Takeoff or Return mode, and can also be extended with arbitrary custom actions written in ROS.
A [mode executor](px4_ros2_control_interface.md#mode-executor) is used to schedule the modes.
Mission definitions can be hard coded in the custom mission mode (either in code or statically loaded from a JSON string), or directly generated within the application.
@@ -69,13 +69,13 @@ They are identified by a name, and any number of these can be registered with th
A custom action is then run whenever a mission item with matching name is executed, and any extra arguments from the JSON definition are passed as arguments (for example an altitude for a takeoff action).
Actions can call other actions, run any mode (PX4 or external by its ID), run a trajectory, or run any other external action before deciding when to continue the mission.
There is a set of default actions, for example for RTL, Land, etc.
There is a set of default actions, for example for Return, Land, etc.
These simply trigger the corresponding PX4 mode.
They can be disabled or replaced with custom implementations.
There are also some special actions (which can be replaced as well):
- `OnFailure`: this is called in case of a failure, e.g. a mode switch failed, a non-existing action is called (by another action) or by an explicit call to `MissionExecutor::abort()`.
The default is to run RTL, with fallback to Land.
The default is to run Return, with fallback to Land.
- `OnResume`: this is called when resuming a mission (either from the ground or in-air).
It handles a number of cases:
- when called with an argument `action="storeState"`: this can be used to store the current position when the mission is deactivated, so it can be resumed from the same position.
+1 -1
View File
@@ -79,7 +79,7 @@ A per-test watchdog turns a hung board into a named failure instead of a stuck t
## Simulated Flight on the FMU (SIH)
`sih/flight_mission.py` performs a complete hardware-in-the-loop flight without any host-side simulator: it switches the board to a [SIH airframe](../sim_sih/index.md) (`SYS_HITL=2`, physics computed on the autopilot), uploads a mission, arms through the NuttX shell, and asserts takeoff, waypoint progression, RTL, landing, and auto-disarm against per-phase timeouts.
`sih/flight_mission.py` performs a complete hardware-in-the-loop flight without any host-side simulator: it switches the board to a [SIH airframe](../sim_sih/index.md) (`SYS_HITL=2`, physics computed on the autopilot), uploads a mission, arms through the NuttX shell, and asserts takeoff, waypoint progression, Return, landing, and auto-disarm against per-phase timeouts.
It runs as the last test of the default bench suite and also works standalone.
Because it arms the flight controller, the suite asks for explicit confirmation on a terminal (type `arm`), and non-interactive runs skip it unless `--allow-arming` is passed.
It first probes the running firmware for the SIH module and records a skip, not a failure, when the build does not include it.
@@ -90,7 +90,7 @@ Run a single test by specifying the `model` and test `case` as command line opti
For example, to test a multicopter mission using the SIH simulator:
```sh
test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'Fly square Multicopter Missions including RTL'
test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sih-sitl.json --speed-factor 10 --model quadx --case 'Fly square Multicopter Missions including Return'
```
The easiest way to find out the current set of models and their associated test cases is to run all PX4 tests [as shown above](#run-all-px4-tests) (note, you can then cancel the build if you wish to test just one).
@@ -108,8 +108,8 @@ About to run 39 test cases for 3 selected models (1 iteration):
- 'Continue on baro stuck during mission (baro height mode)'
- 'Continue on baro stuck during mission (GPS height mode)'
- 'Takeoff and Land'
- 'Fly square Multicopter Missions including RTL'
- 'Fly square Multicopter Missions with manual RTL'
- 'Fly square Multicopter Missions including Return'
- 'Fly square Multicopter Missions with manual Return'
- 'Fly straight Multicopter Mission'
- 'Offboard takeoff and land'
- 'Offboard position control'
@@ -124,8 +124,8 @@ About to run 39 test cases for 3 selected models (1 iteration):
- 'Continue on baro stuck during mission (baro height mode)'
- 'Continue on baro stuck during mission (GPS height mode)'
- 'Takeoff and Land'
- 'Fly square Multicopter Missions including RTL'
- 'Fly square Multicopter Missions with manual RTL'
- 'Fly square Multicopter Missions including Return'
- 'Fly square Multicopter Missions with manual Return'
- 'Fly forward in position control'
- 'Fly forward in altitude control'
- tailsitter:
@@ -137,8 +137,8 @@ About to run 39 test cases for 3 selected models (1 iteration):
- 'Continue on baro stuck during mission (baro height mode)'
- 'Continue on baro stuck during mission (GPS height mode)'
- 'Takeoff and Land'
- 'Fly square Multicopter Missions including RTL'
- 'Fly square Multicopter Missions with manual RTL'
- 'Fly square Multicopter Missions including Return'
- 'Fly square Multicopter Missions with manual Return'
- 'Fly forward in position control'
- 'Fly forward in altitude control'
```
+6 -6
View File
@@ -2,7 +2,7 @@
## Objective
To test the auto modes such as Mission, Takeoff, Hold, and RTL for fixed wing vehicles.
To test the auto modes such as Mission, Takeoff, Hold, and Return for fixed wing vehicles.
## Preflight
@@ -10,7 +10,7 @@ Plan a mission on the ground. Ensure the mission has:
- Takeoff as first waypoint
- Changes in altitude throughout the mission
- Last waypoint is an RTL
- Last waypoint is a Return item
- Duration of 1 to 2 minutes
## Flight Tests
@@ -29,7 +29,7 @@ Plan a mission on the ground. Ensure the mission has:
&nbsp;&nbsp;&nbsp;&nbsp;❏ Verify changes in altitude throughout the mission
&nbsp;&nbsp;&nbsp;&nbsp;❏ Verify Mission Ends in RTL
&nbsp;&nbsp;&nbsp;&nbsp;❏ Verify Mission Ends in Return
&nbsp;&nbsp;&nbsp;&nbsp;❏ Duration of 1 to 2 minutes
@@ -43,7 +43,7 @@ Plan a mission on the ground. Ensure the mission has:
&nbsp;&nbsp;&nbsp;&nbsp;❏ Orbit radius and direction should match parameters
❏ RTL
❏ Return
&nbsp;&nbsp;&nbsp;&nbsp;❏ Arm and takeoff in any manual mode
@@ -51,7 +51,7 @@ Plan a mission on the ground. Ensure the mission has:
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage Return mode
&nbsp;&nbsp;&nbsp;&nbsp;❏ Vehicle should climb to RTL altitude if below it
&nbsp;&nbsp;&nbsp;&nbsp;❏ Vehicle should climb to return altitude if below it
&nbsp;&nbsp;&nbsp;&nbsp;❏ Vehicle should return to home and hold or land
@@ -60,5 +60,5 @@ Plan a mission on the ground. Ensure the mission has:
- Mission should upload on first attempt
- Vehicle should automatically takeoff upon engaging Auto
- Waypoint tracking should be smooth with appropriate turn radius
- Vehicle should adjust height to RTL altitude before returning home
- Vehicle should adjust height to return altitude before returning home
- Landing approach should be stable (if auto-land is configured)
+8 -8
View File
@@ -2,7 +2,7 @@
## Objective
To test the auto modes such as Mission, RTL, etc...
To test the auto modes such as Mission, Return, etc...
## Preflight
@@ -10,7 +10,7 @@ Plan a mission on the ground. Ensure the mission has
- Takeoff as first waypoint
- Changes in Altitude throughout the mission
- Last waypoint is an RTL
- Last waypoint is a Return item
- Duration of 5 to 6 minutes
## Flight Tests
@@ -23,7 +23,7 @@ Plan a mission on the ground. Ensure the mission has
&nbsp;&nbsp;&nbsp;&nbsp;❏ First waypoint set to Takeoff
&nbsp;&nbsp;&nbsp;&nbsp;❏ Enable Mission End RTL
&nbsp;&nbsp;&nbsp;&nbsp;❏ Enable Mission End Return
&nbsp;&nbsp;&nbsp;&nbsp;❏ Duration of 5 to 6 minutes
@@ -35,26 +35,26 @@ Plan a mission on the ground. Ensure the mission has
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage Auto (Mission Mode) to trigger take-off
&nbsp;&nbsp;&nbsp;&nbsp;❏ Observe tracking, cornering and proper RTL performance
&nbsp;&nbsp;&nbsp;&nbsp;❏ Observe tracking, cornering and proper Return performance
&nbsp;&nbsp;&nbsp;&nbsp;❏ Upon touching ground, copter should disarm automatically within 2 seconds (disarm time set by parameter: [COM_DISARM_LAND](../advanced_config/parameter_reference.md#COM_DISARM_LAND))
❏ RTL
❏ Return
&nbsp;&nbsp;&nbsp;&nbsp;❏ Arm and takeoff in position mode
&nbsp;&nbsp;&nbsp;&nbsp;❏ Fly out ~10m from start point
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage RTL Mode
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage Return mode
&nbsp;&nbsp;&nbsp;&nbsp;❏ Observe tracking, cornering and proper RTL performance
&nbsp;&nbsp;&nbsp;&nbsp;❏ Observe tracking, cornering and proper Return performance
## Expected Results
- Take-off should be smooth as throttle is raised
- Mission should upload on first attempt
- Vehicle should automatically take-off upon engaging Auto
- Vehicle should adjust height to RTL altitude before returning home
- Vehicle should adjust height to return altitude before returning home
- Upon landing, copter should not bounce on the ground
<!--
+2 -2
View File
@@ -8,7 +8,7 @@ To test switching between various modes
- Takeoff as first waypoint
- Changes in Altitude throughout the mission
- Last waypoint is a NOT RTL, but a normal waypoint
- Last waypoint is a normal waypoint, not a Return item
- Duration of 5 to 6 minutes
## Flight Tests
@@ -31,7 +31,7 @@ To test switching between various modes
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;❏ Pitch/Roll/Yaw response set to Pitch/Roll/Yaw rates
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage RTL
&nbsp;&nbsp;&nbsp;&nbsp;❏ Engage Return mode
&nbsp;&nbsp;&nbsp;&nbsp;❏ Upon touching ground, copter should disarm automatically within 2 seconds (disarm time set by parameter: COM_DISARM_LAND)
+1 -1
View File
@@ -19,7 +19,7 @@ uint8 MODE_SLOT_NUM = 6 # number of slots
uint8 mode_slot # the slot a specific model selector is in
uint8 arm_switch # arm/disarm switch: _DISARMED_, ARMED
uint8 return_switch # return to launch 2 position switch (mandatory): _NORMAL_, RTL
uint8 return_switch # Return mode 2 position switch (mandatory): _NORMAL_, RETURN
uint8 loiter_switch # loiter 2 position switch (optional): _MISSION_, LOITER
uint8 offboard_switch # offboard 2 position switch (optional): _NORMAL_, OFFBOARD
uint8 kill_switch # throttle kill: _NORMAL_, KILL
+2 -2
View File
@@ -1,11 +1,11 @@
uint64 timestamp # time since system start (microseconds)
uint32 safe_points_id # unique ID of active set of safe_point_items
bool is_evaluation_pending # flag if the RTL point needs reevaluation (e.g. new safe points available, but need loading).
bool is_evaluation_pending # flag if the return point needs reevaluation (e.g. new safe points available, but need loading).
bool has_vtol_approach # flag if approaches are defined for current RTL_TYPE parameter setting
uint8 rtl_type # Type of RTL chosen
uint8 rtl_type # Selected Return type
uint8 safe_point_index # index of the chosen safe point, UINT8_MAX if no rally point was chosen
uint8 RTL_STATUS_TYPE_NONE=0 # pending if evaluation can't pe performed currently e.g. when it is still loading the safe points
+1 -1
View File
@@ -1,5 +1,5 @@
uint64 timestamp # time since system start (microseconds)
bool valid # Flag indicating whether the time estiamtes are valid
float32 time_estimate # [s] Estimated time for RTL
float32 time_estimate # [s] Estimated time for Return
float32 safe_time_estimate # [s] Same as time_estimate, but with safety factor and safety margin included (factor*t + margin)
+1 -1
View File
@@ -36,7 +36,7 @@ bool mode_req_local_position_relaxed # Requires a more relaxed global position e
bool mode_req_global_position # Requires a global position estimate
bool mode_req_global_position_relaxed # Requires a relaxed global position estimate
bool mode_req_mission # Requires an uploaded mission
bool mode_req_home_position # Requires a home position (such as RTL/Return mode)
bool mode_req_home_position # Requires a home position (such as Return mode)
bool mode_req_prevent_arming # Prevent arming (such as in Land mode)
bool mode_req_manual_control # Requires a manual controller
+2 -2
View File
@@ -34,7 +34,7 @@ uint8 NAVIGATION_STATE_ALTCTL = 1 # Altitude control mode
uint8 NAVIGATION_STATE_POSCTL = 2 # Position control mode
uint8 NAVIGATION_STATE_AUTO_MISSION = 3 # Auto mission mode
uint8 NAVIGATION_STATE_AUTO_LOITER = 4 # Auto loiter mode
uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Auto return to launch mode
uint8 NAVIGATION_STATE_AUTO_RTL = 5 # Return mode
uint8 NAVIGATION_STATE_POSITION_SLOW = 6
uint8 NAVIGATION_STATE_GUIDED_COURSE = 7 # Guided Course mode (FW: maintain course/alt/speed)
uint8 NAVIGATION_STATE_ALTITUDE_CRUISE = 8 # Altitude with Cruise mode
@@ -85,7 +85,7 @@ uint8 FAILSAFE_DEFER_STATE_DISABLED = 0
uint8 FAILSAFE_DEFER_STATE_ENABLED = 1
uint8 FAILSAFE_DEFER_STATE_WOULD_FAILSAFE = 2 # Failsafes deferred, but would trigger a failsafe
bool failsafe # true if system is in failsafe state (e.g.:RTL, Hover, Terminate, ...)
bool failsafe # true if system is in failsafe state (e.g. Return, Hover, Terminate, ...)
bool failsafe_and_user_took_over # true if system is in failsafe state but the user took over control
uint8 failsafe_defer_state # one of FAILSAFE_DEFER_STATE_*
+1 -1
View File
@@ -63,7 +63,7 @@ using namespace time_literals;
#define MAC_DATA_BUFFER_SIZE 32
#define BATT_CELL_VOLTAGE_THRESHOLD_RTL 0.5f ///< Threshold in volts to RTL if cells are imbalanced
#define BATT_CELL_VOLTAGE_THRESHOLD_RTL 0.5f ///< Threshold in volts to Return if cells are imbalanced
#define BATT_CELL_VOLTAGE_THRESHOLD_FAILED 1.5f ///< Threshold in volts to Land if cells are imbalanced
#define BATT_CURRENT_UNDERVOLTAGE_THRESHOLD 5.0f ///< Threshold in amps to disable undervoltage protection
+2 -2
View File
@@ -163,7 +163,7 @@ parameters:
long: |
Sets the threshold when the battery will be reported as critically low.
This has to be lower than the low threshold. This threshold commonly
will trigger RTL.
will trigger Return.
type: float
unit: norm
min: 0.05
@@ -192,7 +192,7 @@ parameters:
short: Expected battery current in flight.
long: |
This value is used to initialize the in-flight average current estimation,
which in turn is used for estimating remaining flight time and RTL triggering.
which in turn is used for estimating remaining flight time and Return triggering.
type: float
unit: A
min: 0
+3 -3
View File
@@ -73,7 +73,7 @@
},
"32": {
"name": "rtl",
"description": "RTL"
"description": "Return"
},
"64": {
"name": "position_slow",
@@ -438,7 +438,7 @@
},
"6": {
"name": "rtl",
"description": "RTL"
"description": "Return"
},
"7": {
"name": "land",
@@ -530,7 +530,7 @@
},
"5": {
"name": "auto_rtl",
"description": "RTL"
"description": "Return"
},
"6": {
"name": "acro",
+3 -3
View File
@@ -34,7 +34,7 @@
/**
* @file rtl_time_estimator.cpp
*
* Helper class to calculate the remaining time estimate to go to RTL landing point.
* Helper class to calculate the remaining time estimate to go to Return landing point.
*
*/
@@ -139,14 +139,14 @@ float RtlTimeEstimator::getCruiseGroundSpeed(const matrix::Vector2f &direction_n
const float wind_along_dir = wind.dot(direction_norm);
const float wind_across_dir = matrix::Vector2f(wind - direction_norm * wind_along_dir).norm();
// Note: use fminf so that we don't _rely_ on tailwind towards direction to make RTL more efficient
// Note: use fminf so that we don't _rely_ on tailwind towards direction to make Return more efficient
const float ground_speed = sqrtf(cruise_speed * cruise_speed - wind_across_dir * wind_across_dir) + fminf(
0.f, wind_along_dir);
// Assume that minimum ground speed is always satisfied. If
// windspeed < cas2tas(FW_AIRSPD_MAX) - FW_GND_SPD_MIN
// the assumption always holds. Otherwise it breaks down when
// flying upwind, and the RTL time estimate is optimistic.
// flying upwind, and the return time estimate is optimistic.
float fw_gnd_spd_min = 5.0f;
+1 -1
View File
@@ -34,7 +34,7 @@
/**
* @file rtl_time_estimator.h
*
* Helper class to calculate the remaining time estimate to go to RTL landing point.
* Helper class to calculate the remaining time estimate to go to Return landing point.
*
*/
@@ -700,9 +700,9 @@ void AirspeedModule::select_airspeed_and_publish()
} else if (_prev_airspeed_src > AirspeedSource::GROUND_MINUS_WIND
&& prev_airspeed_index <= MAX_NUM_AIRSPEED_SENSORS) {
mavlink_log_critical(&_mavlink_log_pub,
"Airspeed sensor failure detected. Return to launch (RTL) is advised.\t");
"Airspeed sensor failure detected. Return mode is advised.\t");
events::send(events::ID("airspeed_selector_sensor_failure"), events::Log::Critical,
"Airspeed sensor failure detected. Return to launch (RTL) is advised");
"Airspeed sensor failure detected. Return mode is advised");
} else if (_prev_airspeed_src == AirspeedSource::GROUND_MINUS_WIND
&& _valid_airspeed_src == AirspeedSource::DISABLED) {
+5 -5
View File
@@ -1197,10 +1197,10 @@ Commander::handle_command(const vehicle_command_s &cmd)
break;
case vehicle_command_s::VEHICLE_CMD_NAV_RETURN_TO_LAUNCH: {
/* switch to RTL which ends the mission */
/* switch to Return which ends the mission */
if (_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_RTL, getSourceFromCommand(cmd))) {
mavlink_log_info(&_mavlink_log_pub, "Returning to launch\t");
events::send(events::ID("commander_rtl"), events::Log::Info, "Returning to launch");
mavlink_log_info(&_mavlink_log_pub, "Switching to Return\t");
events::send(events::ID("commander_rtl"), events::Log::Info, "Switching to Return");
cmd_result = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;
} else {
@@ -2236,7 +2236,7 @@ void Commander::checkForMissionUpdate()
} else if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION) {
// Transition to loiter when the mission is cleared and/or finished, and we are still in mission mode.
// However, only do so if there's no pending mode change, so there isn't already a pending change (like RTL).
// However, only do so if there's no pending mode change, so there isn't already a pending change (like Return).
if (_user_mode_intention.get() == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION) {
_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER);
}
@@ -3182,7 +3182,7 @@ void Commander::manualControlLossModeSwitch()
// Force the switch to Hold as a regular mode change (no failsafe, no alarming notification).
// force=true skips the mode availability check on purpose: if Hold cannot actually run (e.g. without a
// valid position estimate), the failsafe mode-fallback escalates from there (Hold -> RTL -> Land/Descend/Terminate).
// valid position estimate), the failsafe mode-fallback escalates from there (Hold -> Return -> Land/Descend/Terminate).
_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER, ModeChangeSource::User, false, true);
mavlink_log_info(&_mavlink_log_pub, "Manual control lost: switching to Hold\t");
@@ -302,7 +302,7 @@ void BatteryChecks::rtlEstimateCheck(const Context &context, Report &reporter, f
{
rtl_time_estimate_s rtl_time_estimate;
// Compare estimate of RTL time to estimate of remaining flight time
// Compare estimate of return time to estimate of remaining flight time
// add hysteresis: if already in the condition, only get out of it if the remaining flight time is significantly higher again
const float hysteresis_factor = reporter.failsafeFlags().battery_low_remaining_time ? 1.1f : 1.0f;
@@ -67,7 +67,7 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
_param_com_flt_time_max.get();
if (remaining_flight_time_sec < 0.1f * _param_com_flt_time_max.get()) {
// send warnings every minute until RTL
// send warnings every minute until Return
const int floored_remaining_flight_time_sec = int(remaining_flight_time_sec);
@@ -75,7 +75,7 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
// less than or equal to a minute remaining on first pass
if (reporter.mavlink_log_pub()) {
mavlink_log_warning(reporter.mavlink_log_pub(), "Approaching max flight time (system will RTL in %i seconds)\t",
mavlink_log_warning(reporter.mavlink_log_pub(), "Approaching max flight time (system will switch to Return mode in %i seconds)\t",
floored_remaining_flight_time_sec);
}
@@ -84,7 +84,7 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
* Maximal flight time warning (less than 1min remaining)
*/
events::send<int16_t>(events::ID("commander_max_flight_time_warning_seconds"), events::Log::Warning,
"Approaching max flight time (system will RTL in {1} seconds)", floored_remaining_flight_time_sec);
"Approaching max flight time (system will switch to Return mode in {1} seconds)", floored_remaining_flight_time_sec);
} else if ((floored_remaining_flight_time_sec % 60) == 0 && floored_remaining_flight_time_sec >= 60
&& floored_remaining_flight_time_sec != _last_flight_time_warning_sec) {
@@ -92,7 +92,7 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
const int floored_remaining_flight_time_min = (int)(remaining_flight_time_sec * 0.016666667f);
if (reporter.mavlink_log_pub()) {
mavlink_log_warning(reporter.mavlink_log_pub(), "Approaching max flight time (system will RTL in %i minutes)\t",
mavlink_log_warning(reporter.mavlink_log_pub(), "Approaching max flight time (system will switch to Return mode in %i minutes)\t",
floored_remaining_flight_time_min);
}
@@ -101,7 +101,7 @@ void FlightTimeChecks::checkAndReport(const Context &context, Report &reporter)
* Maximal flight time warning (more than 1min remaining)
*/
events::send<int16_t>(events::ID("commander_max_flight_time_warning_minutes"), events::Log::Warning,
"Approaching max flight time (system will RTL in {1} minutes)", floored_remaining_flight_time_min);
"Approaching max flight time (system will switch to Return mode in {1} minutes)", floored_remaining_flight_time_min);
}
_last_flight_time_warning_sec = floored_remaining_flight_time_sec;
@@ -107,10 +107,10 @@ void GeofenceChecks::checkAndReport(const Context &context, Report &reporter)
* </profile>
*/
reporter.armingCheckFailure(NavModes::All, health_component_t::system, events::ID("check_gf_no_home"),
events::Log::Error, "Geofence RTL requires valid home");
events::Log::Error, "Geofence Return action requires valid home");
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Geofence RTL requires valid home");
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Geofence Return action requires valid home");
}
}
}
@@ -51,10 +51,10 @@ void ManualControlChecks::checkAndReport(const Context &context, Report &reporte
*/
reporter.armingCheckFailure(NavModes::All, health_component_t::remote_control,
events::ID("check_man_control_rtl_engaged"),
events::Log::Error, "RTL switch engaged");
events::Log::Error, "Return switch engaged");
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: RTL switch engaged");
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Return switch engaged");
}
}
@@ -55,7 +55,7 @@ void RallyPointChecks::checkAndReport(const Context &context, Report &reporter)
if (!_rtl_status_sub.copy(&rtl_status) || rtl_status.safe_point_index == UINT8_MAX) {
/* EVENT
* @description
* No rally point is configured. Return will fall back to the current position when RTL is triggered.
* No rally point is configured. Return mode will fall back to the current position when triggered.
* Upload at least one rally point, or change <param>RTL_TYPE</param> to silence this warning.
*
* <profile name="dev">
+7 -7
View File
@@ -170,7 +170,7 @@ parameters:
description:
short: Delay between failsafe condition triggered and failsafe reaction
long: |-
Before entering failsafe (RTL, Land, Hold), wait COM_FAIL_ACT_T seconds in Hold mode
Before entering failsafe (Return, Land, Hold), wait COM_FAIL_ACT_T seconds in Hold mode
for the user to realize.
During that time the user can switch modes, but cannot take over control via the manual control override feature (see MAN_OVERRIDE_SPD).
Afterwards the configured failsafe action is triggered and the user may use manual control override.
@@ -449,7 +449,7 @@ parameters:
long: |-
Specify modes in which stick input is ignored and no failsafe action is triggered.
External modes requiring stick input will still failsafe.
Auto modes are: Hold, Takeoff, Land, RTL, Descend, Follow Target, Precland, Orbit.
Auto modes are: Hold, Takeoff, Land, Return, Descend, Follow Target, Precland, Orbit.
type: bitmask
bit:
0: Mission
@@ -653,13 +653,13 @@ parameters:
description:
short: Maximum allowed flight time
long: |-
The vehicle aborts the current operation and returns to launch when
The vehicle aborts the current operation and switches to Return mode when
the time since takeoff is above this value. It is not possible to resume the
mission or switch to any auto mode other than RTL or Land. Taking over in any manual
mission or switch to any auto mode other than Return or Land. Taking over in any manual
mode is still possible.
Starting from 90% of the maximum flight time, a warning message will be sent
every 1 minute with the remaining time until automatic RTL.
every 1 minute with the remaining time until automatic Return.
Set to -1 to disable.
type: int32
@@ -685,7 +685,7 @@ parameters:
Action the system takes when a wind speed above the specified threshold is detected.
See COM_WIND_MAX to set the failsafe threshold.
If enabled, it is not possible to resume the mission or switch to any auto mode other than
RTL or Land if this threshold is exceeded. Taking over in any manual
Return or Land if this threshold is exceeded. Taking over in any manual
mode is still possible.
type: enum
values:
@@ -779,7 +779,7 @@ parameters:
short: Remaining flight time low failsafe
long: |-
Action the system takes when the remaining flight time is below
the estimated time it takes to reach the RTL destination.
the estimated time it takes to reach the return destination.
type: enum
values:
0: None
+1 -1
View File
@@ -629,7 +629,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
CHECK_FAILSAFE(status_flags, mission_failure, Action::RTL);
// If manual control loss and GCS connection loss are disabled and we lose both command links and the mission finished,
// trigger RTL to avoid losing the vehicle
// trigger Return to avoid losing the vehicle
if ((_param_com_rc_in_mode.get() == int32_t(RcInMode::DisableManualControl)
|| isFailsafeIgnored(state.user_intended_mode, _param_com_rcl_except.get()))
&& _param_nav_dll_act.get() == int32_t(gcs_connection_loss_failsafe_mode::Disabled)
@@ -49,7 +49,7 @@ enum class FailsafeMode : int32_t {
Disabled = 0,
Warning = 1, // arming allowed, in-flight warning
Error = 2, // arming blocked, in-flight warning
Return = 3, // arming blocked, in-flight RTL
Return = 3, // arming blocked, in-flight Return
Land = 4, // arming blocked, in-flight Land
};
@@ -121,7 +121,7 @@ TEST_F(FailsafeTest, General)
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::None);
// manual control lost -> Hold, then RTL
// manual control lost -> Hold, then Return
time += 10_ms;
failsafe_flags.manual_control_signal_lost = true;
updated_user_intented_mode = failsafe.update(time, state, false, stick_override_request, failsafe_flags);
@@ -139,14 +139,14 @@ TEST_F(FailsafeTest, General)
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::Descend);
// DL link regained -> RTL (manual control still lost)
// DL link regained -> Return (manual control still lost)
time += 10_ms;
failsafe_flags.gcs_connection_lost = false;
updated_user_intented_mode = failsafe.update(time, state, false, stick_override_request, failsafe_flags);
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::RTL);
// Manual control lost cleared -> keep RTL
// Manual control lost cleared -> keep Return
time += 10_ms;
failsafe_flags.manual_control_signal_lost = false;
updated_user_intented_mode = failsafe.update(time, state, false, stick_override_request, failsafe_flags);
@@ -232,7 +232,7 @@ TEST_F(FailsafeTest, TakeoverDenied)
uint8_t updated_user_intented_mode = failsafe.update(time, state, false, stick_override_request, failsafe_flags);
// Wind limit exceeded -> RTL w/o delay and denying takeover
// Wind limit exceeded -> Return w/o delay and denying takeover
time += 10_ms;
failsafe_flags.wind_limit_exceeded = true;
updated_user_intented_mode = failsafe.update(time, state, false, stick_override_request, failsafe_flags);
@@ -292,7 +292,7 @@ TEST_F(FailsafeTest, CanTakeoverDegradedFailsafe)
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::Hold);
// Delay over -> RTL
// Delay over -> Return
time += 5_s;
failsafe_flags.battery_low_remaining_time = true;
updated_user_intented_mode = failsafe.update(time, state, user_intended_mode_updated, false, failsafe_flags);
@@ -371,7 +371,7 @@ TEST_F(FailsafeTest, NoneActionDoesNotRestrictUserTakeover)
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::Hold);
// Delay over -> RTL
// Delay over -> Return
time += 5_s;
updated_user_intented_mode = failsafe.update(time, state, user_intended_mode_updated, false, failsafe_flags);
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
@@ -424,7 +424,7 @@ TEST_F(FailsafeTest, OrbitAfterFailsafeExplicitCommandAllowed)
uint8_t updated_user_intented_mode = failsafe.update(time, state, user_intended_mode_updated, false, failsafe_flags);
// Wind limit exceeded -> RTL
// Wind limit exceeded -> Return
time += 10_ms;
failsafe_flags.wind_limit_exceeded = true;
updated_user_intented_mode = failsafe.update(time, state, user_intended_mode_updated, false, failsafe_flags);
@@ -455,7 +455,7 @@ TEST_F(FailsafeTest, OrbitAutoresumeAfterFailsafeDowngradedToLoiter)
failsafe.update(time, state, false, false, failsafe_flags);
// Wind limit exceeded -> eventually RTL; Orbit is downgraded to Loiter at failsafe entry.
// Wind limit exceeded -> eventually Return; Orbit is downgraded to Loiter at failsafe entry.
// Simulate Commander feeding the returned mode back as user_intended_mode each cycle.
time += 10_ms;
failsafe_flags.wind_limit_exceeded = true;
@@ -640,7 +640,7 @@ TEST_F(FailsafeTest, SkipFailsafe)
ASSERT_EQ(updated_user_intented_mode, state.user_intended_mode);
ASSERT_EQ(failsafe.selectedAction(), FailsafeBase::Action::None);
// Manual control lost while in RTL -> stay in RTL and only warn
// Manual control lost while in Return -> stay in Return and only warn
failsafe_flags.manual_control_signal_lost = true;
updated_user_intented_mode = failsafe.update(time, state, false, false, failsafe_flags);
@@ -744,7 +744,7 @@ TEST_F(FailsafeTest, TrafficAvoidanceUnhealthyUsesTrafficAvoidActParam)
param_set(param_handle(px4::params::COM_TRAFF_AVOID), &com_traff_avoid);
// Disable the generic user-takeover hold delay (set to 5s in SetUp()) so a newly
// triggered RTL/Land is selected immediately instead of Hold-then-RTL/Land.
// triggered Return/Land is selected immediately instead of Hold-then-Return/Land.
float com_fail_act_t = 0.f;
param_set(param_handle(px4::params::COM_FAIL_ACT_T), &com_fail_act_t);
@@ -797,7 +797,7 @@ TEST_F(FailsafeTest, FallbackStabilizedRequiresManualControl)
failsafe_flags.local_altitude_invalid = true;
time += 10_ms;
failsafe.update(time, state, false, false, failsafe_flags);
// checkModeFallback returns RTL from NAV_RCL_ACT. The framework then cascades RTL -> Land -> Descend
// checkModeFallback returns Return from NAV_RCL_ACT. The framework then cascades Return -> Land -> Descend
// because local altitude loss blocks both AUTO_RTL and AUTO_LAND.
EXPECT_EQ(failsafe.selectedAction(), FailsafeBase::Action::Descend);
}
+3 -3
View File
@@ -625,7 +625,7 @@ void FailsafeBase::getSelectedAction(const State &state, const failsafe_flags_s
}
// UX improvement (this is optional for safety): change failsafe to a warning in certain situations.
// If already landing, do not go into RTL
// If already landing, do not go into Return
if (returned_state.updated_user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND) {
if ((selected_action == Action::RTL || returned_state.delayed_action == Action::RTL)
&& modeCanRun(status_flags, vehicle_status_s::NAVIGATION_STATE_AUTO_LAND)) {
@@ -634,7 +634,7 @@ void FailsafeBase::getSelectedAction(const State &state, const failsafe_flags_s
}
}
// If already in RTL, do not go into RTL again (would cause a Hold delay first, then re-start RTL)
// If already in Return, do not go into Return again (would cause a Hold delay first, then re-start Return)
if (returned_state.updated_user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL) {
if ((selected_action == Action::RTL || returned_state.delayed_action == Action::RTL)
&& modeCanRun(status_flags, vehicle_status_s::NAVIGATION_STATE_AUTO_RTL)) {
@@ -643,7 +643,7 @@ void FailsafeBase::getSelectedAction(const State &state, const failsafe_flags_s
}
}
// If already precision landing, do not go into RTL or Land
// If already precision landing, do not go into Return or Land
if (returned_state.updated_user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_PRECLAND) {
if ((selected_action == Action::RTL || selected_action == Action::Land ||
returned_state.delayed_action == Action::RTL || returned_state.delayed_action == Action::Land)
+1 -1
View File
@@ -103,7 +103,7 @@ public:
case Action::Hold: return "Hold";
case Action::RTL: return "RTL";
case Action::RTL: return "Return";
case Action::Land: return "Land";
@@ -545,7 +545,7 @@ bool FlightTaskAuto::_evaluatePositionSetpointTriplet()
const float triplet_yaw = position_setpoint_triplet.current.yaw;
if (PX4_ISFINITE(triplet_yaw)) {
// End of RTL changes yaw once, precision land can change it all the time
// End of Return changes yaw once, precision land can change it all the time
const bool yaw_changed = !PX4_ISFINITE(_triplet_yaw)
|| fabsf(wrap_pi(triplet_yaw - _triplet_yaw)) > 1e-4f;
@@ -63,7 +63,7 @@ bool RoverLandDetector::_get_landed_state()
}
// If we are in RTL and have reached the last valid waypoint then we are landed.
// If we are in Return and have reached the last valid waypoint then we are landed.
if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL) {
vehicle_global_position_s vehicle_global_position{};
_vehicle_global_position_sub.copy(&vehicle_global_position);
@@ -49,7 +49,7 @@ parameters:
MPC_XY_CRUISE:
description:
short: Default horizontal velocity in autonomous modes
long: e.g. in Missions, RTL, Goto if the waypoint does not specify differently
long: e.g. in Missions, Return, Goto if the waypoint does not specify differently
type: float
default: 5.0
unit: m/s
@@ -9,7 +9,7 @@ parameters:
Bitmask to enable pilot override of heading and position during auto modes.
Bit 0 - Yaw nudging: yaw stick rotates the heading in all auto types
(takeoff, mission, RTL, hold, landing). The new heading is held until a
(takeoff, mission, Return, hold, landing). The new heading is held until a
mode switch resets it.
Bit 1 - Land nudging: during autonomous landing the pitch/roll sticks move
+4 -4
View File
@@ -39,18 +39,18 @@ menuconfig NAVIGATOR_ADSB_F3442
compliance.
menuconfig NAVIGATOR_GEOFENCE_AVOIDANCE
bool "Include geofence avoidance path planning for RTL"
bool "Include geofence avoidance path planning for Return mode"
default y
depends on MODULES_NAVIGATOR
---help---
Add support for RTL mode to route around geofences.
Add support for Return mode to route around geofences.
config NAVIGATOR_GEOFENCE_MAX_NODES
int "Max graph nodes for geofence RTL planner"
int "Max graph nodes for geofence Return planner"
default 100
depends on NAVIGATOR_GEOFENCE_AVOIDANCE
---help---
Max number of geofence vertices which the RTL planner can use.
Max number of geofence vertices which the Return planner can use.
Replanning time (on geofence / safety margin change) is cubic, RAM usage quadratic in this number.
menuconfig NAVIGATOR_ADSB_FAKE_TRAFFIC
@@ -508,9 +508,9 @@ bool FeasibilityChecker::checkLandPatternValidity(mission_item_s &mission_item,
} else if (mission_item.nav_cmd == NAV_CMD_RETURN_TO_LAUNCH) {
if (land_start_found && _do_land_start_index < current_index) {
mavlink_log_critical(_mavlink_log_pub,
"Mission rejected: land start item before RTL item not possible.\t");
"Mission rejected: land start item before Return item is not possible.\t");
events::send(events::ID("navigator_mis_land_before_rtl"), {events::Log::Error, events::LogInternal::Info},
"Mission rejected: land start item before RTL item is not possible");
"Mission rejected: land start item before Return item is not possible");
return false;
}
}
@@ -387,7 +387,7 @@ TEST_F(FeasibilityCheckerTest, fixed_wing_landing)
checker.processNextItem(mission_item, 0, 2);
ASSERT_EQ(checker.someCheckFailed(), true);
// cannot have land start before RTL
// cannot have land start before Return
checker.reset();
checker.publishVehicleType(vehicle_status_s::VEHICLE_TYPE_FIXED_WING);
mission_item.nav_cmd = NAV_CMD_DO_LAND_START;
@@ -235,7 +235,7 @@ void GeofenceAvoidancePlanner::updateDestination(const matrix::Vector2d &destina
_destination_healthy = _polygons.setDestination(dest_local);
if (!_destination_healthy) {
// Keep the (breaching) destination so RTL can still fall back to a straight
// Keep the (breaching) destination so Return can still fall back to a straight
// line; just flag it for the user-facing warning.
_status = Status::DestinationBreachesGeofence;
return;
@@ -284,10 +284,10 @@ int GeofenceAvoidancePlanner::updateStartAndFillPath(matrix::Vector2d start)
{
// Populate _path so consumers can blindly follow it:
// - append the saved valid start (anchor) if the current `start` is outside the fence
// - then fill the RTL return path by walking the DAG produced by the dijkstra solver
// - then fill the return path by walking the DAG produced by the dijkstra solver
// Could also avoid storing _path entirely and build it ad-hoc from _next_node_buffer.
// Pro: less state, easier implementation of replanning on fence change during RTL
// Pro: less state, easier implementation of replanning on fence change during Return
// Con: introduces a lot of new edge cases (safe anchoring / replanning conflict somewhat)
int path_index = 0; // points to the first empty slot, increment after writing
@@ -35,7 +35,7 @@
/**
* @file geofence_avoidance_planner.h
* Ensures vehicle waypoints during RTL and autonomous modes remain
* Ensures vehicle waypoints during Return and autonomous modes remain
* inside inclusion fences and outside exclusion fences.
*/
+1 -1
View File
@@ -35,7 +35,7 @@
*
* Mission mode class that handles everything related to executing a mission.
* This class gets included as one of the 'modes' in the Navigator, along with other
* modes like RTL, Loiter, etc.
* modes like Return, Loiter, etc.
*
* @author Julian Oes <julian@oes.ch>
* @author Thomas Gubler <thomasgubler@gmail.com>
+1 -1
View File
@@ -380,7 +380,7 @@ protected:
* @brief Traversal mode used by this navigation mode when walking position items.
*
* Mission mode follows active DO_JUMP control flow by default. Derived modes such as
* mission-based RTL can override this to walk the geometric mission path instead.
* mission-based Return can override this to walk the geometric mission path instead.
* Traversal helpers use this policy unless the caller explicitly overrides it.
*/
virtual MissionTraversalType traversalType() const
+1 -1
View File
@@ -34,7 +34,7 @@
* @file mission_block.h
*
* Base class for Mission class and special flight modes like
* RTL, Land, Loiter, Takeoff, Geofence, etc.
* Return, Land, Loiter, Takeoff, Geofence, etc.
*
* @author Julian Oes <julian@oes.ch>
*/
+1 -1
View File
@@ -223,7 +223,7 @@ struct mission_fence_point_s {
/**
* @brief Position and yaw setpoint struct.
* Used in RTL state machine.
* Used in Return state machine.
*
*/
struct PositionYawSetpoint {
+6 -6
View File
@@ -248,7 +248,7 @@ public:
*
* True only if the setpoint is a valid ORBIT-pattern loiter and the vehicle is within
* one acceptance radius of the loiter circle. Used to decide whether a Hold/pause,
* geofence loiter or RTL climb should continue the existing orbit instead of
* geofence loiter or return climb should continue the existing orbit instead of
* re-centering it on the current position.
*
* @param sp the loiter setpoint to test against
@@ -321,7 +321,7 @@ public:
bool get_mission_start_land_available() { return _mission.get_land_start_available(); }
// RTL
// Return
bool in_rtl_state() const { return _vstatus.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL; }
bool abort_landing();
@@ -397,7 +397,7 @@ private:
orb_advert_t _mavlink_log_pub{nullptr}; /**< the uORB advert to send messages over mavlink */
// Subscriptions
home_position_s _home_pos{}; /**< home position for RTL */
home_position_s _home_pos{}; /**< home position for Return */
mission_result_s _mission_result{};
vehicle_global_position_s _global_pos{}; /**< global vehicle position */
sensor_gps_s _gps_pos{}; /**< gps position */
@@ -421,7 +421,7 @@ private:
bool _geofence_reposition_sent{false}; /**< true if a reposition triplet has been sent for the current breach */
hrt_abstime _time_loitering_after_gf_breach{0}; /**< latches breach state while loitering, prevents reposition center walking */
#if CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE
GeofenceAvoidancePlanner _geofence_avoidance_planner; /**< RTL/auto path planner that routes around fences (visibility graph + Dijkstra) */
GeofenceAvoidancePlanner _geofence_avoidance_planner; /**< Return path planner that routes around fences (visibility graph + Dijkstra) */
float _last_geofence_avoidance_margin{NAN}; /**< margin used for the last polygon rebuild; rebuild when it changes */
#endif // CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE
@@ -446,7 +446,7 @@ private:
#if defined(CONFIG_MODULES_VISION_TARGET_ESTIMATOR) && CONFIG_MODULES_VISION_TARGET_ESTIMATOR
PrecTakeoff _prec_takeoff; /**< keeps vertical takeoffs over the landing target */
#endif // CONFIG_MODULES_VISION_TARGET_ESTIMATOR
RTL _rtl; /**< class that handles RTL */
RTL _rtl; /**< class that handles Return */
Course _course; /**< class that handles course */
#if CONFIG_NAVIGATOR_ADSB
DetectAndAvoid _detect_and_avoid;
@@ -506,7 +506,7 @@ private:
(ParamInt<px4::params::NAV_FORCE_VT>) _param_nav_force_vt, /**< acceptance radius for multicopter alt */
(ParamFloat<px4::params::NAV_MIN_LTR_ALT>) _param_min_ltr_alt, /**< minimum altitude in Loiter mode*/
(ParamFloat<px4::params::NAV_MIN_GND_DIST>)
_param_nav_min_gnd_dist, /**< minimum distance to ground (Mission and RTL)*/
_param_nav_min_gnd_dist, /**< minimum distance to ground (Mission and Return)*/
// non-navigator parameters: Mission (MIS_*)
(ParamFloat<px4::params::MIS_TAKEOFF_ALT>) _param_mis_takeoff_alt,
+9 -8
View File
@@ -1139,10 +1139,11 @@ void Navigator::run()
case PlannerStatus::OutOfRange:
case PlannerStatus::Degenerate:
case PlannerStatus::DijkstraFailed:
mavlink_log_warning(&_mavlink_log_pub, "Geofence data invalid (code %d), RTL will fly directly\t",
mavlink_log_warning(&_mavlink_log_pub, "Geofence data invalid (code %d), Return will fly directly\t",
(int) planner_status);
events::send<uint8_t>(events::ID("rtl_avoidance_build_failed"), {events::Log::Warning, events::LogInternal::Info},
"Geofence data invalid (code {1}), RTL will fly directly", (uint8_t)planner_status);
"Geofence data invalid (code {1}), Return will fly directly",
(uint8_t)planner_status);
break;
default:
@@ -1156,21 +1157,21 @@ void Navigator::run()
const PlannerStatus planner_status = _geofence_avoidance_planner.status();
if (planner_status == PlannerStatus::DestinationInvalid) {
mavlink_log_warning(&_mavlink_log_pub, "RTL destination invalid, not updating\t");
mavlink_log_warning(&_mavlink_log_pub, "Return destination invalid, not updating\t");
events::send(
events::ID("rtl_destination_invalid"),
events::LogLevels(events::Log::Warning, events::LogInternal::Info),
"RTL destination invalid, not updating"
"Return destination invalid, not updating"
);
_geofence_avoidance_planner.resetStatus();
}
if (planner_status == PlannerStatus::DestinationBreachesGeofence) {
mavlink_log_warning(&_mavlink_log_pub, "RTL destination breaches geofence, will fly directly\t");
mavlink_log_warning(&_mavlink_log_pub, "Return destination breaches geofence, will fly directly\t");
events::send(
events::ID("rtl_destination_breaches"),
events::LogLevels(events::Log::Warning, events::LogInternal::Info),
"RTL destination breaches geofence, will fly directly"
"Return destination breaches geofence, will fly directly"
);
_geofence_avoidance_planner.resetStatus();
}
@@ -1739,7 +1740,7 @@ void Navigator::publish_vehicle_command(vehicle_command_s &vehicle_command)
void Navigator::publish_distance_sensor_mode_request()
{
// Send request to enable distance sensor when in the landing phase of a mission or RTL
// Send request to enable distance sensor when in the landing phase of a mission or Return
if (((_navigation_mode == &_rtl) && _rtl.isLanding()) || ((_navigation_mode == &_mission) && _mission.isLanding())) {
if (_distance_sensor_mode_change_request_pub.get().request_on_off !=
@@ -1934,7 +1935,7 @@ int Navigator::print_usage(const char *reason)
R"DESCR_STR(
### Description
Module that is responsible for autonomous flight modes. This includes missions (read from dataman),
takeoff and RTL.
takeoff and Return.
It is also responsible for geofence violation checking.
### Implementation
+2 -2
View File
@@ -129,9 +129,9 @@ parameters:
increment: 0.5
NAV_MIN_GND_DIST:
description:
short: Minimum height above ground during Mission and RTL
short: Minimum height above ground during Mission and Return
long: |-
Minimum height above ground the vehicle is allowed to descend to during Mission and RTL,
Minimum height above ground the vehicle is allowed to descend to during Mission and Return,
excluding landing commands.
Requires a distance sensor to be set up.
Note: only prevents the vehicle from descending further, but does not force it to climb.
+3 -3
View File
@@ -33,7 +33,7 @@
/**
* @file rtl.cpp
*
* Helper class to access RTL
* Helper class to access Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -384,7 +384,7 @@ void RTL::setRtlTypeAndDestination()
#if CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE
// Update destination of geofence avoidance planner. Depending on the
// RTL type it is the position of the loiter or mission landing.
// Return type it is the position of the loiter or mission landing.
GeofenceAvoidancePlanner &planner = _navigator->get_geofence_avoidance_planner();
matrix::Vector2d planner_destination{(double)NAN, (double)NAN};
@@ -663,7 +663,7 @@ void RTL::initRtlMissionType(RtlType new_rtl_type, float rtl_alt)
_rtl_mission_type_handle->initialize();
}
// RTL type is either direct or mission land have to set it later.
// Return type is either direct or mission land have to set it later.
break;
case RtlType::RTL_MISSION_FAST:
+5 -5
View File
@@ -33,7 +33,7 @@
/**
* @file rtl.h
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -117,19 +117,19 @@ private:
void setRtlTypeAndDestination();
/**
* @brief Publish the remaining time estimate to go to the RTL landing point.
* @brief Publish the remaining time estimate to go to the Return landing point.
*
*/
void publishRemainingTimeEstimate();
/**
* @brief Find RTL destination.
* @brief Find return destination.
*
*/
void findRtlDestination(DestinationType &destination_type, PositionYawSetpoint &destination, uint8_t &safe_point_index);
/**
* @brief Find RTL destination if only safe points are considered
* @brief Find return destination if only safe points are considered
*
*/
PositionYawSetpoint findClosestSafePoint(float min_dist, uint8_t &safe_point_index);
@@ -150,7 +150,7 @@ private:
float computeReturnAltitude(const PositionYawSetpoint &rtl_position) const;
/**
* @brief initialize RTL mission type
* @brief initialize Return mission type
*
*/
void initRtlMissionType(RtlType new_rtl_type, float rtl_alt);
+1 -1
View File
@@ -33,7 +33,7 @@
/**
* @file rtl_base.h
*
* Helper class for RTL modes using the mission
* Helper class for Return modes using the mission
*
*/
+16 -16
View File
@@ -33,7 +33,7 @@
/**
* @file rtl_direct.cpp
*
* Helper class to access RTL
* Helper class to access Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -86,28 +86,28 @@ void RtlDirect::on_activation()
_setpoint_on_activation = _navigator->get_position_setpoint_triplet()->current;
_navigator->reset_triplets();
// reset cruising speed and throttle to default for RTL
// reset cruising speed and throttle to default for Return
_navigator->reset_cruising_speed();
_navigator->set_cruising_throttle();
set_rtl_item();
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: start return at %d m (%d m above destination)\t",
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Return: start return at %d m (%d m above destination)\t",
(int)ceilf(_rtl_alt), (int)ceilf(_rtl_alt - _destination.alt));
events::send<int32_t, int32_t>(events::ID("vrtl_return_at"), events::Log::Info,
"RTL: start return at {1m_v} ({2m_v} above destination)",
"Return: start return at {1m_v} ({2m_v} above destination)",
(int32_t)ceilf(_rtl_alt), (int32_t)ceilf(_rtl_alt - _destination.alt));
#if CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE
if (geofenceAvoidanceActive()) {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: avoiding geofence\t");
events::send(events::ID("rtl_avoiding_geofence"), events::Log::Info, "RTL: avoiding geofence");
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Return: avoiding geofence\t");
events::send(events::ID("rtl_avoiding_geofence"), events::Log::Info, "Return: avoiding geofence");
} else if (_navigator->get_geofence_avoidance_planner().needsStraightLineFallback()) {
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "RTL: no geofence avoidance path; flying directly\t");
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "Return: no geofence avoidance path; flying directly\t");
events::send(events::ID("rtl_avoidance_runtime_fallback"), {events::Log::Critical, events::LogInternal::Error},
"RTL: no geofence avoidance path; flying directly");
"Return: no geofence avoidance path; flying directly");
}
#endif // CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE
@@ -127,7 +127,7 @@ void RtlDirect::on_active()
if (_rtl_state != RTLState::IDLE && _rtl_state != RTLState::LAND) {
//check for terrain collision and update altitude if needed
// note: it may trigger multiple times during a RTL, as every time the altitude set is reset
// note: it may trigger multiple times during a Return, as every time the altitude set is reset
updateAltToAvoidTerrainCollisionAndRepublishTriplet(_mission_item);
}
@@ -261,7 +261,7 @@ void RtlDirect::set_rtl_item()
double loiter_center_lon = _global_pos_sub.get().lon;
float loiter_radius = _navigator->get_default_loiter_rad();
// If the vehicle was already established on a loiter when RTL was engaged (e.g. from Hold),
// If the vehicle was already established on a loiter when Return was engaged (e.g. from Hold),
// keep that loiter's center and radius while climbing instead of re-centering the circle on
// the current position.
if (_navigator->is_established_on_loiter(_setpoint_on_activation)) {
@@ -405,8 +405,8 @@ void RtlDirect::set_rtl_item()
setLoiterHoldMissionItem(_mission_item, pos_yaw_sp, _param_rtl_land_delay.get(), _land_approach.loiter_radius_m);
if (_param_rtl_land_delay.get() < -FLT_EPSILON) {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: completed, loitering\t");
events::send(events::ID("rtl_completed_loiter"), events::Log::Info, "RTL: completed, loitering");
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Return: completed, loitering\t");
events::send(events::ID("rtl_completed_loiter"), events::Log::Info, "Return: completed, loitering");
} else {
/* Set the altitude tracking to best effort but not strictly enforce it */
@@ -471,8 +471,8 @@ void RtlDirect::set_rtl_item()
startPrecLand(_mission_item.land_precision);
}
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: land at destination\t");
events::send(events::ID("rtl_land_at_destination"), events::Log::Info, "RTL: land at destination");
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Return: land at destination\t");
events::send(events::ID("rtl_land_at_destination"), events::Log::Info, "Return: land at destination");
break;
}
@@ -513,7 +513,7 @@ RtlDirect::RTLState RtlDirect::getActivationState()
activation_state = RTLState::LAND;
} else if (_land_detected_sub.get().landed) {
// For safety reasons don't go into RTL if landed.
// For safety reasons don't go into Return if landed.
activation_state = RTLState::IDLE;
} else if ((_global_pos_sub.get().alt < _rtl_alt) || _enforce_rtl_alt) {
@@ -545,7 +545,7 @@ rtl_time_estimate_s RtlDirect::calc_rtl_time_estimate()
start_state_for_estimate = getActivationState();
}
// Calculate RTL time estimate only when there is a valid destination
// Calculate return time estimate only when there is a valid destination
// TODO: Also check if vehicle position is valid
if (PX4_ISFINITE(_destination.lat) && PX4_ISFINITE(_destination.lon) && PX4_ISFINITE(_destination.alt)) {
+9 -9
View File
@@ -33,7 +33,7 @@
/**
* @file rtl_direct.h
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -81,14 +81,14 @@ public:
/**
* @brief on activation.
* Initialize the return to launch calculations.
* Initialize the return calculations.
*
*/
void on_activation() override;
/**
* @brief on active
* Update the return to launch calculation and set new setpoints for controller if necessary.
* Update the return calculation and set new setpoints for controller if necessary.
*
*/
void on_active() override;
@@ -101,9 +101,9 @@ public:
void on_inactive() override;
/**
* @brief Calculate the estimated time needed to return to launch.
* @brief Calculate the estimated time needed to return.
*
* @return estimated time to return to launch.
* @return estimated return time.
*/
rtl_time_estimate_s calc_rtl_time_estimate();
@@ -116,7 +116,7 @@ public:
private:
/**
* @brief Return to launch state machine.
* @brief Return state machine.
*
*/
enum class RTLState {
@@ -134,13 +134,13 @@ private:
private:
/**
* @brief Update the RTL state machine.
* @brief Update the Return state machine.
*
*/
void _updateRtlState();
/**
* @brief Set the return to launch control setpoint.
* @brief Set the return control setpoint.
*
*/
void set_rtl_item();
@@ -177,7 +177,7 @@ private:
position_setpoint_s _setpoint_on_activation{}; ///< snapshot of the current setpoint taken before reset on activation, used to continue an established loiter through the climb
RtlTimeEstimator _rtl_time_estimator;
PositionYawSetpoint _destination{(double)NAN, (double)NAN, NAN, NAN}; ///< the RTL position to fly to
PositionYawSetpoint _destination{(double)NAN, (double)NAN, NAN, NAN}; ///< the return position to fly to
loiter_point_s _land_approach;
float _rtl_alt{0.0f}; ///< AMSL altitude at which the vehicle should transit to the destination
@@ -33,7 +33,7 @@
/**
* @file rtl_direct_mission_land.cpp
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -155,7 +155,7 @@ void RtlDirectMissionLand::setActiveMissionItems()
_mission_item.lon = _global_pos_sub.get().lon;
_mission_item.loiter_radius = _navigator->get_default_loiter_rad();
// If the vehicle was already established on a loiter when RTL was engaged (e.g. from Hold),
// If the vehicle was already established on a loiter when Return was engaged (e.g. from Hold),
// keep that loiter's center and radius while climbing instead of re-centering the circle on
// the current position. The setpoint was snapshotted on activation before the triplet reset.
if (_setpoint_on_activation.valid
@@ -182,10 +182,10 @@ void RtlDirectMissionLand::setActiveMissionItems()
_mission_item.autocontinue = true;
_mission_item.origin = ORIGIN_ONBOARD;
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL Mission land: climb to %d m\t",
mavlink_log_info(_navigator->get_mavlink_log_pub(), "Return mission landing: climb to %d m\t",
(int)ceilf(_rtl_alt));
events::send<int32_t>(events::ID("rtl_mission_land_climb"), events::Log::Info,
"RTL Mission Land: climb to {1m_v}",
"Return mission landing: climb to {1m_v}",
(int32_t)ceilf(_rtl_alt));
_needs_climbing = false;
@@ -33,7 +33,7 @@
/**
* @file rtl_direct_mission_land.h
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
+1 -1
View File
@@ -33,7 +33,7 @@
/**
* @file rtl_mission_fast.cpp
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
+1 -1
View File
@@ -33,7 +33,7 @@
/**
* @file rtl_mission_fast.h
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -33,7 +33,7 @@
/**
* @file rtl_mission_fast_reverse.cpp
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
@@ -33,7 +33,7 @@
/**
* @file rtl_mission_fast_reverse.h
*
* Helper class for RTL
* Helper class for Return
*
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
+11 -11
View File
@@ -42,7 +42,7 @@ parameters:
increment: 0.5
RTL_MIN_DIST:
description:
short: Min distance for RTL cone altitude calculation
short: Min distance for return cone altitude calculation
long: |-
Horizontal radius from return point within which special rules for return mode apply
@@ -103,10 +103,10 @@ parameters:
max: 90
RTL_PLD_MD:
description:
short: RTL precision land mode
short: Return precision land mode
long: |-
Use precision landing when doing an RTL landing phase.
This setting does not apply for RTL destinations planned as part of a mission.
Use precision landing during the landing phase of Return mode.
This setting does not apply for return destinations planned as part of a mission.
type: enum
values:
0: No precision landing
@@ -115,7 +115,7 @@ parameters:
default: 0
RTL_LOITER_RAD:
description:
short: Loiter radius for rtl descend
short: Loiter radius for return descent
long: Set the radius for loitering to a safe altitude for VTOL transition.
type: float
default: 80.0
@@ -123,13 +123,13 @@ parameters:
min: 25
decimal: 1
increment: 0.5
- group: Return To Land
- group: Return Mode
definitions:
RTL_TIME_FACTOR:
description:
short: RTL time estimate safety margin factor
short: Return time estimate safety margin factor
long: |-
Safety factor that is used to scale the actual RTL time estimate.
Safety factor that is used to scale the actual return time estimate.
Time with margin = RTL_TIME_FACTOR * time + RTL_TIME_MARGIN
type: float
default: 1.1
@@ -139,7 +139,7 @@ parameters:
increment: 0.1
RTL_TIME_MARGIN:
description:
short: RTL time estimate safety margin offset
short: Return time estimate safety margin offset
long: |-
Margin that is added to the time estimate, after it has already been scaled
Time with margin = RTL_TIME_FACTOR * time + RTL_TIME_MARGIN
@@ -152,9 +152,9 @@ parameters:
increment: 1
RTL_APPR_FORCE:
description:
short: RTL force approach landing
short: Force VTOL approach landing on Return
long: |-
Only consider home/rally RTL points that have a VTOL approach loiter.
Only consider home/rally points as return destinations if they have a VTOL approach loiter.
A VTOL approach loiter is a MAV_CMD_NAV_LOITER_TO_ALT item with finite position and altitude.
type: boolean
default: 0
@@ -819,7 +819,7 @@ TEST_F(MissionBaseTraversalTest, GetPreviousPositionItemsFollowsActiveDoJump)
EXPECT_EQ(previous_items[0], 0);
}
// WHY: Mission-based RTL configures position traversal to skip DO_JUMP loops consistently.
// WHY: Mission-based Return configures position traversal to skip DO_JUMP loops consistently.
// WHAT: [DO_JUMP->2, WP1, WP2] from current_seq=-1 lands on idx 1 with the configured traversal.
TEST_F(IgnoreDoJumpMissionBaseTraversalTest, ConfiguredTraversalSkipsDoJumpForGoToNextPositionItem)
{
@@ -839,7 +839,7 @@ TEST_F(IgnoreDoJumpMissionBaseTraversalTest, ConfiguredTraversalSkipsDoJumpForGo
EXPECT_EQ(mission_base.currentSequence(), 1);
}
// WHY: Reverse mission-path RTL must skip DO_JUMP loops for backward progression too.
// WHY: Reverse mission-path Return must skip DO_JUMP loops for backward progression too.
// WHAT: [WP0, WP1, DO_JUMP->0, WP3] from current_seq=3 lands on idx 1 with the configured traversal.
TEST_F(IgnoreDoJumpMissionBaseTraversalTest, ConfiguredTraversalSkipsDoJumpForGoToPreviousPositionItem)
{
+1 -1
View File
@@ -1547,7 +1547,7 @@ parameters:
max: 18
RC_RETURN_TH:
description:
short: Threshold for selecting return to launch mode
short: Threshold for selecting Return mode
long: |-
0-1 indicate where in the full channel range the threshold sits
0 : min
@@ -135,7 +135,7 @@ bool PrecLandTask::updateMissionSetpoint()
navigator_mission_item_s navigator_mission_item{};
// The live triplet is rewritten by precland once the task starts, while navigator_mission_item
// keeps publishing the logical land item selected by mission or RTL. Prefer that stable source
// keeps publishing the logical land item selected by mission or Return. Prefer that stable source
// and keep the triplet as a fallback for paths that do not publish navigator mission items.
if (_navigator_mission_item_sub.copy(&navigator_mission_item) && cacheMissionSetpoint(navigator_mission_item)) {
return true;
@@ -110,7 +110,7 @@ void VtolAttitudeControl::vehicle_status_poll()
{
_vehicle_status_sub.copy(&_vehicle_status);
// abort front transition when RTL is triggered
// abort front transition when Return is triggered
if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL
&& _nav_state_prev != vehicle_status_s::NAVIGATION_STATE_AUTO_RTL && _vtol_type->get_mode() == mode::TRANSITION_TO_FW) {
_transition_command = vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC;
@@ -157,7 +157,7 @@ void VtolAttitudeControl::vehicle_cmd_poll()
const int transition_command_param1 = static_cast<int>(lround(vehicle_command.param1));
// deny transition from MC to FW in Takeoff, Land, RTL and Orbit
// deny transition from MC to FW in Takeoff, Land, Return and Orbit
if (transition_command_param1 == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW &&
(_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF
|| _vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND
+1 -1
View File
@@ -206,7 +206,7 @@ void AutopilotTesterRtl::load_qgc_mission_and_geofence_here(const std::string &p
const int32_t offset_y = data.mission_items[0].y - static_cast<int32_t>(1e7 * pos.longitude_deg);
// Only items in a global position frame carry lat/lon in x/y. For MAV_FRAME_MISSION
// items (e.g. RTL, DO_* commands) x/y are generic params p5/p6, so offsetting them
// items (e.g. Return, DO_* commands) x/y are generic params p5/p6, so offsetting them
// corrupts the params and the item is rejected by the mission-param validation.
auto is_global_position_frame = [](uint32_t frame) {
switch (frame) {
@@ -84,7 +84,7 @@ TEST_CASE("Control Allocation - Remove one motor", "[controlallocation]")
tester.stop_checking_altitude();
tester.ensure_motors_stopped(1u << (motor_instance - 1), num_motors); // just to be sure
// RTL
// Return
tester.execute_rtl();
std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(180);
tester.wait_until_disarmed(until_disarmed_timeout);
@@ -138,8 +138,8 @@ TEST_CASE("Control Allocation - Remove two motors", "[controlallocation]")
tester.execute_mission();
tester.stop_checking_altitude();
// RTL with two motors out won't work because navigator will wait forever until
// the yaw setpoint is reached during RTL, and it won't land.
// Return with two motors out won't work because navigator will wait forever until
// the yaw setpoint is reached during Return, and it won't land.
tester.land();
std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(180);
tester.wait_until_disarmed(until_disarmed_timeout);
@@ -210,7 +210,7 @@ TEST_CASE("Control Allocation - Return home on motor failure", "[controlallocati
tester.set_param_fd_act_en(true); // Enable motor failure detection
tester.set_param_mc_airmode(1); // Enable airmode for control allocation with motor failure
tester.set_param_ca_failure_mode(1); // Enable control allocation handling of failed motor
tester.set_param_com_act_fail_act(3); // RTL on motor failure
tester.set_param_com_act_fail_act(3); // Return on motor failure
tester.set_takeoff_altitude(flight_altitude);
tester.store_home();
tester.sleep_for(std::chrono::seconds(1)); // Necessary for the takeoff altitude to be applied properly
@@ -222,7 +222,7 @@ TEST_CASE("Control Allocation - Return home on motor failure", "[controlallocati
tester.wait_until_altitude(flight_altitude, std::chrono::seconds(30));
tester.wait_until_speed_lower_than(hover_speed_tolerance, std::chrono::seconds(30));
// TODO: Minor improvement, fly forward for a little bit before triggering motor failure to distinguish "RTL" and "Land only"
// TODO: Minor improvement, fly forward for a little bit before triggering motor failure to distinguish "Return" and "Land only"
// Motor failure mid-air
const int motor_instance = 1;
@@ -230,7 +230,7 @@ TEST_CASE("Control Allocation - Return home on motor failure", "[controlallocati
mavsdk::Failure::Result::Success);
tester.sleep_for(std::chrono::seconds(1));
// Wait for RTL to trigger automatically
// Wait for Return to trigger automatically
std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(180);
tester.wait_until_disarmed(until_disarmed_timeout);
tester.check_home_within(5.f);
@@ -48,7 +48,7 @@ TEST_CASE("Takeoff and Land", "[multicopter][vtol]")
tester.wait_until_disarmed(until_disarmed_timeout);
}
TEST_CASE("Fly square Multicopter Missions including RTL", "[multicopter]")
TEST_CASE("Fly square Multicopter Missions including Return", "[multicopter]")
{
AutopilotTester tester;
tester.connect(connection_url);
@@ -63,7 +63,7 @@ TEST_CASE("Fly square Multicopter Missions including RTL", "[multicopter]")
tester.wait_until_disarmed(until_disarmed_timeout);
}
TEST_CASE("Fly square Multicopter Missions with manual RTL", "[multicopter]")
TEST_CASE("Fly square Multicopter Missions with manual Return", "[multicopter]")
{
AutopilotTester tester;
tester.connect(connection_url);
+4 -4
View File
@@ -35,10 +35,10 @@
// TODO: Add test cases for these scenarios:
// - "RTL type 6 home within reach with no rally points", "[multicopter]"
// - "RTL type 6 home within reach with rally points and home is the closest", "[multicopter]"
// - "RTL type 6 home within reach with rally points and home is not the closest", "[multicopter]"
// - "RTL type 6 home out of reach with rally points and at least one rally point within reach", "[multicopter]"
// - "Return type 6 home within reach with no rally points", "[multicopter]"
// - "Return type 6 home within reach with rally points and home is the closest", "[multicopter]"
// - "Return type 6 home within reach with rally points and home is not the closest", "[multicopter]"
// - "Return type 6 home out of reach with rally points and at least one rally point within reach", "[multicopter]"
TEST_CASE("RTL_TYPE=6 time_remaining_s NaN with no rally points", "[multicopter]")
{
@@ -40,19 +40,19 @@
//
// Pass: the vehicle returns to home and disarms within the timeout AND its ground-truth position
// never violates any of the loaded geofences during the entire armed flight.
TEST_CASE("RTL direct with geofence obstruction", "[multicopter]")
TEST_CASE("Return direct with geofence obstruction", "[multicopter]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
tester.wait_until_ready();
tester.store_home();
// Mission outbound leg ends at a point where straight-line RTL crosses the exclusion polygon
// Mission outbound leg ends at a point where straight-line Return crosses the exclusion polygon
// in the .plan; the planner must detour around it.
tester.load_qgc_mission_and_geofence_here("test/mavsdk_tests/multicopter_mission_geofence_avoid.plan");
// Warning only: the planner still picks up the fence (it reads polygon geometry independent of
// GF_ACTION), but a hypothetical breach won't trigger Hold/RTL failsafe and mask test failure.
// GF_ACTION), but a hypothetical breach won't trigger Hold/Return failsafe and mask test failure.
tester.set_param_int("GF_ACTION", 1);
tester.set_rtl_type(0); // RTL_DIRECT
@@ -33,9 +33,9 @@
// Integration tests for fixed-wing loiter / reposition / Hold interaction.
//
// These exercise how a Hold (MAV_CMD_DO_REPOSITION pause) and RTL interact with an already
// These exercise how a Hold (MAV_CMD_DO_REPOSITION pause) and Return interact with an already
// established loiter:
// 1. RTL while established on a non-default-radius loiter climbs on that same loiter.
// 1. Return while established on a non-default-radius loiter climbs on that same loiter.
// 2. A Hold (all-NaN reposition) while established keeps the loiter but holds the current altitude.
// 3. A Hold while still transiting toward a loiter creates a fresh loiter at the current position.
// 4. A Hold while flying a figure-eight reverts to a plain circular loiter (patterns are not mixed).
@@ -50,8 +50,8 @@ using namespace std::chrono_literals;
namespace
{
// Home-relative center used for the "work" loiter. Placed well away from home so that RTL climbs to
// the full return altitude (close to home the RTL cone would cap the climb).
// Home-relative center used for the "work" loiter. Placed well away from home so that Return climbs to
// the full return altitude (close to home the return cone would cap the climb).
const AutopilotTesterLoiter::LocalCoordinate kWorkCenter{250.0, 0.0};
constexpr float kTakeoffAltitude = 40.f;
@@ -88,13 +88,13 @@ void establish_work_orbit(AutopilotTesterLoiter &tester)
} // namespace
TEST_CASE("Loiter: RTL climbs on an established non-default-radius loiter", "[vtol]")
TEST_CASE("Loiter: Return climbs on an established non-default-radius loiter", "[vtol]")
{
AutopilotTesterLoiter tester;
arm_takeoff_transition_hold(tester);
establish_work_orbit(tester);
// Climb clearly above the loiter altitude when RTL is engaged.
// Climb clearly above the loiter altitude when Return is engaged.
const float rtl_altitude = 80.f;
tester.set_rtl_altitude(rtl_altitude);
tester.execute_rtl();
@@ -102,7 +102,7 @@ TEST_CASE("Loiter: RTL climbs on an established non-default-radius loiter", "[vt
// Accept the altitude the controller itself considers "reached", with 20% margin on top.
const float altitude_tolerance = 1.2f * tester.fw_altitude_acceptance_radius();
// RTL must climb to the return altitude while continuing to circle the very same loiter
// Return must climb to the return altitude while continuing to circle the very same loiter
// (same center and non-default radius), not re-center a new circle.
tester.check_climbs_on_loiter(kWorkCenter, kNonDefaultRadius, kRadiusTolerance, rtl_altitude,
altitude_tolerance, 180s);
+14 -14
View File
@@ -33,7 +33,7 @@
#include "autopilot_tester_rtl.h"
TEST_CASE("RTL direct Home", "[vtol]")
TEST_CASE("Return direct Home", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -49,7 +49,7 @@ TEST_CASE("RTL direct Home", "[vtol]")
tester.check_home_within(5.0f);
}
TEST_CASE("RTL direct Mission Land", "[vtol]")
TEST_CASE("Return direct Mission Land", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -64,7 +64,7 @@ TEST_CASE("RTL direct Mission Land", "[vtol]")
tester.check_mission_land_within(5.0f);
}
TEST_CASE("RTL direct Mission Land preserves multicopter mode", "[vtol]")
TEST_CASE("Return direct Mission Land preserves multicopter mode", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -82,7 +82,7 @@ TEST_CASE("RTL direct Mission Land preserves multicopter mode", "[vtol]")
tester.check_mission_land_within(5.0f);
}
TEST_CASE("RTL with Mission Landing", "[vtol]")
TEST_CASE("Return with Mission Landing", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -96,7 +96,7 @@ TEST_CASE("RTL with Mission Landing", "[vtol]")
tester.wait_until_disarmed(std::chrono::seconds(150));
}
TEST_CASE("RTL with Reverse Mission", "[vtol]")
TEST_CASE("Return with Reverse Mission", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -111,7 +111,7 @@ TEST_CASE("RTL with Reverse Mission", "[vtol]")
tester.wait_until_disarmed(std::chrono::seconds(150));
}
TEST_CASE("RTL with Mission Landing preserves multicopter mode", "[vtol]")
TEST_CASE("Return with Mission Landing preserves multicopter mode", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -130,7 +130,7 @@ TEST_CASE("RTL with Mission Landing preserves multicopter mode", "[vtol]")
tester.check_mission_land_within(5.0f);
}
TEST_CASE("RTL with Reverse Mission preserves multicopter mode", "[vtol]")
TEST_CASE("Return with Reverse Mission preserves multicopter mode", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -149,7 +149,7 @@ TEST_CASE("RTL with Reverse Mission preserves multicopter mode", "[vtol]")
tester.check_home_within(5.0f);
}
TEST_CASE("RTL direct home without approaches", "[vtol]")
TEST_CASE("Return direct home without approaches", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -168,7 +168,7 @@ TEST_CASE("RTL direct home without approaches", "[vtol]")
tester.check_home_within(5.0f);
}
TEST_CASE("RTL direct home without approaches forced", "[vtol]")
TEST_CASE("Return direct home without approaches forced", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -187,7 +187,7 @@ TEST_CASE("RTL direct home without approaches forced", "[vtol]")
tester.check_mission_land_within(5.f);
}
TEST_CASE("RTL direct home with approaches", "[vtol]")
TEST_CASE("Return direct home with approaches", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -206,7 +206,7 @@ TEST_CASE("RTL direct home with approaches", "[vtol]")
tester.check_home_within(5.0f);
}
TEST_CASE("RTL direct home not as rally point", "[vtol]")
TEST_CASE("Return direct home not as rally point", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -224,7 +224,7 @@ TEST_CASE("RTL direct home not as rally point", "[vtol]")
tester.check_mission_land_within(5.0f);
}
TEST_CASE("RTL direct rally without approaches", "[vtol]")
TEST_CASE("Return direct rally without approaches", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -244,7 +244,7 @@ TEST_CASE("RTL direct rally without approaches", "[vtol]")
tester.check_home_not_within(20.);
}
TEST_CASE("RTL direct rally without approaches forced", "[vtol]")
TEST_CASE("Return direct rally without approaches forced", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
@@ -263,7 +263,7 @@ TEST_CASE("RTL direct rally without approaches forced", "[vtol]")
tester.check_mission_land_within(5.f);
}
TEST_CASE("RTL direct rally with approaches", "[vtol]")
TEST_CASE("Return direct rally with approaches", "[vtol]")
{
AutopilotTesterRtl tester;
tester.connect(connection_url);
+1 -1
View File
@@ -215,7 +215,7 @@ def run_mission_tests(mav: Any, timeout: float) -> None:
result, MAV_MISSION_INVALID_PARAM3,
)
# 3. NAV_RTL with param1 set (mask 0x00, no params). RTL is only a valid
# 3. NAV_RTL with param1 set (mask 0x00, no params). Return is only a valid
# mission item under MAV_FRAME_MISSION (no coordinates) in PX4; sending
# it as MAV_FRAME_GLOBAL_INT hits the frame switch's default case
# (MAV_MISSION_UNSUPPORTED) once params pass, regardless of param values.