ros_nodelet相关内容

写在前面

我在CSDN上写了一套关于ros基础的图文教程,欢迎关注!!!


移植自己的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中做对应修改

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容