pybullet and urdf : How can I rotate inner cylinder without rotate outer ring

47 views Asked by At
<?xml version="1.0"?>
<robot name="example_robot">

  <!-- Define the base link -->
  <link name="base_link"/>

  <!-- Define the ring link -->
  <link name="ring_link">
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.5"/>
      </geometry>
      <material name="yellow">
        <color rgba="1 1 0 1"/>
      </material>
    </visual>
  </link>

  <!-- Define the flat cylinder link -->
  <link name="cylinder_link">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.005" ixy="0" ixz="0" iyy="0.005" iyz="0" izz="0.001"/>
    </inertial>
    <visual>
      <geometry>
        <cylinder length="0.1" radius="0.2"/>
      </geometry>
      <material name="red">
        <color rgba="1 0 0 1"/>
      </material>
    </visual>
  </link>

  <!-- Define the joint between base_link and ring_link -->
  <joint name="base_ring_joint" type="fixed">
    <parent link="base_link"/>
    <child link="ring_link"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
  </joint>

  <!-- Define the joint between ring_link and cylinder_link -->
  <joint name="ring_cylinder_joint" type="revolute">
    <parent link="ring_link"/>
    <child link="cylinder_link"/>
    <origin rpy="0 0 0" xyz="0 0 0.025"/>
    <axis xyz="0 0 1"/>
    <limit effort="100" lower="-3.1415" upper="3.1415" velocity="1"/>
  </joint>

</robot>

p.setJointMotorControl2(table, 1, p.TORQUE_CONTROL, force=10)

I want to rotate cylinder without rotate the outer ring . but as I rotate , the outer ring keep rotate along with inner cylinder , please help me. I don't know if the problem is my python code or urdf file

0

There are 0 answers