-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Smooth path even if goal pose is so much near to the robot #5423
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
Smooth path even if goal pose is so much near to the robot #5423
Conversation
bd5e57a to
bd58af2
Compare
| std::lock_guard<nav2_costmap_2d::Costmap2D::mutex_t> lock(*(costmap->getMutex())); | ||
|
|
||
| for (unsigned int i = 0; i != path_segments.size(); i++) { | ||
| if (path_segments[i].end - path_segments[i].start > 9) { |
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.
The path segments still need to be large enough to smooth, i.e. at least size 3, if not that size, it cannot be smoothed any more than it is. I think you just need to update 9 to 3 for this case. It was 9 due to copy+pasting from the SG Filter Smoother in the other plugin which does require length > 9 due to its formulation
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.
It's reasonable. But we have to be careful about the cases which path has 2 pose and we does not set the orientation. Instead of removing the limitation, we can always set orientations first before smoothing? I've seen that when smoothing goes wrong, we always set orientation and thow an exception. How does it sounds to you? With these, we can fix SG Filter as well. two birds in one stone.
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 in #5424 we're discussing putting orientations into NavFn / Theta* itself, so that should handle that problem, no?
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've changed this part as 3 but IMO, it should be 1, it's because end - start + 1 gives you the pose number of segment, not end - start. additionaly, we should smooth the segments having 3 poses. end - start + 1 > 2 goes to end - start > 1 What do you think?
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 we have a path of 1, we can't smooth it. If we have a path of 2, there's nothing to smooth, its always a straight line. Anything less than 3 is meaningless to 'smooth' because its a null operation.
| reversing_segment = false; | ||
|
|
||
| // Find if this path segment is in reverse | ||
| dx = path.poses[2].pose.position.x - path.poses[1].pose.position.x; |
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 this should be reverted.
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.
Could you like to explain of why we have to use 2 - 1 as index ? I tried to search in detail and I still haven't understood.
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.
The first point isn't planned, its typically just the robot's state. The i=1th point is the first truly planned point
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.
Hmm, interesting, thank you. Just for sanity check, for ackermann car, would'nt it be a little bit problematic? for example car has 90 degree yaw angle but path goes along to 270 degree. In that case, the sign of the orientation can give rise to unfeasible control of car. Just 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.
This smoother is only for holonomic planners
|
Otherwise LGTM! |
Signed-off-by: CihatAltiparmak <[email protected]>
Signed-off-by: CihatAltiparmak <[email protected]>
fd2b4d8 to
9389c65
Compare
|
I^ve applied your suggestions. Our next PR should be about sharing common smoothing util function with planners. Then time to the coup de grace goes to setting orientation at planning phase. |
…less_than_ten_poses
Signed-off-by: CihatAltiparmak <[email protected]>
…ation#5423) * Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]>
* Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]>
* Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]>
* Conserve curvature with LIMIT action (#5255) * Conserve curvature with LIMIT action Signed-off-by: Tony Najjar <[email protected]> * fix format Signed-off-by: Tony Najjar <[email protected]> * fix test Signed-off-by: Tony Najjar <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]> * Adding epsilon for voxel_layer precision loss (#5314) * Adding epsilon for voxel_layer precision loss Signed-off-by: bhx <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: bhx <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * fix: correct ThroughActionResult type alias in would_a_planner_recovery_help_condition (#5326) The ThroughActionResult type alias was incorrectly referencing Action::Result instead of ThroughAction::Result, causing the condition to not work properly for ComputePathThroughPoses actions. Fixes #5324 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Adding slow down at target heading to RPP Controller (#5361) * Adding slow down at target heading to RPP Signed-off-by: SteveMacenski <[email protected]> * Update test_regulated_pp.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Steve Macenski <[email protected]> * Eexception rethrow in dockRobot method (#5364) Signed-off-by: Alberto Tudela <[email protected]> * Add global min obstacle height in voxel layer (#5389) * Add min obstacle height in voxel layer Signed-off-by: mini-1235 <[email protected]> * Fix linting Signed-off-by: Maurice <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> * [DEX] Enforce 3 digits precision (#5398) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * [static_layer] limit comparison precision (#5405) * [DEX] limit comparison precision Signed-off-by: Guillaume Doisy <[email protected]> * EPSILON 1e-5 Signed-off-by: Guillaume Doisy <[email protected]> --------- Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Smooth path even if goal pose is so much near to the robot (#5423) * Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]> * Fix KeepoutFilter on the ARM architecture (#5436) Signed-off-by: Sushant Chavan <[email protected]> * Fix missing dependency (#5460) * bump to 1.3.8 for Jazzy release Aug 19, 2025 Signed-off-by: SteveMacenski <[email protected]> * load balance CI Signed-off-by: SteveMacenski <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]> Signed-off-by: bhx <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> Signed-off-by: Guillaume Doisy <[email protected]> Signed-off-by: CihatAltiparmak <[email protected]> Signed-off-by: Sushant Chavan <[email protected]> Co-authored-by: Tony Najjar <[email protected]> Co-authored-by: hutao <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Alberto Tudela <[email protected]> Co-authored-by: mini-1235 <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Cihat Kurtuluş Altıparmak <[email protected]> Co-authored-by: Sushant Chavan <[email protected]> Co-authored-by: Tim Clephas <[email protected]>
* enable_groot_monitoring_ false (#5246) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Add min_distance_to_obstacle parameter to RPP (#4543) * min_distance_to_obstacle Signed-off-by: Guillaume Doisy <[email protected]> * suggestion to time base and combine Signed-off-by: Guillaume Doisy <[email protected]> * typo Signed-off-by: Guillaume Doisy <[email protected]> * use min_approach_linear_velocity Signed-off-by: Guillaume Doisy <[email protected]> --------- Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Parametrizing obstacle layer tf filter tolerance (#5261) Signed-off-by: Marco Bassa <[email protected]> * Fix backport compiler warning (#5277) Signed-off-by: Steve Macenski <[email protected]> * Add missing include of algorithm in differential_motion_model.cpp (#5293) Signed-off-by: Silvio Traversaro <[email protected]> * Remove unused unistd.h header from route_tool.cpp (#5292) Signed-off-by: Silvio Traversaro <[email protected]> * Adding epsilon for voxel_layer precision loss (#5314) * Adding epsilon for voxel_layer precision loss Signed-off-by: bhx <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: bhx <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * fix: correct ThroughActionResult type alias in would_a_planner_recovery_help_condition (#5326) The ThroughActionResult type alias was incorrectly referencing Action::Result instead of ThroughAction::Result, causing the condition to not work properly for ComputePathThroughPoses actions. Fixes #5324 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * outputting tracker feedback on ComputeAndTrack BT node (#5327) * outputting tracker feedback on BT node Signed-off-by: Alexander Yuen <[email protected]> * initializing outputs Signed-off-by: Alexander Yuen <[email protected]> * outputting last state on success Signed-off-by: Alexander Yuen <[email protected]> * linting Signed-off-by: Alexander Yuen <[email protected]> * fixed nav2_tree_nodes.xml Signed-off-by: Alexander Yuen <[email protected]> * Update nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/compute_and_track_route_action.hpp Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: alexanderjyuen <[email protected]> * consolidated function to set outputs null, only setOutput with active feedback Signed-off-by: Alexander Yuen <[email protected]> * add class to method Signed-off-by: Alexander Yuen <[email protected]> * linting Signed-off-by: Alexander Yuen <[email protected]> --------- Signed-off-by: Alexander Yuen <[email protected]> Signed-off-by: alexanderjyuen <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * Adding slow down at target heading to RPP Controller (#5361) * Adding slow down at target heading to RPP Signed-off-by: SteveMacenski <[email protected]> * Update test_regulated_pp.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Steve Macenski <[email protected]> * Include <stdexcept> in docking_exceptions.hpp for exception handling (#5363) Signed-off-by: Alberto Tudela <[email protected]> * Eexception rethrow in dockRobot method (#5364) Signed-off-by: Alberto Tudela <[email protected]> * Add global min obstacle height in voxel layer (#5389) * Add min obstacle height in voxel layer Signed-off-by: mini-1235 <[email protected]> * Fix linting Signed-off-by: Maurice <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> * [DEX] Enforce 3 digits precision (#5398) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * [static_layer] limit comparison precision (#5405) * [DEX] limit comparison precision Signed-off-by: Guillaume Doisy <[email protected]> * EPSILON 1e-5 Signed-off-by: Guillaume Doisy <[email protected]> --------- Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * corner case bin check (#5413) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Add IndexType definition for Nanoflann KDTree in `node_spatial_tree`. (#5420) * fix: Add KDTree type definition to include unsigned int for IndexType Signed-off-by: Ericsii <[email protected]> * code format Signed-off-by: Ericsii <[email protected]> --------- Signed-off-by: Ericsii <[email protected]> * Smooth path even if goal pose is so much near to the robot (#5423) * Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]> * Fix KeepoutFilter on the ARM architecture (#5436) Signed-off-by: Sushant Chavan <[email protected]> * Fix missing dependency (#5460) * Support loading multiple behavior tree files as subtrees (#5426) * Support loading multiple behavior tree files as subtrees Signed-off-by: Jad El Hajj <[email protected]> * Fix code style Signed-off-by: Jad El Hajj <[email protected]> * Added default param value Signed-off-by: Jad El Hajj <[email protected]> * Added recursive check to loadBehaviorTree and adapted unit test accordingly Signed-off-by: Jad El Hajj <[email protected]> * Removed nested loadBehaviorTree check in navigators Signed-off-by: Jad El Hajj <[email protected]> * Removed whitespace cpplint Signed-off-by: Jad El Hajj <[email protected]> * Fixed goalReceived Signed-off-by: Jad El Hajj <[email protected]> * Let loadbehaviorTree use its own search_directories var Signed-off-by: Jad El Hajj <[email protected]> * PR fixes-format-lint and test Signed-off-by: Jad El Hajj <[email protected]> * fix pointer Signed-off-by: Jad El Hajj <[email protected]> * Added unit test for BT xml validity Signed-off-by: Jad El Hajj <[email protected]> * CPPLint Signed-off-by: Jad El Hajj <[email protected]> * Check non existent search directory for bt Signed-off-by: Jad El Hajj <[email protected]> * CPPLint Signed-off-by: Jad El Hajj <[email protected]> * Fixed BT tests Signed-off-by: Jad El Hajj <[email protected]> * Fixed BT tests Signed-off-by: Jad El Hajj <[email protected]> --------- Signed-off-by: Jad El Hajj <[email protected]> * bump 1.4.0 to 1.4.1 for aug 19 sync Signed-off-by: SteveMacenski <[email protected]> * Fixing backport error Signed-off-by: SteveMacenski <[email protected]> * load balance CI Signed-off-by: SteveMacenski <[email protected]> * Fixing BT Navigator backport merge conflict issue Signed-off-by: SteveMacenski <[email protected]> --------- Signed-off-by: Guillaume Doisy <[email protected]> Signed-off-by: Marco Bassa <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: Silvio Traversaro <[email protected]> Signed-off-by: bhx <[email protected]> Signed-off-by: Alexander Yuen <[email protected]> Signed-off-by: alexanderjyuen <[email protected]> Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> Signed-off-by: Ericsii <[email protected]> Signed-off-by: CihatAltiparmak <[email protected]> Signed-off-by: Sushant Chavan <[email protected]> Signed-off-by: Jad El Hajj <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Marco Bassa <[email protected]> Co-authored-by: Silvio Traversaro <[email protected]> Co-authored-by: hutao <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: alexanderjyuen <[email protected]> Co-authored-by: Alberto Tudela <[email protected]> Co-authored-by: mini-1235 <[email protected]> Co-authored-by: YLFeng <[email protected]> Co-authored-by: Cihat Kurtuluş Altıparmak <[email protected]> Co-authored-by: Sushant Chavan <[email protected]> Co-authored-by: Tim Clephas <[email protected]> Co-authored-by: Jad EL HAJJ <[email protected]>
* Conserve curvature with LIMIT action (ros-navigation#5255) * Conserve curvature with LIMIT action Signed-off-by: Tony Najjar <[email protected]> * fix format Signed-off-by: Tony Najjar <[email protected]> * fix test Signed-off-by: Tony Najjar <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]> * Adding epsilon for voxel_layer precision loss (ros-navigation#5314) * Adding epsilon for voxel_layer precision loss Signed-off-by: bhx <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> * Update nav2_costmap_2d/plugins/voxel_layer.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: bhx <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * fix: correct ThroughActionResult type alias in would_a_planner_recovery_help_condition (ros-navigation#5326) The ThroughActionResult type alias was incorrectly referencing Action::Result instead of ThroughAction::Result, causing the condition to not work properly for ComputePathThroughPoses actions. Fixes ros-navigation#5324 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Adding slow down at target heading to RPP Controller (ros-navigation#5361) * Adding slow down at target heading to RPP Signed-off-by: SteveMacenski <[email protected]> * Update test_regulated_pp.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Steve Macenski <[email protected]> * Eexception rethrow in dockRobot method (ros-navigation#5364) Signed-off-by: Alberto Tudela <[email protected]> * Add global min obstacle height in voxel layer (ros-navigation#5389) * Add min obstacle height in voxel layer Signed-off-by: mini-1235 <[email protected]> * Fix linting Signed-off-by: Maurice <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> * [DEX] Enforce 3 digits precision (ros-navigation#5398) Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * [static_layer] limit comparison precision (ros-navigation#5405) * [DEX] limit comparison precision Signed-off-by: Guillaume Doisy <[email protected]> * EPSILON 1e-5 Signed-off-by: Guillaume Doisy <[email protected]> --------- Signed-off-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Smooth path even if goal pose is so much near to the robot (ros-navigation#5423) * Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]> * Fix KeepoutFilter on the ARM architecture (ros-navigation#5436) Signed-off-by: Sushant Chavan <[email protected]> * Fix missing dependency (ros-navigation#5460) * bump to 1.3.8 for Jazzy release Aug 19, 2025 Signed-off-by: SteveMacenski <[email protected]> * load balance CI Signed-off-by: SteveMacenski <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]> Signed-off-by: bhx <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: SteveMacenski <[email protected]> Signed-off-by: Alberto Tudela <[email protected]> Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Maurice <[email protected]> Signed-off-by: Guillaume Doisy <[email protected]> Signed-off-by: CihatAltiparmak <[email protected]> Signed-off-by: Sushant Chavan <[email protected]> Co-authored-by: Tony Najjar <[email protected]> Co-authored-by: hutao <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Alberto Tudela <[email protected]> Co-authored-by: mini-1235 <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Cihat Kurtuluş Altıparmak <[email protected]> Co-authored-by: Sushant Chavan <[email protected]> Co-authored-by: Tim Clephas <[email protected]>
…ation#5423) * Smooth path even if goal pose is so much near to the robot Signed-off-by: CihatAltiparmak <[email protected]> * Apply suggestions Signed-off-by: CihatAltiparmak <[email protected]> * Remove unnecessary diff Signed-off-by: CihatAltiparmak <[email protected]> --------- Signed-off-by: CihatAltiparmak <[email protected]>
Basic Info
Description of contribution in a few bullet points
I have removed the limitation of pose number from smooth method, so that robot's plan can be smoothed
Description of documentation updates required from your changes
no
Description of how this change was tested
Future work that may be required in bullet points
For Maintainers:
backport-*.