Function rclc_executor_spin_some

Function Documentation

rcl_ret_t rclc_executor_spin_some(rclc_executor_t *executor, const uint64_t timeout_ns)

The spin_some function checks one-time for new data from the DDS-queue.

The static-LET executor performs the following actions:

  • initializes the wait_set with all handle of the array executor->handles

  • waits for new data from DDS queue with rcl_wait() with timeout executor->timeout_ns

  • takes all ready handles from the wait_set with rcl_take()

  • processes all handles in the order, how they were added to the executor with the respective add-functions by calling respective callback (thus implementing first-read, process, semantic of LET)

Memory is dynamically allocated within rcl-layer, when DDS queue is accessed with rcl_wait_set_init()

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • executor[inout] pointer to initialized executor

  • timeout_ns[in] timeout in nanoseconds

Returns:

RCL_RET_OK if spin_once operation was successful

Returns:

RCL_RET_INVALID_ARGUMENT if any parameter is a null pointer

Returns:

RCL_RET_TIMEOUT if rcl_wait() returned timeout (aka no data is avaiable during until the timeout)

Returns:

RCL_RET_ERROR if any other error occured