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

Revision history [back]

click to hide/show revision 1
initial version

Thanks for the pointers. Actually, I know and did all these tutorials. I wrote the following code

actionlib::SimpleActionClient<kobuki_msgs::autodockingaction> ac("AutoDockingAction", true); ac.waitForServer(); kobuki_msgs::AutoDockingActionGoal goal; ac.sendGoal(goal);

//wait for the action to return bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0));

if (finished_before_timeout) { actionlib::SimpleClientGoalState state = ac.getState(); ROS_INFO("Action finished: %s",state.toString().c_str()); } else ROS_INFO("Action did not finish before the time out.");

But I got a compilation problem in the line ac.sendGoal(goal);

In actionlib client tutorial, the same command above is used, but in my current example, did not want to compile. Is there any error in the code?

Thanks for the pointers. Actually, I know and did all these tutorials. I wrote the following code


actionlib::SimpleActionClient<kobuki_msgs::autodockingaction>   actionlib::SimpleActionClient<kobuki_msgs::AutoDockingAction> ac("AutoDockingAction", true);
         ac.waitForServer();
         kobuki_msgs::AutoDockingActionGoal goal;
            ac.sendGoal(goal);

ac.sendGoal(goal); //wait for the action to return bool finished_before_timeout = ac.waitForResult(ros::Duration(30.0));

ac.waitForResult(ros::Duration(30.0)); if (finished_before_timeout) { actionlib::SimpleClientGoalState state = ac.getState(); ROS_INFO("Action finished: %s",state.toString().c_str()); } else ROS_INFO("Action did not finish before the time out.");

out.");

But I got a compilation problem in the line ac.sendGoal(goal);

In actionlib client tutorial, the same command above is used, but in my current example, did not want to compile. Is there any error in the code?