usdot-fhwa-stol / carma-utils

Utility libraries for hardware drivers in the CARMA Platform
2 stars 5 forks source link

fix rclcpp duration definition #229

Closed adev4a closed 4 months ago

adev4a commented 4 months ago

PR Details

This PR addresses https://github.com/usdot-fhwa-stol/carma-platform/issues/2388. The rclcpp::Duration instantiation in carma-utils was updated to use the format rclcpp::Duration(int nanoseconds, int seconds) in a prior commit https://github.com/usdot-fhwa-stol/carma-utils/pull/228, which still builds fine but breaks carma-platform during runtime.

This PR fixes the rclcpp duration instantiation in carma-utils to support foxy and humble versions.

Description

While testing the VRU test scenario on develop it was found that the current implementation causes motion computation node to throw a "Cannot store a negative time in rclcpp::Time while in Active state" exception.

Related GitHub Issue

https://github.com/usdot-fhwa-stol/carma-utils/pull/228

Related Jira Key

https://usdot-carma.atlassian.net/browse/CAR-6046

Motivation and Context

How Has This Been Tested?

Unit tested and integration tested on ros-foxy

Types of changes

Checklist:

adev4a commented 4 months ago

@afrye51 this updates the changes made in https://github.com/usdot-fhwa-stol/carma-utils/pull/228. Looking at the rclcpp Duration definition in humble https://github.com/ros2/rclcpp/blob/humble/rclcpp/include/rclcpp/duration.hpp, this should still work

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud