-
Notifications
You must be signed in to change notification settings - Fork 717
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
make parameters work in depth_image_proc #544
Conversation
@@ -66,7 +66,8 @@ class CropForemostNode : public rclcpp::Node | |||
CropForemostNode::CropForemostNode(const rclcpp::NodeOptions & options) | |||
: Node("CropForemostNode", options) | |||
{ | |||
this->get_parameter("distance", distance_); | |||
// TODO(ros2) What is a good default for this? |
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.
ROS1 had no default (and uninitialized, so 0, probably). We could declare without default so it crashes if not provided in a configuration file.
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.
Oh, there is a call with no default-- I hadn't noticed that. I'll update to that.
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.
Actually, there isn't a call to declare_parameters without a default. So i think for now, we leave this as-is
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.
@mikeferguson yes there is http://docs.ros2.org/dashing/api/rclcpp/classrclcpp_1_1Node.html. default_value=rclcpp::ParameterValue()
having the parameter value structure empty is an empty non-default argument that will throw an exception when you try to get
it. An example is https://github.com/ros-planning/navigation2/blob/master/nav2_bt_navigator/src/bt_navigator.cpp#L62 where I specifically made it so that if you don't provide a behavior tree, it will throw an exception and bring down the process as a fatal failure.
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.
ok - that wasn't compiling for me cause I still had the template parameter in there. updated and pushed.
Let me know what you want to do about the distance parameter (if anything) |
Linters again |
Thanks for fixing that up :-) |
No description provided.