Taking a Photo
In this lesson we will learn how to take a photo. TurtleBot has different image
topics. We will work with /camera/rgb/image_raw
. We will use image_view
package. It is a simple image viewer for ROS image topics.
1. Launch Gazebo.
2. Open a new terminal and make a directory.
3. Change directory.
4. Run image_view.
You will see this string in terminal:
You will see what TurtleBot sees.
5. Make right-click on the picture to take a photo.
You will see this string in terminal:
6. By default, images will be saved as frame0000.jpg, frame0001.jpg
.
You can control name, location and format of saved images using _filename_format
parameter.
6.1 Interrupt the current process (press Ctrl+C
).
6.2 Run image_view with _filename_format
parameter.
6.3 Make right-click on the picture to take a photo.
6.4 The picture will be saved as tutorial00.jpg
.
NOTE: If you want to change the location use full path to the folder you want.
Incorrectly:
Correctly:
7. Interrupt the process.
8. Run ls
command.
You will see the new files.
9. Open the image file.
NOTE: You can use image viewer which you prefer. For instance, you can use eog which is GNOME image viewer.
You will see the image.
10. Interrupt Gazebo. Close the terminals.
You can watch these steps in the video:
You can read more about image_view package and its parameters on wiki_ros.