0
$\begingroup$

Rosanswers logo

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.

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.

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.


Originally posted by Ayush Sharma on ROS Answers with karma: 41 on 2017-03-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by Wolf with karma: 7555 on 2017-03-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Ayush Sharma on 2017-03-12:
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.

Comment by Ayush Sharma on 2017-03-12:
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.

Comment by Ayush Sharma on 2017-03-12:
Using (http://answers.ros.org/question/9102/how-to-extract-data-from-bag/?sort=votes&page=1#sort-top)command, 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

Comment by Wolf on 2017-03-12:
Did you Check your BAG contains the topic, rosbag info "File Name"?

Comment by Wolf on 2017-03-12:
Also you can imspect the bag using rqt_bag

Comment by Ayush Sharma on 2017-03-12:
@Wolf, the question has been edited as per your suggested alternatives. Regards

Comment by Wolf on 2017-03-12:
I think you can also right click or something to inspect the current message values of each topic in rqt

Comment by Ayush Sharma on 2017-03-12:
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?

$\endgroup$

Your Answer

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