sensor_msgs
PointCloud
- 已过时,用PointCloud2代替
PointCloud2
- 可以设定长宽(Organized,如
height=240,width=320),或不设定长宽(默认height=1宽度为点云总数,如width=240*320) - 需要将
header.frame_id设置为特定TF(如world) - 调用
point_cloud2(header, fields, points)创建点云信息header包含参考坐标系,fields为描述符,points为具体数据 - 代码示例Python参考,C++参考
import struct
from sensor_msgs import point_cloud2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header