Ask Your Question
5

how to send a predefined path to a local planner?

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

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

Comments

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

aarontan gravatar imageaarontan ( 2018-06-12 10:14:18 -0600 )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 imageLi Xie ( 2018-06-12 16:17:32 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
4

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

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

Comments

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 imageLi Xie ( 2015-12-14 15:06:56 -0600 )edit
1

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

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

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

Comments

1

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 imagemgruhler ( 2015-12-10 04:06:26 -0600 )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 imageLi Xie ( 2015-12-14 14:59:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 892 times

Last updated: Dec 10 '15