美文网首页
ros_nodelet相关内容

ros_nodelet相关内容

作者: Allen的光影天地 | 来源:发表于2020-06-28 15:54 被阅读0次

    移植自己的node到nodelet的流程:

    1. add the necessary #includes: 添加必要头文件

    2. get rid of int main(): 删除main函数

    3. subclass nodelet::Nodelet: 继承Nodelet class

    4. move code from constructor to onInit(): 把原来的node类中的构造函数移植到nodelet的初始化函数中,因为nodelet的构造函数无参

    5. add the PLUGINLIB_EXPORT_CLASS macro: 使用pluginlib的宏来注册插件

    6. add <build_depend> and <run_depend> dependencies on nodelet in the package manifest.:添加build_depend 和 run_depend到package.xml文件中

    7. create the .xml file to define the nodelet as a plugin: 创建对应插件的.xml描述文件

    8. add the <nodelet> item in the <export> part of the package manifest:将7中写好的xml放在package.xml文件的export部分

    9. make the necessary changes to CMakeLists.txt (comment out a rosbuild_add_executable, add a rosbuild_add_library) : 在cmakelist中做对应修改

    相关文章

      网友评论

          本文标题:ros_nodelet相关内容

          本文链接:https://www.haomeiwen.com/subject/tldwfktx.html