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

how to send a predefined path to a local planner?

asked 2015-12-06 20:26:19 -0500

Li Xie gravatar image

hello everyone,

I am facing a situation.

I am recently developing a trajectory planner for research purposes. I have written the trajectory planner in a local planner, which has adhered to the local_planner interface set in nav_core.

In order to test and improve this trajectory planner, I should feed a complex enough path (curve path for example) into the trajectory planner and analyse the generated output trajectory commands. Now I can do so by setting a goal pose on Rviz and using one of the global planners. But this does not always generate exactly the same path every time.

So I wish to send a predefined complex path (or a vector of PoseStamped) to the trajectory planner directly (like using: rostopic pub), or reproduce the same complex path on Rviz feeding to the trajectory planner.

Do you have any ideas how to do so or even better methods?

Thanks very much in advance.

edit retag flag offensive close merge delete


did you figure this out? if so, do you have any sample code that you can share? Thank you.

aarontan gravatar image aarontan  ( 2018-06-12 10:14:18 -0500 )edit

No, I did not. Although the comments below are very smart and helpful, I did not have enough time to implement that back then. I ended up with a compromised test plan (mostly focused on only testing simple paths, instead of complex paths)

Li Xie gravatar image Li Xie  ( 2018-06-12 16:17:32 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2015-12-09 13:04:45 -0500

mgruhler gravatar image

I guess the best way is to write your own global planner plugin, which adheres to the respective interface there. However, this then does nothing when receiving the usual move_base goals.

Rather, you add whatever ROS concept you want (subscriber, service server, action server) to this global planner plugin for retrieving the path from wherever you want (publisher, service client, action client) and pass it down the chain.

Then, you can use the full move_base structure and can have deterministic global plans...

edit flag offensive delete link more


This does sound a valid idea. I think it is not difficult create the proposed global planner plugin. The more detail how to achieve retrieve the path, either by feeding the same array of vectors or built-in array of vector in the global planner, is to be determined based on global planner architectu

Li Xie gravatar image Li Xie  ( 2015-12-14 15:06:56 -0500 )edit

answered 2015-12-10 02:14:37 -0500

updated 2015-12-10 02:15:38 -0500

The path generated by the standard move_base mechanics is stored in a topic (I think it's called just path) composed of an array of vectors. My point is, those vectors are the same kind of vectors that describe the actual pose of the robot, so maybe you can build a node that retrieves the pose of the robot (taken from the odometry or whichever mechanism you're using for the localization) while you move manually your robot in the trajectory that suits your purposes.

That way you'll have an array of vectors describing the path you just made with your robot, which with minor adjustments you can publish into the path topic of move_base.

I don't know how complex this could be, but if it isn't possible the easy way is record a bag file of a path generated from move_base that seems good to you, and replay it anytime you want.

edit flag offensive delete link more



I strongly disagree. The path topic is published from the global_planner, so you cannot send a path to move_base. There is no subscriber...

mgruhler gravatar image mgruhler  ( 2015-12-10 04:06:26 -0500 )edit

thanks very much for your answer. I will later take a deeper look into the path topic to see if there were a way to implement.

Li Xie gravatar image Li Xie  ( 2015-12-14 14:59:02 -0500 )edit

answered 2021-03-10 06:29:14 -0500

ingtux gravatar image

A more recent solution to this problem is to use move_base_flex. You can use the exe_path action and specify a custom path and your desired local planner (path tracker) to follow that custom path.

edit flag offensive delete link more

Question Tools



Asked: 2015-12-06 20:20:53 -0500

Seen: 1,809 times

Last updated: Mar 10 '21