Simulating stereo and mono cameras in Gazebo
In the previous section, we discussed laser scanner simulation. In this section, we will see how to simulate a camera. A camera is an important sensor for all kinds of robots. We will see how to launch both mono and stereo camera simulations. You can use the following commands to launch the simulations.
Mono camera:
$ roslaunch sensor_sim_gazebo camera.launch
Stereo camera:
$ roslaunch sensor_sim_gazebo stereo_camera.launch
You can view the image from the camera either using Rviz or using a tool called image_view
.
You can look at the mono camera view using the following command:
$ rosrun image_view image_view image:=/sensor/camera1/image_raw
Figure 18: Image from simulated camera
To view images from a simulated stereo camera, use the following commands:
$ rosrun image_view image_view image:=/stereo/camera/right/image_raw $ rosrun image_view image_view image:=/stereo/camera/left/image_raw
This commands will display two image windows from each camera...