Skip to content

Interface

Fadri Furrer edited this page Jan 19, 2016 · 2 revisions

The planner is called via a service. To embed the planner in your own c++ project add the following snipplet:

#include <ros/ros.h>
#include <nbvplanner/nbvp_srv.h>

...

int iteration = 0;
while (ros::ok()) {
  nbvplanner::nbvp_srv planSrv;
  planSrv.request.header.stamp = ros::Time::now();
  planSrv.request.header.seq = iteration;
  planSrv.request.header.frame_id = ros::this_node::getNamespace();
  if (ros::service::call("nbvplanner", planSrv)) {

      ...

      // Process the computed path in planSrv.response.path to make
      // the robot track it

      ...

      iteration++;
    }
  } else {
    ROS_WARN_THROTTLE(1, "Planner not reachable");
    ros::Duration(1.0).sleep();
  }
}

Subscribed Topics

Published Topics

Services

Clone this wiki locally