<root BTCPP_format="4">
  <BehaviorTree ID="MainTree">
    <Sequence name="root">
      <!-- Retry waist + arm + hand until HandControl_H succeeds -->
      <RetryUntilSuccessful name="retry_all_action" num_attempts="5">
        <Sequence>
          <WaistControl_H name="s1_waist_bend_down" /> <!--pitch w rad -->
          <Arm_H name="s2_arm_stretch_out" />
          <HandControl_H name="s3_hand_pickup" />
          <Arm_H name="s4_arm_lift" />
          <WaistControl_H name="s5_waist_bend_up" />
          <WaistControl_H name="s6_waist_turn_around" />
          <LegControl_H name="s7_leg_move_back" />
          <WaistControl_H name="s8_waist_bend_down" />
          <Arm_H name="s9_arm_stretch_out" />
          <HandControl_H name="s10_hand_release" />
          <Arm_H name="s11_arm_move_to_snapshot_pose" />
          <CameraTakePhoto_H name="s12_camera_take_photo" />
          <WaistControl_H name="s13_waist_bend_up" />
          <Arm_H name="s14_arm_retract" />
        </Sequence>
      </RetryUntilSuccessful>      
    </Sequence>
  </BehaviorTree>
</root>
