My urdf model spawns in the origin(0 0 0) instead of where the parts have to be, how can I fix that?
Hi there,
I'm new here and the only thing I found out about my problem ist, that it may have been caused by the inertias but I alreay fixed them so now I dont know what to do. (gazebo-9 ubuntu melodic)
My urdf/xacro is spawning in gazebo but every link is in the origin and not where it is supposed to be. No problem is shown at the terminal. Seems to be a physics problem, but dont know which. The problem came up after I put meshes in instead of a simple box.
Here is my xacro (its an adapted version of the testmodel from swervebot/fourwheelsteering). If you need anything else, just tell me.
<!-- Constants for robot dimensions -->
<xacro:property name="PI" value="3.1415926535897931"/>
<xacro:property name="height" value="0.5" /> <!-- height of the body -->
<xacro:property name="body_m" value="25.0" /> <!--mass of the body structure -->
<xacro:property name="body_l" value="0.8" /> <!-- length of the body structure -->
<xacro:property name="body_w" value="0.8" /> <!-- width of the body structure -->
<xacro:property name="body_h" value="0.2" /> <!-- thickness of the body structure -->
<xacro:property name="leg_m" value="1" /> <!-- mass of a thigh leg -->
<xacro:property name="leg_r" value="0.015" /> <!-- radius of the leg cylinders -->
<xacro:property name="wheel_m" value="5" /> <!-- mass of a single wheel -->
<xacro:property name="wheel_r" value="0.24" /> <!-- radius of the wheels -->
<xacro:property name="wheel_h" value="0.15" /> <!-- thickness of the wheels -->
<xacro:property name="wheel_off" value="0.01" /> <!-- thickness of the wheels -->
<xacro:property name="joint_damping" value="1" /> <!-- damping of all joints -->
<!-- Import all Gazebo-customization elements, including Gazebo colors -->
<xacro:include filename="$(find swerve_controller)/test/urdf/swervebot.gazebo" />
<!-- Import Rviz colors -->
<xacro:include filename="$(find swerve_controller)/test/urdf/materials.xacro" />
<!-- BODY link -->
<link name="dummy">
</link>
<link name="body">
<collision>
<origin xyz="0 0 0" rpy="0 0 3.14"/>
<geometry>
<mesh filename="package://swerve_controller/test/model/Vorderachse_neu.dae" scale="0.001 0.001 0.001"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 3.14"/>
<geometry>
<mesh filename="package://swerve_controller/test/model/Vorderachse_neu.dae" scale="0.001 0.001 0.001"/>
</geometry>
<material name="orange"/>
</visual>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="0.003678"/>
<inertia ixx="0.000478" ixy="0.0" ixz="-0.000003"
iyy="0.000331" iyz="0.0"
izz="0.000154"/>
</inertial>
</link>
<!--<scale>1 1 1</scale>
<uri> model://swerve_controller/test/urdf/base_link.dae</uri>-->
<!-- LEG joints -->
<joint name="leg_lf_joint" type="continuous">
<origin xyz="0 0.306 -0.06" rpy="0 0 0"/>
<parent link="body" />
<child link="leg_lf" />
<dynamics damping="${joint_damping}"/>
<axis xyz="0 0 1" />
</joint>
<!-- LEG links -->
<link name="leg_lf">
<collision>
<origin xyz="0 0.122 0" rpy="${PI/2} 0 0"/>
<geometry>
<cylinder radius="${leg_r}" length="0.244"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0.122 0" rpy="${PI/2} 0 0"/>
<geometry>
<cylinder radius="${leg_r}" length="0.244"/>
</geometry>
<material name="green"/>
</visual>
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="${leg_m}"/>
<inertia ixx="0.00001" ixy="0.0" ixz="0.0"
iyy="0.0003" iyz="0.0"
izz="0.0005"/>
</inertial>
</link>
<!-- WHEEL joints -->
<joint name="wheel_lf_joint" type="continuous">
<parent link="leg_lf"/>
<child link="wheel_lf"/>
<origin xyz="0 0.18 0" rpy="0 0 0"/>
<dynamics damping="${joint_damping}"/>
<axis xyz="0 1 0"/>
</joint>
<!-- WHEEL links -->
<link name="wheel_lf">
<collision>
<origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
<geometry>
<cylinder radius="${wheel_r}" length="${wheel_h}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 ${PI/2} ${PI/2}"/>
<geometry>
<cylinder radius="${wheel_r}" length="${wheel_h}"/>
</geometry>
<material name="black"/>
</visual>
<inertial>
<origin xyz="0 0 0" rpy="0 ${PI/2} ${PI/2}"/>
<mass value="${wheel_m}"/>
<inertia ixx="${wheel_m / 12.0 * (3*wheel_r*wheel_r + wheel_h*wheel_h)}" ixy="0.0" ixz="0.0"
iyy="${wheel_m / 12.0 * (3*wheel_r*wheel_r + wheel_h*wheel_h)}" iyz="0.0"
izz="${wheel_m / 2.0 * wheel_r * wheel_r}"/>
</inertial>
Asked by TUBerlinstudent on 2021-02-04 12:01:26 UTC
Comments