Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple action client freezes dring client object declaration. #125

Closed
veeraragav opened this issue Feb 15, 2019 · 1 comment
Closed

simple action client freezes dring client object declaration. #125

veeraragav opened this issue Feb 15, 2019 · 1 comment

Comments

@veeraragav
Copy link

`#include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <actionlib/client/terminal_state.h>
#include <roadmap_global_planner_msgs/DoPatrolAction.h>

int main (int argc, char **argv)
{
ros::init(argc, argv, "fakee");
std::cout<<"fakee"<<std::endl;
// create the action client
// true causes the client to spin its own thread
actionlib::SimpleActionClient<roadmap_global_planner_msgs::DoPatrolAction> ac("patrol_controller", true);
std::cout<<"fakee"<<std::endl;
while(!ac.waitForServer(ros::Duration(5.0))){
ROS_INFO("Waiting for the move_base action server to come up");
}

ROS_INFO("Action server started, sending goal.");
// send a goal to the action
roadmap_global_planner_msgs::DoPatrolGoal goal;

ac.sendGoal(goal);

//wait for the action to return
bool finished_before_timeout = ac.waitForResult(ros::Duration(1.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.");

//exit
return 0;
}`

The program freezes at actionlib::SimpleActionClient<roadmap_global_planner_msgs::DoPatrolAction> ac("patrol_controller", true);

Same case for whichever client i create.

How do i solve this problem?

@veeraragav
Copy link
Author

sorry, that was a mistake with roadmap_global_planner_msgs's CMakeLists.txt.
I did not add actionlib_msgs to catkin_package(CATKIN_DEPENDS ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant