0
$\begingroup$

Rosanswers logo

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...


Originally posted by atmiguel on ROS Answers with karma: 17 on 2012-06-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Dan Lazewatsky with karma: 9115 on 2012-06-18

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.