Skip to content

Global vs ROV control frame toggle#60

Draft
mringsby wants to merge 1 commit into
feature/light-controlfrom
feature/global-frame
Draft

Global vs ROV control frame toggle#60
mringsby wants to merge 1 commit into
feature/light-controlfrom
feature/global-frame

Conversation

@mringsby

@mringsby mringsby commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a world-referenced translation mode alongside the default body-relative (ROV) frame.

  • When global is enabled, the current IMU yaw is captured as a reference; pilot surge/sway are rotated by the live yaw so "forward" keeps driving the captured heading regardless of how the ROV has yawed.
  • Falls back to ROV frame whenever IMU yaw is missing or stale (>500 ms) — safe default.
  • Implemented entirely topside — no firmware/protocol change. The Controller reads yaw from the injected IMU receiver.
  • Toggle from: gamepad B button, the home dashboard ("Control Mode" card), or the debug page. Current frame also surfaced in /api/command/status. New endpoint: GET/POST /api/controller/frame.

⚠️ Stacked PR

Based on feature/light-control (not main) so the diff stays clean. Review/merge that one first; rebase this onto main afterward.

Verification

  • ruff check . + ruff format --check . — pass.
  • pytest tests/test_controller.py — pass (added rotation, stale-fallback, ROV-identity, and toggle tests).
  • ⚠️ In-water TODO: confirm the rotation sign matches the IMU yaw convention; it's isolated to one spot in Controller._apply_frame for a one-line flip.

🤖 Generated with Claude Code

Adds a world-referenced translation mode alongside the default body-relative
(ROV) frame. When global mode is enabled the current IMU yaw is captured as a
reference and pilot surge/sway are rotated by the live yaw so 'forward' keeps
driving the captured heading regardless of how the ROV has yawed. Falls back to
ROV frame whenever IMU yaw is missing or stale.

Implemented entirely topside (no firmware/protocol change): the Controller reads
yaw from the injected IMU receiver. Toggle from the gamepad (B button), the home
dashboard, or the debug page; current frame is also surfaced in
/api/command/status. New endpoint: GET/POST /api/controller/frame.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant