Function rclc_executor_add_subscription_with_context

Function Documentation

rcl_ret_t rclc_executor_add_subscription_with_context(rclc_executor_t *executor, rcl_subscription_t *subscription, void *msg, rclc_subscription_callback_with_context_t callback, void *context, rclc_executor_handle_invocation_t invocation)

Adds a subscription to an executor.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • executor[inout] pointer to initialized executor

  • subscription[in] pointer to an allocated subscription

  • msg[in] pointer to an allocated message

  • callback[in] function pointer to a callback

  • context[in] type-erased ptr to additional callback context

  • invocation[in] invocation type for the callback (ALWAYS or only ON_NEW_DATA)

Returns:

RCL_RET_OK if add-operation was successful

Returns:

RCL_RET_INVALID_ARGUMENT if any parameter is a null pointer (NULL context is ignored)

Returns:

RCL_RET_ERROR if any other error occured