Split groundstation package out of simulation#14
Merged
Conversation
Move genuinely-production ground-station/flight-planner code into a new top-level groundstation/ package, keeping simulation/ as the physics/ mock-hardware framework: - groundstation/: pumping_planner.py, landing_planner.py, gcs.py, rawes_modes.py, mavlink_log.py, ekf_flags.py (moved whole), plus new winch_protocol.py (WinchCommand/WinchTelemetry wire format extracted from simulation/winch_node.py) and unified_ground.py (NvComms base + GcsComms production adapter extracted from simulation/unified_ground.py). - simulation/ keeps VirtualComms (comms.py), DirectComms/LuaComms (unified_ground.py), and the winch control-loop stand-ins (winch.py's WinchController, winch_node.py's GovernedWinchNode + Anemometer) since these simulate hardware/algorithms that will eventually run standalone (winch node firmware) rather than code that runs on the real ground station today. - Removed dead code: simulation/comms.py's MavlinkComms class was never imported/instantiated anywhere (GcsComms in unified_ground.py is the actual production adapter used by SITL stack tests); deleted along with its unused _PHASE_TO_SUB duplicate. - Updated ~25 import call-sites across simulation/, calibrate/, analysis/, and tests/ to the new module paths. - pyproject.toml: added groundstation/groundstation.* to the packages.find include list. test.sh: added groundstation to the Docker sync tar list. - Updated AGENTS.md, design/flight_stack.md, design/simulation.md, design/testing.md to reflect the new package and removed dead code. Validated: 467/467 unit tests, 14 passed/5 skipped simtests, and an isolated SITL stack run (test_pumping_cycle_lua_sitl) all pass.
- Remove stale 'Current focus' section. - RAWES_* parameter mapping and DShot config tables were duplicated from design/flight_stack.md and design/dshot.md; replaced with short pointers per AGENTS.md's own 'no duplicated tables' policy. - Moved the long /tmp Git-Bash-vs-WSL gotcha and the long-running-command efficiency guidance out of AGENTS.md into design/sitl_testing.md (their natural owner doc per the Documentation Ownership table), leaving short pointers behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new top-level
groundstation/package (9th package, alongsidesimulation,arduloop,calibrate,envelope,analysis,viz3d,scripts,tests) split out ofsimulation/.Rule of thumb used to decide what moved: does this code genuinely run on the real ground station/flight-planner today, or does it stand in for hardware that doesn't exist yet?
Moved whole (git mv, no logic changes) into
groundstation/pumping_planner.py,landing_planner.pygcs.py(RawesGCS,WallClock,SimClock)rawes_modes.py(wire-protocol constants, world-origin helpers)mavlink_log.py,ekf_flags.pySplit by class
unified_ground.py:GcsComms+NvCommsbase +_cmd_to_nv/_PHASE_TO_SUBmoved togroundstation/unified_ground.py(production MAVLink adapter).DirectComms/LuaComms(simtest/Lua-unit-test only) stay insimulation/unified_ground.py, importingNvCommsfromgroundstation.winch_node.py: extracted theWinchCommand/WinchTelemetrywire-protocol dataclasses into newgroundstation/winch_protocol.py.GovernedWinchNode/Anemometer/GovernedWinchControllerstay insimulation/since they simulate not-yet-built winch-node hardware (same category as vehicle physics/mock ArduPilot).Dead code removed
simulation/comms.py'sMavlinkCommsclass (and its_PHASE_TO_SUBdict) — confirmed via repo-wide grep it was never imported/instantiated anywhere;GcsCommsinunified_ground.pyis the actual production adapter used by SITL stack tests.Other changes
simulation/,calibrate/,analysis/,tests/.pyproject.tomlandtest.sh's Docker sync tar list updated for the new package.AGENTS.md,design/flight_stack.md,design/simulation.md,design/testing.md.Testing
pytest tests/unit -m "not simtest" -q— 467/467 passed.pytest tests/simtests -q— 14 passed, 5 skipped (matches baseline).bash test.sh stack -n 4(full SITL stack suite) — 7/7 passed.Note:
test_kinematic_gps_sitlintermittently failed with a GPS-glitch/EKF-window assertion during initial runs (both under-n 4and isolated-n 1), but a byte-for-byte diff of every changed/moved file against pre-splitmainshowed zero logic differences, and the test subsequently passed cleanly on repeated re-runs on this branch. This appears to be pre-existing timing/host-load sensitivity in that test's real-time SITL physics, not a regression from this change — logged in repo memory for future reference.