Feature addition: capability for the RRP to drive the robot backwards#2427
Feature addition: capability for the RRP to drive the robot backwards#2427padhupradheep wants to merge 7 commits intoros-navigation:foxy-develfrom
Conversation
Signed-off-by: Pradheep-office <padhupradheep@gmail.com>
SteveMacenski
left a comment
There was a problem hiding this comment.
Good first prototype stab at it! Needs some clean up though in formatting, readability, and a bit of simplification
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
|
ament_uncrustify and ament_cpplint fails for the other part of the code, which was not written as part of this feature. I will do the cleaning up and give a separate PR! |
|
This feature should also be targeted to |
...troller/include/nav2_regulated_pure_pursuit_controller/regulated_pure_pursuit_controller.hpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
|
All good updates, now just to get things into the C++ stylings and best practices |
|
Should this be a new PR ? I do not see any other way to merge the changes from my branch to |
|
A new PR would work but you'd also run into the same conflicts if you based these changes on Foxy, but you'd instead run into them locally when you tried to rebase. Copy paste would work... though never the most elegant solution 😉. |
SteveMacenski
left a comment
There was a problem hiding this comment.
Very good, just last clean up before merging. After these changes, do make sure to test a bit and make sure that you've covered all of the edge cases (reversing, reverse then back forward, doing that multiple times in a single path, etc)
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Outdated
Show resolved
Hide resolved
nav2_regulated_pure_pursuit_controller/src/regulated_pure_pursuit_controller.cpp
Show resolved
Hide resolved
| const geometry_msgs::msg::PoseStamped & pose ) | ||
| { | ||
| // Iterating through the global path to determine the position of the cusp | ||
| for (unsigned int pose_id = 1; pose_id <= global_plan_.poses.size(); ++pose_id) { |
There was a problem hiding this comment.
This should be < not <= since size() of 7 has elements of 0,1,2,3,4,5,6. I think in fixing that you can remove your most recent change of || pose_id == global_plan_.poses.size(), yeah? Or if not, please explain why that's there. If this is actually the last point, then why bother detecting it?
There was a problem hiding this comment.
|| pose_id == global_plan_.poses.size()
This is very important. There maybe a scenario, where there is no cusp at all in the path (easiest example will be: imagine a robot driving straight to a goal). In that scenario, we need the distance of the goal from the robot's position, so that here, we don't satisfy this condition. Because the return value from this function where the code lies will be 0 and the robot will not move at all,, because the marked condition will satisfy and the lookahead_distance will be assigned 0.0.
There was a problem hiding this comment.
Well the <= should definitely be <, if we can agree on that we can separate the topics
I see. Honestly you bring up a good point, 0.0 is a bad return value. How about change return 0.0 to return std::numeric_limits<double>::max(). Then it should always be > lookahead_dist for the check later. Then you can remove that check in the loop and when the for exits from no cusp it returns max.
There was a problem hiding this comment.
Well the <= should definitely be <, if we can agree on that we can separate the topics
Agreed, I think it makes sense.
Honestly you bring up a good point, 0.0 is a bad return value. How about change return 0.0 to return std::numeric_limits::max().
This is a valid point, which I would definitely change!
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
|
I'll backport this to Foxy/Galactic once the main one is merged |
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: