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

feat(obstacle_collision_checker): fix dynamic parameter update #2153

Closed

Conversation

brkay54
Copy link
Member

@brkay54 brkay54 commented Oct 25, 2022

Signed-off-by: Berkay Karaman berkay@leodrive.ai

Description

Closes #2143

While Bus ODD tests, we needed to use obstacle_collision_checker package to bring to vehicle collision awareness. If vehicle can not stop with nominal acceleration before collision, it should send emergency stop. However, obstacle_collision_checker failed in tests.
After little investigation, we realize the parameters are returning zero. Because search_radius is returning zero, node can not detect anything in the lane. After some changes and updating param call back function, node run successfully.

Related links

Tests performed

Notes for reviewers

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@brkay54 brkay54 self-assigned this Oct 25, 2022
@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 10.82% // Head: 10.80% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (006a742) compared to base (cf6dda5).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2153      +/-   ##
==========================================
- Coverage   10.82%   10.80%   -0.02%     
==========================================
  Files        1177     1177              
  Lines       84506    84647     +141     
  Branches    19898    19986      +88     
==========================================
+ Hits         9149     9150       +1     
- Misses      65666    65797     +131     
- Partials     9691     9700       +9     
Flag Coverage Δ *Carryforward flag
differential 7.74% <0.00%> (?)
total 10.80% <0.00%> (ø) Carriedforward from cf6dda5

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...lision_checker_node/obstacle_collision_checker.cpp 5.00% <0.00%> (-2.53%) ⬇️
...n_checker_node/obstacle_collision_checker_node.cpp 0.86% <0.00%> (+0.13%) ⬆️
...ner/scene_module/pull_over/geometric_pull_over.hpp 0.00% <0.00%> (ø)
...nner/scene_module/pull_over/goal_searcher_base.hpp 0.00% <ø> (ø)
...src/scene_module/pull_over/geometric_pull_over.cpp 0.00% <0.00%> (ø)
...anner/src/scene_module/pull_over/goal_searcher.cpp 0.00% <0.00%> (ø)
...er/src/scene_module/pull_over/pull_over_module.cpp 0.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 90 to 93
// Dynamic Reconfigure
OnSetParametersCallbackHandle::SharedPtr set_param_res_;
rcl_interfaces::msg::SetParametersResult paramCallback(
const std::vector<rclcpp::Parameter> & parameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed and I do not understand why this fixes the issue.
Is another node setting the parameter search_radius to 0 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same question. I'd like to fix it properly.

Copy link
Member Author

@brkay54 brkay54 Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added dynamic reconfiguration again, and I updated update_param function, then parameters were set successfully. Also, I added node to control.launch.py. I am gonna change the PR name.

@brkay54 brkay54 changed the title feat(obstacle_collision_checker): remove dynamic parameter update feat(obstacle_collision_checker): fix dynamic parameter update Oct 27, 2022
Signed-off-by: Berkay Karaman <berkay@leodrive.ai>
Comment on lines +244 to +245
for (size_t i = 1; i < vehicle_footprints.size();
i++) { // skip first footprint because surround obstacle checker handle it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write the comment above the for-loop to fix layout?

Suggested change
for (size_t i = 1; i < vehicle_footprints.size();
i++) { // skip first footprint because surround obstacle checker handle it
// skip first footprint because surround obstacle checker handle it
for (size_t i = 1; i < vehicle_footprints.size(); i++) {

@@ -266,6 +297,7 @@ def launch_setup(context, *args, **kwargs):
shift_decider_component,
vehicle_cmd_gate_component,
operation_mode_transition_manager_component,
obstacle_collision_checker_component,
Copy link
Contributor

@kenji-miyake kenji-miyake Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TakaHoribe @yukkysaito How should we handle this? Is it okay for TIER IV to add this here, or should we consider another way? Maybe adding a if-condition is good?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the product, so I want to add an if-condition.

BTW, I feel strange that obstacle_collision_checker is in the control component.
I think it would be better to put obstacle_collision_checker into diagnostic systems and make it configurable there in the future.

[&name](const rclcpp::Parameter & parameter) { return parameter.get_name() == name; });
if (it != parameters.cend()) {
value = it->template get_value<T>();
const auto itr = std::find_if(
Copy link
Contributor

@kenji-miyake kenji-miyake Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brkay54 Since it seems that bug-fix and refactoring are mixed, could you split PRs into the appropriate sizes/types?

Copy link
Member Author

@brkay54 brkay54 Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review. I am going to close this PR and create 3 PRs for bug-fix, refactoring, and for launch files (I gonna add flag for obstacle_collision_checker to enable).

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.

obstacle_collision_checker does not run properly
4 participants