You are attempting to call methods on an uninitialized goal handle
Hi,
I've written a simple action server & client. However I am getting this error message from the server when calling the goal:
[ERROR] [1500532897.640619656]: You are attempting to call methods on an uninitialized goal handle
This is the simple server code - what am I missing?:
Thanks Mark
FibonacciAction(std::string name)
: action_name_(name)
, as_(name, false)
{
action_name_ = name;
as_.registerGoalCallback(boost::bind(&FibonacciAction::goalCb, this));
as_.registerPreemptCallback(boost::bind(&FibonacciAction::preemptCb, this));
as_.start();
}
void goalCb()
{
bool success = true;
goal_ = *(as_.acceptNewGoal()); if( as_.isActive() ) {
if(success)
{
result_.text = "goalCb Succeeded";
ROS_INFO("%s: goalCb Succeeded", action_name_.c_str());
// set the action state to succeeded
as_.setSucceeded(result_);
}
}
void preemptCb()
{
bool success = true;
// push_back the seeds for the fibonacci sequence
if(success)
{
result_.text = "preemptCb Succeeded";
ROS_INFO("%s: preemptCb Succeeded", action_name_.c_str());
// set the action state to succeeded
//as_.setSucceeded(result_);
as_.setPreempted( result_, result_.text );
}
}