Robotics StackExchange | Archived questions

What is the most efficient way to record pose, velocity and acceleration of my robot during the simulation?

So first, I am not aware of any feature already implemented in Gazebo that would do this. If you know of anything, please let me know.

In the past, whenever I needed to record the pose for some debugging I would just launch a ROS node that would subscribe to /gazebo/get_model_state or /gazebo/link_states and similar topics and with some frequency write those data into a txt file somewhere on my disc.

This can only sample a new pose with certain frequency (around 3 times the time step or higher). I'm thinking writing a Gazebo-ROS model plugin could enable sampling the data more frequently and it just seems more neat to me. I could access the robot's pose, velocity and acceleration by Gazebo API.

I could choose to publish the data on a ROS topic and then read and save the data from the ROS topic when I want to, but maybe better would be to record the data in the plugin itself. I can imagine there could be some drawbacks, like writing to a file very frequently is time consuming (how does logging processes do that?). So maybe plugin could just remember all the data and write them down only after the simulation is closed. Though I don't know if that is even possible. I close my simulations by pressing CTRL+C in the terminal. Wouldn't that just make the plugin stop and the data could never be retrieved?

What do you think is the best approach? What are its pros and cons?

Asked by kumpakri on 2020-02-11 05:07:16 UTC

Comments

Is it possible, that you could paint a real life picture where do you need this data at a frequency greater than what ros is doing now. I personally think the current rate of data publish rate is good enough for all purposes.

Asked by shiraz_baig on 2020-03-07 01:50:21 UTC

Answers