https://github.com/mapiv/ros2_bag_to_image
Set of nodes to convert either online of offline image messages to image files
https://github.com/mapiv/ros2_bag_to_image
ros2
Last synced: 11 months ago
JSON representation
Set of nodes to convert either online of offline image messages to image files
- Host: GitHub
- URL: https://github.com/mapiv/ros2_bag_to_image
- Owner: MapIV
- Created: 2023-08-07T03:25:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T04:11:37.000Z (about 1 year ago)
- Last Synced: 2025-03-27T05:23:08.378Z (about 1 year ago)
- Topics: ros2
- Language: C++
- Homepage:
- Size: 29.3 KB
- Stars: 46
- Watchers: 2
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ROS2 BAG to image
## Topic to Image
Subscribes to a ROS2 Image topic and stores received messages to PNG files.
How to launch:
```
ros2 launch ros2_bag_to_image topic_to_image.xml \
input/topic:=/camera/image_rect compressed:=True
```
The images are exported in lossless PNG format.
Set `compressed` to `True` to subscribe to a compressed image_transport.
### Parameters
| Parameter | Default | Description |
|-----------------|--------------|------------------------------------|
| `input/topics` | `/image_raw` | ROS2 Topic to subscribe |
| `output/path` | `/tmp/` | Path where to store the PNG files. |
| `output/prefix` | | Text to prepend to the output file |
## BAG To Image
Opens, reads, extracts and saves `sensor_msgs/msg/Image` or `sensor_msgs/msg/CompressedImages` from Ros2 bag.
Stores all the topics in the defined output path, names the images as:
`topic_name_stampsecs_stampnsecs.png`
The images are exported in lossless PNG format.
How to launch:
```bash
$ ros2 launch ros2_bag_to_image bag_to_image.xml \
input/path:=/PATH_TO/input_bag/ \
input/topics:="['camera1/image_rawcompressed', 'camera2/image_raw']"
```
### Parameters
| Parameter | Default | Description |
|------------------------|-----------|---------------------------------------------------------------------|
| `input/path` | | Input Rosbag Path |
| `input/bag_format` | `cdr` | Path where to store the PNG files. |
| `input/bag_storage_id` | `sqlite3` | Text to prepend to the output file |
| `input/topics` | | List of Input Topics in the form `"['topic1', 'topic2', 'topicN']"` |
| `output/path` | `/tmp/` | Output path PNG files |