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

You are attempting to call methods on an uninitialized goal handle

asked 2017-07-20 01:50:17 -0500

MarkyMark2012 gravatar image

updated 2017-07-22 14:43:37 -0500

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 );
  }
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-07-22 14:33:20 -0500

MarkyMark2012 gravatar image

Problem was I needed to add the following line to the goalCb callback (code above now updated)

goal_ = *(as_.acceptNewGoal());
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-07-20 01:50:17 -0500

Seen: 1,531 times

Last updated: Jul 22 '17