[ros-users] rospy and simulation time
kwc at willowgarage.com
Thu Nov 4 21:18:56 UTC 2010
rospy does obey simulation time, but you have to initialize a node
(i.e. you need an init_node()). Only nodes can obey simulated time
because you have to subscribe to a topic.
On Thu, Nov 4, 2010 at 1:58 PM, Patrick Doyle <wpdster at gmail.com> wrote:
> Is it possible to make rospy use simulation time instead of wall-clock time?
> Consider the following program:
> #!/usr/bin/env python
> import roslib; roslib.load_manifest('wpdtb')
> import rospy
> print "About to sleep for 5 seconds..."
> print "done"
> I run this on a slow machine (i.e. one in which simulation time runs
> slower than real time). If I start up roscore in one window, and run
> this in a second window, it exits after 5 seconds as expected. If
> instead I launch the PR2 simulator in one window:
> $ roslaunch pr2_gazabo pr2_empty_world.launch
> and run this in a second window, it still exits after about 5
> wallclock seconds. I thought the /use_sim_time parameter would have
> made this wait 5 simulated seconds.
> I have similar problems with rospy.rate(). And I've given up all
> together passing a Duration() timeout to wait_for_service().
> ros-users mailing list
> ros-users at code.ros.org
More information about the ros-users