action result is published, but callback not being called
I must have set up my callback wrong, but I've followed the tutorials and cannot find the issue.
It's a relatively simple example.
typedef actionlib::SimpleActionClient<face_detector::FaceDetectorAction> ActionClient;
ValveInspection::ValveInspection()
{
valve_client = new ActionClient ("valve_inspection_classifier", false);
}
void ValveInspection::activeCb()
{
cout << "Active!" << endl;
}
void ValveInspection::doneCb(const actionlib::SimpleClientGoalState& state, const face_detector::FaceDetectorResultConstPtr& result)
{
cout << "Got here!" << endl;
cout << result->face_positions.size() << endl;
}
void ValveInspection::requestValves()
{
face_detector::FaceDetectorGoal goal;
valve_client->sendGoal(goal, boost::bind(&ValveInspection::doneCb, this, _1, _2),boost::bind(&ValveInspection::activeCb, this), ActionClient::SimpleFeedbackCallback());
cout <<"Sent goal!" << endl;
}
int main (int argc, char **argv)
{
ros::init(argc, argv, "valve_inspection");
ValveInspection* vi = new ValveInspection();
ros::Rate r = ros::Rate(1);
while(ros::ok())
{
vi->requestValves();
r.sleep();
}
}
If I subscribe to /valve_inspection_classifier/result, I get results. However, the callback is not being called.
My output from the couts is only:
Sent goal!
Sent goal!
Sent goal!
Sent goal!
So the activeCb and doneCb are not being called. Can someone shed some light on this?