ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

point cloud produces meaningless data

asked 2012-06-18 06:16:26 -0500

atmiguel gravatar image

I'm trying to save the data that my TurtleBot sees when PointCloud2 is turned on. To do this I call 'rostopic echo /camera/depth/points > points.txt' but when I view the data it looks like the following:

header:

seq: 253

stamp:

secs: 1340030655

nsecs: 180170944

frame_id: camera_rgb_optical_frame

height: 480

width: 640

fields:


name: x

offset: 0

datatype: 7

count: 1

name: y

offset: 4

datatype: 7

count: 1

name: z

offset: 8

datatype: 7

count: 1

is_bigendian: False

point_step: 16

row_step: 10240

data: [0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 128, 63,

0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 128, 63,

0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 128, 63,

0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 128, 63,

.

.

.

0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 192, 127, 0, 0, 128, 63,]

Why does it give me the same point over and over again? When the data shows up in rviz it looks perfectly fine...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-06-18 06:35:14 -0500

rostopic echoing a PointCloud2 will not produce useful output in the data field. What you're seeing is a serialized format which is intended to be deserialized before use. If you want to save point cloud data for later you should use either rosbag record, which you can later play back as ROS messages, or cloud_to_pcd which saves pcd files.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-06-18 06:16:26 -0500

Seen: 800 times

Last updated: Jun 18 '12