0
$\begingroup$

I have a robot described in an xacro file that appears to spawn correctly in a world with a ground plane:

 <model name="ground_plane">
        <static>true</static>
        <link name="link">
            <collision name="collision">
                <geometry>
                    <plane>
                    <normal>0 0 1</normal>
                    </plane>
                </geometry>
            </collision>
            <visual name="visual">
                <geometry>
                    <plane>
                    <normal>0 0 1</normal>
                    <size>100 100</size>
                    </plane>
                </geometry>
                <material>
                    <ambient>0.8 0.8 0.8 1</ambient>
                    <diffuse>0.8 0.8 0.8 1</diffuse>
                    <specular>0.8 0.8 0.8 1</specular>
                </material>
            </visual>
        </link>
    </model>

The bot has a chassis described in an xacro file like this:

<xacro:macro name="body" params="mass d h w *origin">
    <inertial>
        <xacro:insert_block name="origin"/>
        <mass value="${mass}" />
        <inertia 
            ixx="${(1/12) * mass * (h*h+w*w)}" 
            ixy="0.0"
            ixz="0.0"
            iyy="${(1/12) * mass * (d*d+w*w)}" 
            iyz="0.0"
            izz="${(1/12) * mass * (d*d+h*h)}" />
    </inertial>
</xacro:macro>

And then the chassis is defined as:

<link name="base_link_back">
<xacro:body mass="0.00001" d="0.0000010" h="0.000003" w="0.00003">
  <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0"/>
</xacro:body>
</link>

<joint name="base_link_back_joint" type="fixed">
<parent link="base_link"/>
<child link="base_link_back"/>
<origin rpy="0 0.0 3.14" xyz="0.0 0.0 0.0" />
</joint>

<link name="chassis">
<xacro:body mass="0.360" d="0.125" h="0.028" w="0.1256">
  <origin xyz="0 0.014 0.0" rpy="0.0 0.0 0.0"/>
</xacro:body>
<collision>
  <origin rpy="0.0 0.0 0.0" xyz="0 0.018 0"/>
  <geometry>
    <box size="0.1 0.015 0.1"/>
  </geometry>
</collision>

<visual>
  <origin rpy="0.0 3.14 0.0" xyz="0.0 0.0 0.0"/>
  <geometry>
    <mesh filename="$(find rae_description)/urdf/models/RAE-TOP-ASSY_0417.STL" scale="1.0 1.0 1.0"/>
  </geometry>
  <material name="mat">
    <lighting>1</lighting>
    <color rgba="0.1 0.1 0.1 1.0"/>
    <shader type='pixel'/>
    <emissive>0 0 0 1</emissive>
  </material>
  <transparency>0</transparency>
  <cast_shadows>1</cast_shadows>
</visual>

</link>

<joint name="base_chassis_joint" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin rpy="1.57 0.0 1.57" xyz="-0.0307 0.0 0.0" />
</joint>

The wheels have been commented out so this is just the chassis.

When gz is run, the chassis hovers above the ground plane, but when I play the sim, the chassis drops down to where half of the bot is below the ground plane (which prevents the wheels from touching the ground plane).

Could this be a spawning issue or am I missing a setting?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.