<?xml version="1.0"?>
<robot name="chair">

  <!-- Base link at the top of the front right leg -->
  <link name="chair_link">
    <visual>
      <geometry>
        <sphere radius="0.0008898876404494383"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="invisible">
        <color rgba="0 0 0 0"/>
      </material>
    </visual>
    <collision name="chair">
      <geometry>
        <sphere radius="0.0008898876404494383"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.0007047020337064468"/>
      <inertia ixx="5.580535493887648e-07" ixy="0.0" ixz="0.0" iyy="5.580535493887648e-07" iyz="0.0" izz="5.580535493887648e-07"/>
    </inertial>
  </link>

  <!-- Base link at the top of the front right leg -->
  <link name="base">
    <visual>
      <geometry>
        <sphere radius="0.0008898876404494383"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="invisible">
        <color rgba="0 0 0 0"/>
      </material>
    </visual>
    <inertial>
      <mass value="0.0007047020337064468"/>
      <inertia ixx="5.580535493887648e-07" ixy="0.0" ixz="0.0" iyy="5.580535493887648e-07" iyz="0.0" izz="5.580535493887648e-07"/>
    </inertial>
  </link>

  <!-- Seat -->
  <link name="seat">
    <visual>
      <geometry>
        <box size="0.32035955056179777 0.3470561797752809 0.017797752808988765"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <box size="0.32035955056179777 0.3470561797752809 0.017797752808988765"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.7047020337064468"/>
      <inertia ixx="0.006696642592665178" ixy="0.0" ixz="0.0" iyy="0.005580535493887649" iyz="0.0" izz="0.011161070987775298"/>
    </inertial>
  </link>

  <!-- Front left leg -->
  <link name="front_left_leg">
    <visual>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.007047020337064468"/>
      <inertia ixx="0.0005580535493887648" ixy="0.0" ixz="0.0" iyy="0.0005580535493887648" iyz="0.0" izz="5.5805354938876486e-05"/>
    </inertial>
  </link>

  <!-- Front right leg -->
  <link name="front_right_leg">
    <visual>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.007047020337064468"/>
      <inertia ixx="0.0005580535493887648" ixy="0.0" ixz="0.0" iyy="0.0005580535493887648" iyz="0.0" izz="5.5805354938876486e-05"/>
    </inertial>
  </link>

  <!-- Back left leg -->
  <link name="back_left_leg">
    <visual>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.007047020337064468"/>
      <inertia ixx="0.0005580535493887648" ixy="0.0" ixz="0.0" iyy="0.0005580535493887648" iyz="0.0" izz="5.5805354938876486e-05"/>
    </inertial>
  </link>

  <!-- Back right leg -->
  <link name="back_right_leg">
    <visual>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder radius="0.017797752808988765" length="0.3915505617977528"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.007047020337064468"/>
      <inertia ixx="0.0005580535493887648" ixy="0.0" ixz="0.0" iyy="0.0005580535493887648" iyz="0.0" izz="5.5805354938876486e-05"/>
    </inertial>
  </link>

  <!-- Backrest (tilted back support) -->
  <link name="backrest">
    <visual>
      <geometry>
        <box size="0.32035955056179777 0.013348314606741574 0.3648539325842697"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
      <material name="wood">
        <color rgba="0.6 0.4 0.2 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <box size="0.32035955056179777 0.013348314606741574 0.3648539325842697"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
    </collision>
    <inertial>
      <mass value="0.3523510168532234"/>
      <inertia ixx="0.006696642592665178" ixy="0.0" ixz="0.0" iyy="0.011161070987775298" iyz="0.0" izz="0.005580535493887649"/>
    </inertial>
  </link>

  <!-- Joint connecting base_link to seat -->

  <joint name="baselink_to_base" type="fixed">
    <parent link="chair_link"/>
    <child link="base"/>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
  </joint>

  <joint name="base_to_seat" type="fixed">
    <parent link="base"/>
    <child link="seat"/>
    <origin xyz="0.14238202247191012 -0.16017977528089888 0.0" rpy="0 0 0"/>
  </joint>

  <!-- Joint connecting front left leg to seat -->
  <joint name="seat_to_front_left_leg" type="fixed">
    <parent link="seat"/>
    <child link="front_left_leg"/>
    <origin xyz="0.13348314606741574 0.13348314606741574 -0.2046741573033708" rpy="0 0 0"/>
  </joint>

  <!-- Joint connecting front right leg to seat -->
  <joint name="seat_to_front_right_leg" type="fixed">
    <parent link="seat"/>
    <child link="front_right_leg"/>
    <origin xyz="0.13348314606741574 -0.13348314606741574 -0.2046741573033708" rpy="0 0 0"/>
  </joint>

  <!-- Joint connecting back left leg to seat -->
  <joint name="seat_to_back_left_leg" type="fixed">
    <parent link="seat"/>
    <child link="back_left_leg"/>
    <origin xyz="-0.13348314606741574 0.13348314606741574 -0.2046741573033708" rpy="0 0 0"/>
  </joint>

  <!-- Joint connecting back right leg to seat -->
  <joint name="seat_to_back_right_leg" type="fixed">
    <parent link="seat"/>
    <child link="back_right_leg"/>
    <origin xyz="-0.13348314606741574 -0.13348314606741574 -0.2046741573033708" rpy="0 0 0"/>
  </joint>

  <!-- Joint connecting backrest to seat (tilted back 15 degrees) -->
  <joint name="seat_to_backrest" type="fixed">
    <parent link="seat"/>
    <child link="backrest"/>
    <origin xyz="0.0 -0.2046741573033708 0.17797752808988765" rpy="0.21 0 0"/>
  </joint>

</robot>
