Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill in message_info timestamps #163

Merged
merged 3 commits into from
Apr 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1972,13 +1972,17 @@ static rmw_ret_t rmw_take_int(
dds_sample_info_t info;
while (dds_take(sub->enth, &ros_message, &info, 1, 1) == 1) {
if (info.valid_data) {
*taken = true;
if (message_info) {
message_info->publisher_gid.implementation_identifier = eclipse_cyclonedds_identifier;
memset(message_info->publisher_gid.data, 0, sizeof(message_info->publisher_gid.data));
assert(sizeof(info.publication_handle) <= sizeof(message_info->publisher_gid.data));
memcpy(
message_info->publisher_gid.data, &info.publication_handle,
sizeof(info.publication_handle));
message_info->source_timestamp = info.source_timestamp;
// TODO(iluetkeb) add received timestamp, when implemented by Cyclone
message_info->received_timestamp = 0;
}
#if REPORT_LATE_MESSAGES > 0
dds_time_t tnow = dds_time();
Expand All @@ -1987,7 +1991,6 @@ static rmw_ret_t rmw_take_int(
fprintf(stderr, "** sample in history for %.fms\n", static_cast<double>(dt) / 1e6);
}
#endif
*taken = true;
return RMW_RET_OK;
}
}
Expand Down