URDF: How to add additional frames to links (i.e., rigid body)? Then attached a revolute joint to that link.

asked 2023-01-24 00:17:46 -0500

AhmadA gravatar image

Hello there,

I am just getting started with URDF, and I am trying a simple example, a single link pendulum. The pendulum is connected to the world frame via a revolute joint and should swing sideways. The URDF file is shown below, along with the image from rviz. The joint is connected to the default frame of the link, which is the center of mass. I need to connect the joint at the edge of the link. I know I can change the visual element, but the kinematics and dynamics will be incorrect. I played the commented <origin> tags, but that did not help. Would a workaround for this issue be to add a dummy weightless link with two fixed joints at both ends to bridge the revolute joint and the original link?

<?xml version="1.0"?>
<robot name="pendulum">
  <link name="world" />

  <link name="first_link">
    <!-- <origin xyz="0 0 0.5" rpy="0 0 0" /> -->
    <inertial>
      <mass value="1"/>
      <inertia ixx="1.5417" ixy="0" ixz="0" iyy="3.467" iyz="0" izz="4.742" />
      <!-- <origin xyz="0 0 0.5" rpy="0 0 0" /> -->
    </inertial>
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <material name="white">
        <color rgba="1 1 1 0.35" />
      </material>
    </visual>
  </link>

  <joint name="first_joint" type="continuous">
    <parent link="world"/>
    <child link="first_link"/>
    <axis rpy="0 0 0" xyz="0 1 0" />
    <origin rpy="0 0 0" xyz="0 0 -0.5" />
  </joint>

</robot>

Kind regards, and I look forward to hearing from you.

edit retag flag offensive close merge delete