-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(smoother):Add footprint collision checking to SimpleSmoother #5462
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
base: main
Are you sure you want to change the base?
feat(smoother):Add footprint collision checking to SimpleSmoother #5462
Conversation
Signed-off-by: CPPavithra <[email protected]>
@CPPavithra check out the CI build issues on linting / system build. Your solution does not compile. |
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.
How was this tested? I think a new test case(s) might be good to make sure this works properly
@@ -94,6 +95,7 @@ class SimpleSmoother : public nav2_core::Smoother | |||
* @param costmap Pointer to minimal costmap | |||
* @param max_time Maximum time to compute, stop early if over limit | |||
*/ | |||
|
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.
Remove extra space
@@ -124,6 +126,9 @@ class SimpleSmoother : public nav2_core::Smoother | |||
int max_its_, refinement_ctr_, refinement_num_; | |||
bool do_refinement_, enforce_path_inversion_; | |||
std::shared_ptr<nav2_costmap_2d::CostmapSubscriber> costmap_sub_; | |||
//member variables added to store foorprint sub and collision checker |
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.
Remove comment
auto node = parent.lock(); | ||
logger_ = node->get_logger(); | ||
|
||
declare_parameter_if_not_declared( |
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.
Why the reorganization? Revert to only the line changes required for the feature addition please.
@@ -126,6 +138,7 @@ void SimpleSmoother::smoothImpl( | |||
|
|||
nav_msgs::msg::Path new_path = path; | |||
nav_msgs::msg::Path last_path = path; | |||
const nav_msgs::msg::Path original_path = path; //new var |
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.
Why the comment?
@@ -199,6 +212,30 @@ void SimpleSmoother::smoothImpl( | |||
} | |||
|
|||
updateApproximatePathOrientations(new_path, reversing_segment); | |||
|
|||
/* *********************************************************************** |
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.
Why these blocks? Remove?
************** START: NEW FOOTPRINT COLLISION CHECKING ***************** | ||
************************************************************************/ | ||
//After smoothing,we perform a full footprint collision check on the result. | ||
for (const auto & pose : new_path.poses) { |
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.
I think the collision checking should be modifying the block in the while loop so we can exit out in the first iteration that becomes invalid. That way, we can smooth as much as possible before causing collision (as we do now).
If you updateApproximatePathOrientations
proactively before checking collision, you can use the footprint checker in the while loop.
Basic Info
Description of contribution in a few bullet points
SimpleSmoother
.Description of documentation updates required from your changes
No documentation changes are required. This PR is a bug fix that improves the safety and correctness of the smoother without adding new user-facing parameters or behaviors that need configuration.
Description of how this change was tested
nav2_smoother
package.colcon test
.Future work that may be required in bullet points
For Maintainers: - [ ] Check that any new parameters added are updated in docs.nav2.org
backport-*
.