record_bag
Record ROS bag data from specified topics for a set duration, or run in background triggered by a topic to capture signal injections.
Instructions
Record a rosbag for specified topics over a set duration. Set background=True for async recording.
trigger_on_topic appends the named topic to the recorded topic list.
rosbag record --duration starts its countdown only after the first message
arrives on any recorded topic. Synchronous recording has a hard timeout of
duration_sec + 15s; a silent background recording remains active until
stop_record_bag(handle). Use background=True and choose duration_sec long
enough to cover inject latency + signal duration + margin.
Inject-then-record sequence: record_bag(background=True, trigger_on_topic=) -> confirm the returned handle -> inject_signal(...) -> stop_record_bag(handle). A synchronous record on a silent command topic (no publisher before injection) hangs because the synchronous call would block injection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | remote | |
| topics | Yes | ||
| background | No | ||
| output_path | No | ||
| duration_sec | No | ||
| confirm_token | No | ||
| trigger_on_topic | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |