Closed Durant35 closed 6 years ago
import sensor_msgs.point_cloud2 as pc2 def publish_point_clouds(publisher, points): # Publish point clouds and bounding boxes header = std_msgs.msg.Header() header.stamp = rospy.Time.now() header.frame_id = "velodyne" # points.shape = (?, 4) # points[:, :3] ==> (?, 0...2) msg_points = pc2.create_cloud_xyz32(header, points[:, :3]) publisher.publish(msg_points)
sensor_msgs/PointCloud2 Message
Only contains XYZ
sensor_msgs/PointCloud2 Message