Skip to content

Feature addition: capability for the RRP to drive the robot backwards#2427

Closed
padhupradheep wants to merge 7 commits intoros-navigation:foxy-develfrom
padhupradheep:RRP_reverse_driving
Closed

Feature addition: capability for the RRP to drive the robot backwards#2427
padhupradheep wants to merge 7 commits intoros-navigation:foxy-develfrom
padhupradheep:RRP_reverse_driving

Conversation

@padhupradheep
Copy link
Member


Basic Info

Info Please fill out this column
Ticket(s) this addresses #2327
Primary OS tested on Ubuntu 20.04
Robotic platform tested on gazebo simulation of neobotix mp-400

Description of contribution in a few bullet points

  • I added this neat new feature for driving the robot using the RRP planner backwards. This enables car-like robots to efficiently perform the maneuvers using the SMAC planner.

Description of documentation updates required from your changes

  • Added new parameter "reverse_driving", so need to add that to default configs and documentation page

Future work that may be required in bullet points

  • I tested on a differential drive robot, but it will be great if someone can test it on an Ackermann drive!

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.org
  • Check that any significant change is added to the migration guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

Signed-off-by: Pradheep-office <padhupradheep@gmail.com>
Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

Good first prototype stab at it! Needs some clean up though in formatting, readability, and a bit of simplification

@padhupradheep
Copy link
Member Author

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!

@SteveMacenski
Copy link
Member

This feature should also be targeted to main not foxy we can merge it back into foxy once its done, that might be why some of the linters are failing, those profiles have changed over time. Please retarget to main

@SteveMacenski
Copy link
Member

All good updates, now just to get things into the C++ stylings and best practices

@padhupradheep padhupradheep changed the base branch from foxy-devel to main July 7, 2021 21:15
@padhupradheep padhupradheep changed the base branch from main to foxy-devel July 7, 2021 21:19
@padhupradheep padhupradheep changed the base branch from foxy-devel to main July 8, 2021 13:15
@padhupradheep padhupradheep changed the base branch from main to foxy-devel July 8, 2021 13:15
@padhupradheep
Copy link
Member Author

Should this be a new PR ? I do not see any other way to merge the changes from my branch to main without conflicts. Or am I missing a method ?

@SteveMacenski
Copy link
Member

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 😉.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

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)

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) {
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

@padhupradheep padhupradheep Jul 8, 2021

Choose a reason for hiding this comment

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

|| 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.

Copy link
Member

@SteveMacenski SteveMacenski Jul 8, 2021

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

@padhupradheep padhupradheep Jul 8, 2021

Choose a reason for hiding this comment

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

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!

padhupradheep and others added 2 commits July 8, 2021 19:20
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
@SteveMacenski
Copy link
Member

I'll backport this to Foxy/Galactic once the main one is merged

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.

2 participants