Controller Spawner couldn‘t find the expected controller_manager ROS interface解决办法

  1. 确保安装以下插件,记住对应版本
sudo apt install ros-noetic-gazebo-ros-control

可通过该指令来验证:

rosservice list | grep controller_manager

预计输出:

/controller_manager/list_controller_types
/controller_manager/list_controllers
/controller_manager/load_controller
/controller_manager/reload_controller_libraries
/controller_manager/switch_controller
/controller_manager/unload_controller

  "gazebo_ros_control" filename="libgazebo_ros_control.so">
    /MYROBOT</robotNamespace>
  </plugin>
</gazebo>

如果robotNamespace在上面指定(它是可选的),则controller_manager 将被命名为/MYROBOT/controller_manager/…

  1. 若还是有问题,请注意检查命名空间:命名空间必须一致!! /arm arm: /arm,切记斜杠!
  <!-- load the controllers -->
  "controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/arm" args="joint_state_controller"/>

arm:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50


  <!-- ros_control plugin -->
  
    "gazebo_ros_control" filename="libgazebo_ros_control.so">
      /arm</robotNamespace>
      gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
  </gazebo>

你可能感兴趣的:(ROS,ubuntu)