Quantcast
Viewing latest article 20
Browse Latest Browse All 75

"Attempting to accept the next goal when a new goal is not available"

Hello! I'm trying to perform an action-client/action-server structure using a callback structure. So it just has to read info from the goal and publish messages on a turtlesim topic. When I run this node (either before or after I created the client) every time the server receives a Goal I get this: [ INFO] [1501865084.462187784]: Server Created [ INFO] [1501865086.638608252]: I'm in goalCB() and I'm receiving a new Goal [ERROR] [1501865086.638780375]: Attempting to accept the next goal when a new goal is not available This is my code (which btw for now does nothing, I just wanted to see if everything worked) class polygonAction { public : polygonAction(std::string name) : as(nh_, name, false), action_name_(name) { //register the goal and feeback callbacks as.registerGoalCallback(boost::bind(&polygonAction::goalCB, this)); as.registerPreemptCallback(boost::bind(&polygonAction::preemptCB, this)); ROS_INFO("Server Created"); //Stuff for turtlesim we don't care [...] as.start(); } ~polygonAction(void) { } void goalCB() { ROS_INFO("I'm in goalCB() and I'm receiving a new Goal"); goal_length = as.acceptNewGoal()->length; goal_sides = as.acceptNewGoal()->sides; ROS_INFO("Received %d sides and %d lenght", goal_sides, goal_length); } void preemptCB() { ROS_INFO("%s: Preempted", action_name_.c_str()); // set the action state to preempted as.setPreempted(); } //Stuff for turtlesim we are not interested in [...] protected: ros::NodeHandle nh_; actionlib::SimpleActionServer as; std::string action_name_; int goal_sides, goal_length, sides_count; es_1::polygonFeedback feedback_; es_1::polygonResult result_; ros::Publisher pub; ros::Subscriber sub; }; int main(int argc, char** argv) { ros::init(argc, argv, "polygon_action_server"); polygonAction polygon("polygon"); ros::spin(); return 0; } Any ideas?

Viewing latest article 20
Browse Latest Browse All 75

Trending Articles