You should be able to view the camera images in ROS the same way you would a real camera. The usual ROS utility for that is image_view.
You can run a command like this:
rosrun image_view image_view image:=/camera/image_raw
Provide your correct topic name for the image parameter.
Originally posted by joq with karma: 25443 on 2014-09-04
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by K. Zeng on 2014-09-04:
In the Gazebo topic selector, the topic for the camera feed shows up as /gazebo/default/mesh_robot/stereocamera/head/camera/images. I tried to replace /camera/image_raw with that, and I only got a blank window. Also, I forgot to mention this in the original question, but I'm using a stereo camera.
Comment by joq on 2014-09-04:
In that case, you probably want to run stereo_view, instead.
Comment by K. Zeng on 2014-09-05:
That makes sense. The issue is that from what I can see, only one image topic (/gazebo/default/mesh_robot/stereocamera/head/camera/images) shows up in Gazebo's topic selector.
Comment by K. Zeng on 2014-09-05:
I just tried to run "rosrun image_view stereo_view stereo:=/gazebo/default/mesh_robot/stereocamera/head/camera image:=images", but I'm still getting a grey screen even though I increased queue size and set approximate sync to true.
Comment by K. Zeng on 2014-09-05:
I pulled an rqt_graph, and it shows that Gazebo and the stereo view node aren't publishing or subscribing topics at all. The thing is, I know the stereo camera works because I was able to visualize the camera's data using Gazebo controls. I think at this point, I'm going to ask a separate question.
Comment by joq on 2014-09-06:
rostopic list will show them all.
Comment by K. Zeng on 2014-09-11:
This is strange, I ran rostopic list for an environment with the camera-equipped robot. The topics are the following:
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg
No images
Comment by joq on 2014-09-12:
In that case, there is something wrong with the way you are launching gazebo or its camera plugin.
Comment by K. Zeng on 2014-09-12:
The command I used was roslaunch gazebo_ros {world_name.launch}, where the .world file has a robot model with the default camera from Gazebo's model database. I didn't use any separate command to launch a camera plugin.
Comment by joq on 2014-09-12:
OK. Check the world file, then.
Comment by K. Zeng on 2014-09-12:
The code for the camera is actually part of a Gazebo .sdf model that is part of the .world file via the tag. Should I maybe ask a question like this on Gazebo answers instead?
Comment by K. Zeng on 2014-09-15:
Right now, I'm just trying to get the camera I have to publish the picture. Should I download camera_drivers to make it actually publish?
Comment by joq on 2014-09-17:
Gazebo questions are better asked on http://answers.gazebosim.org Trying it with your actual camera driver should also help sort out any ROS problems.
Comment by K. Zeng on 2014-09-22:
You were right. The reason the camera wasn't able to publish anything to ROS was because I didn't have any kind of plugin. I downloaded gazebo_ros_pkgs and used one of their plugins, and it can publish image topics just fine.