Ask Your Question
2

How can I publish a global path exactly once?

asked 2018-11-06 02:19:41 -0500

stevemartin gravatar image

I am using move_base package from navigation stack in ROS. For the parameters, I have selected o use grid_path due to my robot's motion limitations. Everything works as expected but now, whenever I send a goal (2d nav goal on rviz), move_base constructs a full path from the beginning till the goal point and the topic is called /move_base/GlobalPlanner/plan . The problem is that the topic continuously spams with the same path message until robot gets to the destination. How can I make to publish a single message to the topic and not spam?

edit retag flag offensive close merge delete

Comments

try using a service

mewbot gravatar image mewbot  ( 2018-11-06 03:01:23 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-11-06 03:04:29 -0500

bpinaya gravatar image

Well you could use a service, that way it behaves in a request/response kind of way. Check this service nav_msgs/GetPlan from here http://docs.ros.org/api/nav_msgs/html...

You'll send:

geometry_msgs/PoseStamped start

geometry_msgs/PoseStamped goal

float32 tolerance

and you'll get a:

nav_msgs/Path plan

If you need to learn more about services the wiki is your friend http://wiki.ros.org/Services

Good luck!

edit flag offensive delete link more

Comments

Okay, I got it, thanks :)

stevemartin gravatar image stevemartin  ( 2018-11-06 03:46:03 -0500 )edit
0

answered 2018-11-06 08:33:47 -0500

harshal gravatar image

Have you considered setting the planner frequency to 0.0 in the move_base params? This is supposed to publish the whole path just once and the planner is not invoked again (or in case the controller reports infeasible path and re planning is required).

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-11-06 02:19:41 -0500

Seen: 741 times

Last updated: Nov 06 '18