Ask Your Question
1

Sending multiple goals to Navigation Stack

asked 2017-05-15 13:16:47 -0500

ganhao89 gravatar image

updated 2017-05-24 10:46:52 -0500

Procópio gravatar image

I am writing a program for autonomous navigation of a Husky. I combining imu, wheel encoders and visual odometry for navigation. All the sensors have been successfully integrated and a target goal can be sent to the robot. Here is my question:

How can I send the robot multiple goals so that it will visit each goal and do not stop at each one? Right now, I am using the ac.waitForResult() function, (based on the "Sending Goals to the Navigation Stack" tutorial). The robot will stop at each goal and then move to the next one. I want the robot to move smoothly.

image description

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-06-21 20:41:58 -0500

jayess gravatar image

updated 2017-06-26 02:11:36 -0500

Procópio gravatar image

Part of the problem may be from looping for 5.0 seconds and waiting for 1.0 second in the callback Usually, you want your callbacks to execute quickly and six seconds is not quick. I also notice that you're instantiating the action client in your callback too.

You should probably make a class and have the callback manipulate the class attributes. That way, you don't have to have the waiting and instantiation in your callback.

http://wiki.ros.org/actionlib_tutoria...

edit flag offensive delete link more
1

answered 2017-05-16 00:13:43 -0500

billy gravatar image

You can issue a new goal prior to the current one completing. Monitor the output (geometry_msgs/PoseWithCovarianceStamped) of AMCL and when it gets close enough for you, issue the next goal. I can't promise it will be "smoothly" but you should be able to do it without it stopping.

Experiment with RVIZ goal setting to see how close you need to get before issuing next goal.

edit flag offensive delete link more

Comments

Actually, I don't need the robot to reach each goal. I was trying to issue a new goal prior to the current one completing, but I am not sure I did it right. It feels like the robot still stopped a little bit when it receives a new goal. I cannot put the code here, so I will add it as another answer

ganhao89 gravatar image ganhao89  ( 2017-05-16 11:34:12 -0500 )edit

Your code above shows you waiting until goal is reached before being allowed to return. So it looks like you still stop at goal, then send next goal. Instead of using the action client to get status, monitor the actual position of the robot as noted in my answer and when it gets (continued)

billy gravatar image billy  ( 2017-05-16 11:51:42 -0500 )edit

and when it gets with in a certain distance, issue new goal. Do not wait for goal to be reached...do not block in your callback waiting for goal to be reached.

billy gravatar image billy  ( 2017-05-16 11:52:46 -0500 )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

4 followers

Stats

Asked: 2017-05-15 13:16:47 -0500

Seen: 1,141 times

Last updated: Jun 26 '17