RosTimerΒΆ

Inherits: RefCounted

A timer that triggers a callback at a fixed rate, synchronized with the ROS 2 executor.

DescriptionΒΆ

RosTimer provides a way to execute Godot code on a regular schedule, managed by the ROS 2 executor. It is created through RosNode.create_timer().

Unlike Godot's built-in timers, RosTimer is tied to the ROS 2 clock and processing loop, making it more suitable for tasks requiring synchronization with ROS 2 events or simulation time.

MethodsΒΆ

void

cancel()

float

get_remaining_time() const

bool

is_canceled() const

bool

is_ready() const

void

reset()


Method DescriptionsΒΆ

void cancel() πŸ”—

Stops the timer from triggering its callback.


float get_remaining_time() const πŸ”—

Returns the amount of time (in seconds) remaining until the next timer trigger.


bool is_canceled() const πŸ”—

Returns true if the timer has been canceled.


bool is_ready() const πŸ”—

Returns true if the timer is ready to trigger its callback.


void reset() πŸ”—

Resets the timer's internal clock. If the timer was previously canceled, it will start running again.