Commit e221903a authored by Inès EL HADRI's avatar Inès EL HADRI 💤

Working point cloud

parent 1923389c
......@@ -13,10 +13,10 @@ def scan_callback(scanMsg):
obstacles = ranges_to_positions(scanMsg)
sample = [ [ round(p[0], 2), round(p[1], 2), round(p[2], 2) ] for p in obstacles[10:20] ]
rosNode.get_logger().info( f"\nheader:\n{scanMsg.header}\nnumber of ranges: {len(scanMsg.ranges)}\nSample: {sample}\n" )
# Publish a msg
pointCloud = sensor_msgs_py.point_cloud2.create_cloud_xyz32(Header(frame_id='frame'), obstacles)
rosNode.get_logger().info( f"\nheader:\n{scanMsg.header}\nnumber of ranges: {len(scanMsg.ranges)}\nSample: {pointCloud}\n" )
pointCloud = sensor_msgs_py.point_cloud2.create_cloud_xyz32(Header(frame_id=scanMsg.header.frame_id), obstacles)
point_publisher.publish(pointCloud)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment