Ask Your Question

Revision history [back]

diff_drive Robot descripion couldn't be retrieved from param server error

Hi!

I'm having issues trying to run diff_drive_controller in simulation. I put a minimal example in a repo.

When I try to launch a diff drive controller the window from which I run Gazebo shows errors:

[ERROR] [1529684868.494983844, 21.407000000]: Robot descripion couldn't be retrieved from param server.
[ERROR] [1529684868.495055462, 21.407000000]: Failed to initialize the controller
[ERROR] [1529684868.495111534, 21.407000000]: Initializing controller 'mobile_base_controller' failed

The controller spawner returns:

[INFO] [1529684868.441842, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
    [INFO] [1529684868.443299, 0.000000]: Controller Spawner: Waiting for service controller_manager/switch_controller
    [INFO] [1529684868.445685, 0.000000]: Controller Spawner: Waiting for service controller_manager/unload_controller
    [INFO] [1529684868.447657, 0.000000]: Loading controller: joint_state_controller
    [INFO] [1529684868.454313, 21.366000]: Loading controller: mobile_base_controller
    [ERROR] [1529684869.496449, 22.405000]: Failed to load mobile_base_controller

Here are relevant snippets: diff_drive.launch:

<launch>
  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find dd_bot)/config/diff_drive.yaml" command="load"/>

  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/dd_bot" args="joint_state_controller
    mobile_base_controller"/>

<!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/dd_bot/joint_states" />
  </node>

</launch>

diff_drive.yaml:

dd_bot:
    joint_state_controller:
        type: joint_state_controller/JointStateController
        publish_rate: 50  

    mobile_base_controller:
      type: "diff_drive_controller/DiffDriveController"
      left_wheel: 'left_wheel_joint'
      right_wheel: 'right_wheel_joint'
      pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
      twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

relevant piece of urdf:

...
  <transmission name="right_tran">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="right_wheel_joint">
        <!--hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface-->
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="right_motor">
        <!--hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface-->
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
  </transmission>

    <transmission name="left_tran">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="left_wheel_joint">
        <!--hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface-->
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="left_motor">
        <!--hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface-->
        <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
  </transmission>

  <gazebo>
      <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
          <!-- <robotParam>/robot_state_publisher/robot_description</robotParam> -->
          <robotNamespace>/dd_bot</robotNamespace>
        <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      </plugin>
  </gazebo>

I also created a file with velocity controllers for the joints and that one works every time:

<launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find dd_bot)/config/motor_control.yaml" command="load"/>

  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/dd_bot" args="joint_state_controller
    right_velocity_controller left_velocity_controller"/>

<!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/dd_bot/joint_states" />
  </node>

</launch>

Any help would be highly appreciated!