Dejan,<div><br></div><div>I'm not sure I quite understood the question. Are you seeing the message "Error in moving to goal pose..." 5 times, just that the first time takes 15 seconds and the others happen back-to-back? If so, that may be a bug in move_base and I'll have a look. If you're not seeing that message print 5 times then it could be a problem in actionlib, which I can also look at. From glancing briefly at your code, I'd expect things to work.</div>
<div><br></div><div>Let me know and hope all is well,</div><div><br></div><div>Eitan<br><br><div class="gmail_quote">On Sat, Oct 9, 2010 at 5:26 PM, Dejan Pangercic <span dir="ltr"><<a href="mailto:dejan.pangercic@gmail.com">dejan.pangercic@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi there,<br>
<br>
I am using "move_base" SimpleActionClient and I have a problem that it<br>
sort of randomly fails (due to unstable/hallucinated percepts).<br>
Using below code I wanted to make it retry 5 times. It however does<br>
not do so (It was supposed to be retrying for 15 seconds each time, it<br>
however does so only in the first go). What am I doing wrong?<br>
CODE:<br>
void moveRobot(geometry_msgs::Pose goal_pose)<br>
{<br>
  int count = 0;<br>
  while (count < 5)<br>
    {<br>
      actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction><br>
ac("move_base", true);<br>
<br>
      //wait for the action server to come up<br>
      while(!ac.waitForServer(ros::Duration(5.0)))<br>
        {<br>
          ROS_INFO("Waiting for the move_base action server to come up");<br>
        }<br>
      move_base_msgs::MoveBaseGoal goal;<br>
      goal.target_pose.header.frame_id = "/map";<br>
      goal.target_pose.header.stamp = ros::Time::now();<br>
<br>
      if (count == 0)<br>
        goal.target_pose.pose = goal_pose;<br>
      else<br>
        {<br>
          goal_pose.orientation.z =  goal_pose.orientation.z + 0.01;<br>
          goal.target_pose.pose = goal_pose;<br>
        }<br>
      ROS_INFO("Sending goal");<br>
      ac.sendGoal(goal);<br>
      ac.waitForResult();<br>
<br>
      ROS_INFO("Pose Position x: %f, y:%f, z:%f Orientation x:%f,<br>
y:%f, z:%f, w:%f", goal.target_pose.pose.position.x,<br>
               goal.target_pose.pose.position.y,<br>
goal.target_pose.pose.position.z, goal.target_pose.pose.orientation.x,<br>
               goal.target_pose.pose.orientation.y,<br>
goal.target_pose.pose.orientation.z,<br>
goal.target_pose.pose.orientation.w);<br>
<br>
      actionlib::SimpleClientGoalState state = ac.getState();<br>
      if(state == actionlib::SimpleClientGoalState::SUCCEEDED)<br>
        {<br>
          ROS_INFO("Robot has moved to the goal pose");<br>
          count = 10;<br>
        }<br>
      else<br>
        {<br>
          count++;<br>
          ROS_ERROR("Error in moving robot to goal pose: %s. Retrying<br>
%d time", state.toString().c_str(), count);<br>
          sleep(1);<br>
        }<br>
    }<br>
  if (count == 5)<br>
    {<br>
      ROS_ERROR("Plan aborted, exiting!!!");<br>
      exit(1);<br>
    }<br>
}<br>
<br>
<br>
cheers, d.<br>
<br>
--<br>
MSc. Dejan Pangercic<br>
PhD Student/Researcher<br>
Intelligent Autonomous Systems Group<br>
Technische Universität München<br>
Telephone: +49 (89) 289-26908<br>
E-Mail: <a href="mailto:dejan.pangercic@cs.tum.edu">dejan.pangercic@cs.tum.edu</a><br>
WWW: <a href="http://ias.cs.tum.edu/people/pangercic" target="_blank">http://ias.cs.tum.edu/people/pangercic</a><br>
_______________________________________________<br>
PR2-users mailing list<br>
<a href="mailto:PR2-users@lists.willowgarage.com">PR2-users@lists.willowgarage.com</a><br>
<a href="http://lists.willowgarage.com/cgi-bin/mailman/listinfo/pr2-users" target="_blank">http://lists.willowgarage.com/cgi-bin/mailman/listinfo/pr2-users</a><br>
</blockquote></div><br></div>