Typedef rcl_timer_callback_t

Typedef Documentation

typedef void (*rcl_timer_callback_t)(rcl_timer_t*, int64_t)

User callback signature for timers.

The first argument the callback gets is a pointer to the timer. This can be used to cancel the timer, query the time until the next timer callback, exchange the callback with a different one, etc.

The only caveat is that the function rcl_timer_get_time_since_last_call() will return the time since just before this callback was called, not the previous call. Therefore the second argument given is the time since the previous callback was called, because that information is no longer accessible via the timer. The time since the last callback call is given in nanoseconds.