rclpy.timer module

class rclpy.timer.Rate(timer: Timer, *, context)

Bases: object

A utility for sleeping at a fixed rate.

destroy()
sleep()

Block until timer triggers.

Care should be taken when calling this from a callback. This may block forever if called in a callback in a SingleThreadedExecutor.

class rclpy.timer.Timer(callback, callback_group, timer_period_ns, clock, *, context=None)

Bases: object

cancel()
property clock
destroy()
property handle
is_canceled()
is_ready()
reset()
time_since_last_call()
time_until_next_call()
property timer_period_ns