ROS ROS call learning notebook camera ----- ubuntu16.04 display, and an imaging area in Rviz display


In the development process embedded in particular human intelligence development, develop during the robot, we need to collect information through the camera, ROS developers, too, need to call the camera for information collection, further data analysis and judgment action to make the next step, therefore, call the ROS system camera is an important step in data collection were learning!
The blog, Lin Jun seniors will take you to the operating system how ubuntu16.04 in ROS call camera captures and displays the imaging area in Rviz, the steps below to see it!

First, open the preparation before ubuntu16.04

1. Open the VM, click on our ubuntu16.04 right click, select Settings, as follows:

Here Insert Picture Description

2, in the Settings page select usb controller, usb and is compatible with selectusb3.0And then determine

Here Insert Picture Description
These are open before the operation ubuntu16.04 it!

Second, open ubuntu, connecting the camera

1, open ubuntu16.04, into the graphical interface, the user looks above VM selected, right-click selection device movable

Here Insert Picture Description
Image above is my own camera name, may not be as small as a partner, and then click on the circle 4connectionMy connection is good, so the display is disconnected, small partners should be connected to the beginning

Third, the installation uvc-cam, used to call the camera

1, open the terminal, enter the following command to install uvc-cam

sudo apt-get install ros-kinetic-uvc-camera

Here Insert Picture Description
His has been installed, it prompted the page above, small partners that appears, select yes to install just fine!

Fourth, start ROS, calling camera

1. Start ROS

roscore

Here Insert Picture Description

2, a new terminal and run uvc_camera camera node

1), the following command to run the camera node

rosrun uvc_camera uvc_camera_node

As shown below:
Here Insert Picture Description

3, in a terminal, after waiting for the display does not move, then a new terminal, and the view image information of a camera

1), enter the following:

rostopic list

As shown below:
Here Insert Picture Description
4, print information camera
1), enter the following:

rostopic echo /camera_info

As follows:
Here Insert Picture Description
DisplayingCtrl+CTermination of print

5, using image_view call camera, as shown below

1), enter a command to open the camera interface

rosrun image_view image_view image:=/image_raw

As follows:
Here Insert Picture Description
FIG successful call was on the camera, to achieve complete

Fifth, start RVIZ, camera and display area

1, run Rviz

1), the following command input

rosrun rviz rviz

2, add image

Click to add theBy display typeTab, selectImage,As follows:
Here Insert Picture Description

3, set the image oftopicIs [/ image_raw], as follows:

Here Insert Picture Description
Then click at the blank space, everything Ok, images came out, I remember, before the end do not close, oh, in particular, calls the terminal camera can not be closed, shut down there is no image of:
Here Insert Picture Description
here, we in this experiment is perfect successful friends, ROS call camera that this step is Ok Oh!
That's all for this blog, oh, I hope this blog, to understand the small partners ROS call camera helps, useful for small partner, then remember to point praise, attention Oh! Problems encountered little friends Comments Guest Book, Lin Jun seniors to answer them, that seniors are not too cold!
Chen programming years and one day in January ^ _ ^

Published 46 original articles · won praise 44 · views 7709

Guess you like

Origin blog.csdn.net/qq_42451251/article/details/104927879