Error in ROS: Controller Spawner couldn't find the expected controller_manager ROS interface

天大地大妈咪最大 提交于 2019-12-11 05:18:31

问题


I am getting this error:

[WARN] [1549645986.850056, 54.996000]: Controller Spawner couldn't find the expected controller_manager ROS interface

while launching a urdf in gazebo. I am using ROS Kinetic and have looked for a solution for this error everywhere but couldn't find it. A similar question is asked here. I have done everything suggested in that link and the libjoint_state_controller.so file is present at opt/ros/kinetic/lib. I have added the gazebo plugin in my .xacro file.

<gazebo>
 <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
  <robotNamespace>/mushak</robotNamespace>
  <robotParam>/mushak/robot_description</robotParam>
 </plugin>
</gazebo>

This is the .launch file:

<?xml version="1.0" encoding="UTF-8"?>
<launch>
 <group ns="/mushak"> 
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find mushak_pkg)/urdf/mushak_model.xacro'" />
  <arg name="x" default="0"/>
  <arg name="y" default="0"/>
  <arg name="z" default="0.2412"/>

  <!-- Spawn the robot model -->
  <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
      args="-urdf -param robot_description -model mushak -x $(arg x) -y $(arg y) -z $(arg z)" />

  <!-- Load controllers -->
  <rosparam command="load" file="$(find mushak_pkg)/config/config.yaml" />

  <!-- Controllers -->

  <node name="controller_spawner" pkg="controller_manager" type="spawner"
    respawn="false" output="screen" ns="/mushak"
    args="
    joint_state_controller
    joint1_position_controller
    joint2_position_controller
    joint3_position_controller
    joint4_position_controller
    joint5_position_controller
    joint6_position_controller
    --timeout 50
    ">
  </node>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
      <remap from="/joint_states" to="/mushak/joint_states" />
  </node>

 </group>

</launch>

The model is opening in rviz without any error. The following is the output when I run rospack find joint_state_controller .

/opt/ros/kinetic/share/joint_state_controller

Also, in the terminal in which the Gazebo is running the following error is shown:

[ERROR] [1550681387.800721476, 9.313000000]: GazeboRosControlPlugin missing while using DefaultRobotHWSim, defaults to true. This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead. If you do not want to fix this issue in an old package just set to true.

I have added the transmissions to all the joints:

   <transmission name="trans_${name}">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${name}">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor_${name}">
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
    </transmission>

Can someone help me with this please!

来源:https://stackoverflow.com/questions/54793113/error-in-ros-controller-spawner-couldnt-find-the-expected-controller-manager-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!