Training Full Body Tracker On G1

by ADMIN 33 views

Introduction

Training a full body tracker on the Unitree G1 robot using the V1 version of code can be a complex task, especially when encountering issues. In this article, we will delve into the modifications made to the humanoid config in the H1 retargeting process and the addition of a robot/g1.yaml file. We will also discuss the training environment and the results obtained after training for over 8000 epochs.

Modifications to Humanoid Config and Addition of Robot/G1 YAML File

The humanoid config in the H1 retargeting process was modified to enable retargeting to the G1. This involved adding a robot/g1.yaml file, which contains the necessary configurations for the G1 robot.

Robot/G1 YAML File

The robot/g1.yaml file contains the following configurations:

robot:
  dof_obs_size: ${eval:${len:${.isaacgym_dof_body_ids}}*6} 
  number_of_actions: 23
  self_obs_max_coords_size: 358

  isaacgym_dof_body_ids: [ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,20,21,22,23 ]

  key_bodies: [ "left_ankle_roll_link", "right_ankle_roll_link" ]
  non_termination_contact_bodies: [ "left_ankle_roll_link", "right_ankle_roll_link" ]
  right_foot_name: "right_ankle_roll_link"
  left_foot_name: "left_ankle_roll_link"
  foot_name: "ankle_roll_link"
  knee_name: "knee_link"

  isaacgym_dof_names: [ 'left_hip_pitch_joint', 'left_hip_roll_joint', 'left_hip_yaw_joint', 'left_knee_joint', 'left_ankle_pitch_joint', 'left_ankle_roll_joint',
                        'right_hip_pitch_joint', 'right_hip_roll_joint', 'right_hip_yaw_joint', 'right_knee_joint', 'right_ankle_pitch_joint', 'right_ankle_roll_joint',
                        'waist_yaw_joint', 'waist_roll_joint', 'waist_pitch_joint',
                        'left_shoulder_pitch_joint', 'left_shoulder_roll_joint', 'left_shoulder_yaw_joint', 'left_elbow_joint',
                        'right_shoulder_pitch_joint', 'right_shoulder_roll_joint', 'right_shoulder_yaw_joint', 'right_elbow_joint' ]

  isaacgym_body_names: [ 'pelvis',
                         'left_hip_pitch_link', 'left_hip_roll_link', 'left_hip_yaw_link', 'left_knee_link', 'left_ankle_pitch_link', 'left_ankle_roll_link',
                         'right_hip_pitch_link', 'right_hip_roll_link', 'right_hip_yaw_link', 'right_knee_link', 'right_ankle_pitch_link', 'right_ankle_roll_link',
                         'waist_yaw_link', 'waist_roll_link', 'torso_link',
                         'left_shoulder_pitch_link', 'left_shoulder_roll_link', 'left_shoulder_yaw_link', 'left_elbow_link',
                         'right_shoulder_pitch_link', 'right_shoulder_roll_link', 'right_shoulder_yaw_link', 'right_elbow_link' ]

  init_state:
    pos: [ 0.0, 0.0, 0.8 ] 
    rot: [ 0.0, 0.0, 0.0, 1.0 ] 
    lin_vel: [ 0.0, 0.0, 0.0 ]
    ang_vel: [ 0.0, 0.0, 0.0 ]
    default_joint_angles:
      left_hip_pitch_joint: -0.1
      left_hip_roll_joint: 0.
      left_hip_yaw_joint: 0.
      left_knee_joint: 0.3
      left_ankle_pitch_joint: -0.2
      left_ankle_roll_joint: 0.
      right_hip_pitch_joint: -0.1
      right_hip_roll_joint: 0.
      right_hip_yaw_joint: 0.
      right_knee_joint: 0.3
      right_ankle_pitch_joint: -0.2
      right_ankle_roll_joint: 0.
      waist_yaw_joint: 0.
      waist_roll_joint: 0.
      waist_pitch_joint: 0.
      left_shoulder_pitch_joint: 0.
      left_shoulder_roll_joint: 0.
      left_shoulder_yaw_joint: 0.
      left_elbow_joint: 0.
      right_shoulder_pitch_joint: 0.
      right_shoulder_roll_joint: 0.
      right_shoulder_yaw_joint: 0.
      right_elbow_joint: 0.

  control:
    control_type: P
    stiffness:
      hip_yaw: 100    
      hip_roll: 100  
      hip_pitch: 100 
      knee: 200   
      ankle_pitch: 20   
      ankle_roll: 20   
      waist_yaw: 400   
      waist_roll: 400   
      waist_pitch: 400    
      shoulder_pitch: 90   
      shoulder_roll: 60   
      shoulder_yaw: 20   
      elbow: 60      
    damping: 
      hip_yaw: 2.5       
      hip_roll: 2.5     
      hip_pitch: 2.5       
      knee: 5       
      ankle_pitch: 0.2   
      ankle_roll: 0.1    
      waist_yaw: 5.0    
      waist_roll: 5.0     
      waist_pitch: 5.0  
      shoulder_pitch: 2.0  
      shoulder_roll: 1.0 
      shoulder_yaw: 0.4 
      elbow: 1.0    
    action_scale: 0.25
    clamp_actions: 100.0
  asset:
    collapse_fixed_joints: True
    replace_cylinder_with_capsule: True
    flip_visual_attachments: False
    armature: 0.001 
    thickness: 0.01
    max_angular_velocity: 1000.
    max_linear_velocity: 1000.
    density: 0.001
    angular_damping: 0.
    linear_damping: 0.
    asset_file_name: "urdf/g1.urdf"
    robot_type: g1_29dof_anneal_23dof
    self_collisions: False 
    default_dof_drive_mode: 3
motion_lib:
  _target_: phys_anim.utils.motion_lib_g1.G1_MotionLib
env:
  config:
    simulator:
      sim:
        fps: 200 
        control_freq_inv: 4  
        substeps: 1

Training Environment and Results

The training environment consisted of 2x 4090 GPUs, a batch size of 2048, and 2048 environments. After training for over 8000 epochs, the result was that the robot immediately fell over at the start.

Troubleshooting and Optimization

To troubleshoot and optimize the training process, we need to analyze the results obtained and identify the potential causes of the issue.

  1. Insufficient Training: The robot may not have received sufficient training to learn the complex movements required to maintain balance.
  2. Incorrect Configurations: The configurations in the robot/g1.yaml file may not be accurate, leading to incorrect predictions and movements.
  3. Inadequate Data: The dataset used for training may not be sufficient to cover all possible scenarios, leading to overfitting and poor generalization.

To address these issues, we can try the following:

  1. Increase Training Time: Increase the training time to allow the robot to learn more complex movements and improve its balance.
  2. Adjust Configurations: Adjust the configurations in the robot/g1.yaml file to ensure that they are accurate and consistent with the robot's capabilities.
  3. Augment Dataset: Augment the dataset used for training to include more scenarios and variations, reducing the risk of overfitting and improving generalization.

By analyzing the results and identifying potential causes, we can take steps to troubleshoot and optimize the training process, ultimately achieving better results and improving the robot's performance.

Conclusion

Q: What are the common issues encountered when training a full body tracker on the Unitree G1 robot?

A: The common issues encountered when training a full body tracker on the Unitree G1 robot include:

  • Insufficient Training: The robot may not have received sufficient training to learn the complex movements required to maintain balance.
  • Incorrect Configurations: The configurations in the robot/g1.yaml file may not be accurate, leading to incorrect predictions and movements.
  • Inadequate Data: The dataset used for training may not be sufficient to cover all possible scenarios, leading to overfitting and poor generalization.

Q: How can I troubleshoot and optimize the training process?

A: To troubleshoot and optimize the training process, you can try the following:

  • Increase Training Time: Increase the training time to allow the robot to learn more complex movements and improve its balance.
  • Adjust Configurations: Adjust the configurations in the robot/g1.yaml file to ensure that they are accurate and consistent with the robot's capabilities.
  • Augment Dataset: Augment the dataset used for training to include more scenarios and variations, reducing the risk of overfitting and improving generalization.

Q: What are the benefits of using a full body tracker on the Unitree G1 robot?

A: The benefits of using a full body tracker on the Unitree G1 robot include:

  • Improved Balance: The full body tracker can help the robot maintain balance and stability, even in complex environments.
  • Enhanced Mobility: The full body tracker can enable the robot to move more efficiently and effectively, reducing the risk of injury and improving overall performance.
  • Increased Autonomy: The full body tracker can allow the robot to operate more autonomously, reducing the need for human intervention and improving overall productivity.

Q: How can I ensure that the full body tracker is properly calibrated and configured?

A: To ensure that the full body tracker is properly calibrated and configured, you can try the following:

  • Verify Configurations: Verify that the configurations in the robot/g1.yaml file are accurate and consistent with the robot's capabilities.
  • Perform Calibration: Perform calibration on the full body tracker to ensure that it is properly aligned and configured.
  • Test and Validate: Test and validate the full body tracker to ensure that it is functioning correctly and providing accurate predictions.

Q: What are the potential risks and challenges associated with using a full body tracker on the Unitree G1 robot?

A: The potential risks and challenges associated with using a full body tracker on the Unitree G1 robot include:

  • Inaccurate Predictions: The full body tracker may provide inaccurate predictions, leading to poor performance and increased risk of injury.
  • System Failure: The full body tracker may fail to function correctly, leading to system failure and increased risk of injury.
  • Cybersecurity Risks: The full body tracker may be vulnerable to cybersecurity risks, such as hacking and data breaches.

Q: How can I mitigate the risks and challenges associated with using a full body tracker on the Unitree G1 robot?

A: To mitigate the risks and challenges associated with using a full body tracker on the Unitree G1 robot, you can try the following:

  • Implement Safety Features: Implement safety features, such as emergency shutdown and collision detection, to reduce the risk of injury and system failure.
  • Conduct Regular Maintenance: Conduct regular maintenance on the full body tracker to ensure that it is functioning correctly and providing accurate predictions.
  • Implement Cybersecurity Measures: Implement cybersecurity measures, such as encryption and firewalls, to reduce the risk of hacking and data breaches.