Simple image subscriber and viewer for ROS2 (tested in Foxy, Humble).
Currently viewer only works with RGB raw and JPEG compressed images. Other image formats like PNG, Theora or depth can be added in the future when the need arises.
- Install external dependencies
- Setup ROS2 environment (follow ROS2 guide)
- Compile
~/> mkdir build
~/> cd build
~/build> cmake .. && makeBuild will produce 2 binaries: rosimg and rosbag-preview
- Example for topic with uncompressed image:
# make sure ros2 bag player is run elsewhere
~/build> ./rosimg /image_raw
# this will read images straight from ROS bag file
# so no ros2 bag player is needed
~/build> ./rosbag-preview rosbag.db3 /image_raw- Option 1 (sudo might be required)
~/build> make install- Option 2
~/build> cp -v ./rosimg $HOME/bin/
~/build> cp -v ./rosbag-preview $HOME/bin/- Example for topic with compressed camera image:
~/> rosimg /camera/compressed
~/> rosbag-preview rosbag.db3 /camera/compressed