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

make parameters work in depth_image_proc #544

Merged
merged 1 commit into from Jun 12, 2020
Merged

make parameters work in depth_image_proc #544

merged 1 commit into from Jun 12, 2020

Conversation

mikeferguson
Copy link
Member

@mikeferguson mikeferguson commented Jun 12, 2020

No description provided.

@@ -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?
Copy link
Member

@SteveMacenski SteveMacenski Jun 12, 2020

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.

Copy link
Member Author

@mikeferguson mikeferguson Jun 12, 2020

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.

Copy link
Member Author

@mikeferguson mikeferguson Jun 12, 2020

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

Copy link
Member

@SteveMacenski SteveMacenski Jun 12, 2020

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.

Copy link
Member Author

@mikeferguson mikeferguson Jun 12, 2020

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.

@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 12, 2020

Let me know what you want to do about the distance parameter (if anything)

@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 12, 2020

t/project/build/depth_image_proc/test_results/depth_image_proc/uncrustify.xunit.xml'
 
  >>>
 
build/depth_image_proc/test_results/depth_image_proc/cpplint.xunit.xml: 12 tests, 0 errors, 1 failure, 0 skipped
 
- depth_image_proc.cpplint whitespace/line_length [2] (/root/project/src/image_pipeline/depth_image_proc/src/disparity.cpp:89)
 
  <<< failure message
 
    Lines should be <= 100 characters long
 
  >>>
 
build/depth_image_proc/test_results/depth_image_proc/uncrustify.xunit.xml: 12 tests, 0 errors, 1 failure, 0 skipped
 
- depth_image_proc.uncrustify src/disparity.cpp
 
  <<< failure message
 
    Diff with 6 lines
 
  >>>

Linters again

@SteveMacenski SteveMacenski merged commit c819047 into ros-perception:ros2 Jun 12, 2020
1 of 2 checks passed
@SteveMacenski
Copy link
Member

SteveMacenski commented Jun 12, 2020

Thanks for fixing that up :-)

@mikeferguson mikeferguson deleted the fix_params branch Jun 12, 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