Skip to content

Instantly share code, notes, and snippets.

View vbschettino's full-sized avatar

Vinicius Schettino vbschettino

View GitHub Profile
@vbschettino
vbschettino / rosbag_controlled_recording.py
Created September 12, 2020 16:55
Class and ROS node to record a rosbag with controls to start, stop and pause
#!/usr/bin/env python
"""Node to record a rosbag with start/stop/pause control through service calls.
Example call:
rosrun utilities rosbag_controlled_recording.py _rosbag_command:="rosbag record -o /home/foo/test_bag /bar_topic" _record_from_startup:=false
Then start/pause/resume/stop can be controlled through:
rosservice call /rosbag_controlled_recording/start
rosservice call /rosbag_controlled_recording/pause_resume
rosservice call /rosbag_controlled_recording/pause_resume
rosservice call /rosbag_controlled_recording/stop