Function rcl_clock_init

Function Documentation

rcl_ret_t rcl_clock_init(rcl_clock_type_t clock_type, rcl_clock_t *clock, rcl_allocator_t *allocator)

Initialize a clock based on the passed type.

This will allocate all necessary internal structures, and initialize variables.

Attribute

Adherence

Allocates Memory

Yes [1]

Thread-Safe

No [2]

Uses Atomics

No

Lock-Free

Yes

[1] If is RCL_ROS_TIME [2] Function is reentrant, but concurrent calls on the same object are not safe. Thread-safety is also affected by that of the object.

Parameters:
  • clock_type[in] the type identifying the time source to provide

  • clock[in] the handle to the clock which is being initialized

  • allocator[in] The allocator to use for allocations

Returns:

RCL_RET_OK if the time source was successfully initialized, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ERROR an unspecified error occur.