Get realtimefactor through plugin (programmatically)
Hi,
I've been trying to get the current realtime factor programmatically. I tried getting it through a world plugin but cannot find a get function, only for real time and Sim time. I know it's inside the /diagnostics topic and also am trying to subscribe to that topic through a plugin but it seems a little unhandy this way. Is there another method to get the real time factor programmatically?
Asked by niall on 2015-09-11 10:07:44 UTC
Answers
I don't know if there is a method to just receive it but:
the realtime factor is just deltaSimTime / deltaTealTime (averaged over a second or a few millis...)
creating such a plugin should be easy...
Asked by evilBiber on 2015-09-14 02:22:41 UTC
Comments
Thanks evilBiber. Yes I figured such but as you say, averaged over a second, a few millis, this is different. I was hoping I could get the exact number the way Gazebo GUI calculates it. And figured, since Gazebo calculates it anyway, there would be a function for this.
Asked by niall on 2015-09-14 03:29:05 UTC
Comments
OK so my second method worked by creating a world plugin that subscribes to the gz topic
~/diagnostics
and then publish this to a ROS topic but this obviously isn't ideal. Still interested in a solution where I can get it from for instance the WorldPtr somehow.Asked by niall on 2015-09-13 09:08:18 UTC