Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Fixed deprecation warning for Duration constructor in ROS Galactic when building with LDMRS support #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions driver/src/ldmrs/sick_ldmrs_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down