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

Saving odometry data:Conversion into "txt" / "CSV"

asked 2017-03-12 06:32:55 -0600

Ayush Sharma gravatar image

updated 2017-03-13 09:11:56 -0600

I want to get the raw odometry data from the Rviz. Consider the following example i have implemented from one of the ROS Books in which the bot is supposed to move from one position to another and then come back to the starting point.

image description

As shown in the output, the arrows represents the odom data. I want to view this odom data in a file including the complete raw data of odom in text form of the whole process. I want to view the data the Rviz is planning at each instant of time. Is it feasible with ROS?? I tried the rosbag concept, but playing the generated bag file is not giving me the desired output.

<update> Using ( http://answers.ros.org/question/9102/... , I tried the "rostopic echo -b file.bag -p /topic > data.txt" but I am getting a blank txt file " and i am not able to observe any output with the command "rostopic echo -b file.bag -p /topic.</update>

On using the "rqt" command to check the data of the bag file, then i got the following output. image description This means that the bag file has the data, but then why am i getting a blank ".txt" file?? Also, how to understand the data the "rqt" is showing?? Also, why am i not able to get "csv" file? Note: (Update from the suggested given answer) Using "rostopic echo /odom" is giving an appropriate change of odom values. But i want a user understandable set of odom values.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-12 07:56:53 -0600

Wolf gravatar image

Is

rostopic echo /robot/odom

What you are looking For? Note that you May Change the topic name... Andere you can also Forward the output to a Text File using > operator..

edit flag offensive delete link more

Comments

My requirement is similar to this question. I also need to have info of each step taken by the bot during a simulation, the data processed by the odom in backhand and the laser data.

Ayush Sharma gravatar image Ayush Sharma  ( 2017-03-12 08:22:45 -0600 )edit

With this , i will then try to retrieve the data of arduino connected ROS and will get the raw data ROS is processing from the ultrasonic sensor. Somewhat similar to what i have asked in this question.

Ayush Sharma gravatar image Ayush Sharma  ( 2017-03-12 08:25:12 -0600 )edit

Using ( http://answers.ros.org/question/9102/... , I tried the "rostopic echo -b file.bag -p /topic > data.txt" but I am getting a blank txt file " and i am not able to observe any output with the command "rostopic echo -b file.bag -p /topic

Ayush Sharma gravatar image Ayush Sharma  ( 2017-03-12 08:26:20 -0600 )edit

Did you Check your BAG contains the topic, rosbag info "File Name"?

Wolf gravatar image Wolf  ( 2017-03-12 08:32:04 -0600 )edit

Also you can imspect the bag using rqt_bag

Wolf gravatar image Wolf  ( 2017-03-12 08:33:32 -0600 )edit

@Wolf, the question has been edited as per your suggested alternatives. Regards

Ayush Sharma gravatar image Ayush Sharma  ( 2017-03-12 09:35:16 -0600 )edit

I think you can also right click or something to inspect the current message values of each topic in rqt

Wolf gravatar image Wolf  ( 2017-03-12 10:53:01 -0600 )edit

Yes sir. I saw the http://wiki.ros.org/rqt_bagand found how we can vary the view. I am now wondering how to save the data in a tabular or excel form ,ie: CSV / Txt format. Don't know why the CSV conversion command is not giving a result and why the txt file showing an empty file. any suggestions?

Ayush Sharma gravatar image Ayush Sharma  ( 2017-03-12 11:20:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-12 06:32:55 -0600

Seen: 2,378 times

Last updated: Mar 13 '17