rclpy.experimental.async_timer module

class rclpy.experimental.async_timer.AsyncTimer(timer_period_ns: int, clock: AsyncClock, context: Context, callback: Callable[[], None] | Callable[[TimerInfo], None] | Callable[[], Awaitable[None]] | Callable[[TimerInfo], Awaitable[None]], autostart: bool, on_destroy: Callable[[AsyncTimer], None], tg: TaskGroup | None = None)

Bases: BaseTimer

A periodic timer.

Experimental

This API is experimental.

Create a timer.

Warning

Users should not create a timer with this constructor, instead they should call Node.create_timer() or AsyncNode.create_timer().

property callback: Callable[[], None] | Callable[[TimerInfo], None] | Callable[[], Awaitable[None]] | Callable[[TimerInfo], Awaitable[None]]
cancel() None