controller可以说是ros_control中间最重要的功能可扩展部件了,通过ros_control的的处理可以调用写好的其他类来实现一些数据功能
controller被认为是一个ros中的插件而不是运行程序,编写完成后使用在启动的hardware_interface::RobotHW的实现中这使得运行时只有一个进程启动
如果一个在package包中的my_controller::new_controller需要被hardware_interface::RobotHW的实现找到需要达成以下条件
1.在其package.xml末尾将
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
替换为
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
<plugin_test plugin="${prefix}/controller.xml" />
<controller_interface plugin="${prefix}/controller.xml"/>
</export>
ps1:如果有在CMakeList.txt中间加入新的依赖在find_package中,一定要在