Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to stop joint pose from being completely ignored by Gazebo

What are the rules by which Gazebo interprets joint poses? They seem completely different from links.

I have a two simple "bars", representing parts of a leg, each rotated by 45 degrees to form a "knee" at their intersection:

<link name="upper">
    <pose>-.01 .035 .1 0 0 0.785398</pose>
    <inertial>
        <pose>0 0 -0.5 0 0 0</pose>
        <inertia>
            <ixx>0.01</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
        </inertia>
        <mass>10.0</mass>
    </inertial>
    <collision name="collision">
        <geometry>
            <box>
                <size>0.04 0.005 0.003</size>
            </box>
        </geometry>
    </collision>
    <visual name="visual">
        <geometry>
            <box>
                <size>0.04 0.005 0.003</size>
            </box>
        </geometry>
        <material>
            <script>Gazebo/Purple</script>
        </material>
    </visual>
</link>
<link name="middle">
    <pose>0 0 .097 0 0 -0.785398</pose>
    <inertial>
        <pose>0 0 -0.5 0 0 0</pose>
        <inertia>
            <ixx>0.01</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.01</iyy>
            <iyz>0</iyz>
            <izz>0.01</izz>
        </inertia>
        <mass>10.0</mass>
    </inertial>
    <collision name="collision">
        <geometry>
            <box>
                <size>0.07 0.005 0.003</size>
            </box>
        </geometry>
    </collision>
    <visual name="visual">
        <geometry>
            <box>
                <size>0.07 0.005 0.003</size>
            </box>
        </geometry>
        <material>
            <script>Gazebo/Blue</script>
        </material>
    </visual>
</link>

I want to attach a revolute joint at the intersection, representing the knee joint. So I thought the joint's pose would be identical to the point at the end of the bar. This point is calculated as the half the length of the bar, minus an inset, rotated about the origin by 45 degrees, which is the x/y coordinate of (-0.0229809703886, 0.0229809703886).

This gives me a joint with a pose like:

<joint name="upper_middle_joint" type="revolute">
    <pose>-0.0229809703886 0.0229809703886 0 0 0 0</pose>
    <child>middle</child>
    <parent>upper</parent>
    <axis>
        <limit>
            <lower>-0.4</lower>
            <upper>0.4</upper>
        </limit>
        <xyz>0 0 1</xyz>
    </axis>
</joint>

However, when I view this in Gazebo, it looks like:

![joint misalignment](http://i.imgur.com/rwkXhUz.png)

Instead of posing the joint up along the y-axis by 0.023 and over along the negative x-axis by 0.023, it appears to have moved the joint up along the y-axis by 0.04 and nothing along the x-axis.

What am I doing wrong?