Gazebo Setup
Gazebo should've been installed with ROS if not you can follow gazebo installation guide
following that make sure that you install the gazebo-ros-pkgs with:
sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
To get a camera running we followed the guide linked to by Physical and Simulation
However we ran into issues with the ros not recognizing the camera model we created. We solved the issue in the troubleshooting section below.
Troubleshooting
Problem:rostopic list
shows no camera topics.
Solution :Make sure you added the correct model in Gazebo. Make sure that the Gazebo simulation is running, not paused. Check themodel.sdf
file and ensure that the<plugin>
tag is in the correct location in the file. Try running Gazebo in verbose mode (rosrun gazebo_ros gazebo--verbose
) and see if there are any helpful warning or error messages that can help pinpoint the problem.
Solution:Additionally gazebo may not be reading the correct sdf file so modify your model.config
and comment out the other sdf files so that it appears as
...
<!-- <sdf version="1.2">model-1_2.sdf</sdf>
<sdf version="1.3">model-1_3.sdf</sdf>
<sdf version="1.4">model-1_4.sdf</sdf> -->
<sdf version="1.5">model.sdf</sdf>
...
Problem:The ROS topics are listed, but I don't see anything in Rviz.
Solution:Make sure that there are objects for the camera to see in Gazebo. Make sure that you have an Image or PointCloud2 display added in RViz. Check that your Image or PointCloud2 displays are set to show the correct topic. Check that the Image or PointCloud2 displays are not disabled (checkbox). Ensure that your RViz Fixed Frame matches theframeName
you specified in the<plugin>
tag. Ensure that the sensor clipping parameters are not set up so that all points are being clipped.