Gazebo object sinks into fixed object [Solved]

asked 2020-08-16 12:42:03 -0600

Fatalon gravatar image

Hello, I created a scene, in which a hanoi tower is placed on top of a supporting box, which stands on a table next to a robot.
The board and also the supporting box have a fixed joint to the world reference forcing them to stick to there position. The disks, which should later be grapped by the robot arm have not such a fixed joint and spawn on top of the board, sliding down into the appropriate position. But as you can see in the image, the lowest disk sinks into the board and ignores somehow the collision properties of the table (visual and collision are both based on the same .stl file). Also, if you stack multiple tokens on top of each other, they stack appropriatly to their collision properties.

<robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22" name="edo">xmlns:xacro="http://www.ros.org/wiki/...> <xacro:include filename="$(find hanoi_tower_description)/urdf/materials.xacro"> <xacro:include filename="$(find hanoi_tower_description)/urdf/towers_of_hanoi_board.xacro"></xacro:include></xacro:include></robot>

<xacro:arg name="board_name" default="towers_of_hanoi_board"/>
<xacro:arg name="origin_xyz" default="0 0 0"/>
<xacro:arg name="origin_rpy" default="0 0 0"/>

<!-- Fix to world just for testing -->
<link name="world"/>

<gazebo reference="world">
    <static>true</static>
</gazebo>

<xacro:towers_of_hanoi_board board_name="$(arg board_name)" parent="world">
    <origin xyz="$(arg origin_xyz)" rpy="$(arg origin_rpy)" />
</xacro:towers_of_hanoi_board>

</robot>

board.xacro <robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22">xmlns:xacro="http://www.ros.org/wiki/...></robot>

<!-- <xacro:include filename="$(find edo_description)/urdf/utilities.xacro" /> -->

<xacro:macro name="towers_of_hanoi_board" params="parent board_name *origin">

    <!--joint between {parent} and base_link-->
    <joint name="${parent}_${board_name}_joint" type="fixed">
        <xacro:insert_block name="origin"/>
        <parent link="${parent}"/>
        <child link="${board_name}_base_link"/>
    </joint>

    <link name="${board_name}_base_link">
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="0.07"/>
            <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0" />
        </inertial>

        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://hanoi_tower_description/meshes/towers_of_hanoi/hanoi-board.stl"/>
            </geometry>
            <material name="Brown"/>
        </visual>

        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://hanoi_tower_description/meshes/towers_of_hanoi/hanoi-board.stl"/>
            </geometry>
            <material name="Brown"/>
        </collision>

    </link>
    <gazebo reference="${board_name}_base_link">
        <material>Gazebo/Wood</material>
    </gazebo>

</xacro:macro>

</robot>

token.xacro <robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro%22">xmlns:xacro="http://www.ros.org/wiki/...></robot>

<xacro:property name="color" value="White" />
<xacro:property name="diameter" value="0.07" />
<xacro:property name="hole_diameter" value="0.012" />
<xacro:property name="height" value="0.015" />
<xacro:property name ...
(more)
edit retag flag offensive close merge delete

Comments

have you got any solution?

waltergun gravatar image waltergun  ( 2022-01-14 15:39:03 -0600 )edit

yeah - I think in the end, I adjusted the token.xacro visual origin to be at
<origin rpy="0 0 0" xyz="0 0 ${height / 2}"/> instead of <origin rpy="0 0 0" xyz="0 0 0"/>

If you have a similar issue, I would suggest to you, that you inspect your collision model and compare it against your visual model.

Fatalon gravatar image Fatalon  ( 2022-01-16 12:12:21 -0600 )edit