Skip to content

Commit

Permalink
Explicit time conversion (#657)
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Rodrigues <[email protected]>
  • Loading branch information
AiVerisimilitude authored Nov 13, 2023
1 parent cad665e commit a29e656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion quality_of_service_demo/rclcpp/src/message_lost_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class MessageLostListener : public rclcpp::Node
[this](const sensor_msgs::msg::Image::ConstSharedPtr msg) -> void
{
rclcpp::Time now = this->get_clock()->now();
auto diff = now - msg->header.stamp;
rclcpp::Time stamp_time(msg->header.stamp, RCL_ROS_TIME);
auto diff = now - stamp_time;
RCLCPP_INFO(
this->get_logger(),
"I heard an image. Message single trip latency: [%f]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class QosOverridesListener : public rclcpp::Node
[this](sensor_msgs::msg::Image::ConstSharedPtr msg) -> void
{
rclcpp::Time now = this->get_clock()->now();
auto diff = now - msg->header.stamp;
rclcpp::Time stamp_time(msg->header.stamp, RCL_ROS_TIME);
auto diff = now - stamp_time;
RCLCPP_INFO(
this->get_logger(),
"I heard an image. Message single trip latency: [%f]",
Expand Down

0 comments on commit a29e656

Please sign in to comment.