ros2_recorder is a script designed to work with the go2_ros2_sdk for the Unitree Go2 robot and the TurtleBot4. It records video streams from the robot's camera, along with odometry and LIDAR scan data, saving them into organized and timestamped files. Optimized for single-robot setups, it can also be configured via parameters for namespaced robots.
- Operating System: Ubuntu 22.04
- ROS2 Distribution: Humble
- Robot SDKs:
- go2_ros2_sdk for Unitree Go2
- turtlebot4 for TurtleBot4
- Python Dependencies:
- OpenCV (
opencv-python) cv_bridge
- OpenCV (
Clone the Repository
git clone https://github.com/akifbayram/ros2_recorder.git
cd ros2_recorder-
Ensure
go2_ros2_sdkorturtlebot4is RunningMake sure the appropriate SDK is active and publishing the necessary topics for your robot.
-
Run the Script
python ros2_recorder.py
-
Configure Parameters (Optional)
You can customize the script's behavior using command-line arguments.
Examples:
-
Default Run for Go2:
python ros2_recorder.py
-
Run for TurtleBot4 with Namespace
/robot1:python ros2_recorder.py --robot_type turtlebot4 --namespace /robot1
-
Run with Custom Topics:
python ros2_recorder.py \ --robot_type turtlebot4 \ --namespace /robot1 \ --image_topic /custom_camera/image \ --odom_topic /custom_odom \ --scan_topic /custom_scan
-
Run with All Parameters Specified:
python ros2_recorder.py \ --output_directory "/home/user/ros_output" \ --robot_type go2 \ --namespace /my_robot \ --image_topic /my_robot/camera/image \ --odom_topic /my_robot/odom \ --scan_topic /my_robot/scan \ --video_filename my_video.mp4 \ --odom_filename my_odometry.csv \ --scan_filename my_scan.csv \ --video_fps 30.0 \ --video_codec XVID \ --display_video \ --check_interval 10.0 \ --no_data_timeout 10.0
-
-
Stop Recording
Press
Ctrl+Cin the terminal to stop recording.
This project utilizes the excellent work from the following repositories:
