feat(teleop): multi-episode recording without restarting the simulator - #182
Open
2047767028-lang wants to merge 1 commit into
Open
feat(teleop): multi-episode recording without restarting the simulator#1822047767028-lang wants to merge 1 commit into
2047767028-lang wants to merge 1 commit into
Conversation
Previously autoteleop.sh supported exactly one episode per launch: a single y/N press killed every teleop process (simulator included) and the script exited, so collecting N episodes meant restarting all four terminals N times (~2 min of Isaac Sim startup per episode). This adds an end-of-episode signal on a new /sim/stop_episode topic: - autoteleop.sh: y/n now only ends the *current* episode (keep/discard), shows a completeness check of the produced files (.mcap / metadata.yaml / recording_info.json), and waits for the next episode; a new q key stops everything as before. - api_core.py (_on_recording): on the stop signal, finalize the current ros2 bag gracefully via SIGINT (metadata.yaml intact), write recording_info.json if the episode ended before frame 100, and re-arm the one-shot wait_recording latch for the next record-button press. - server_node.py / ros_nodes.py / teleop.py: subscribe to the stop signal and reset the cached recording state on both the simulator and teleop sides, so the next episode requires a fresh button press and never auto-starts from stale signals. Ported from a validated implementation on the pre-3.2.0 layout (used to collect multi-episode datasets that trained successfully); adapted to the 3.2.0 package layout but not yet run end-to-end on 3.2.0 itself. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Motivation
autoteleop.shcurrently supports exactly one episode per launch:pressing y/N kills every teleop process (simulator included) and the
script exits. Collecting N episodes means restarting all four terminals
N times, paying the full Isaac Sim startup cost per episode.
This implements the multi-episode half of #181.
How it works
A new
/sim/stop_episodetopic carries an end-of-episode signal:autoteleop.sh:y/nnow end only the current episode(keep / mark-discarded), print a completeness check of the produced
files (
.mcap,metadata.yaml,recording_info.json), and keepwaiting — the next record-button press starts the next episode.
A new
qkey stops everything (the previous y/N behaviour).api_core.py(_on_recording): on the stop signal, the current ros2bag is finalized gracefully via SIGINT (so
metadata.yamliswritten),
recording_info.jsonis written if the episode endedbefore frame 100, and the one-shot
wait_recordinglatch is re-armedfor the next record-button press.
server_node.py/ros_nodes.py/teleop.py: subscribe to thestop signal and reset the cached recording state on both the
simulator and teleop sides, so the next episode always requires a
fresh record-button press and never auto-starts from stale signals.
Testing status
Being transparent here: the logic was developed and validated
end-to-end on the pre-3.2.0 layout (a v3.0-era container) — we used it
to collect multi-episode teleop datasets in one sitting, which later
trained successfully. This PR ports it 1:1 to the current package
layout (insertion points verified against current
main;bash -nandpy_compilepass), but our local environment cannot run the 3.2.0stack, so it has NOT been run end-to-end on 3.2.0 itself. Happy to
adjust anything that doesn't match the new runtime.
🤖 Generated with Claude Code