mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
get_angle_target_to_sysid() had no staleness check, so it always pointed at the last-received GLOBAL_POSITION_INT for the followed vehicle no matter how old. If that vehicle's telemetry lags or drops, the mount kept pointing at the stale location, then snapped once fresh data arrived. Return false (mount holds its last commanded angle) once the target hasn't updated within 3 seconds. Also clears the stale target location when retargeted to a different sysid, so the previous target's last-known position isn't briefly reported as the new target's. Per rmackay9's review, this is scoped to just the timeout fix; a separate PR will follow for using AP_Follow's kinematic estimate. AI-assisted: implementation drafted with Claude Code, reviewed and verified by the author. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>