From 39c107820ec2d2af45ecc818148e21ec057176be Mon Sep 17 00:00:00 2001 From: Krzysztof Suszka Date: Fri, 4 Mar 2022 13:47:55 +0100 Subject: [PATCH] Fixed deprecation warning for Duration constructor in ROS Galactic --- driver/src/ldmrs/sick_ldmrs_driver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/src/ldmrs/sick_ldmrs_driver.cpp b/driver/src/ldmrs/sick_ldmrs_driver.cpp index 14f700e..11296de 100755 --- a/driver/src/ldmrs/sick_ldmrs_driver.cpp +++ b/driver/src/ldmrs/sick_ldmrs_driver.cpp @@ -291,8 +291,8 @@ void SickLDMRS::pubObjects(datatypes::ObjectList &objects) for (int i = 0; i < objects.size(); i++) { oa.objects[i].id = objects[i].getObjectId(); - oa.objects[i].tracking_time = s_rclcpp_clock.now() - rclcpp::Duration(objects[i].getObjectAge() / expected_frequency_); // ros::Time::now() - ros::Duration(objects[i].getObjectAge() / expected_frequency_); - oa.objects[i].last_seen = s_rclcpp_clock.now() - rclcpp::Duration(objects[i].getHiddenStatusAge() / expected_frequency_); // ros::Time::now() - ros::Duration(objects[i].getHiddenStatusAge() / expected_frequency_); + oa.objects[i].tracking_time = s_rclcpp_clock.now() - rclcpp::Duration(0, objects[i].getObjectAge() / expected_frequency_); // ros::Time::now() - ros::Duration(objects[i].getObjectAge() / expected_frequency_); + oa.objects[i].last_seen = s_rclcpp_clock.now() - rclcpp::Duration(0, objects[i].getHiddenStatusAge() / expected_frequency_); // ros::Time::now() - ros::Duration(objects[i].getHiddenStatusAge() / expected_frequency_); oa.objects[i].velocity.twist.linear.x = objects[i].getAbsoluteVelocity().getX(); oa.objects[i].velocity.twist.linear.y = objects[i].getAbsoluteVelocity().getY(); oa.objects[i].velocity.twist.linear.x = objects[i].getAbsoluteVelocity().getX();