ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

How to follow a nav_msgs/path ?

asked 2018-06-27 09:54:23 -0600

aarontan gravatar image

Hello,

I am using this package to publish an astroid path.

I would like my robot to be able to follow this published path, I was wondering if anyone have a clue about how to approach this problem?

If I would like to redefine the path to something similar to a sine wave, how would I go about that?

Thank you, Aaron

edit retag flag offensive close merge delete

Comments

Have you taken a look at the navigation stack?

jayess gravatar image jayess  ( 2018-06-27 13:59:16 -0600 )edit

Please don't crosspost. It wastes time and effort of everyone. Please see our support page.

jayess gravatar image jayess  ( 2018-06-27 14:01:46 -0600 )edit

Oh okay, sorry I did not know about that but I understand now.

And yes I have looked at the navigation stack however I am not sure how to integrate move_base with a published path message. I am wondering if anyone have experience with this before and could provide me with some pointers.

Thanks

aarontan gravatar image aarontan  ( 2018-06-27 14:48:14 -0600 )edit

I have the same problem. Are you finished and solve this problem? Thanks

Ahmed_Desoky gravatar image Ahmed_Desoky  ( 2020-07-20 13:04:00 -0600 )edit

Hello

To make your robot follow a published path:

-Publish the desired path using the package you have. -Subscribe to the published path in your robot's control system. -Extract the necessary path information from the received message. -Implement a control algorithm that interprets the path information and generates appropriate commands for the robot. -Execute the control commands in your robot's hardware or simulation environment.

gregbowers gravatar image gregbowers  ( 2023-06-22 05:30:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-06-28 01:06:49 -0600

mgruhler gravatar image

updated 2018-06-29 01:43:01 -0600

Basically, you have three options.

  1. Write your own "planner" that follows the path. This can actually be a simple controller without any collision avoidance and should be straightforward.
  2. You can write a GlobalPlannerPlugin to move_base that subscribes to the path you create (or creates it itself) and then passes it down to the local planner. There are quite some questions about this (e.g. here or here). Then you have the full capabilities of move_base available later on
  3. Use move_base_flex. This exposes additional actions which should let you do what you want directly. See this question for details.

I personally have done 1 (pretty easy) and 2 (works quite will). EVen though I haven't tested it, I'd say 3 would be the way to go now (though move_base_flex is currently still not very stable, but quite actively developed).


EDIT

About option 1: No, there are no tutorials (that I know of). Just create a subscriber to your path message, and try to follow this using a simple controller. Most basic way would be to implement a simple P[I][D]-controller that trys to stay on the path with a fixed x-velocity (in my experience, PD is totally fine for such a task). If your robot is a differential drive, this is the easiest way.

About option 2: The link to the tutorial is in one of the linked answers above. For reference.

edit flag offensive delete link more

Comments

Thank you for your reply, I am interested in the first two options, do you have any tutorials on how to achieve this?

aarontan gravatar image aarontan  ( 2018-06-28 15:08:00 -0600 )edit

see edit above.

mgruhler gravatar image mgruhler  ( 2018-06-29 01:43:12 -0600 )edit

@mgruhler Hey, I have created a package that computes a global path and I want to execute option 2 from your answer where the global plugin subscribes to this path being published and passes it down to the local planner but am unable to implement it. Here is the code of the plugin I've written to subscribe to the global path and use it but it doesn't work - https://drive.google.com/drive/folder...

Please let me know what should I do to solve this.

hanks gravatar image hanks  ( 2021-03-19 09:35:47 -0600 )edit

no. Post a new question including your code, describe what you are trying to do, what you have tried so far and where you are stuck...

mgruhler gravatar image mgruhler  ( 2021-03-19 11:12:45 -0600 )edit
hanks gravatar image hanks  ( 2021-03-19 11:17:06 -0600 )edit

Question Tools

5 followers

Stats

Asked: 2018-06-27 09:54:23 -0600

Seen: 3,755 times

Last updated: Jun 29 '18