bebop_driver_node.cpp
Go to the documentation of this file.
1 
25 #include <string>
26 #include <vector>
27 #include <algorithm>
28 
29 #include <ros/ros.h>
30 #include <nodelet/loader.h>
31 
32 int main(int argc, char* argv[])
33 {
34  ros::init(argc, argv, "bebop_driver_node", ros::init_options::NoSigintHandler);
35  nodelet::Loader nll;
36 
38  nodelet::V_string nargv;
39  const std::string nl_name = ros::this_node::getName();
40  nll.load(nl_name, "bebop_driver/BebopDriverNodelet", remap, nargv);
41 
42  const std::vector<std::string>& loaded_nodelets = nll.listLoadedNodelets();
43  if (std::find(loaded_nodelets.begin(),
44  loaded_nodelets.end(),
45  nl_name) == loaded_nodelets.end())
46  {
47  // Nodelet OnInit() failed
48  ROS_FATAL("bebop_driver nodelet failed to load.");
49  return 1;
50  }
51 
52  // It reaches here when OnInit() succeeds
53  ROS_INFO("bebop_driver nodelet loaded.");
54  ros::spin();
55  return 0;
56 }
#define ROS_FATAL(...)
bool load(const std::string &name, const std::string &type, const M_string &remappings, const V_string &my_argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL const std::string & getName()
std::vector< std::string > listLoadedNodelets()
ROSCPP_DECL void spin(Spinner &spinner)
ROSCPP_DECL const M_string & getRemappings()
ROSCPP_DECL std::string remap(const std::string &name)
#define ROS_INFO(...)
int main(int argc, char *argv[])
std::vector< std::string > V_string
std::map< std::string, std::string > M_string


bebop_driver
Author(s): Mani Monajjemi
autogenerated on Mon Jun 10 2019 12:58:56