URDF model, axis

Hi there,

Really enjoy your courses. Recently finished the 5 day course, and i absolutely loved it. (on that note, was i supposed to receive a certificate, take a test, or is that only related to finishing entire learning paths?)

Anyways, i’m doing the URDF course now, as suggested by the learning path (Beginner), and i believe there might be a small error with the Mira URDF. In the joint state publisher it’s obvious that the roll movement is set to perform a forward roll - however, from my understanding of roll, pitch and yaw this would be the actual pitch movement. Roll would be the “sideways” roll:

Am i wrong?

I changed the URDF into this, which made more sense to me (i just switched the axis for the roll/pitch, by moving the eyes):

<?xml version="1.0"?>

    <robot name="mira">

        <material name="blue">

            <color rgba="0 0 0.8 1"/>

        </material>

        <material name="red">

            <color rgba="0.8 0 0 1"/>

        </material>

        <material name="green">

            <color rgba="0 0.8 0 1"/>

        </material>

        <material name="grey">

            <color rgba="0.75 0.75 0.75 1"/>

        </material>

        <material name="white">

            <color rgba="1.0 1.0 1.0 1"/>

        </material>

        <material name="black">

            <color rgba="0 0 0 1"/>

        </material>

    <!-- * * * Link Definitions * * * -->

        <!-- ROLL -->

        <link name="base_link">

            <visual>

                <origin rpy="0.0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder radius="0.06" length="0.09"/>

                </geometry>

                <material name="grey"/>

            </visual>

    </link>

        <link name="roll_M1_link">

            <visual>

                <origin rpy="0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder length="0.005" radius="0.01"/>

                </geometry>

                <material name="red"/>

            </visual>

        </link>

        <joint name="roll_joint" type="revolute">

         <parent link="base_link"/>

         <child link="roll_M1_link"/>

            <origin xyz="0.0023 0 -0.0005" rpy="0 0 0"/>

            <limit lower="-0.2" upper="0.2" effort="0.1" velocity="0.005"/>

            <axis xyz="1 0 0"/>

    </joint>

        <!-- PITCH -->

        <link name="pitch_M2_link">

            <visual>

                <origin rpy="0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder length="0.005" radius="0.01"/>

                </geometry>

                <material name="green"/>

            </visual>

        </link>

        <joint name="pitch_joint" type="revolute">

         <parent link="roll_M1_link"/>

         <child link="pitch_M2_link"/>

         <origin xyz="0 0 0" rpy="0 -1.5708 0"/>

            <limit lower="0" upper="0.44" effort="0.1" velocity="0.005"/>

            <axis xyz="0 1 0"/>

    </joint>

        <!-- YAW -->

        <link name="yaw_M3_link">

            <visual>

                <origin rpy="0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder length="0.005" radius="0.01"/>

                </geometry>

                <material name="blue"/>

            </visual>

        </link>

        <joint name="yaw_joint" type="continuous">

         <parent link="pitch_M2_link"/>

         <child link="yaw_M3_link"/>

            <origin xyz="0.01 0 0" rpy="0 1.5708 0"/>

            <limit effort="0.1" velocity="0.01"/>

            <axis xyz="0 0 1"/>

    </joint>

        <!-- HEAD -->

        <link name="head_link">

    <visual>

                <origin rpy="0.0 0 0" xyz="0 0 0"/>

                <geometry>

                    <sphere radius="0.06"/>

                </geometry>

                <material name="white"/>

            </visual>

    </link>

        <joint name="base_head_joint" type="fixed">

         <parent link="yaw_M3_link"/>

         <child link="head_link"/>

         <origin xyz="0 0 0.06" rpy="0 0 0"/>

    </joint>

        <!-- EYES BLINK -->

        <link name="left_eye_link">

    <visual>

                <origin rpy="0.0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder radius="0.00525" length="0.00525"/>

                </geometry>

                <material name="black"/>

            </visual>

    </link>

        <link name="right_eye_link">

    <visual>

                <origin rpy="0.0 0 0" xyz="0 0 0"/>

                <geometry>

                    <cylinder radius="0.00525" length="0.00525"/>

                </geometry>

                <material name="black"/>

            </visual>

    </link>

        <joint name="head_lefteye_joint" type="fixed">

            <parent link="head_link"/>

            <child link="left_eye_link"/>

            <origin xyz="0.057 -0.0095 0.0085" rpy="-1.5708 0 0"/>

        </joint>

        <joint name="head_righteye_joint" type="fixed">

            <parent link="head_link"/>

            <child link="right_eye_link"/>

            <origin xyz="0.057 0.0095 0.0085" rpy="-1.5708 0 0"/>

        </joint>

        <!-- CAMERA -->

        <link name="camera_link">

    <visual>

                <origin rpy="0.0 0 0" xyz="0 0 0"/>

                <geometry>

                    <box size="0.0005 0.0005 0.0005"/>

                </geometry>

                <material name="green"/>

            </visual>

    </link>

        <joint name="head_camera_joint" type="fixed">

            <parent link="head_link"/>

            <child link="camera_link"/>

            <origin xyz="0 0.057 0.0255" rpy="0 0 0"/>

        </joint>

    </robot>

Hi,

The roll Pitch and Yaw axis are just arbitrary really. So yeah you are right! It really depends on what you want to consider roll in the robots head. Its right oth ways. Th eRoollPicthYaw its really clear in planes, but in a robt head, it can be reallywhat you want. Yaw is more universal, but pitch and roll is up to you really :wink:

Noted. Thank you once again, Miguel !