How to use ROS time to slow down the simulation?

asked 2021-07-11 12:18:53 -0500

sandeepROS gravatar image

Hello members,

I am a beginner in ROS and really appreciate it if someone can give me a clear answer. I am running a python node in ROS. The algorithm in the node takes sometimes more "real-time" to solve. I am running the nodes at fixed rate in ROS using rospy.Rate(10) . Then I use rate.sleep() to make sure that the rate is maintained. The algorithm needs to be solved at the rate of 10 hz. The problem occurs when the algorithm fails to solve it within that time. If I am correct, it is possible to define 'simulation time' in ROS, but I am not sure if that helps my case. Can I control my simulation time? That means, can I slow down my simulation? While the rospy.Rate(10) is the same as the previous value, can I allow my algorithm more time to solve so that the simulation runs without any problem?

If I am sounding unclear: Now I am expecting my simulation of duration 30 seconds to be run in 30 sec. Can I do the same simulation and make it run slowly in 60 sec, for example? What tools in ROS should/can I use?

edit retag flag offensive close merge delete

Comments

Have you checked this

matteopantano gravatar image matteopantano  ( 2021-07-13 13:48:10 -0500 )edit