Skip to content

Quaternion deviation logging, MAVLink query tooling, IC-capture fix, venv centralization#17

Merged
mcroomp merged 1 commit into
mainfrom
agent/quaternion-deviation-and-mavlink-tooling
Jul 22, 2026
Merged

Quaternion deviation logging, MAVLink query tooling, IC-capture fix, venv centralization#17
mcroomp merged 1 commit into
mainfrom
agent/quaternion-deviation-and-mavlink-tooling

Conversation

@mcroomp

@mcroomp mcroomp commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • calibrate run: log actual vs. target attitude quaternion (mav_att_q_*, mav_att_target_q_*, mav_att_qerr_*) and show qerr(d)/qyaw(d) in the live console table instead of V/A.
  • groundstation/gcs.py: fix ATTITUDE_TARGET (#83) decode-registration bug (was only registered under SET_ATTITUDE_TARGET); explicitly request ATTITUDE_QUATERNION/ATTITUDE_TARGET via MAV_CMD_SET_MESSAGE_INTERVAL since neither rides the legacy EXTRA1 stream group.
  • scripts/rawes.lua: fix a real MODE_PASSIVE --hold (RAWES_YIC sentinel) IC-capture bug — _ic_seeded persists across RAWES_MODE transitions for the whole FC boot, so a second --hold capture in the same boot only updated the pending fields and never reached the committed GUIDED target, leaving the attitude target frozen at a stale prior value (large non-decaying quaternion error). Now commits directly to _ic_roll_deg/_ic_pitch_deg in the capture branch.
  • analysis/mavlink_jsonl_query.py: reassemble multi-chunk STATUSTEXT messages (ArduPilot splits >50-byte gcs:send_text() calls across messages sharing an id/chunk_seq) instead of printing raw ~50-byte fragments.
  • analysis/mavlink_jsonl_query.md: new canonical usage doc for the tool.
  • setup.cmd/setup.sh: always perform the editable pip install -e . install (previously missing entirely, causing ModuleNotFoundError in fresh venvs); now hash-gated on pyproject.toml like the requirements.txt install so it's a no-op after the first run.
  • calibrate.cmd/pump_lua.cmd/visualize.cmd: centralize venv setup by delegating to setup.cmd instead of duplicating setup logic.
  • Docs: design/flight_stack.md, design/calibration.md, design/sitl_testing.md, AGENTS.md updated to document the above (RAWES_YIC capture path + gotcha, quaternion columns, mavlink_jsonl_query.py as first-line diagnostic tool).
  • .gitignore: fix tests/oneoff/ rule to **/tests/oneoff/ so it also matches the stray simulation/tests/oneoff/ legacy directory (was leaving 46 untracked scratch files visible to git status).

Testing

  • Verified pip install -e . --no-deps idempotency and hash-gating via bash setup.sh (first run installs + stamps, second run skips both installs).
  • Verified analysis/mavlink_jsonl_query.py statustext reassembly against run_passive_20260722_121402.mavlink.jsonl and an older run_passive_20260715_105728 log.
  • Diagnosed the --hold staleness bug end-to-end via the mavlink log (RAWES YIC capture: r=89.9 p=20.0 vs. subsequent RAWES guided cmd: ... rpy=(0.0,0.0,...) never converging).
  • Full SITL/simtest re-run of the Lua fix was not performed in this session (would require spinning up SITL).

…venv centralization

- calibrate/run.py: log actual vs target attitude quaternion (mav_att_q_*,
  mav_att_target_q_*, mav_att_qerr_*) and show qerr/qyaw in the live table.
- groundstation/gcs.py: fix ATTITUDE_TARGET (#83) decode registration bug
  (was only registered under SET_ATTITUDE_TARGET); explicitly request
  ATTITUDE_QUATERNION/ATTITUDE_TARGET via MAV_CMD_SET_MESSAGE_INTERVAL since
  neither rides the legacy EXTRA1 stream group.
- scripts/rawes.lua: fix MODE_PASSIVE --hold (RAWES_YIC sentinel) IC capture
  staleness bug -- _ic_seeded persists across RAWES_MODE transitions for the
  whole FC boot, so a second --hold capture in the same boot only updated
  the pending fields and never reached the committed GUIDED target. Now
  commits directly to _ic_roll_deg/_ic_pitch_deg in the capture branch.
- analysis/mavlink_jsonl_query.py: reassemble multi-chunk STATUSTEXT messages
  (ArduPilot splits >50-byte gcs:send_text() calls across messages sharing
  an id/chunk_seq) instead of printing raw ~50-byte fragments.
- analysis/mavlink_jsonl_query.md: new canonical usage doc for the tool.
- setup.cmd/setup.sh: always perform the editable `pip install -e .`
  install (was previously missing entirely, causing ModuleNotFoundError in
  fresh venvs), now hash-gated on pyproject.toml like the requirements.txt
  install so it's a no-op after the first run.
- calibrate.cmd/pump_lua.cmd/visualize.cmd: centralize venv setup by
  delegating to setup.cmd instead of duplicating setup logic.
- design/flight_stack.md, design/calibration.md, design/sitl_testing.md,
  AGENTS.md: document the above (RAWES_YIC capture path + gotcha, quaternion
  columns, mavlink_jsonl_query.py as first-line diagnostic tool).
- .gitignore: fix tests/oneoff/ rule to **/tests/oneoff/ so it also matches
  the stray simulation/tests/oneoff/ legacy directory.
@mcroomp
mcroomp merged commit a0a7b00 into main Jul 22, 2026
19 of 20 checks passed
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