URDF: Continuous joints just slides down [closed]
Hi there. I'm using ROS Indigo Gazebo 2.2.6
I'm trying to set up a simple car simulation for gazebo which consists of a box as chassis and 4 cylinders as wheels. Also I would like to implement a node which transform the steering angle for a virtual bicycle model to the steering angles of the two front wheels. For that I tried to implement two perpendicular continuous-joints for the front wheels and one continuous-joint each for the back wheels.
However, when I start the simulation the chassis seems not to be fixed to the wheels and the chassis just falls down in the front but stays in place in the back.
Here's the code
<robot name="erod_macros" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="wheel" params="wheelname lr fr steerable">
<joint name="wheel_hinge_${wheelname}" type="${steerable}">
<parent link="chassis"/>
<child link="wheel_hinge_bearing_${wheelname}"/>
<origin xyz="${fr*wheel_base/2} ${lr*track_width/2} ${wheel_radius}" rpy="0 0 0"/>
<axis xyz="0 0 1" rpy="0 0 0"/>
</joint>
<link name="wheel_hinge_bearing_${wheelname}">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<sphere radius="${wheel_bearing_radius}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<sphere radius="${wheel_bearing_radius}"/> radius="${wheel_bearing_radius}"/>
</geometry>
</visual>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="0.0001"/>
<inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/>
</inertial>
</link>
<!-- Joint: HingeWheel -->
<joint name="wheel_axis_${wheelname}" type="continuous">
<parent link="wheel_hinge_bearing_${wheelname}"/>
<child link="wheel_${wheelname}"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
<axis xyz="0 ${lr} 0" rpy="0 0 0"/>
</joint>
<!-- Link: Wheel -->
<link name="wheel_${wheelname}">
<collision>
<origin xyz="0 0 0" rpy="${Pi/2} 0 0"/>
<geometry>
<cylinder length="${wheel_width}" radius="${wheel_radius}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="${Pi/2} 0 0"/>
<geometry>
<cylinder length="${wheel_width}" radius="${wheel_radius}"/>
</geometry>
</visual>
<inertial>
<origin xyz="0 0 0" rpy="${Pi/2} 0 0"/>
<mass value="${wheel_mass}"/>
<inertia ixx="${wheel_I_rr}" ixy="0.0" ixz="0.0" iyy="${wheel_I_yy}" iyz="0.0" izz="${wheel_I_rr}"/>
</inertial>
</link>
<!-- Transmission: Steer the wheel -->
<!-- Transmission: Rotate the wheel -->
<gazebo reference="wheel_${wheelname}"> <mu1 value="200.0"/> <mu2 value="200.0"/> <material>Gazebo/Black</material> </gazebo>
</xacro:macro>
</robot>