Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I expect when you say you're using ROS Service that you're calling it from the command line? If so then yes it will always be a little off.

You could write a ROS node that checks the rostopic /clock and if the time is right, calls the service get_model_state to get your model position. You have to enable use_sime_time when starting Gazebo though to make sure the clocks are synchronized (http://answers.gazebosim.org/question/3172/timing-synchronisation-between-gazebo-and-ros/). The node can run as fast as you want so it will check the time every Gazebo iteration making it fast enough for your needs I expect. Good luck!