First time here? Check out the FAQ!


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 Mar 12 '17

Ayush Sharma gravatar image

updated Mar 13 '17

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered Mar 12 '17

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

Preview: (hide)

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  ( Mar 12 '17 )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  ( Mar 12 '17 )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  ( Mar 12 '17 )edit

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

Wolf gravatar image Wolf  ( Mar 12 '17 )edit

Also you can imspect the bag using rqt_bag

Wolf gravatar image Wolf  ( Mar 12 '17 )edit

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

Ayush Sharma gravatar image Ayush Sharma  ( Mar 12 '17 )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  ( Mar 12 '17 )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  ( Mar 12 '17 )edit

Question Tools

1 follower

Stats

Asked: Mar 12 '17

Seen: 2,379 times

Last updated: Mar 13 '17