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

How to get markers pose in a file?

asked 2014-04-06 18:11:42 -0600

miloup gravatar image

Hi, I am using different AR tags and need to know how I can save their poses into a text file so I can use their poses in a MATLAB code. When I use "echo", it gives me a long list with different markers_id and the poses are not fixed. Any suggestion? Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-05-27 00:27:27 -0600

BennyRe gravatar image

@ggregory8 is absolutely right with using rosbag.

I also want to mention the solution with plain rosbag.

Record your data with

rosbag record /topic

And then process it in Matlab with the matlab_rosbag package.

edit flag offensive delete link more
1

answered 2014-05-26 23:57:54 -0600

ggregory8 gravatar image

Hi,

You can echo straight into a file using:

rostopic echo /topic > filename.txt

But this isn't ideal as it will be the same format as the echo displays it to the commandline.

A better way is to record topics using rosbag and then you can write the topic data you want straight to a file using:

rostopic echo -b file.bag -p /topic > filename.txt

This has the benefit of formatting the data suitable for a csv file, which you can then manipulate with excel / matlab.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-04-06 18:11:42 -0600

Seen: 953 times

Last updated: May 27 '14