ROS visualization tool Rviz& displays the video of the computer camera
Overview
Install Rviz and use it to display video from the computer camera.
One, get to know Rviz
RViz is ROS 三维可视化工具
. Its main purpose is 三维方式显示ROS消息
to be able to 数据进行可视化表达
. For example, it is possible to express the distance between the sensor in the laser rangefinder (LRF) sensor and the obstacle without programming, and the point cloud data (PCD, Point Cloud Data) of the three-dimensional distance sensor such as RealSense, Kinect or Xtion, obtained from the camera Image value, etc.
rviz: The ROS Visualization Tool, ie
机器人操作系统3D可视化工具
. Its role is: a virtual world, used to simulate the effect of the robot in the real world.
Simply put, it is a simulator software of ROS.
Second, install Rviz
1. Preliminary preparation
Find the virtual machine settings
Click on the USB controller and change the USB compatibility to USB2.0 to
connect to the camera.
Check whether
cheese can be used normally. #Using this command will call the camera, and an interface will pop up to display the camera’s screen
#The default cheese should be no According to the need to execute the following command
sudo apt-get install cheese
2. Installation
Compile from source file
Download first
rosdep install rviz
Compile
rosmake rviz
Start and
run the following command
roscore
rosrun rviz rviz
You can also run the following commands directly, the effect is the same
roscore
rviz
The open interface is as follows
3. A brief introduction to the interface
The overall interface
area division introduction
➊ 3D view (3D view): Refers to the black part of the screen. It is the main screen on which various data can be viewed in three dimensions. The background color, fixed frame, grid, etc. of the 3D view can be set in detail in the Global Options and Grid items displayed on the left.
➋ Displays: The display on the left is an area where users can select data views from various topics. If you click [Add] at the bottom left of screen 4, the selection screen will be as shown in Figure 6-7. There are currently about 30 different displays to choose from, which we will introduce in detail in the description below.
➌ Menu: The menu is at the top. The user can choose the command to save or read the status of the display screen, as well as various panels.
➍ Tools: Tools are buttons located at the bottom of the menu that allow users to select multiple functions with various function buttons, such as Interact, Move Camera, Select, Focus Camera, Measure, 2D Pose Estimate, 2D Navigation Goal and Publish Point and so on.
➎ Views: Set the viewpoint of the 3D view
■ Orbit: Rotate around the specified viewpoint (here called Focus). This is the most commonly used basic view by default.
■ FPS (First Person): Display the picture seen by the first person viewpoint.
■ ThirdPersonFollower: Shows the view of chasing a specific target from a third-person viewpoint.
■ TopDownOrtho: This is the Z-axis view, which is different from other views. It is displayed in direct view instead of perspective.
■ XYOrbit: similar to the default value of Orbit, but the focus is fixed on the XY plane with the Z axis value of 0.
➏ Time: Display the current time (wall time), ROS Time and their respective elapsed time. This is mainly used for simulation, if you need to restart, please click the [Reset] button at the bottom.
Screen selection screen
最上面是display的类型。最下面是名称,必须是独一无二的。
Show own properties
Status共有四种状态:OK,Warning,Error和Disable。 不同的状态,扩展内容里面会有说明。
The most commonly used menu in the process of using RViz should be the screen 5 menu. The display menu is used to select the information displayed on the 3D View screen
Three, camera video display
1. Install related feature packs
Install uvc camera function package
sudo apt-get install ros-melodic-uvc-camera
Install image related function packages
sudo apt-get install ros-melodic-image-*
sudo apt-get install ros-melodic-rqt-image-view
2. Related startup
Start the core program of Ros
roscore
Run the uvc_camera node in another terminal
rosrun uvc_camera uvc_camera_node
Open another terminal to view topic messages
rostopic list
Print camera information
rostopic echo /camera_info
3. Rviz configuration
Open rviz
rviz
Find Add in the lower left corner of the tab and click.
Find Image under By display type, click to select, and then click OK to add
. Change the value of image Topic to /image_raw and the
result is displayed
If you can't open the camera, you can choose to change the USB, and then run the command again.
Four, summary and reference materials
1. Summary
This article is mainly a brief introduction and use of the ROS visualization tool Rviz. Rviz is a 3D simulator, which is equivalent to showing the things in life in the 3D model.
2. Reference materials
RViz study notes (1)-install
ROS study (7): three-dimensional visualization tool (RViz) .
ROS query notebook camera parameters, use rviz to display real-time video .