ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Diff_drive plugin:couldn't get wheel hinge joint named wheel_left_joint

asked 2020-11-17 08:35:46 -0600

rezenders gravatar image

I am trying to add a diff_drive gazebo plugin into a urdf model but I am getting the error:

   EXCEPTION: DiffDrive(ns = //): couldn't get wheel hinge joint named wheel_left_joint

The urdf model is something like:

<link name="base_footprint"/>

<joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin xyz="0 0 0" rpy="0 0 0"/>
</joint>

<link name="base_link">
    <visual>
        <origin xyz="0 0 0.0875" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.15" radius="0.2"/>
        </geometry>
    </visual>
    <collision>
        <origin xyz="0 0 0.0875" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.15" radius="0.2"/>
        </geometry>
    </collision>
    <inertial>
       <origin xyz="0 0 0" rpy="0 0 0"/>
       <mass value="1.3729096e+00"/>
       <inertia ixx="8.7002718e-03" ixy="-4.7576583e-05" ixz="1.1160499e-04"
                iyy="8.6195418e-03" iyz="-3.5422299e-06"
                izz="1.4612727e-02" />
    </inertial>
</link>

<joint name="wheel_left_joint" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_left_link"/>
    <origin xyz="0.0 0.144 0.023" rpy="-1.57075 0 0"/>
    <axis xyz="0 0 1"/>
</joint>

<link name="wheel_left_link">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.018" radius="0.033"/>
        </geometry>
    </visual>
    <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.018" radius="0.033"/>
        </geometry>
    </collision>
</link>

<joint name="wheel_right_joint" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_right_link"/>
    <origin xyz="0.0 -0.144 0.023" rpy="-1.57075 0 0"/>
    <axis xyz="0 0 1"/>
</joint>

<link name="wheel_right_link">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.018" radius="0.033"/>
        </geometry>
    </visual>
    <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder length="0.018" radius="0.033"/>
        </geometry>
    </collision>
</link>

And I am adding the plugin with:

  <gazebo>
    <plugin name="diff_controller" filename="libgazebo_ros_diff_drive.so">
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometrySource>world</odometrySource>
      <publishOdomTF>true</publishOdomTF>
      <robotBaseFrame>base_footprint</robotBaseFrame>
      <publishWheelTF>false</publishWheelTF>
      <publishTf>true</publishTf>
      <publishWheelJointState>true</publishWheelJointState>
      <legacyMode>false</legacyMode>
      <updateRate>30</updateRate>
      <leftJoint>wheel_left_joint</leftJoint>
      <rightJoint>wheel_right_joint</rightJoint>
      <wheelSeparation>0.287</wheelSeparation>
      <wheelDiameter>0.066</wheelDiameter>
      <wheelAcceleration>1</wheelAcceleration>
      <wheelTorque>10</wheelTorque>
      <rosDebugLevel>na</rosDebugLevel>
    </plugin>
  </gazebo>

Any ideas? My first tought was that the joint name was wrong, but it is not. I have no clue what might be happening.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-17 09:29:54 -0600

rezenders gravatar image

The wheels link were missing the inertial tag, after I added it worked.

<inertial>
           <origin xyz="0 0 0" rpy="0 0 0"/>
           <mass value="1.3729096e+00"/>
           <inertia ixx="8.7002718e-03" ixy="-4.7576583e-05" ixz="1.1160499e-04"
                    iyy="8.6195418e-03" iyz="-3.5422299e-06"
                    izz="1.4612727e-02" />
</inertial>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-17 08:35:46 -0600

Seen: 155 times

Last updated: Nov 17 '20