Skip to content

reconsider signature of rcl_clock_get_now #273

@dirk-thomas

Description

@dirk-thomas

Currently the function takes a rcl_time_point_t * but neither checks the clock_type nor set the clock_type:

rcl/rcl/src/rcl/time.c

Lines 228 to 240 in d3a734f

rcl_ret_t
rcl_clock_get_now(rcl_clock_t * clock, rcl_time_point_t * time_point)
{
RCL_CHECK_ARGUMENT_FOR_NULL(time_point, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator());
if (clock->type && clock->get_now) {
return clock->get_now(clock->data,
&(time_point->nanoseconds));
}
RCL_SET_ERROR_MSG(
"clock is not initialized or does not have get_now registered.",
rcl_get_default_allocator());
return RCL_RET_ERROR;
}

Should the signature be changed to a rcl_time_point_value_t instead?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions