A simple model of Denso robot written by URDF in ROS - ROS robotic arm study notes (1)

Using URDF to write a simple model of Denso robot in ROS (Kinetic)
The URDF model of Denso is mainly based on Figure 1, and then modified accordingly according to the actual situation.
denso robotic arm

A model of the Denso robotic arm

The problem encountered in the process of writing the model, the coordinate system in RVIZ is X in red, Y in green, and Z in blue. The value of rpy is the direction of the arrow along the coordinate system, clockwise is positive, counterclockwise is negative.
One thing that must be noted is that if the object generated by URDF does not do any rotation and position transformation , then the origin of the object's coordinate system is at the center of its own object , and the object's own coordinate system and the reference coordinates of the earth. The lines are coincident, so when you load a model without any transformations , you will see half of the objects below the grid lines.

The rpy in the origin entry in the Link property is the rotation transformation of the link relative to its own coordinate system; and XYZ is the position translation transformation of the link's object center relative to the origin of its own coordinate system.
Coordinate system transformation between connecting rods

 <link name="base_link">
        <visual>
            <geometry>
                <box size="0.1 0.1 0.15"/>
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 0.075"/>
            <material name="blue"/>
        </visual>
    </link>

It can be seen from this that the base_link has a position transformation relative to its own coordinate system. It moves 0.075 in the Z direction, which is exactly half of the height of the base_link, so the base_link seen in the figure is all exposed. instead of half below the grid lines.

The rpy in the origin entry in the Joint property is the rotation transformation of the child link's coordinate system relative to the parent link's coordinate system; and XYZ is the position translation transformation of the origin of the child link's coordinate system relative to the origin of the parent link's coordinate system.
Coordinate system transformation between connecting rods

<joint name="joint1" type="revolute">
        <parent link="base_link"/>
        <child link="shoulder_link"/>
        <origin rpy="0 0 0" xyz="0 0 0.15"/>
        <axis xyz="0 0 1"/>
        <limit effort="300" lower="-2.79252675555" upper="2.79252675555" velocity="1"/> 
        <dynamics damping="50" friction="1"/>
    </joint>

It can be seen from here that shoulder_link has a position transformation relative to the base_link coordinate system. It moves 0.15 in the Z direction, which is exactly the height of base_link, so the coordinate system of shoulder_link seen in the figure is on the upper surface of base_link. .

<?xml version="1.0"?>
<robot name="myfirstrobot">
    <material name="blue">
        <color rgba="0 0 0.8 0.6"/>
    </material>

    <material name="white">
        <color rgba="1 1 1 0.6"/>
    </material>

  <material name="orange">
    <color rgba="1 0.4 0.1 0.6"/>
  </material>

    <!-- Base Link -->
    <link name="base_link">
        <visual>
            <geometry>
                <box size="0.1 0.1 0.15"/>
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 0.075"/>
            <material name="blue"/>
        </visual>
    </link>

    <joint name="joint1" type="revolute">
        <parent link="base_link"/>
        <child link="shoulder_link"/>
        <origin rpy="0 0 0" xyz="0 0 0.15"/>
        <axis xyz="0 0 1"/>
        <limit effort="300" lower="-2.79252675555" upper="2.79252675555" velocity="1"/> 
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="shoulder_link">
        <visual>
            <geometry>
                <cylinder length="0.125" radius="0.08"/>
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 0.0625"/>
            <material name="white"/>
        </visual>
        <collision>
           <origin rpy="0 0 0" xyz="0 0 0.0625"/>
           <geometry>
              <cylinder length="0.125" radius="0.08"/>
           </geometry>
       </collision>
       <inertial>
          <mass value="1"/>
          <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
       </inertial>
   </link>
  <gazebo reference="shoulder_link">
    <material>Gazebo/White</material>
  </gazebo>

    <joint name="joint2" type="revolute">
        <parent link="shoulder_link"/>
        <child link="elbow_link"/>
        <origin rpy="1.570795 0 0" xyz="0 0 0.125"/>
        <axis xyz="0 0 1"/>
        <limit effort="300" lower="-2.094395066" upper="2.094395066" velocity="1"/>  
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="elbow_link">
        <visual>
            <geometry>
                 <box size="0.06 0.06 0.21"/>
            </geometry>
            <origin rpy="-1.570795 0 0" xyz="0 0.105 0"/>
            <material name="orange"/>
        </visual>
        <collision>
           <origin rpy="-1.570795 0 0" xyz="0 0.105 0"/>
           <geometry>
             <box size="0.06 0.06 0.21"/>
           </geometry>
       </collision>
       <inertial>
          <mass value="1"/>
          <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
       </inertial>
  </link>
  <gazebo reference="elbow_link">
    <material>Gazebo/orange</material>
  </gazebo>

   <joint name="joint3" type="revolute">
        <parent link="elbow_link"/>
        <child link="wrist_link"/>
        <origin rpy="0 0 1.570795" xyz="0 0.21 0"/>
        <axis xyz="0 0 1"/>
        <limit effort="300" lower="-1.2217304" upper="1.2217304" velocity="1"/> 
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="wrist_link">
        <visual>
            <geometry>
                 <box size="0.06 0.06 0.176"/>
            </geometry>
            <origin rpy="1.570795 0 0" xyz="0.03 0 0"/>
            <material name="orange"/>
        </visual>
       <collision>
           <origin rpy="1.570795 0 0" xyz="0.03 0 0"/>
           <geometry>
             <box size="0.06 0.06 0.176"/>
          </geometry>
      </collision>
      <inertial>
         <mass value="1"/>
         <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
      </inertial>
  </link>
  <gazebo reference="wrist_link">
    <material>Gazebo/orange</material>
  </gazebo>

    <joint name="joint4" type="revolute">
        <parent link="wrist_link"/>
        <child link="shoulder_r_link"/>
        <origin rpy="1.570795 -3.1415926 0" xyz="0.03 -0.088 0"/>
        <axis xyz="0 0 1"/>
        <limit effort="300" lower="-2.79252675555" upper="2.79252675555" velocity="1"/> 
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="shoulder_r_link">
        <visual>
            <geometry>
                 <cylinder length="0.122" radius="0.03"/>
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 0.061"/>
            <material name="red"/>
        </visual>
        <collision>
            <origin rpy="0 0 0" xyz="0 0 0.061"/>
            <geometry>
                <cylinder length="0.122" radius="0.03"/>
            </geometry>
       </collision>
       <inertial>
           <mass value="1"/>
           <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
       </inertial>
  </link>
  <gazebo reference="shoulder_r_link">
    <material>Gazebo/red</material>
  </gazebo>

   <joint name="joint5" type="revolute">
        <parent link="shoulder_r_link"/>
        <child link="elbow_r_link"/>
        <origin rpy="1.570795 0 -1.570795" xyz="0 0 0.119"/>
        <axis xyz="1 0 0"/>
        <limit effort="300" lower="-2.094395066" upper="2.094395066" velocity="1"/>  
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="elbow_r_link">
        <visual>
            <geometry>
                 <cylinder length="0.070" radius="0.03"/>
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 -0.005"/>
            <material name="orange"/>
        </visual>
        <collision>
            <origin rpy="0 0 0" xyz="0 0 -0.005"/>
            <geometry>
                <cylinder length="0.070" radius="0.03"/>
            </geometry>
       </collision>
       <inertial>
          <mass value="1"/>
          <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
       </inertial>
  </link>
  <gazebo reference="elbow_r_link">
    <material>Gazebo/orange</material>
  </gazebo>

    <joint name="joint6" type="continuous">
        <parent link="elbow_r_link"/>
        <child link="wrist_r_link"/>
        <origin rpy="-1.570795 0 -1.570795" xyz="0 0 -0.04"/>
        <axis xyz="0 1 0"/>
        <dynamics damping="50" friction="1"/>
    </joint>

    <link name="wrist_r_link">
        <visual>
            <geometry>
                 <cylinder length="0.020" radius="0.03"/>
            </geometry>
            <origin rpy="1.570795 0 0" xyz="0 0 0"/>
            <material name="red"/>
        </visual>
        <collision>
            <origin rpy="1.570795 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.020" radius="0.03"/>
            </geometry>
       </collision>
      <inertial>
          <mass value="1"/>
          <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="1.0"/>
      </inertial>
  </link>
  <gazebo reference="wrist_r_link">
    <material>Gazebo/red</material>
  </gazebo>
</robot>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324371138&siteId=291194637