# Cannot create Simple Action Client

Greetings, I am trying to write an action client so I can send goals to move_base. I know that I can send them through messages also, but I would prefer the action client so I can monitor them. So my setup is this. Running Hydro I execute my localisation launch file with move_base included. I want my action client to send goals to move_base, however even when i follow exactly the steps described in http://wiki.ros.org/navigation/Tutori... , although it compiles fine,when I run the node it hangs during this step :

MoveBaseClient ac("move_base", true);

It just stays there forever. Could it be a threading issue or something ? For reference here is the file that compiles fine

#include <ros/ros.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>

typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;

int main(int argc, char** argv){
ROS_INFO("STEP 1");
//tell the action client that we want to spin a thread by default
MoveBaseClient ac("move_base", true);
ROS_INFO("STEP 2");
//wait for the action server to come up
while(!ac.waitForServer(ros::Duration(5.0))){
ROS_INFO("Waiting for the move_base action server to come up");
}
ROS_INFO("STEP 3");
move_base_msgs::MoveBaseGoal goal;

//we'll send a goal to the robot to move 1 meter forward

goal.target_pose.pose.position.x = 1.0;
goal.target_pose.pose.orientation.w = 1.0;

ROS_INFO("Sending goal");
ac.sendGoal(goal);

ac.waitForResult();

if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
ROS_INFO("Hooray, the base moved 1 meter forward");
else
ROS_INFO("The base failed to move forward 1 meter for some reason");

return 0;
}