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

Fix bugs related to subscription age and setting timeout (#609, #611) #612

Merged
merged 1 commit into from
Nov 10, 2020
Merged

Fix bugs related to subscription age and setting timeout (#609, #611) #612

merged 1 commit into from
Nov 10, 2020

Conversation

mschickler
Copy link
Contributor

#609 - The original code used rclcpp::Clock::now() to retrieve the time, which returns a clock of type RCL_SYSTEM_TIME. All other code is using rclcpp::Node::now() which returns a clock of type RCL_ROS_TIME. The two time sources are not compatible and cannot be compared or operated on together. This change pushes the code down into the impl where the node handle is available for calling now() when now is not provided as an argument. It is worth noting that calling age(node->now()) instead of age() is not even possible as a workaround since that will result in another exception due to the passed time object source not being compatible with rclcpp::Time(0,0). Similar "what" text as the original problem, just having to do with comparing to unlike time sources.

#611 - There is no constructor for rclcpp::Duration that takes a double. Convert to a std::chrono::duration before passing to the setTimeout() function that takes a rclcpp::Duration.

@pjreed pjreed self-assigned this Nov 10, 2020
@pjreed
Copy link
Contributor

pjreed commented Nov 10, 2020

Good catch, thanks!

@pjreed pjreed merged commit cc1943d into swri-robotics:dashing-devel Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants