Function rcl_set_ros_time_override

Function Documentation

rcl_ret_t rcl_set_ros_time_override(rcl_clock_t *clock, rcl_time_point_value_t time_value)

Set the current time for this RCL_ROS_TIME time source.

This function will update the internal storage for the RCL_ROS_TIME time source. If queried and override enabled the time source will return this value, otherwise it will return the system time.

This function is not thread-safe with rcl_clock_add_jump_callback(), nor rcl_clock_remove_jump_callback() functions when used on the same clock object.

Attribute

Adherence [1]

Allocates Memory

No

Thread-Safe

No [2]

Uses Atomics

Yes

Lock-Free

Yes

[1] Only applies to the function itself, as jump callbacks may not abide to it. [2] Function is reentrant, but concurrent calls on the same object are not safe.

Parameters:
  • clock[in] The clock to update.

  • time_value[in] The new current time.

Returns:

RCL_RET_OK if the time source was set successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ERROR an unspecified error occur.