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

Data Fields | |
| uint64_t | _opaque [EXECUTOR_OPAQUE_U64S] |
| size_t | handle_count |
| bool | in_dispatch |
| uint64_t | invocation_time_ns |
| size_t | max_handles |
| enum nros_executor_semantics_t | semantics |
| size_t | service_count |
| enum nros_executor_state_t | state |
| size_t | subscription_count |
| const struct nros_support_t * | support |
| uint64_t | timeout_ns |
| size_t | timer_count |
| nros_executor_trigger_t | trigger |
| void * | trigger_context |
Executor structure.
The executor delegates all dispatch logic to an internal executor. The C struct retains state, timeout, and per-type counters for API compatibility.
The internal executor is stored inline in _opaque — no heap allocation is needed. The storage size is computed at build time from NROS_EXECUTOR_MAX_CBS and NROS_EXECUTOR_ARENA_SIZE.
| uint64_t nros_executor_t::_opaque[EXECUTOR_OPAQUE_U64S] |
Inline opaque storage for the executor. Managed by nros_executor_init/fini — no heap allocation needed.
| size_t nros_executor_t::handle_count |
Number of handles registered
| bool nros_executor_t::in_dispatch |
Reentrancy guard: set to true while spin_once is dispatching callbacks. Blocking helpers (nros_client_call, nros_action_send_goal, etc.) check this flag and return NROS_RET_REENTRANT if set.
| uint64_t nros_executor_t::invocation_time_ns |
Next invocation time in nanoseconds for drift-compensated spin_period
| size_t nros_executor_t::max_handles |
Maximum handles (configured at init)
| enum nros_executor_semantics_t nros_executor_t::semantics |
Data communication semantics
| size_t nros_executor_t::service_count |
Number of service handles
| enum nros_executor_state_t nros_executor_t::state |
Current state
| size_t nros_executor_t::subscription_count |
Number of subscription handles
| const struct nros_support_t* nros_executor_t::support |
Pointer to support context
| uint64_t nros_executor_t::timeout_ns |
Timeout in nanoseconds for spin_some
| size_t nros_executor_t::timer_count |
Number of timer handles
| nros_executor_trigger_t nros_executor_t::trigger |
Trigger function (NULL = default "any" trigger)
| void* nros_executor_t::trigger_context |
User context for trigger function