|
nros C API
Lightweight ROS 2 client for embedded real-time systems
|
#include <nros_generated.h>

Data Fields | |
| void * | _executor |
| rclc_timer_callback_with_context_t | callback |
| const struct rcl_clock_t * | clock |
| void * | context |
| size_t | handle_id |
| uint64_t | period_ns |
| enum rclc_timer_state_t | state |
Timer structure.
Already an arena handle before phase-487: rclc_executor_add_timer creates the timer inside the executor arena and records (handle_id, _executor) here, and every live accessor forwards there. The period, callback, context and clock are the REGISTRATION INPUTS: rclc's rclc_timer_init_default(timer, support, period, callback) takes them at init, before any executor exists, and a removed timer can be added again, so they stay. phase-487 W3 removed the one field that was a copy, last_call_time_ns: written by init and reset, read by nothing, and stale for any timer the executor ran (issue 1049).
| void* rcl_timer_t::_executor |
Opaque pointer to internal executor (set by rclc_executor_add_timer)
| rclc_timer_callback_with_context_t rcl_timer_t::callback |
User callback function
| const struct rcl_clock_t* rcl_timer_t::clock |
The clock this timer is scheduled against, or NULL for the WALL timer rclc_timer_init_with_context creates (phase-430 W1).
rcl's rcl_timer_init takes a rcl_clock_t * here and rcl's timer keeps it; ours does the same, in the same position, so a reader of one recognises the other. The clock must outlive the timer — the executor reads its type at rclc_executor_add_timer time, not at init.
| void* rcl_timer_t::context |
User context pointer
| size_t rcl_timer_t::handle_id |
Handle ID from executor registration (SIZE_MAX = not registered)
| uint64_t rcl_timer_t::period_ns |
Period in nanoseconds
| enum rclc_timer_state_t rcl_timer_t::state |
Current state