Skip to content

tracker: release manual control when setting mode - #1575

Open
robertlong13 wants to merge 1 commit into
ArduPilot:masterfrom
robertlong13:pr/tracker-release-manual-control
Open

tracker: release manual control when setting mode#1575
robertlong13 wants to merge 1 commit into
ArduPilot:masterfrom
robertlong13:pr/tracker-release-manual-control

Conversation

@robertlong13

Copy link
Copy Markdown
Contributor

When I was testing ArduPilot/ardupilot#30202, it took me a while to figure out how to release manual control. Once you do tracker position, you cannot get the tracker to do anything else until you call tracker position 32767 32767.

I think it's probably appropriate to release manual control any time the user changes mode, so that's what I've done here.

@tridge
tridge force-pushed the pr/tracker-release-manual-control branch from 095e75c to b8dd2d2 Compare August 30, 2026 00:07
@tridge

tridge commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting.
Full report: https://uav.tridgell.net/DevCallReviews/2026_09_01_AIReview/devcall_pr_reviews.html#prMAVProxy-1575

Reviewed at head b8dd2d249c. COMMENT — the premise is right and it still applies cleanly to master. Nothing in AntennaTracker clears manual_control_yaw/_pitch on a mode change, 32767 is exactly the firmware's 0x7FFF sentinel, and positions[0]→yaw / positions[1]→pitch matches the firmware's field use.

One ordering issue. cmd_tracker_position assigns self._manual_control at line 103 and only then calls manual_control_send() at 104. If the send raises on the release path, the flag has already been cleared, the exception propagates out of the nested call so connection.set_mode() on the next line never runs, and a retry won't re-attempt the release because the flag now says there's nothing to release — the mode change is lost and the state is wrong. The take path has the mirror problem but is harmless (a spurious release is a no-op). Assigning the flag after a successful send, or a try/finally, closes both.

For transparency: my two review passes disagreed on this one — one called it a blocking bug, the other a minor note. Both described the same mechanics, so I've landed between them: a real ordering defect with a trivial fix, but it needs the send to actually raise, and this is an antenna tracker rather than a vehicle.

Two smaller notes. The generic mode command bypasses the release entirely — with the tracker selected as the current link, mode AUTO goes through mavproxy_mode.py's cmd_mode (:41, :74) straight to master.set_mode(), leaving the axes latched. Out of scope for a 6-line fix, but worth a follow-up. And find_connection() is re-resolved inside the nested call and prefers self.connection, so the release can go down a different link than the one that took manual control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants