ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

problems running image_publisher node

asked 2021-12-06 13:23:00 -0600

v.leto gravatar image

Hi! It's my first time I have to deal with images in ROS. As I am a beginner, I tried to run this node

rosrun image_publisher image_publisher /opt/ros/indigo/share/rviz/images/splash.png

but I get

[ERROR] [1638817012.952972146]: Failed to load image (/opt/ros/indigo/share/rviz/images/splash.png): cap_.isOpened() onInit /tmp/binarydeb/ros-melodic-image-publisher-1.14.0/src/nodelet/image_publisher_nodelet.cpp 147

I don' have a splash.png as far as I know.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-06 16:52:09 -0600

osilva gravatar image

Hi @v.leto

The issue is the image path is incorrect,

If you are running Melodic then file path would be:

/opt/ros/melodic/share/rviz/images/splash.png

After running rosrun image_publisher image_publisher /opt/ros/melodic/share/rviz/images/splash.png then image_publisher will print a message such as:

[ INFO] [1638830830.340437700]: File name for publishing image is : /opt/ros/melodic/share/rviz/images/splash.png
[ INFO] [1638830830.348288400]: Flip horizontal image is : false
[ INFO] [1638830830.349854100]: Flip flip_vertical image is : false

To visualize, run another terminal rqt, under Plugins->ImageView, select from the drop down menu and you will be able to visualize image as shown below:

image description

edit flag offensive delete link more

Comments

thank you very much @osilva. Is this the way to see images with open cv? I mean, I have to run rqt and then Plugins->ImageView? And if would like to see another .png image, where should I put it,

v.leto gravatar image v.leto  ( 2021-12-07 03:16:58 -0600 )edit

Yes you can see published images in OpenCV, you will need something called cvbridge. Here a link to get you started: http://wiki.ros.org/cv_bridge

osilva gravatar image osilva  ( 2021-12-07 05:47:54 -0600 )edit

You can place your .png file in any file path, just change it:

rosrun image_publisher image_publisher <file path>

osilva gravatar image osilva  ( 2021-12-07 05:50:26 -0600 )edit

thanks again!

v.leto gravatar image v.leto  ( 2021-12-07 15:31:59 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-12-06 13:23:00 -0600

Seen: 235 times

Last updated: Dec 06 '21