Conversation
Throw launch detection only asked for any positive forward acceleration. That is satisfied by normal accelerometer noise and permanently satisfied while the aircraft is simply held nose up, so a short GPS ground speed glitch was enough to start the launch with the aircraft still in the pilot's hands and spin up the motor to launch throttle. Require the forward acceleration to have exceeded nav_fw_launch_accel, as the setting description already promises. The acceleration peak of a throw is over before the GPS speed follows, so a peak seen shortly before still counts. Bungee and swing launch detection are unchanged, defaults are unchanged. Fixes iNavFlight#10995
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoRequire recent acceleration peak for GPS throw launch detection
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Problem
Fixes #10995. On INAV 8.0.1 (SpeedyBee F405 Wing) the reporter armed in launch mode, raised the throttle and held the aircraft still in his hands. Launch mode triggered on its own and the motor spun up to launch throttle. His DVR showed GPS ground speed briefly reading 11 km/h with 6 satellites, a positioning error.
Cause
src/main/navigation/navigation_fw_launch.c:426on maintenance-10.x. The throw pathisForwardLaunchedneeds onlyisGPSHeadingValid(),groundSpeed > nav_fw_launch_velocityandimuMeasuredAccelBF.x > 0.imuMeasuredAccelBFis the raw body-frame accelerometer including gravity, so an aircraft held nose-up reads a permanently positive x.isGPSHeadingValid()(src/main/io/gps.c:673) is true with a fix, 6 satellites and 300 cm/s. A GPS speed glitch above 300 cm/s for 40 ms (nav_fw_launch_detect_time) was therefore enough.nav_fw_launch_accel, described as the "threshold for bungee launch or throw launch", was not used on this path.Change
WAIT_DETECTIONnow records the time at whichimuMeasuredAccelBF.xlast exceedednav_fw_launch_accel. The throw path requires that this happened within the last 1000 ms (THROW_LAUNCH_ACCEL_HOLD_TIME) instead ofx > 0, because the throw's acceleration peak is over before the GPS speed follows (@breadoven in the issue). The timestamp is cleared when it expires, when the throttle drops low inWAIT_DETECTION, and inresetFixedWingLaunchController(). Bungee and swing detection and all defaults are unchanged.Test
Not run on hardware or SITL. Cause verified by reading
navigation_fw_launch.c:426andgps.c:673on maintenance-10.x; Qodo's two findings on this PR (stale timestamp after signed-delta overflow, timestamp surviving a throttle-low abort) are addressed by commit 4888b74.Flash / RAM
Not measured yet. The upstream firmware CI has not been released for this PR, so no size report exists.
Docs
No documentation change needed:
docs/Settings.mdalready describesnav_fw_launch_accelas the "Forward acceleration threshold for bungee launch or throw launch"; the code now matches that text.