-
Notifications
You must be signed in to change notification settings - Fork 971
Fix deprecation warnings for upcoming ROS Galactic release #631
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 deprecation warnings for upcoming ROS Galactic release #631
Conversation
If we are constructing from nanoseconds we must be explicit about the units. Signed-off-by: Jacob Perron <[email protected]>
If a default value is not provided, then we must specify the parameter type. Signed-off-by: Jacob Perron <[email protected]>
| first_measurement->topic_name_; | ||
| // revertTo may invalidate first_measurement | ||
| if (!revertTo(first_measurement_time - rclcpp::Duration(1))) { | ||
| if (!revertTo(first_measurement_time - rclcpp::Duration(1ns))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayrton04 should this be 1ns, 1s, ...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I meant to ask the same question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the equivalent ROS 1 code, it is also subtracting 1 nanosecond:
robot_localization/src/ros_filter.cpp
Line 611 in a2da33b
| if (!revertTo(firstMeasurementTime - 1e-9)) // revertTo may invalidate firstMeasurement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the PRs involved here are
https://github.com/cra-ros-pkg/robot_localization/pull/266/files
and
https://github.com/cra-ros-pkg/robot_localization/pull/279/files
The only reason we subtract any time at all is to ensure that we go to a measurement (presumably the first) that is before first_measurement_time. But we could also just change this to use >=:
robot_localization/src/ros_filter.cpp
Lines 3322 to 3323 in 3326e80
| while (!filter_state_history_.empty() && | |
| filter_state_history_.back()->last_measurement_time_ > time) |
If I had to guess (I didn't dig too far), the measurement times were likely stored as doubles originally, and the 1e-9 thing was just me being careful with floating point numbers. But ROS times have exact representations, so I think the 1e-9 could go, and we can change the revertTo reverse iteration to check for >= instead of just >.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, that change could be outside of scope for this. It was meant to be 1 nanosecond, yes.
|
@jacobperron I opened a |
Signed-off-by: Jacob Perron <[email protected]>
|
Hold up, there's more warnings in other files I've overlooked. |
Signed-off-by: Jacob Perron <[email protected]>
Okay, I think I got them all. |
|
Otherwise LGTM, waiting for Tom's response on that one comment |
Signed-off-by: Jacob Perron <[email protected]>
When there is a NoParameterOverrideProvided exception, the parameter is not declared so we don't need to undeclare it. Signed-off-by: Jacob Perron <[email protected]>
|
@SteveMacenski, feel free to merge. I know you said LGTM, but your review still had comments requested, so I re-requested your review. |
Try-catches were added in #631 due to a new rclcpp feature enforcing static parameter. The behavior was later patched for this particular use-case in ros2/rclcpp#1673, so now we can avoid having to try-catch. Signed-off-by: Jacob Perron <[email protected]>
Try-catches were added in #631 due to a new rclcpp feature enforcing static parameter. The behavior was later patched for this particular use-case in ros2/rclcpp#1673, so now we can avoid having to try-catch. Signed-off-by: Jacob Perron <[email protected]>
* Add missing message_filters dependency (#666) Headers from message_filters are included here: https://github.com/cra-ros-pkg/robot_localization/blob/67098c2341b5d1ccbcceb8eede60e79db74814a6/include/robot_localization/ros_robot_localization_listener.h\#L41-L42 Signed-off-by: Jacob Perron <[email protected]> * Remove try-catch blocks around declare_parameter (#663) Try-catches were added in #631 due to a new rclcpp feature enforcing static parameter. The behavior was later patched for this particular use-case in ros2/rclcpp#1673, so now we can avoid having to try-catch. Signed-off-by: Jacob Perron <[email protected]> Co-authored-by: Jacob Perron <[email protected]>
* Remove try-catch blocks around declare_parameter (#663) Try-catches were added in #631 due to a new rclcpp feature enforcing static parameter. The behavior was later patched for this particular use-case in ros2/rclcpp#1673, so now we can avoid having to try-catch. Signed-off-by: Jacob Perron <[email protected]> * Add missing message_filters dependency (#666) Headers from message_filters are included here: https://github.com/cra-ros-pkg/robot_localization/blob/67098c2341b5d1ccbcceb8eede60e79db74814a6/include/robot_localization/ros_robot_localization_listener.h\#L41-L42 Signed-off-by: Jacob Perron <[email protected]> * Revert "Enable QoS overrides (#657)" This reverts commit 2816e92. Co-authored-by: Jacob Perron <[email protected]>
Building against the latest version of rclcpp produces some deprecation warnings. This PR fixes warnings related to
rclcpp::Durationconstruction (6b36efd) andrclcpp::Node::declare_parameter(7055b82).Related tickets upstream, deprecating usage:
The second commit (7055b82) related to declare_parameter is not compatible with Foxy, so I recommend creating a new
galactic-develbranch and we can retarget this PR.