- ROS2 Rolling (or your desired ROS2 distribution)
- A topic with data to save (sensor_msgs/msg/Image)
- Clone this repository to your ROS2 workspace:
cd ~/ros2_ws/src
git clone https://github.com/dark516/ros2_image_saver
- Build the package:
cd ~/ros2_ws
colcon build --packages-select ros2_image_saver
- Source the workspace:
source ~/ros2_ws/install/setup.bash
- Run the node with an explicit indication of the port received in the previous step
ros2 run ros2_image_saver_pkg image_saver --dir /path/to/save/images (default: images)
And now every frame sent to the topic will be saved to the specified directory