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

Revision history [back]

click to hide/show revision 1
initial version

The navigation stack operates using actionlib. Thus, to communicate with move_base, you must use actionlib's ActionClient to send commands and receive feedback. For simplicity, you can use the following code:

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

class MyClass
{
  private:
      NavClient nav_client_;
  ...
}

MyClass::MyClass() : nav_client_("move_base", true) 
{
  ...
}

MyClass::cancelNavigation()
{
  nav_client_.cancelAllGoals();
}

For more advanced actionlib usage, you can find complete documentation on actionlib here.