Setting up a wheel joint

asked 2018-01-10 17:48:04 -0500

horseatinweeds gravatar image

Can I get some advice for setting up the wheel joint? I'm trying to use the differential drive plugin. I got most of this from the mybot tutorial, and it works, but I'm having two issues. First, I can't seem to add friction to the joint. When you set the speed back to zero, the robot keeps coasting along, as if there is friction, but very slight. Nothing like a geared motor car robot would have without disengaging the transmission. I've played with the <dynamics> settings for dampening and friction for the joint, but even high values don't make a difference.

Second, the robot only turns slightly. I'm still trying to understand what the differential drive plugin does, but it's not very intuitive.

Here is the main .xacro for the mybot

<?xml version="1.0"?>

<robot name="mybot" xmlns:xacro="http://www.ros.org/wiki/xacro">


  <xacro:property name="PI" value="3.1415926535897931"/>

  <xacro:property name="chassisHeight" value="0.1"/>
  <xacro:property name="chassisLength" value="0.4"/>
  <xacro:property name="chassisWidth" value="0.2"/>
  <xacro:property name="chassisMass" value="50"/>

  <xacro:property name="casterRadius" value="0.05"/>
  <xacro:property name="casterMass" value="5"/>

  <xacro:property name="wheelWidth" value="0.05"/>
  <xacro:property name="wheelRadius" value="0.1"/>
  <xacro:property name="wheelPos" value="0.2"/>
  <xacro:property name="wheelMass" value="5"/>

  <xacro:property name="cameraSize" value="0.05"/>
  <xacro:property name="cameraMass" value="0.1"/>

  <xacro:include filename="$(find mybot_description)/urdf/mybot.gazebo" />
  <xacro:include filename="$(find mybot_description)/urdf/materials.xacro" />
  <xacro:include filename="$(find mybot_description)/urdf/macros.xacro" />

  <link name="footprint" />

  <joint name="base_joint" type="fixed">
    <parent link="footprint"/>
    <child link="chassis"/>
  </joint>

  <link name="chassis">
    <collision>
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/>
      <geometry>
    <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/>
      </geometry>
    </collision>

    <visual>
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/>
      <geometry>
    <box size="${chassisLength} ${chassisWidth} ${chassisHeight}"/>
      </geometry>
      <material name="orange"/>
    </visual>

    <inertial>
      <origin xyz="0 0 ${wheelRadius}" rpy="0 0 0"/>
      <mass value="${chassisMass}"/>
      <box_inertia m="${chassisMass}" x="${chassisLength}" y="${chassisWidth}" z="${chassisHeight}"/>
    </inertial>
  </link>

  <joint name="fixed" type="fixed">
    <parent link="chassis"/>
    <child link="caster_wheel"/>
  </joint>

  <link name="caster_wheel">

    <collision>
      <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/>
      <geometry>
    <sphere radius="${casterRadius}"/>
      </geometry>
    </collision>

    <visual> 
      <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/>
      <geometry>
    <sphere radius="${casterRadius}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <origin xyz="${casterRadius-chassisLength/2} 0 ${casterRadius-chassisHeight+wheelRadius}" rpy="0 0 0"/>
      <mass value="${casterMass}"/>
      <sphere_inertia m="${casterMass}" r="${casterRadius}"/>
    </inertial>
  </link>


  <wheel lr="left" tY="-1"/>
  <wheel lr="right" tY="1"/>

  <joint name="camera_joint" type="fixed">
    <origin xyz="${-cameraSize+chassisLength/2} 0 ${cameraSize+wheelRadius+cameraSize/2}" rpy="0 0 0"/>
    <parent link="chassis"/>
    <child link="camera"/>
  </joint>

  <link name="camera">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${cameraSize} ${cameraSize} ${cameraSize}"/>
      </geometry>
    </collision>

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${cameraSize} ${cameraSize} ${cameraSize}"/>
      </geometry>
      <material name="blue"/>
    </visual ...
(more)
edit retag flag offensive close merge delete

Comments

Did you ever figure out how to enforce the <dynamics> tags? It would certainly be helpful to know.

AdamGronewold gravatar image AdamGronewold  ( 2021-05-12 20:00:13 -0500 )edit