Skip to content

run_policy: optional per-session rosbag (--task.debug.record-rosbag) - #181

Open
tomasz-lewicki wants to merge 2 commits into
mainfrom
dev/tomasz/session-rosbag
Open

run_policy: optional per-session rosbag (--task.debug.record-rosbag)#181
tomasz-lewicki wants to merge 2 commits into
mainfrom
dev/tomasz/session-rosbag

Conversation

@tomasz-lewicki

Copy link
Copy Markdown
Contributor

Records a ros2 bag record --all for the lifetime of one run_policy run and stops it (clean MCAP close) on Ctrl-C / completion / error, then prints the bag's absolute path.

Each run gets its own short, self-contained bag — no more hunting for a timestamp inside a 30-min fleet-telemetry recording.

  • Off by default; enable with --task.debug.record-rosbag (dir via --task.debug.rosbag-dir, default ~/run_policy_bags).
  • No-op when disabled; failure to start is logged and swallowed so it can't take down the run.

@tomasz-lewicki
tomasz-lewicki force-pushed the dev/tomasz/session-rosbag branch 6 times, most recently from d36ad7d to bc04508 Compare July 28, 2026 22:57
Spawns 'ros2 bag record --all' in its own process group for the lifetime of a
run_policy run and SIGINTs it for a clean MCAP close on exit (Ctrl-C, normal
completion, or error), then prints the bag's absolute path. Each run gets its
own short, self-contained bag, so debugging one run no longer means hunting for
a timestamp inside a long fleet-telemetry recording.

Wrapped around policy.run() via a SessionRecorder context manager; no-op when
the flag is off, and any failure to start recording is logged and swallowed so
it can never take down the policy run. Output dir configurable via
--task.debug.rosbag-dir (default ~/run_policy_bags).
@tomasz-lewicki
tomasz-lewicki force-pushed the dev/tomasz/session-rosbag branch from bc04508 to 4a356e6 Compare July 28, 2026 23:01
@tomasz-lewicki
tomasz-lewicki requested a review from Juyue July 29, 2026 00:14

@czxiao-robotics czxiao-robotics left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Juyue
Juyue previously approved these changes Jul 30, 2026

@Juyue Juyue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does recording influence the inference latency?

Looks good to me as long as it works!

… pin

Robot-local work captured from fmd-rccu-1:
- DebugConfig.dry_run / dryer_run: run the loop without sending commands
  (dry_run) or without any bridge/hardware via a fabricated-state
  SyntheticInterface (dryer_run).
- base.py: wire the synthetic interface for dryer_run; pin ONNX Runtime to a
  single intra-op thread so it stays off the isolated RT cores.
- SessionRecorder: pin ros2 bag record to its own core (DebugConfig.rosbag_cpu,
  default 2) so it stops stealing cycles from the policy core.
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.

3 participants