Package rospy :: Module timer :: Class Timer

Class Timer

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        Timer

Convenience class for calling a callback at a specified rate

Instance Methods
 
__init__(self, period, callback, oneshot=False)
Constructor.
source code
 
shutdown(self)
Stop firing callbacks.
source code
 
run(self) source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from threading.Thread: daemon, ident, name

Inherited from object: __class__

Method Details

__init__(self, period, callback, oneshot=False)
(Constructor)

source code 

Constructor.

Parameters:
  • period (rospy.Time) - desired period between callbacks
  • callback (function taking rospy.TimerEvent) - callback to be called
  • oneshot (bool) - if True, fire only once, otherwise fire continuously until shutdown is called [default: False]
Overrides: object.__init__

run(self)

source code 
Overrides: threading.Thread.run