版本是melodic
官网链接:
rviz/UserGuide - ROS Wiki
学习参考:
SLAM+语音机器人DIY系列:(二)ROS入门——9.熟练使用rviz | 古月居
直观认识rviz的效果:
ROS学习(七):三维可视化工具(RViz) - 豌豆ip代理
安装:
sudo apt-get install ros-melodic-rviz
rviz插件
rviz的操作基本上围绕插件,点击Add就可知道默认支持的插件有哪些。大多插件需要订阅自己编写的话题,达到显示的目的。
许多插件的中文资料还不全,不易查找,还需阅读官方的英文说明。
PointCloud2
注意,PointCloud2与PointCloud的消息类型不同,需区分开。(PointCloud)
Add->PointCloud2
| 选项 | 描述 |
|---|---|
| Topic | 订阅的话题 |
| Unreliable | |
| Selectable | Whether or not this cloud is selectable using the selection tool.是否能用选取工具选择点云 |
| Style | 点显示类型,共5种Points, squares, Flat Squares, Spheres, Boxes |
| Size | 显示点大小 |
| Alpha | 透明度[0,1],1是不透明 |
| Decay Time | 延时时间(可能做出运动线条) |
| Position Transfrom | 坐标转换的轴 |
| Color Transfrom | 颜色转换 |
| Queue Size | 队列大小 |
| Channel Name | 通道 |
| Use rainbow | 是否用RGB颜色,或灰度颜色 |
| Invert Rainbow | |
| Autocompute Intensity | Whether or not to auto-compute the “Min Intensity” and “Max Intensity” properties.是否自动计算最小强度和最大强度 |
| Min Intensity | 最小强度 |
| Max Intensity | 最大强度 |
详见:rviz/DisplayTypes/PointCloud - ROS Wiki
If you’re using a LaserScan display, the only available channel will be the “Intensity” channel.
对于激光扫描的显示,唯一有效的通道就是强度通道。
PointCloud2消息类型:link
# This message holds a collection of N-dimensional points, which may
# contain additional information such as normals, intensity, etc. The
# point data is stored as a binary blob, its layout described by the
# contents of the "fields" array.
# The point cloud data may be organized 2d (image-like) or 1d
# (unordered). Point clouds organized as 2d images may be produced by
# camera depth sensors such as stereo or time-of-flight.
# Time of sensor data acquisition, and the coordinate frame ID (for 3d
# points).
Header header
# 2D structure of the point cloud. If the cloud is unordered, height is
# 1 and width is the length of the point cloud.
uint32 height
uint32 width
# Describes the channels and their layout in the binary data blob.
PointField[] fields
bool is_bigendian # Is this data bigendian?
uint32 point_step # Length of a point in bytes
uint32 row_step # Length of a row in bytes
uint8[] data # Actual point data, size is (row_step*height)
bool is_dense # True if there are no invalid points
Compact Message Definition:
std_msgs/Header header
uint32 height
uint32 width
sensor_msgs/PointField[] fields
bool is_bigendian
uint32 point_step
uint32 row_step
uint8[] data
bool is_dense
Camera
rviz/DisplayTypes/Camera - ROS Wiki http://wiki.ros.org/rviz/DisplayTypes/Camera
用到两种消息类型:
sensor_msgs/Image Message
(sensor_msgs/Image Documentation)
sensor_msgs/CameraInfo Message
(sensor_msgs/CameraInfo Documentation)
摄像机显示从摄像机的角度创建一个新的渲染窗口,并将来自摄像机的图像覆盖在其顶部。 为了使此显示正常工作,预订的sensor_msgs / Image话题必须是相机的一部分,并且旁边必须有一个名为camera_info的sensor_msgs / CameraInfo话题。 例如:
/ wide_stereo / left / image_rect
/ wide_stereo / left / camera_info
The Camera display assumes a z-forward x-right frame, rather than the normal x-forward y-left robot frame.
摄像机显示采用的是z朝前方向x朝右边框,而不是一般的x朝前方向y朝左边。(?没看懂?)
可配置:

| Name | Description |
|---|---|
| Alpha | 透明度 |
| Image | 订阅的话题 |
| Topic | 基于订阅的Image话题生成CameraInfo话题 |
rviz目前支持RGB8、RGBA8、BG

最低0.47元/天 解锁文章
4764

被折叠的 条评论
为什么被折叠?



