feat: SLAM streaming, recording, and playback (issues #78, #82)#86
Open
MoveFastAndBreakThings-dot wants to merge 6 commits into
Open
feat: SLAM streaming, recording, and playback (issues #78, #82)#86MoveFastAndBreakThings-dot wants to merge 6 commits into
MoveFastAndBreakThings-dot wants to merge 6 commits into
Conversation
Record real flight sensor data and replay later without the drone.
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.
What this does
Implements the full SLAM data pipeline between Shepard and Emu.
Changes
Streaming (issue #82)
SLAMProvider— abstract base class definingget_frame() → SLAMFrameSLAMFrame— holds 3D point cloud (N×3 numpy), drone pose (x/y/z/roll/pitch/yaw), and timestampSLAMEmuStreamer— background thread that pushesslam_dataframes over WebSocket continuouslyOakdAltimeterSLAMProvider— real provider: fuses OAK-D depth camera + XM125 radar altimeter + MAVLink orientationinto a georeferenced point cloud
DebugSLAMProvider— fake point cloud for testing without hardwareEmu.register_slam_streamer()— listens for{"type":"slam","command":"start/stop"}from Emu and starts/stops thestream to save bandwidth
Recording & Playback
SLAMRecorder— transparent decorator around anySLAMProvider; records every frame to disk as compressed numpy(.npz) while passing frames through unchanged
SLAMPlaybackProvider— replays a recording at original speed using preserved timestamps; implementsSLAMProviderso it plugs directly into
SLAMEmuStreamerRecordingManager— manages multiple named recordings (list, load, delete)Samples
slam_stream.py— test streaming with fake data (no hardware)slam_stream_real.py— real hardware (Pi + OAK-D + XM125)slam_record.py— record a session, Ctrl+C to stop and saveslam_playback.py— replay any saved recording through EmuTesting
All acceptance criteria verified by 8/8 automated tests:
PYTHONPATH=".:dep/labeller" python tmp/test_slam_local.py
End-to-end tested manually:
slam_record.pystreams to Emu SLAM tab live, recording saved to disk,slam_playback.pyreplays identical session.
Notes
recordings/andtmp/added to.gitignore— recordings stay local, not committedSLAMProvider.get_frame()