Home | Tutorials | Wiki | Issues
Ask Your Question
1

Get realtimefactor through plugin (programmatically)

asked 2015-09-11 10:07:44 -0500

niall gravatar image

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?

edit retag flag offensive close merge delete

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.

niall gravatar imageniall ( 2015-09-13 09:08:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-14 02:22:41 -0500

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

edit flag offensive delete link more

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.

niall gravatar imageniall ( 2015-09-14 03:29:05 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-09-11 10:07:44 -0500

Seen: 206 times

Last updated: Sep 14 '15