Function rcl_clock_get_now

Function Documentation

rcl_ret_t rcl_clock_get_now(rcl_clock_t *clock, rcl_time_point_value_t *time_point_value)

Fill the time point value with the current value of the associated clock.

This function will populate the data of the time_point_value object with the current value from it’s associated time abstraction.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

Yes [1]

Lock-Free

Yes

[1] If is of RCL_ROS_TIME type.

Parameters:
  • clock[in] The time source from which to set the value.

  • time_point_value[out] The time_point value to populate.

Returns:

RCL_RET_OK if the last call time was retrieved successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_ERROR an unspecified error occur.