bebop_driver_node.cpp
Go to the documentation of this file.
00001 
00025 #include <string>
00026 #include <vector>
00027 #include <algorithm>
00028 
00029 #include <ros/ros.h>
00030 #include <nodelet/loader.h>
00031 
00032 int main(int argc, char* argv[])
00033 {
00034   ros::init(argc, argv, "bebop_driver_node", ros::init_options::NoSigintHandler);
00035   nodelet::Loader nll;
00036 
00037   nodelet::M_string remap(ros::names::getRemappings());
00038   nodelet::V_string nargv;
00039   const std::string nl_name = ros::this_node::getName();
00040   nll.load(nl_name, "bebop_driver/BebopDriverNodelet", remap, nargv);
00041 
00042   const std::vector<std::string>& loaded_nodelets = nll.listLoadedNodelets();
00043   if (std::find(loaded_nodelets.begin(),
00044                 loaded_nodelets.end(),
00045                 nl_name) == loaded_nodelets.end())
00046   {
00047     // Nodelet OnInit() failed
00048     ROS_FATAL("bebop_driver nodelet failed to load.");
00049     return 1;
00050   }
00051 
00052   // It reaches here when OnInit() succeeds
00053   ROS_INFO("bebop_driver nodelet loaded.");
00054   ros::spin();
00055   return 0;
00056 }


bebop_driver
Author(s): Mani Monajjemi
autogenerated on Sat Jun 8 2019 20:37:45