ArduPilot / ArduPilot/ardupilot

Missing @RebootRequired annotation on WP_SPD / Q_WP_SPD — mid-mission PARAM_SET has no effect on ArduPlane/QuadPlane

Open
#33,952 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
15.9k
Forks
21.4k
Avg merge
3d 17h
Merged PRs (30d)
119

Description

## Summary

The `WP_SPD` parameter (in `libraries/AC_WPNav/AC_WPNav.cpp:49-56`) and its quadplane alias `Q_WP_SPD` lack the `@RebootRequired: True` annotation, despite the fact that changes to this parameter do not take effect mid-mission on ArduPlane/QuadPlane.

## Reproduction (ArduPlane VTOL / QuadPlane, SITL)

1. Boot with `Q_WP_SPD=5` (default)
2. Send `PARAM_SET Q_WP_SPD=12` while disarmed (PARAM_VALUE ack confirms `Q_WP_SPD=12` saved to EEPROM)
3. Arm and start AUTO mission
4. Observe drone still flies at ~5 m/s (the old default), not 12 m/s

## Root cause (traced in source)

- `AC_WPNav::wp_and_spline_init_m(speed_ms)` sets `_check_wp_speed_change = !is_positive(speed_ms)` ([AC_WPNav.cpp:227](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AC_WPNav/AC_WPNav.cpp#L227)). When called with a positive `speed_ms` (e.g. the current `_wp_desired_speed_ne_ms`), the change-detection flag is locked to `false`.
- `QuadPlane::waypoint_controller()` ([quadplane.cpp:3266](https://github.com/ArduPilot/ardupilot/blob/master/ArduPlane/quadplane.cpp#L3266)) calls `set_wp_destination_NED_m()` → `wp_and_spline_init_m(_wp_desired_speed_ne_ms)` BEFORE `update_wpnav()`. This locks `_check_wp_speed_change=false` before `update_wpnav()`'s change detection ([AC_WPNav.cpp:688-693](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AC_WPNav/AC_WPNav.cpp#L688-L693)) can run.
- Result: `_wp_speed_ms` (param) is updated to 12, but `_wp_desired_speed_ne_ms` (runtime) never syncs from the new param value. The drone continues at the old speed until reboot.

## Expected behavior

Either:

**(a)** Add `@RebootRequired: True` to `WP_SPD`/`Q_WP_SPD` so GCSes (QGC, MP) prompt the user to reboot after changing it, **or**

**(b)** Fix the change-detection logic so mid-mission `PARAM_SET` takes effect on the next waypoint leg.

## Workaround

Reboot the FC after setting `Q_WP_SPD`. Confirmed by ArduPilot's own autotest ([`Tools/autotest/quadplane.py:1742-1757`](https://github.com/ArduPilot/ardupilot/blob/master/Tools/autotest/quadplane.py#L1742-L1757)), which sets `Q_WP_SPD=7.0` then calls `reboot_sitl()` before flying.

## Forum reports of this confusion

- https://discuss.ardupilot.org/t/q-wp-radius-and-q-wp-speed-quadplane-in-auto-mode/138387
- https://discuss.ardupilot.org/t/change-speed-command-not-working-in-quadplane/82781

## Version

master @ 6493770924 (also reproduces on 4.6.x)

## Contrast with annotated params

`Q_ENABLE` correctly carries `@RebootRequired: True` ([quadplane.cpp:14](https://github.com/ArduPilot/ardupilot/blob/master/ArduPlane/quadplane.cpp#L14)), so GCSes know to prompt for reboot. `WP_SPD`/`Q_WP_SPD` should follow the same pattern given the same effective behavior.

Contributor guide

Open the contributing guide

Research direction

Inspect the WP_SPD declaration in libraries/AC_WPNav/AC_WPNav.cpp:49-56 and locate the Q_WP_SPD declaration, comparing the existing Q_ENABLE annotation in ArduPlane/quadplane.cpp:14. Review the control flow at quadplane.cpp:3266 and AC_WPNav.cpp:227,688-693, then use Tools/autotest/quadplane.py:1742-1757 as the relevant SITL reference. Done means the chosen metadata or runtime fix is verified for the reported mid-mission behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot, robotics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.