diff --git a/.gitignore b/.gitignore index 448caf14e..b3396b4de 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,8 @@ docs/superpowers/ # Motion assets (downloaded from HF at runtime) src/unilab/assets/motions/g1/*.npz src/unilab/assets/motions/g1/*.csv +src/unilab/assets/motions/g1/**/*.npz +src/unilab/assets/motions/g1/**/*.csv src/unilab/assets/motions/g1/flip src/unilab/assets/motions/g1/flip_npz src/unilab/assets/motions/x2/*.npz @@ -101,3 +103,17 @@ src/unilab/assets/checkpoints/**/*.onnx # Backend temp XML emitted next to robot.xml (motrix/mujoco scene materialization) src/unilab/assets/robots/**/tmp*.xml + +# Training artifacts (curves, videos, screenshots) +val/ + +# Agent working directory (not committed) +.sisyphus/ + +# Internal planning docs (not for upstream) +G1_23DOF_INIT.md +G1_23DOF_PR_CHECKLIST.md +APPO_HARDWARE_TIMING_ANALYSIS.md + +# Training log artifacts (checkpoints, ONNX exports) +log/ diff --git a/conf/appo/task/g1_23dof_climb_tracking/motrix.yaml b/conf/appo/task/g1_23dof_climb_tracking/motrix.yaml new file mode 100644 index 000000000..7844addb7 --- /dev/null +++ b/conf/appo/task/g1_23dof_climb_tracking/motrix.yaml @@ -0,0 +1,65 @@ +# @package _global_ +training: + task_name: G1ClimbTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 +env: + sampling_mode: adaptive + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.3 + ee_body_pos_z_threshold: 0.3 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_climb_tracking/mujoco.yaml b/conf/appo/task/g1_23dof_climb_tracking/mujoco.yaml new file mode 100644 index 000000000..21380ecb4 --- /dev/null +++ b/conf/appo/task/g1_23dof_climb_tracking/mujoco.yaml @@ -0,0 +1,65 @@ +# @package _global_ +training: + task_name: G1ClimbTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 +env: + sampling_mode: adaptive + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.3 + ee_body_pos_z_threshold: 0.3 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_flip_tracking/motrix.yaml b/conf/appo/task/g1_23dof_flip_tracking/motrix.yaml new file mode 100644 index 000000000..05098dac7 --- /dev/null +++ b/conf/appo/task/g1_23dof_flip_tracking/motrix.yaml @@ -0,0 +1,86 @@ +# @package _global_ +training: + task_name: G1FlipTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + steps_per_env: 24 + max_iterations: 3500 + save_interval: 500 + algorithm: + num_learning_epochs: 10 + num_mini_batches: 8 + clip_param: 0.2 + gamma: 0.99 + lam: 0.95 + value_loss_coef: 1.0 + entropy_coef: 0.005 + learning_rate: 1.0e-3 + max_grad_norm: 1.0 + use_clipped_value_loss: true + schedule: adaptive + desired_kl: 0.01 + adaptive_kl_factor: 2.0 + adaptive_lr_factor: 1.5 + optimizer: adam + tau: 1.0 + target_update_freq: 1 + vtrace_clip_rho: 1.0 + vtrace_clip_c: 1.0 + enable_compile: true +env: + sampling_mode: start + truncate_on_clip_end: true + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.005 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_flip_tracking/mujoco.yaml b/conf/appo/task/g1_23dof_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..6676d9360 --- /dev/null +++ b/conf/appo/task/g1_23dof_flip_tracking/mujoco.yaml @@ -0,0 +1,70 @@ +# @package _global_ +training: + task_name: G1FlipTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + steps_per_env: 24 + max_iterations: 3500 + save_interval: 500 + algorithm: + entropy_coef: 0.005 + num_learning_epochs: 10 + num_mini_batches: 8 + desired_kl: 0.01 +env: + sampling_mode: start + truncate_on_clip_end: true + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.005 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_motion_tracking/motrix.yaml b/conf/appo/task/g1_23dof_motion_tracking/motrix.yaml new file mode 100644 index 000000000..aa74c1a66 --- /dev/null +++ b/conf/appo/task/g1_23dof_motion_tracking/motrix.yaml @@ -0,0 +1,29 @@ +# @package _global_ +training: + task_name: G1MotionTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 5000 + save_interval: 500 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_motion_tracking/mujoco.yaml b/conf/appo/task/g1_23dof_motion_tracking/mujoco.yaml new file mode 100644 index 000000000..3b31907a5 --- /dev/null +++ b/conf/appo/task/g1_23dof_motion_tracking/mujoco.yaml @@ -0,0 +1,32 @@ +# @package _global_ +training: + task_name: G1MotionTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 5000 + save_interval: 500 + algorithm: + adaptive_kl_factor: 2.0 + adaptive_lr_factor: 1.5 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_walk_flat/mujoco.yaml b/conf/appo/task/g1_23dof_walk_flat/mujoco.yaml new file mode 100644 index 000000000..e68cd0af1 --- /dev/null +++ b/conf/appo/task/g1_23dof_walk_flat/mujoco.yaml @@ -0,0 +1,36 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: mujoco +algo: + max_iterations: 500 + save_interval: 100 +env: + control_config: + action_scale: 0.25 + curriculum: + enabled: false + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 0.2 + feet_phase: 1.0 + lin_vel_z: -1.0 + ang_vel_xy: -0.25 + base_height: -500.0 + orientation: -5.0 + action_rate: -0.01 + pose: -0.1 + tracking_sigma: 0.25 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + base_height_target: 0.754 + min_base_height: 0.55 + max_tilt_deg: 25.0 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/appo/task/g1_23dof_wall_flip_tracking/motrix.yaml b/conf/appo/task/g1_23dof_wall_flip_tracking/motrix.yaml new file mode 100644 index 000000000..3b543c9c4 --- /dev/null +++ b/conf/appo/task/g1_23dof_wall_flip_tracking/motrix.yaml @@ -0,0 +1,50 @@ +# @package _global_ +training: + task_name: G1WallFlipTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 5000 + save_interval: 500 + algorithm: + num_learning_epochs: 5 + num_mini_batches: 4 + clip_param: 0.2 + gamma: 0.99 + lam: 0.95 + value_loss_coef: 1.0 + entropy_coef: 0.01 + learning_rate: 1.0e-3 + max_grad_norm: 1.0 + use_clipped_value_loss: true + schedule: adaptive + desired_kl: 0.01 + adaptive_kl_factor: 2.0 + adaptive_lr_factor: 1.5 + optimizer: adam + tau: 1.0 + target_update_freq: 1 + vtrace_clip_rho: 1.0 + vtrace_clip_c: 1.0 + enable_compile: true +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/appo/task/g1_23dof_wall_flip_tracking/mujoco.yaml b/conf/appo/task/g1_23dof_wall_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..0decec32d --- /dev/null +++ b/conf/appo/task/g1_23dof_wall_flip_tracking/mujoco.yaml @@ -0,0 +1,87 @@ +# @package _global_ +training: + task_name: G1WallFlipTracking23Dof + sim_backend: mujoco + play_steps: 1000 + replay_queue_size: 5 +algo: + num_envs: 1024 + steps_per_env: 20 + max_iterations: 7000 + save_interval: 500 + algorithm: + num_learning_epochs: 6 + num_mini_batches: 8 + clip_param: 0.2 + gamma: 0.99 + lam: 0.95 + value_loss_coef: 1.0 + entropy_coef: 0.005 + learning_rate: 1.0e-3 + max_grad_norm: 1.0 + use_clipped_value_loss: true + schedule: adaptive + desired_kl: 0.008 + adaptive_kl_factor: 2.0 + adaptive_lr_factor: 1.5 + optimizer: adam + tau: 1.0 + target_update_freq: 1 + vtrace_clip_rho: 1.0 + vtrace_clip_c: 1.0 + enable_compile: true +env: + sampling_mode: start + truncate_on_clip_end: true + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.005 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/motrix.yaml b/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/motrix.yaml new file mode 100644 index 000000000..d1698fb4c --- /dev/null +++ b/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/motrix.yaml @@ -0,0 +1,59 @@ +# @package _global_ +# Motrix owner for FlashSAC G1 23-DoF walk flat. +# Mirrors 29-DoF flashsac/g1_walk_flat/motrix.yaml: +# - Keeps the mujoco owner's FlashSAC algo identity +# - Adopts the Motrix-direction env + reward tuning (kp/kd rand off, retuned shaping) +training: + task_name: G1Walk23DofFlat + sim_backend: motrix +algo: + num_envs: 4096 + learning_starts: 49 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + replay_buffer_n: 256 + tau: 0.05 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + domain_rand: + randomize_kp: false + randomize_kd: false + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 0.0 + scale_gyro: 0.0 + scale_gravity: 0.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.1 + scale_linvel: 0.0 +reward: + scales: + tracking_lin_vel: 2.2 + tracking_ang_vel: 1.8 + penalty_ang_vel_xy: -1.2 + penalty_orientation: -12.0 + penalty_action_rate: -2.5 + pose: -0.6 + penalty_feet_ori: -5.0 + feet_phase: 6.0 + alive: 12.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + close_feet_threshold: 0.15 + pose_weights: [0.01, 2.0, 5.0, 0.01, 5.0, 5.0, 0.01, 2.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/mujoco.yaml b/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/mujoco.yaml new file mode 100644 index 000000000..34e63d24d --- /dev/null +++ b/conf/offpolicy/task/flashsac/g1_23dof_walk_flat/mujoco.yaml @@ -0,0 +1,53 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: mujoco +algo: + num_envs: 4096 + learning_starts: 49 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + #use_symmetry: true + replay_buffer_n: 256 + tau: 0.05 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 0.0 + scale_gyro: 0.0 + scale_gravity: 0.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.1 + scale_linvel: 0.0 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 1.5 + penalty_ang_vel_xy: -1.0 + penalty_orientation: -10.0 + penalty_action_rate: -5.0 + pose: -0.5 + penalty_feet_ori: -25.0 + feet_phase: 5.0 + alive: 10.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.005 + close_feet_threshold: 0.15 + pose_weights: [0.01, 2.0, 5.0, 0.01, 5.0, 5.0, 0.01, 2.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/sac/g1_23dof_flip_tracking/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..f48e6108a --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_flip_tracking/mujoco.yaml @@ -0,0 +1,76 @@ +# @package _global_ +training: + task_name: G1FlipTrackingSAC23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 4096 + max_iterations: 25000 + save_interval: 1000 + gamma: 0.99 + tau: 0.05 + num_atoms: 501 + updates_per_step: 4 + policy_frequency: 2 + use_symmetry: false + algo_params: + alpha_init: 0.005 + target_entropy_ratio: 0.05 + max_grad_norm: 10.0 +env: + sampling_mode: mixed + sampling_start_ratio: 0.1 + truncate_on_clip_end: true + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/offpolicy/task/sac/g1_23dof_motion_tracking/motrix.yaml b/conf/offpolicy/task/sac/g1_23dof_motion_tracking/motrix.yaml new file mode 100644 index 000000000..e042ee799 --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_motion_tracking/motrix.yaml @@ -0,0 +1,19 @@ +# @package _global_ +# G1 23-DoF Motion Tracking SAC — Motrix variant for sim2sim eval. +# Inherits the mujoco training config in full and only switches the rendering +# backend so checkpoints trained on mujoco can be replayed via motrix's native +# renderer (`eval --sim motrix`). Training on motrix is not the intended path. +defaults: + - /task/sac/g1_23dof_motion_tracking/mujoco + - _self_ + +training: + task_name: G1MotionTrackingSAC23Dof + sim_backend: motrix +env: + # motrix backend's kp/kd override path is broken on column slices, and DR + # is not desirable during deterministic sim2sim eval anyway. Match the + # `g1_walk_flat/motrix.yaml` convention by switching them off. + domain_rand: + randomize_kp: false + randomize_kd: false diff --git a/conf/offpolicy/task/sac/g1_23dof_motion_tracking/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_motion_tracking/mujoco.yaml new file mode 100644 index 000000000..a68d07fae --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_motion_tracking/mujoco.yaml @@ -0,0 +1,73 @@ +# @package _global_ +training: + task_name: G1MotionTrackingSAC23Dof + sim_backend: mujoco +algo: + num_envs: 2048 + max_iterations: 25000 + save_interval: 1000 + gamma: 0.99 + tau: 0.05 + num_atoms: 501 + updates_per_step: 4 + policy_frequency: 2 + use_symmetry: false + algo_params: + alpha_init: 0.1 + target_entropy_ratio: 0.5 + max_grad_norm: 10.0 +env: + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.07450087032950714 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.07450087032950714 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + truncate_on_clip_end: true + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -2.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/offpolicy/task/sac/g1_23dof_walk_flat/motrix.yaml b/conf/offpolicy/task/sac/g1_23dof_walk_flat/motrix.yaml new file mode 100644 index 000000000..d67013177 --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_walk_flat/motrix.yaml @@ -0,0 +1,50 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: motrix +algo: + num_envs: 2048 + learning_starts: 1 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + use_symmetry: false + algo_params: + alpha_init: 0.001 + target_entropy_ratio: 0.0 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + domain_rand: + randomize_kp: false + randomize_kd: false + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 +reward: + scales: + tracking_lin_vel: 2.2 + tracking_ang_vel: 1.8 + penalty_ang_vel_xy: -1.2 + penalty_orientation: -12.0 + penalty_action_rate: -2.5 + pose: -0.6 + penalty_feet_ori: -5.0 + feet_phase: 6.0 + alive: 12.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + close_feet_threshold: 0.15 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/sac/g1_23dof_walk_flat/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_walk_flat/mujoco.yaml new file mode 100644 index 000000000..1f2ca273c --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_walk_flat/mujoco.yaml @@ -0,0 +1,54 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: mujoco +algo: + num_envs: 2048 + learning_starts: 10 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + use_symmetry: true + algo_params: + alpha_init: 0.001 + target_entropy_ratio: 0.0 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 1.0 + scale_gyro: 0.0 + scale_gravity: 0.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.1 + scale_linvel: 0.0 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 1.5 + penalty_ang_vel_xy: -1.0 + penalty_orientation: -10.0 + penalty_action_rate: -4.0 + pose: -0.5 + penalty_feet_ori: -20.0 + feet_phase: 5.0 + alive: 10.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.04 + close_feet_threshold: 0.15 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/sac/g1_23dof_walk_rough/motrix.yaml b/conf/offpolicy/task/sac/g1_23dof_walk_rough/motrix.yaml new file mode 100644 index 000000000..844fb2f2a --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_walk_rough/motrix.yaml @@ -0,0 +1,51 @@ +# @package _global_ +training: + task_name: G1Walk23DofRough + sim_backend: motrix +algo: + num_envs: 2048 + learning_starts: 1 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + use_symmetry: false + algo_params: + alpha_init: 0.001 + target_entropy_ratio: 0.0 +env: + sim_dt: 0.01 + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + domain_rand: + randomize_kp: false + randomize_kd: false + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 +reward: + scales: + tracking_lin_vel: 2.2 + tracking_ang_vel: 1.8 + penalty_ang_vel_xy: -1.2 + penalty_orientation: -12.0 + penalty_action_rate: -2.5 + pose: -0.6 + penalty_feet_ori: -5.0 + feet_phase: 6.0 + alive: 12.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + close_feet_threshold: 0.15 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/sac/g1_23dof_walk_rough/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_walk_rough/mujoco.yaml new file mode 100644 index 000000000..16689327b --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_walk_rough/mujoco.yaml @@ -0,0 +1,54 @@ +# @package _global_ +training: + task_name: G1Walk23DofRough + sim_backend: mujoco +algo: + num_envs: 2048 + learning_starts: 10 + max_iterations: 5000 + save_interval: 1000 + updates_per_step: 8 + use_symmetry: true + algo_params: + alpha_init: 0.001 + target_entropy_ratio: 0.0 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 1.0 + scale_gyro: 0.0 + scale_gravity: 0.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.1 + scale_linvel: 0.0 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 1.5 + penalty_ang_vel_xy: -1.0 + penalty_orientation: -10.0 + penalty_action_rate: -4.0 + pose: -0.5 + penalty_feet_ori: -20.0 + feet_phase: 5.0 + alive: 10.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.04 + close_feet_threshold: 0.15 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/offpolicy/task/sac/g1_23dof_wall_flip_tracking/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_wall_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..f67d34d2e --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_wall_flip_tracking/mujoco.yaml @@ -0,0 +1,75 @@ +# @package _global_ +training: + task_name: G1WallFlipTrackingSAC23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 4096 + max_iterations: 25000 + save_interval: 1000 + gamma: 0.99 + tau: 0.05 + num_atoms: 501 + updates_per_step: 4 + policy_frequency: 2 + use_symmetry: false + algo_params: + alpha_init: 0.005 + target_entropy_ratio: 0.0 + max_grad_norm: 10.0 +env: + sampling_mode: uniform + truncate_on_clip_end: true + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 1000000000.0 + ee_body_pos_z_threshold: 1000000000.0 + terminate_on_undesired_contacts: false + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/offpolicy/task/sac/g1_23dof_wbt_obs/mujoco.yaml b/conf/offpolicy/task/sac/g1_23dof_wbt_obs/mujoco.yaml new file mode 100644 index 000000000..d0623bad2 --- /dev/null +++ b/conf/offpolicy/task/sac/g1_23dof_wbt_obs/mujoco.yaml @@ -0,0 +1,79 @@ +# @package _global_ +training: + task_name: G1WBTObs23Dof + sim_backend: mujoco +algo: + num_envs: 4096 + max_iterations: 140000 + save_interval: 1000 + gamma: 0.99 + tau: 0.05 + num_atoms: 501 + updates_per_step: 4 + policy_frequency: 2 + use_symmetry: false + algo_params: + alpha_init: 0.1 + target_entropy_ratio: 0.5 + max_grad_norm: 10.0 +env: + sim_dt: 0.005 + sensor: + local_linvel: pelvis_local_linvel + gyro: pelvis_gyro + upvector: pelvis_upvector + control_config: + action_scale: 2.0 + simulate_action_latency: true + anchor_pos_z_threshold: 0.40 + ee_body_pos_z_threshold: 0.5 + truncate_on_clip_end: true + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.5 + scale_gyro: 0.2 + enable_zero_linvel: true + enable_zero_anchor_pos: true + enable_anchor_ori_noise: true + scale_anchor_ori: 0.05 + obs_history_length: 5 + domain_rand: + randomize_base_mass: true + added_mass_range: [-1.0, 1.0] + random_com: true + com_offset_x: [-0.05, 0.05] + randomize_com_y: true + com_offset_y: [-0.05, 0.05] + randomize_com_z: true + com_offset_z: [-0.05, 0.05] + randomize_gravity: false + gravity_range: [[0.0, 0.0, -9.81], [0.0, 0.0, -9.81]] + push_robots: true + push_interval: 200 + max_force: [300.0, 300.0, 120.0] + push_body_name: null + randomize_kp: true + kp_multiplier_range: [0.9, 1.1] + randomize_kd: true + kd_multiplier_range: [0.85, 1.15] + randomize_geom_friction: true + friction_range: [0.3, 1.2] + friction_geom_pattern: "^(left|right)_foot[1-7]_collision$" + enable_encoder_bias: true + encoder_bias_range: [-0.01, 0.01] +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 1.0 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -5.0 + undesired_contacts: -0.1 + joint_acc_l2: -2.5e-7 + joint_torque_l2: -1e-5 diff --git a/conf/offpolicy/task/td3/g1_23dof_walk_flat/mujoco.yaml b/conf/offpolicy/task/td3/g1_23dof_walk_flat/mujoco.yaml new file mode 100644 index 000000000..850f155e8 --- /dev/null +++ b/conf/offpolicy/task/td3/g1_23dof_walk_flat/mujoco.yaml @@ -0,0 +1,46 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: mujoco +algo: + max_iterations: 100000 +env: + control_config: + action_scale: 1.0 + gait_phase_init_mode: "offset_phase" + reset_base_qvel_limit: 0.5 + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 1.0 + scale_gyro: 0.0 + scale_gravity: 0.0 + scale_joint_angle: 0.01 + scale_joint_vel: 0.1 + scale_linvel: 0.0 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 1.5 + penalty_ang_vel_xy: -1.0 + penalty_orientation: -10.0 + penalty_action_rate: -4.0 + pose: -0.5 + penalty_feet_ori: -20.0 + feet_phase: 5.0 + alive: 10.0 + tracking_sigma: 0.25 + base_height_target: 0.754 + min_base_height: 0.3 + max_tilt_deg: 65.0 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.04 + close_feet_threshold: 0.15 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/ppo/task/g1_23dof_box_tracking/motrix.yaml b/conf/ppo/task/g1_23dof_box_tracking/motrix.yaml new file mode 100644 index 000000000..e453b0721 --- /dev/null +++ b/conf/ppo/task/g1_23dof_box_tracking/motrix.yaml @@ -0,0 +1,60 @@ +# @package _global_ +training: + task_name: G1BoxTracking23Dof + sim_backend: motrix + play_env_num: 16 + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 40000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.002 + desired_kl: 0.01 + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +play_profile: + enabled: true + env: + render_spacing: 2.5 + scene: + enabled: true + source_model_file: src/unilab/assets/robots/g1/scene_flat_23dof_with_largebox.xml + ground_texture_file: src/unilab/assets/robots/g1/textures/floor.png + skybox_rgb1: [0.90, 0.90, 0.91] + skybox_rgb2: [0.68, 0.68, 0.70] + ground_texrepeat: [0.25, 0.25] +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.5 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + undesired_contacts: -0.1 + object_global_ref_position_error_exp: 4.0 + object_global_ref_orientation_error_exp: 3.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 + std_object_pos: 0.12 + std_object_ori: 0.2 diff --git a/conf/ppo/task/g1_23dof_box_tracking/mujoco.yaml b/conf/ppo/task/g1_23dof_box_tracking/mujoco.yaml new file mode 100644 index 000000000..4c7b186f3 --- /dev/null +++ b/conf/ppo/task/g1_23dof_box_tracking/mujoco.yaml @@ -0,0 +1,44 @@ +# @package _global_ +training: + task_name: G1BoxTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 30000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 +env: + sim_dt: 0.005 + sensor: + gyro: pelvis_gyro + upvector: pelvis_upvector +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + undesired_contacts: -0.1 + object_global_ref_position_error_exp: 2.0 + object_global_ref_orientation_error_exp: 2.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 + std_object_pos: 0.2 + std_object_ori: 0.3 diff --git a/conf/ppo/task/g1_23dof_climb_tracking/motrix.yaml b/conf/ppo/task/g1_23dof_climb_tracking/motrix.yaml new file mode 100644 index 000000000..f554a13d7 --- /dev/null +++ b/conf/ppo/task/g1_23dof_climb_tracking/motrix.yaml @@ -0,0 +1,74 @@ +# @package _global_ +training: + task_name: G1ClimbTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.005 + desired_kl: 0.01 +env: + sampling_mode: adaptive + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.3 + ee_body_pos_z_threshold: 0.3 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_climb_tracking/mujoco.yaml b/conf/ppo/task/g1_23dof_climb_tracking/mujoco.yaml new file mode 100644 index 000000000..34fc4ae59 --- /dev/null +++ b/conf/ppo/task/g1_23dof_climb_tracking/mujoco.yaml @@ -0,0 +1,74 @@ +# @package _global_ +training: + task_name: G1ClimbTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.005 + desired_kl: 0.01 +env: + sampling_mode: adaptive + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.3 + ee_body_pos_z_threshold: 0.3 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_flip_tracking/motrix.yaml b/conf/ppo/task/g1_23dof_flip_tracking/motrix.yaml new file mode 100644 index 000000000..fff96e018 --- /dev/null +++ b/conf/ppo/task/g1_23dof_flip_tracking/motrix.yaml @@ -0,0 +1,34 @@ +# @package _global_ +training: + task_name: G1FlipTracking23Dof + sim_backend: motrix + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 30000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.05 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_flip_tracking/mujoco.yaml b/conf/ppo/task/g1_23dof_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..8e62a80ff --- /dev/null +++ b/conf/ppo/task/g1_23dof_flip_tracking/mujoco.yaml @@ -0,0 +1,74 @@ +# @package _global_ +training: + task_name: G1FlipTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.005 + desired_kl: 0.01 +env: + sampling_mode: start + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_motion_tracking/motrix.yaml b/conf/ppo/task/g1_23dof_motion_tracking/motrix.yaml new file mode 100644 index 000000000..6bcc0a74f --- /dev/null +++ b/conf/ppo/task/g1_23dof_motion_tracking/motrix.yaml @@ -0,0 +1,52 @@ +# @package _global_ +training: + task_name: G1MotionTracking23Dof + sim_backend: motrix + play_env_num: 16 + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 15000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +play_profile: + enabled: true + env: + render_spacing: 2.5 + scene: + enabled: true + source_model_file: src/unilab/assets/robots/g1/scene_flat_23dof.xml + ground_texture_file: src/unilab/assets/robots/g1/textures/floor.png + skybox_rgb1: [0.90, 0.90, 0.91] + skybox_rgb2: [0.68, 0.68, 0.70] + ground_texrepeat: [0.25, 0.25] +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.05 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 \ No newline at end of file diff --git a/conf/ppo/task/g1_23dof_motion_tracking/mujoco.yaml b/conf/ppo/task/g1_23dof_motion_tracking/mujoco.yaml new file mode 100644 index 000000000..3a411cd18 --- /dev/null +++ b/conf/ppo/task/g1_23dof_motion_tracking/mujoco.yaml @@ -0,0 +1,34 @@ +# @package _global_ +training: + task_name: G1MotionTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 15000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 \ No newline at end of file diff --git a/conf/ppo/task/g1_23dof_motion_tracking_deploy/motrix.yaml b/conf/ppo/task/g1_23dof_motion_tracking_deploy/motrix.yaml new file mode 100644 index 000000000..a0359647e --- /dev/null +++ b/conf/ppo/task/g1_23dof_motion_tracking_deploy/motrix.yaml @@ -0,0 +1,101 @@ +# @package _global_ +training: + task_name: G1MotionTracking23DofDeploy + sim_backend: motrix + play_env_num: 16 + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 15000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +env: + sim_dt: 0.005 + sensor: + local_linvel: pelvis_local_linvel + gyro: pelvis_gyro + upvector: pelvis_upvector + domain_rand: + random_com: true + com_offset_x: [-0.025, 0.025] + com_offset_y: [-0.05, 0.05] + com_offset_z: [-0.05, 0.05] + randomize_base_mass: true + added_mass_range: [-1.5, 1.5] + push_robots: true + push_interval: 750 + max_force: [1.0, 1.0, 0.5] + randomize_joint_default_pos: true + joint_default_pos_range: [-0.01, 0.01] + noise_config: + scale_joint_angle: 0.01 + scale_joint_vel: 0.5 + scale_gyro: 0.2 + scale_linvel: 0.5 + scale_gravity: 0.05 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 +play_profile: + enabled: true + env: + render_spacing: 2.5 + scene: + enabled: true + source_model_file: src/unilab/assets/robots/g1/scene_flat_23dof.xml + ground_texture_file: src/unilab/assets/robots/g1/textures/floor.png + skybox_rgb1: [0.90, 0.90, 0.91] + skybox_rgb2: [0.68, 0.68, 0.70] + ground_texrepeat: [0.25, 0.25] +reward: + scales: + motion_global_root_pos: 1.0 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.05 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_motion_tracking_deploy/mujoco.yaml b/conf/ppo/task/g1_23dof_motion_tracking_deploy/mujoco.yaml new file mode 100644 index 000000000..4c725f29d --- /dev/null +++ b/conf/ppo/task/g1_23dof_motion_tracking_deploy/mujoco.yaml @@ -0,0 +1,85 @@ +# @package _global_ +training: + task_name: G1MotionTracking23DofDeploy + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 15000 + save_interval: 500 + obs_groups: + actor: + - actor + algorithm: + entropy_coef: 0.005 +env: + sim_dt: 0.005 + sensor: + local_linvel: pelvis_local_linvel + gyro: pelvis_gyro + upvector: pelvis_upvector + domain_rand: + random_com: true + com_offset_x: [-0.025, 0.025] + com_offset_y: [-0.05, 0.05] + com_offset_z: [-0.05, 0.05] + randomize_base_mass: true + added_mass_range: [-1.5, 1.5] + push_robots: true + push_interval: 750 + max_force: [1.0, 1.0, 0.5] + randomize_geom_friction: true + friction_range: [0.3, 1.2] + randomize_joint_default_pos: true + joint_default_pos_range: [-0.01, 0.01] + noise_config: + scale_joint_angle: 0.01 + scale_joint_vel: 0.5 + scale_gyro: 0.2 + scale_linvel: 0.5 + scale_gravity: 0.05 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 1.0 + motion_body_ori: 1.0 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_joint_pos: 0.0 + motion_joint_vel: 0.0 + action_rate_l2: -0.1 + joint_limit: -10.0 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_walk_flat/motrix.yaml b/conf/ppo/task/g1_23dof_walk_flat/motrix.yaml new file mode 100644 index 000000000..ab1c8a94f --- /dev/null +++ b/conf/ppo/task/g1_23dof_walk_flat/motrix.yaml @@ -0,0 +1,64 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: motrix +algo: + num_envs: 2048 + max_iterations: 2200 + empirical_normalization: true + obs_groups: + actor: + - policy + critic: + - critic + policy: + init_noise_std: 0.5 + algorithm: + learning_rate: 3.0e-4 + entropy_coef: 5.0e-3 +env: + domain_rand: + randomize_kp: false + randomize_kd: false + control_config: + action_scale: 0.5 + commands: + vel_limit: + - [0.4, 0.0, 0.0] + - [0.7, 0.0, 0.0] + gait_phase_init_mode: offset_phase + reset_base_qvel_limit: 0.05 + curriculum: + enabled: false + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 0.25 + forward_progress: 0.0 + under_speed: -0.2 + upper_body_pose: -0.05 + penalty_feet_ori: 0.0 + feet_phase: 1.2 + feet_phase_contrast: 1.5 + feet_phase_contact: 1.0 + feet_double_stance: -1.0 + lin_vel_z: -1.0 + ang_vel_xy: -0.2 + base_height: -120.0 + orientation: -2.5 + action_rate: -0.005 + pose: -0.05 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] + tracking_sigma: 0.25 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + base_height_target: 0.765 + min_forward_speed_for_gait_reward: 0.05 + min_base_height: 0.5 + max_tilt_deg: 35.0 diff --git a/conf/ppo/task/g1_23dof_walk_flat/mujoco.yaml b/conf/ppo/task/g1_23dof_walk_flat/mujoco.yaml new file mode 100644 index 000000000..0397b885d --- /dev/null +++ b/conf/ppo/task/g1_23dof_walk_flat/mujoco.yaml @@ -0,0 +1,39 @@ +# @package _global_ +training: + task_name: G1Walk23DofFlat + sim_backend: mujoco +algo: + num_envs: 2048 + max_iterations: 2200 + obs_groups: + actor: + - actor +env: + control_config: + action_scale: 0.25 + curriculum: + enabled: false + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 0.2 + feet_phase: 1.0 + lin_vel_z: -1.0 + ang_vel_xy: -0.25 + base_height: -500.0 + orientation: -5.0 + action_rate: -0.01 + pose: -0.1 + tracking_sigma: 0.25 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + base_height_target: 0.754 + min_base_height: 0.55 + max_tilt_deg: 25.0 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/ppo/task/g1_23dof_walk_rough/mujoco.yaml b/conf/ppo/task/g1_23dof_walk_rough/mujoco.yaml new file mode 100644 index 000000000..ea82c6792 --- /dev/null +++ b/conf/ppo/task/g1_23dof_walk_rough/mujoco.yaml @@ -0,0 +1,45 @@ +# @package _global_ +training: + task_name: G1Walk23DofRough + sim_backend: mujoco +algo: + num_envs: 2048 + max_iterations: 2200 + obs_groups: + actor: + - actor +env: + control_config: + action_scale: 0.25 + curriculum: + enabled: true + initial_scale: 0.5 + min_scale: 0.5 + max_scale: 1.0 + level_down_threshold: 150.0 + level_up_threshold: 750.0 + degree: 0.001 + noise_config: + level: 1.0 + scale_joint_angle: 0.01 + scale_joint_vel: 1.5 + scale_gyro: 0.2 +reward: + scales: + tracking_lin_vel: 2.0 + tracking_ang_vel: 0.2 + feet_phase: 1.0 + lin_vel_z: -1.0 + ang_vel_xy: -0.25 + base_height: -500.0 + orientation: -5.0 + action_rate: -0.01 + pose: -0.1 + tracking_sigma: 0.25 + gait_frequency: 1.5 + feet_phase_swing_height: 0.09 + feet_phase_tracking_sigma: 0.008 + base_height_target: 0.754 + min_base_height: 0.55 + max_tilt_deg: 25.0 + pose_weights: [0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 0.01, 1.0, 5.0, 0.01, 5.0, 5.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0] diff --git a/conf/ppo/task/g1_23dof_wall_flip_tracking/motrix.yaml b/conf/ppo/task/g1_23dof_wall_flip_tracking/motrix.yaml new file mode 100644 index 000000000..04c69a001 --- /dev/null +++ b/conf/ppo/task/g1_23dof_wall_flip_tracking/motrix.yaml @@ -0,0 +1,88 @@ +# @package _global_ +training: + task_name: G1WallFlipTracking23Dof + sim_backend: motrix + play_env_num: 16 + play_steps: 1000 + render_spacing: 3.0 +algo: + num_envs: 1024 + max_iterations: 12000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.005 + desired_kl: 0.01 +env: + motrix_max_iterations: 3 + sampling_mode: start + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +play_profile: + enabled: true + env: + render_spacing: 4.0 + scene: + enabled: true + source_model_file: src/unilab/assets/robots/g1/scene_flat_23dof_with_wall.xml + ground_texture_file: src/unilab/assets/robots/g1/textures/floor.png + skybox_rgb1: [0.90, 0.90, 0.91] + skybox_rgb2: [0.68, 0.68, 0.70] + ground_texrepeat: [0.25, 0.25] +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/conf/ppo/task/g1_23dof_wall_flip_tracking/mujoco.yaml b/conf/ppo/task/g1_23dof_wall_flip_tracking/mujoco.yaml new file mode 100644 index 000000000..7a49d091d --- /dev/null +++ b/conf/ppo/task/g1_23dof_wall_flip_tracking/mujoco.yaml @@ -0,0 +1,74 @@ +# @package _global_ +training: + task_name: G1WallFlipTracking23Dof + sim_backend: mujoco + play_steps: 1000 +algo: + num_envs: 1024 + max_iterations: 20000 + save_interval: 500 + empirical_normalization: true + obs_groups: + actor: + - actor + critic: + - critic + algorithm: + entropy_coef: 0.005 + desired_kl: 0.01 +env: + sampling_mode: start + truncate_on_clip_end: false + sim_dt: 0.005 + control_config: + action_scale: + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.5475464629911068 + - 0.35066146637882434 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.5475464629911068 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + - 0.43857731392336724 + anchor_pos_z_threshold: 0.5 + ee_body_pos_z_threshold: 0.5 + terminate_on_undesired_contacts: true + noise_config: + level: 0.0 +reward: + scales: + motion_global_root_pos: 0.5 + motion_global_root_ori: 0.5 + motion_body_pos: 2.0 + motion_body_ori: 1.5 + motion_body_lin_vel: 1.0 + motion_body_ang_vel: 1.0 + motion_ee_body_pos_z: 2.0 + motion_joint_pos: 0.5 + motion_joint_vel: 0.25 + action_rate_l2: -0.005 + joint_limit: -10.0 + undesired_contacts: -0.1 + std_root_pos: 0.3 + std_root_ori: 0.4 + std_body_pos: 0.3 + std_body_ori: 0.4 + std_body_lin_vel: 1.0 + std_body_ang_vel: 3.14 + std_joint_pos: 0.2 + std_joint_vel: 1.0 diff --git a/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md b/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md index b19473520..7a6ffed19 100644 --- a/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md +++ b/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md @@ -63,6 +63,14 @@ uv run scripts/generate_support_matrix.py --write | PPO (torch) | `sharpa_inhand_grasp` (Sharpa in-hand grasp) | Tested | Tested | | PPO (torch) | `a2_joystick_flat` (a2 joystick flat) | Tested | - | | PPO (torch) | `allegro_inhand_grasp` (allegro inhand grasp) | Tested | Tested | +| PPO (torch) | `g1_23dof_box_tracking` (g1 23dof box tracking) | Tested | Tested | +| PPO (torch) | `g1_23dof_climb_tracking` (g1 23dof climb tracking) | Tested | Tested | +| PPO (torch) | `g1_23dof_flip_tracking` (g1 23dof flip tracking) | Tested | Tested | +| PPO (torch) | `g1_23dof_motion_tracking` (g1 23dof motion tracking) | Tested | Tested | +| PPO (torch) | `g1_23dof_motion_tracking_deploy` (g1 23dof motion tracking deploy) | Tested | Tested | +| PPO (torch) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Tested | Tested | +| PPO (torch) | `g1_23dof_walk_rough` (g1 23dof walk rough) | Tested | Registered | +| PPO (torch) | `g1_23dof_wall_flip_tracking` (g1 23dof wall flip tracking) | Tested | Tested | | PPO (torch) | `g1_box_tracking` (g1 box tracking) | Tested | Tested | | PPO (torch) | `g1_climb_tracking` (g1 climb tracking) | Tested | Tested | | PPO (torch) | `g1_motion_tracking_deploy` (g1 motion tracking deploy) | Tested | Tested | @@ -85,6 +93,14 @@ uv run scripts/generate_support_matrix.py --write | PPO (mlx) | `sharpa_inhand_grasp` (Sharpa in-hand grasp) | Configured | Configured | | PPO (mlx) | `a2_joystick_flat` (a2 joystick flat) | Configured | - | | PPO (mlx) | `allegro_inhand_grasp` (allegro inhand grasp) | Configured | Configured | +| PPO (mlx) | `g1_23dof_box_tracking` (g1 23dof box tracking) | Configured | Configured | +| PPO (mlx) | `g1_23dof_climb_tracking` (g1 23dof climb tracking) | Configured | Configured | +| PPO (mlx) | `g1_23dof_flip_tracking` (g1 23dof flip tracking) | Configured | Configured | +| PPO (mlx) | `g1_23dof_motion_tracking` (g1 23dof motion tracking) | Configured | Configured | +| PPO (mlx) | `g1_23dof_motion_tracking_deploy` (g1 23dof motion tracking deploy) | Configured | Configured | +| PPO (mlx) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Configured | Configured | +| PPO (mlx) | `g1_23dof_walk_rough` (g1 23dof walk rough) | Configured | Registered | +| PPO (mlx) | `g1_23dof_wall_flip_tracking` (g1 23dof wall flip tracking) | Configured | Configured | | PPO (mlx) | `g1_box_tracking` (g1 box tracking) | Configured | Configured | | PPO (mlx) | `g1_climb_tracking` (g1 climb tracking) | Configured | Configured | | PPO (mlx) | `g1_motion_tracking_deploy` (g1 motion tracking deploy) | Configured | Configured | @@ -102,18 +118,31 @@ uv run scripts/generate_support_matrix.py --write | APPO (torch) | `g1_wall_flip_tracking` (G1 wall flip tracking) | Tested | Tested | | APPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | Tested | | APPO (torch) | `sharpa_inhand` (Sharpa in-hand) | Tested | Tested | +| APPO (torch) | `g1_23dof_climb_tracking` (g1 23dof climb tracking) | Tested | Tested | +| APPO (torch) | `g1_23dof_flip_tracking` (g1 23dof flip tracking) | Tested | Tested | +| APPO (torch) | `g1_23dof_motion_tracking` (g1 23dof motion tracking) | Tested | Tested | +| APPO (torch) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Tested | Registered | +| APPO (torch) | `g1_23dof_wall_flip_tracking` (g1 23dof wall flip tracking) | Tested | Tested | | APPO (torch) | `g1_climb_tracking` (g1 climb tracking) | Tested | Tested | | SAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Tested | | SAC (torch) | `g1_walk_rough` (G1 walk rough) | Tested | Tested | | SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Tested | | SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | Registered | | SAC (torch) | `g1_wall_flip_tracking` (G1 wall flip tracking) | Tested | Registered | +| SAC (torch) | `g1_23dof_flip_tracking` (g1 23dof flip tracking) | Tested | Registered | +| SAC (torch) | `g1_23dof_motion_tracking` (g1 23dof motion tracking) | Tested | Tested | +| SAC (torch) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Tested | Tested | +| SAC (torch) | `g1_23dof_walk_rough` (g1 23dof walk rough) | Tested | Tested | +| SAC (torch) | `g1_23dof_wall_flip_tracking` (g1 23dof wall flip tracking) | Tested | Registered | +| SAC (torch) | `g1_23dof_wbt_obs` (g1 23dof wbt obs) | Tested | Registered | | SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | Registered | | TD3 (torch) | `go1_joystick_flat` (Go1 joystick) | Registered | Tested | | TD3 (torch) | `go2_joystick_flat` (Go2 joystick) | Registered | Tested | | TD3 (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | +| TD3 (torch) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Tested | Registered | | FlashSAC (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | Registered | | FlashSAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Tested | +| FlashSAC (torch) | `g1_23dof_walk_flat` (g1 23dof walk flat) | Tested | Tested | ### Source Index diff --git a/scripts/convert_motion_29dof_to_23dof.py b/scripts/convert_motion_29dof_to_23dof.py new file mode 100644 index 000000000..f90ee6f82 --- /dev/null +++ b/scripts/convert_motion_29dof_to_23dof.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +"""Convert 29-DoF G1 motion NPZ files to 23-DoF. + +Removes the 6 RM (redundant manipulator) joints: + - waist_roll_joint, waist_pitch_joint + - left_wrist_pitch_joint, left_wrist_yaw_joint + - right_wrist_pitch_joint, right_wrist_yaw_joint + +And maps body data from 31-body 29-DoF XML order to 24-body 23-DoF XML order. + +29-DoF joint indices to remove (0-indexed): [13, 14, 20, 21, 27, 28] +29-DoF body indices to keep (0-indexed): [0..12, 15..20, 23..27] + → maps to 24 bodies in 23-DoF XML order (pelvis + 23 links) +""" + +from __future__ import annotations + +import argparse +from pathlib import Path + +import numpy as np + +# 29-DoF joint indices to REMOVE (0-indexed) +# waist_roll=13, waist_pitch=14, left_wrist_pitch=20, left_wrist_yaw=21, +# right_wrist_pitch=27, right_wrist_yaw=28 +JOINT_REMOVE_IDX = [13, 14, 20, 21, 27, 28] + +# 29-DoF body indices to KEEP → 25 bodies in 23-DoF NPZ order +# +# The exported NPZ includes the MuJoCo world body (id=0) at index 0, +# so NPZ index = MuJoCo body ID for all child bodies. +# Keeping: world(0), pelvis→right_ankle_roll(1-13), +# torso_link→left_wrist_roll_link(16-21), +# right_shoulder_pitch_link→right_wrist_roll_link(24-28) +BODY_KEEP_IDX = [ + 0, # world body (MuJoCo id=0) + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, # pelvis → right_ankle_roll_link + 16, + 17, + 18, + 19, + 20, + 21, # torso_link → left_wrist_roll_link + 24, + 25, + 26, + 27, + 28, # right_shoulder_pitch_link → right_wrist_roll_link +] +# Result: 25 bodies (world + 24 child bodies matching 23-DoF XML body order) +# MuJoCo body ID directly indexes into this array (NPZ index = MuJoCo body ID). + + +def convert_motion_npz(src_path: Path, dst_path: Path, is_box: bool = False) -> None: + """Convert a 29-DoF motion NPZ to 23-DoF and save.""" + data = np.load(src_path, allow_pickle=True) + + # Build output dict + out: dict[str, np.ndarray] = {} + + # Copy fps (no change) + out["fps"] = data["fps"] + + # Joint data: remove 6 RM joint columns + joint_keep = [i for i in range(data["joint_pos"].shape[1]) if i not in JOINT_REMOVE_IDX] + assert len(joint_keep) == 23, f"Expected 23 kept joints, got {len(joint_keep)}" + out["joint_pos"] = data["joint_pos"][:, joint_keep] + out["joint_vel"] = data["joint_vel"][:, joint_keep] + + # Body data: keep only mapped body indices + assert len(BODY_KEEP_IDX) == 25, ( + f"Expected 25 kept bodies (world + 24 child), got {len(BODY_KEEP_IDX)}" + ) + for key in ("body_pos_w", "body_quat_w", "body_lin_vel_w", "body_ang_vel_w"): + out[key] = data[key][:, BODY_KEEP_IDX] + + # Object data (box tracking): pass through unchanged + object_keys = ("object_pos_w", "object_quat_w", "object_lin_vel_w", "object_ang_vel_w") + for key in object_keys: + if key in data: + out[key] = data[key] + + # Save + dst_path.parent.mkdir(parents=True, exist_ok=True) + np.savez_compressed(dst_path, **out) + + # Print summary + src_shapes = {k: data[k].shape for k in data.keys()} + dst_shapes = {k: out[k].shape for k in out.keys()} + print(f"Converted: {src_path.name}") + print(f" Source shapes: {src_shapes}") + print(f" Output shapes: {dst_shapes}") + print(f" Saved to: {dst_path}") + + +def main() -> None: + parser = argparse.ArgumentParser(description="Convert 29-DoF G1 motion NPZ files to 23-DoF") + parser.add_argument( + "input", + nargs="*", + help="Input NPZ files (default: predefined G1 motion files)", + ) + parser.add_argument( + "--output-dir", + "-o", + type=Path, + default=None, + help="Output directory (default: same as input dir + '_23dof' suffix)", + ) + parser.add_argument( + "--suffix", + default="_23dof", + help="Suffix for output files (default: _23dof)", + ) + parser.add_argument( + "--copy-box-object-data", + action="store_true", + help="Copy object pose data for box tracking files", + ) + args = parser.parse_args() + + # Default: convert the known 29-DoF motion files + motion_root = ( + Path(__file__).resolve().parent.parent / "src" / "unilab" / "assets" / "motions" / "g1" + ) + + default_inputs = [ + motion_root / "flip_360_001__A304.npz", + motion_root / "flip_from_wall_104__A304.npz", + motion_root / "sub3_largebox_003_boxconverted.npz", + ] + + inputs = [Path(p) for p in args.input] if args.input else default_inputs + + for src_path in inputs: + if not src_path.exists(): + print(f"WARNING: {src_path} not found, skipping") + continue + + if args.output_dir: + dst_dir = args.output_dir + else: + # Default: same directory + dst_dir = src_path.parent + + stem = src_path.stem # e.g. "flip_360_001__A304" + dst_name = f"{stem}{args.suffix}.npz" + dst_path = dst_dir / dst_name + + is_box = "box" in stem.lower() or "largebox" in stem.lower() + convert_motion_npz(src_path, dst_path, is_box=is_box) + + +if __name__ == "__main__": + main() diff --git a/src/unilab/assets/motions/g1/23dof_amp/.gitkeep b/src/unilab/assets/motions/g1/23dof_amp/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/src/unilab/assets/robots/g1/assets/left_wrist_roll_rubber_hand.STL b/src/unilab/assets/robots/g1/assets/left_wrist_roll_rubber_hand.STL new file mode 100644 index 000000000..8fa435b66 Binary files /dev/null and b/src/unilab/assets/robots/g1/assets/left_wrist_roll_rubber_hand.STL differ diff --git a/src/unilab/assets/robots/g1/assets/right_wrist_roll_rubber_hand.STL b/src/unilab/assets/robots/g1/assets/right_wrist_roll_rubber_hand.STL new file mode 100644 index 000000000..c365aa9d8 Binary files /dev/null and b/src/unilab/assets/robots/g1/assets/right_wrist_roll_rubber_hand.STL differ diff --git a/src/unilab/assets/robots/g1/assets/torso_link_23dof_rev_1_0.STL b/src/unilab/assets/robots/g1/assets/torso_link_23dof_rev_1_0.STL new file mode 100644 index 000000000..079aa8124 Binary files /dev/null and b/src/unilab/assets/robots/g1/assets/torso_link_23dof_rev_1_0.STL differ diff --git a/src/unilab/assets/robots/g1/g1_23dof.xml b/src/unilab/assets/robots/g1/g1_23dof.xml new file mode 100644 index 000000000..44a468a35 --- /dev/null +++ b/src/unilab/assets/robots/g1/g1_23dof.xml @@ -0,0 +1,316 @@ + + + + diff --git a/src/unilab/assets/robots/g1/g1_23dof_sphere_hand.xml b/src/unilab/assets/robots/g1/g1_23dof_sphere_hand.xml new file mode 100644 index 000000000..50c7d6c43 --- /dev/null +++ b/src/unilab/assets/robots/g1/g1_23dof_sphere_hand.xml @@ -0,0 +1,317 @@ + + + + diff --git a/src/unilab/assets/robots/g1/scene_climb_20_z_scale_1_23dof.xml b/src/unilab/assets/robots/g1/scene_climb_20_z_scale_1_23dof.xml new file mode 100644 index 000000000..7ad80ee36 --- /dev/null +++ b/src/unilab/assets/robots/g1/scene_climb_20_z_scale_1_23dof.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/unilab/assets/robots/g1/scene_flat_23dof.xml b/src/unilab/assets/robots/g1/scene_flat_23dof.xml new file mode 100644 index 000000000..c90487742 --- /dev/null +++ b/src/unilab/assets/robots/g1/scene_flat_23dof.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/unilab/assets/robots/g1/scene_flat_23dof_with_largebox.xml b/src/unilab/assets/robots/g1/scene_flat_23dof_with_largebox.xml new file mode 100644 index 000000000..5a6ea6fd7 --- /dev/null +++ b/src/unilab/assets/robots/g1/scene_flat_23dof_with_largebox.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/unilab/assets/robots/g1/scene_flat_23dof_with_wall.xml b/src/unilab/assets/robots/g1/scene_flat_23dof_with_wall.xml new file mode 100644 index 000000000..0e237be6d --- /dev/null +++ b/src/unilab/assets/robots/g1/scene_flat_23dof_with_wall.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/unilab/assets/robots/g1/scene_rough_23dof.xml b/src/unilab/assets/robots/g1/scene_rough_23dof.xml new file mode 100644 index 000000000..98d1774b7 --- /dev/null +++ b/src/unilab/assets/robots/g1/scene_rough_23dof.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/unilab/base/backend/motrix/backend.py b/src/unilab/base/backend/motrix/backend.py index d2d5ff266..17350b829 100644 --- a/src/unilab/base/backend/motrix/backend.py +++ b/src/unilab/base/backend/motrix/backend.py @@ -210,19 +210,25 @@ def __init__( # (e.g. a Stewart platform) have passive joints, so the model-wide # ``joint_dof_pos_indices`` is wider than ``num_actuators``. self._actuator_joint_pos_indices: np.ndarray | None = None + self._actuator_joint_vel_indices: np.ndarray | None = None if self._supports_position_actuator_gains: joint_pos_idx: list[int] = [] + joint_vel_idx: list[int] = [] for actuator in sorted(self._position_actuators, key=lambda a: int(a.index)): if actuator.target_type != "joint": joint_pos_idx = [] + joint_vel_idx = [] break joint = self._model.get_joint(actuator.target_name) if joint is None or int(joint.num_dof_pos) != 1: joint_pos_idx = [] + joint_vel_idx = [] break joint_pos_idx.append(int(joint.dof_pos_index)) + joint_vel_idx.append(int(joint.dof_vel_index)) if len(joint_pos_idx) == int(self._model.num_actuators): self._actuator_joint_pos_indices = np.asarray(joint_pos_idx, dtype=np.intp) + self._actuator_joint_vel_indices = np.asarray(joint_vel_idx, dtype=np.intp) self._actuator_joint_pos_slice = ( _contiguous_slice(self._actuator_joint_pos_indices) if self._actuator_joint_pos_indices is not None @@ -933,10 +939,21 @@ def get_base_ang_vel(self) -> np.ndarray: # ------------------------------------------------------------------ # def get_dof_pos(self) -> np.ndarray: - return self._body.get_joint_dof_pos(self._data) # type: ignore[no-any-return] + indices = ( + self._actuator_joint_pos_indices + if self._actuator_joint_pos_indices is not None + else self._joint_dof_pos_indices + ) + result = self._data.dof_pos[..., indices] # type: ignore[no-any-return] + return result def get_dof_vel(self) -> np.ndarray: - return self._body.get_joint_dof_vel(self._data) # type: ignore[no-any-return] + indices = ( + self._actuator_joint_vel_indices + if self._actuator_joint_vel_indices is not None + else self._joint_dof_vel_indices + ) + return self._data.dof_vel[..., indices] # type: ignore[no-any-return] # ------------------------------------------------------------------ # # Body kinematics — world frame # diff --git a/src/unilab/envs/locomotion/g1/joystick.py b/src/unilab/envs/locomotion/g1/joystick.py index 7c19939f2..42bdf9be5 100644 --- a/src/unilab/envs/locomotion/g1/joystick.py +++ b/src/unilab/envs/locomotion/g1/joystick.py @@ -706,3 +706,36 @@ class G1WalkRoughCfg(G1WalkFlatCfg): registry.register_env("G1WalkFlat", G1WalkEnv, sim_backend="motrix") registry.register_env("G1WalkRough", G1WalkEnv, sim_backend="mujoco") registry.register_env("G1WalkRough", G1WalkEnv, sim_backend="motrix") + + +class G1Walk23DofEnv(G1WalkEnv): + @property + def obs_groups_spec(self) -> dict[str, int]: + # gyro(3) + gravity(3) + diff(23) + dof_vel(23) + action(23) + cmd(3) + phase(2) = 80 + return {"obs": 80, "critic": 83} + + +@registry.envcfg("G1Walk23DofFlat") +@dataclass +class G1Walk23DofFlatCfg(G1WalkFlatCfg): + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof.xml") + ) + ) + + +@registry.envcfg("G1Walk23DofRough") +@dataclass +class G1Walk23DofRoughCfg(G1Walk23DofFlatCfg): + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_rough_23dof.xml") + ) + ) + + +registry.register_env("G1Walk23DofFlat", G1Walk23DofEnv, sim_backend="mujoco") +registry.register_env("G1Walk23DofFlat", G1Walk23DofEnv, sim_backend="motrix") +registry.register_env("G1Walk23DofRough", G1Walk23DofEnv, sim_backend="mujoco") +registry.register_env("G1Walk23DofRough", G1Walk23DofEnv, sim_backend="motrix") diff --git a/src/unilab/envs/motion_tracking/__init__.py b/src/unilab/envs/motion_tracking/__init__.py index 5d5d57040..1d392bc92 100644 --- a/src/unilab/envs/motion_tracking/__init__.py +++ b/src/unilab/envs/motion_tracking/__init__.py @@ -8,23 +8,39 @@ from .g1 import ( BoxMotionData, BoxMotionLoader, + G1BoxTracking23DofCfg, + G1BoxTracking23DofEnvCfg, G1BoxTrackingCfg, G1BoxTrackingEnv, G1BoxTrackingEnvCfg, G1ClimbTrackingCfg, G1ClimbTrackingEnv, G1ClimbTrackingEnvCfg, + G1FlipTracking23DofCfg, + G1FlipTracking23DofEnvCfg, G1FlipTrackingCfg, G1FlipTrackingEnv, G1FlipTrackingEnvCfg, + G1FlipTrackingSAC23DofCfg, + G1FlipTrackingSAC23DofEnv, + G1MotionTracking23DofCfg, + G1MotionTracking23DofDeployEnvCfg, + G1MotionTracking23DofEnvCfg, G1MotionTrackingCfg, G1MotionTrackingEnv, G1MotionTrackingEnvCfg, + G1MotionTrackingSAC23DofCfg, + G1MotionTrackingSAC23DofEnv, G1MotionTrackingSACCfg, G1MotionTrackingSACEnv, + G1WallFlipTracking23DofCfg, + G1WallFlipTracking23DofEnvCfg, G1WallFlipTrackingCfg, G1WallFlipTrackingEnv, G1WallFlipTrackingEnvCfg, + G1WallFlipTrackingSAC23DofCfg, + G1WallFlipTrackingSAC23DofEnv, + G1WBTObs23DofCfg, G1WBTObsCfg, G1WBTObsEnv, ) @@ -61,4 +77,21 @@ "X2WallFlipTrackingCfg", "X2WallFlipTrackingEnv", "X2WallFlipTrackingEnvCfg", + # 23-DoF variants (from parent UniLab/, under testing) + "G1MotionTracking23DofCfg", + "G1MotionTracking23DofDeployEnvCfg", + "G1MotionTracking23DofEnvCfg", + "G1MotionTrackingSAC23DofCfg", + "G1MotionTrackingSAC23DofEnv", + "G1WBTObs23DofCfg", + "G1FlipTracking23DofCfg", + "G1FlipTracking23DofEnvCfg", + "G1FlipTrackingSAC23DofCfg", + "G1FlipTrackingSAC23DofEnv", + "G1WallFlipTracking23DofCfg", + "G1WallFlipTracking23DofEnvCfg", + "G1WallFlipTrackingSAC23DofCfg", + "G1WallFlipTrackingSAC23DofEnv", + "G1BoxTracking23DofCfg", + "G1BoxTracking23DofEnvCfg", ] diff --git a/src/unilab/envs/motion_tracking/g1/__init__.py b/src/unilab/envs/motion_tracking/g1/__init__.py index 372669326..c97e3866a 100644 --- a/src/unilab/envs/motion_tracking/g1/__init__.py +++ b/src/unilab/envs/motion_tracking/g1/__init__.py @@ -1,57 +1,95 @@ """Motion tracking environments for Unitree G1.""" -from .box_tracking import G1BoxTrackingCfg, G1BoxTrackingEnv, G1BoxTrackingEnvCfg +from .box_tracking import ( + G1BoxTracking23DofCfg, + G1BoxTracking23DofEnvCfg, + G1BoxTrackingCfg, + G1BoxTrackingEnv, + G1BoxTrackingEnvCfg, +) from .flip_tracking import ( G1ClimbTrackingCfg, G1ClimbTrackingEnv, G1ClimbTrackingEnvCfg, + G1FlipTracking23DofCfg, + G1FlipTracking23DofEnvCfg, G1FlipTrackingCfg, G1FlipTrackingEnv, G1FlipTrackingEnvCfg, + G1WallFlipTracking23DofCfg, + G1WallFlipTracking23DofEnvCfg, G1WallFlipTrackingCfg, G1WallFlipTrackingEnv, G1WallFlipTrackingEnvCfg, ) from .flip_tracking_sac import ( + G1FlipTrackingSAC23DofCfg, + G1FlipTrackingSAC23DofEnv, G1FlipTrackingSACCfg, G1FlipTrackingSACEnv, + G1WallFlipTrackingSAC23DofCfg, + G1WallFlipTrackingSAC23DofEnv, G1WallFlipTrackingSACCfg, G1WallFlipTrackingSACEnv, ) from .motion_box_loader import BoxMotionData, BoxMotionLoader from .tracking import ( + G1MotionTracking23DofCfg, + G1MotionTracking23DofDeployEnvCfg, + G1MotionTracking23DofEnvCfg, G1MotionTrackingCfg, G1MotionTrackingDeployEnv, G1MotionTrackingDeployEnvCfg, G1MotionTrackingEnv, G1MotionTrackingEnvCfg, ) -from .tracking_obs import G1WBTObsCfg, G1WBTObsEnv -from .tracking_sac import G1MotionTrackingSACCfg, G1MotionTrackingSACEnv +from .tracking_obs import G1WBTObs23DofCfg, G1WBTObsCfg, G1WBTObsEnv +from .tracking_sac import ( + G1MotionTrackingSAC23DofCfg, + G1MotionTrackingSAC23DofEnv, + G1MotionTrackingSACCfg, + G1MotionTrackingSACEnv, +) __all__ = [ + "G1MotionTracking23DofCfg", + "G1MotionTracking23DofDeployEnvCfg", + "G1MotionTracking23DofEnvCfg", "G1MotionTrackingCfg", "G1MotionTrackingDeployEnv", "G1MotionTrackingDeployEnvCfg", "G1MotionTrackingEnv", "G1MotionTrackingEnvCfg", + "G1MotionTrackingSAC23DofCfg", + "G1MotionTrackingSAC23DofEnv", "G1MotionTrackingSACCfg", "G1MotionTrackingSACEnv", + "G1WBTObs23DofCfg", "G1WBTObsCfg", "G1WBTObsEnv", + "G1FlipTracking23DofCfg", + "G1FlipTracking23DofEnvCfg", "G1FlipTrackingCfg", "G1FlipTrackingEnv", "G1FlipTrackingEnvCfg", + "G1FlipTrackingSAC23DofCfg", + "G1FlipTrackingSAC23DofEnv", + "G1FlipTrackingSACCfg", + "G1FlipTrackingSACEnv", + "G1WallFlipTracking23DofCfg", + "G1WallFlipTracking23DofEnvCfg", "G1WallFlipTrackingCfg", "G1WallFlipTrackingEnv", "G1WallFlipTrackingEnvCfg", - "G1FlipTrackingSACCfg", - "G1FlipTrackingSACEnv", + "G1WallFlipTrackingSAC23DofCfg", + "G1WallFlipTrackingSAC23DofEnv", "G1WallFlipTrackingSACCfg", "G1WallFlipTrackingSACEnv", "G1ClimbTrackingCfg", "G1ClimbTrackingEnv", "G1ClimbTrackingEnvCfg", + "G1BoxTracking23DofCfg", + "G1BoxTracking23DofEnvCfg", "G1BoxTrackingCfg", "G1BoxTrackingEnv", "G1BoxTrackingEnvCfg", diff --git a/src/unilab/envs/motion_tracking/g1/box_tracking.py b/src/unilab/envs/motion_tracking/g1/box_tracking.py index 5024323bb..7f37a8b68 100644 --- a/src/unilab/envs/motion_tracking/g1/box_tracking.py +++ b/src/unilab/envs/motion_tracking/g1/box_tracking.py @@ -75,6 +75,48 @@ class G1BoxTrackingEnvCfg(G1BoxTrackingCfg): pass +@dataclass +class G1BoxTracking23DofCfg(G1BoxTrackingCfg): + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str( + ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof_with_largebox.xml" + ) + ) + ) + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "sub3_largebox_003_boxconverted_23dof.npz" + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +@registry.envcfg("G1BoxTracking23Dof") +@dataclass +class G1BoxTracking23DofEnvCfg(G1BoxTracking23DofCfg): + pass + + def _build_box_motion_reference_state( env: Any, env_ids: np.ndarray, motion_data: BoxMotionData ) -> tuple[np.ndarray, np.ndarray]: @@ -179,6 +221,8 @@ def build_reset_plan(self, env: Any, env_ids: np.ndarray) -> ResetPlan: @registry.env("G1BoxTracking", sim_backend="mujoco") @registry.env("G1BoxTracking", sim_backend="motrix") +@registry.env("G1BoxTracking23Dof", sim_backend="mujoco") +@registry.env("G1BoxTracking23Dof", sim_backend="motrix") class G1BoxTrackingEnv(G1MotionTrackingEnv): """Motion tracking env extended with large-box state and rewards.""" diff --git a/src/unilab/envs/motion_tracking/g1/flip_tracking.py b/src/unilab/envs/motion_tracking/g1/flip_tracking.py index b6515a36d..01d230cbe 100644 --- a/src/unilab/envs/motion_tracking/g1/flip_tracking.py +++ b/src/unilab/envs/motion_tracking/g1/flip_tracking.py @@ -146,3 +146,137 @@ class G1ClimbTrackingEnv(G1MotionTrackingEnv): """G1 climb-tracking environment implementation.""" _cfg: G1ClimbTrackingCfg + + +@dataclass +class G1FlipTracking23DofCfg(G1FlipTrackingCfg): + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof.xml") + ) + ) + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "flip_360_001__A304_23dof.npz" + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +@registry.envcfg("G1FlipTracking23Dof") +@dataclass +class G1FlipTracking23DofEnvCfg(G1FlipTracking23DofCfg): + pass + + +@dataclass +class G1WallFlipTracking23DofCfg(G1WallFlipTrackingCfg): + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof_with_wall.xml") + ) + ) + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "flip_from_wall_104__A304_23dof.npz" + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +@registry.envcfg("G1WallFlipTracking23Dof") +@dataclass +class G1WallFlipTracking23DofEnvCfg(G1WallFlipTracking23DofCfg): + pass + + +@dataclass +class G1ClimbTracking23DofCfg(G1ClimbTrackingCfg): + """23-DoF config for the climb_20_z_scale_1 motion clip.""" + + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str( + ASSETS_ROOT_PATH / "robots" / "g1" / "scene_climb_20_z_scale_1_23dof.xml" + ) + ) + ) + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "climb_20_z_scale_1.0_23dof.npz" + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +@registry.envcfg("G1ClimbTracking23Dof") +@dataclass +class G1ClimbTracking23DofEnvCfg(G1ClimbTracking23DofCfg): + """Registered 23-DoF configuration for G1 box-climb motion tracking.""" + + pass + + +registry.register_env("G1ClimbTracking23Dof", G1ClimbTrackingEnv, sim_backend="mujoco") +registry.register_env("G1ClimbTracking23Dof", G1ClimbTrackingEnv, sim_backend="motrix") +registry.register_env("G1FlipTracking23Dof", G1FlipTrackingEnv, sim_backend="mujoco") +registry.register_env("G1FlipTracking23Dof", G1FlipTrackingEnv, sim_backend="motrix") +registry.register_env("G1WallFlipTracking23Dof", G1WallFlipTrackingEnv, sim_backend="mujoco") +registry.register_env("G1WallFlipTracking23Dof", G1WallFlipTrackingEnv, sim_backend="motrix") diff --git a/src/unilab/envs/motion_tracking/g1/flip_tracking_sac.py b/src/unilab/envs/motion_tracking/g1/flip_tracking_sac.py index dfafb4877..894939d2f 100644 --- a/src/unilab/envs/motion_tracking/g1/flip_tracking_sac.py +++ b/src/unilab/envs/motion_tracking/g1/flip_tracking_sac.py @@ -18,7 +18,12 @@ from unilab.base import registry -from .flip_tracking import G1FlipTrackingCfg, G1WallFlipTrackingCfg +from .flip_tracking import ( + G1FlipTracking23DofEnvCfg, + G1FlipTrackingCfg, + G1WallFlipTracking23DofEnvCfg, + G1WallFlipTrackingCfg, +) from .tracking_sac import G1MotionTrackingSACEnv @@ -54,3 +59,27 @@ class G1WallFlipTrackingSACEnv(G1MotionTrackingSACEnv): """ _cfg: G1WallFlipTrackingSACCfg + + +@registry.envcfg("G1FlipTrackingSAC23Dof") +@dataclass +class G1FlipTrackingSAC23DofCfg(G1FlipTracking23DofEnvCfg): + pass + + +@registry.env("G1FlipTrackingSAC23Dof", sim_backend="mujoco") +@registry.env("G1FlipTrackingSAC23Dof", sim_backend="motrix") +class G1FlipTrackingSAC23DofEnv(G1MotionTrackingSACEnv): + _cfg: G1FlipTrackingSAC23DofCfg + + +@registry.envcfg("G1WallFlipTrackingSAC23Dof") +@dataclass +class G1WallFlipTrackingSAC23DofCfg(G1WallFlipTracking23DofEnvCfg): + pass + + +@registry.env("G1WallFlipTrackingSAC23Dof", sim_backend="mujoco") +@registry.env("G1WallFlipTrackingSAC23Dof", sim_backend="motrix") +class G1WallFlipTrackingSAC23DofEnv(G1MotionTrackingSACEnv): + _cfg: G1WallFlipTrackingSAC23DofCfg diff --git a/src/unilab/envs/motion_tracking/g1/motion_box_loader.py b/src/unilab/envs/motion_tracking/g1/motion_box_loader.py index 80a9e9e09..034fde15e 100644 --- a/src/unilab/envs/motion_tracking/g1/motion_box_loader.py +++ b/src/unilab/envs/motion_tracking/g1/motion_box_loader.py @@ -86,7 +86,7 @@ def __init__(self, motion_file, body_indices=None): if "joint_names" in data: n_robot_joints = len(data["joint_names"]) else: - n_robot_joints = self.joint_pos.shape[1] - 7 + n_robot_joints = self.joint_pos.shape[1] self.num_joints = n_robot_joints self.joint_pos = self.joint_pos[:, :n_robot_joints] diff --git a/src/unilab/envs/motion_tracking/g1/tracking.py b/src/unilab/envs/motion_tracking/g1/tracking.py index 4a9b4df98..4648c88d8 100644 --- a/src/unilab/envs/motion_tracking/g1/tracking.py +++ b/src/unilab/envs/motion_tracking/g1/tracking.py @@ -209,6 +209,52 @@ class G1MotionTrackingDeployEnvCfg(G1MotionTrackingCfg): pass +@dataclass +class G1MotionTracking23DofCfg(G1MotionTrackingCfg): + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "dance1_subject2_part_23dof.npz" + ) + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof.xml") + ) + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +@registry.envcfg("G1MotionTracking23Dof") +@dataclass +class G1MotionTracking23DofEnvCfg(G1MotionTracking23DofCfg): + pass + + +@registry.envcfg("G1MotionTracking23DofDeploy") +@dataclass +class G1MotionTracking23DofDeployEnvCfg(G1MotionTracking23DofCfg): + pass + + def _build_motion_reference_state( env: Any, env_ids: np.ndarray, motion_data: MotionData ) -> tuple[np.ndarray, np.ndarray]: @@ -1459,3 +1505,14 @@ def _build_actor_obs( axis=1, dtype=get_global_dtype(), ) + + +# --- 23-DoF env registrations (same env classes, 23-DoF configs) --- +registry.register_env("G1MotionTracking23Dof", G1MotionTrackingEnv, sim_backend="mujoco") +registry.register_env("G1MotionTracking23Dof", G1MotionTrackingEnv, sim_backend="motrix") +registry.register_env( + "G1MotionTracking23DofDeploy", G1MotionTrackingDeployEnv, sim_backend="mujoco" +) +registry.register_env( + "G1MotionTracking23DofDeploy", G1MotionTrackingDeployEnv, sim_backend="motrix" +) diff --git a/src/unilab/envs/motion_tracking/g1/tracking_obs.py b/src/unilab/envs/motion_tracking/g1/tracking_obs.py index 0e04d01f1..724a8cb41 100644 --- a/src/unilab/envs/motion_tracking/g1/tracking_obs.py +++ b/src/unilab/envs/motion_tracking/g1/tracking_obs.py @@ -29,7 +29,9 @@ import numpy as np +from unilab.assets import ASSETS_ROOT_PATH from unilab.base import registry +from unilab.base.scene import SceneCfg from unilab.dr import ( DomainRandomizationCapabilities, ResetPlan, @@ -469,3 +471,42 @@ def _fill_obs_history( sel = slice(None) if env_ids is None else env_ids for key, val in components.items(): self._hist_buf[key][sel, :] = val[:, None, :] + + +@registry.envcfg("G1WBTObs23Dof") +@dataclass +class G1WBTObs23DofCfg(G1WBTObsCfg): + motion_file: str | list[str] = str( + ASSETS_ROOT_PATH / "motions" / "g1" / "dance1_subject2_part_23dof.npz" + ) + scene: SceneCfg = field( + default_factory=lambda: SceneCfg( + model_file=str(ASSETS_ROOT_PATH / "robots" / "g1" / "scene_flat_23dof.xml") + ) + ) + body_names: tuple[str, ...] = ( + "pelvis", + "left_hip_roll_link", + "left_knee_link", + "left_ankle_roll_link", + "right_hip_roll_link", + "right_knee_link", + "right_ankle_roll_link", + "torso_link", + "left_shoulder_roll_link", + "left_elbow_link", + "left_wrist_roll_rubber_hand", + "right_shoulder_roll_link", + "right_elbow_link", + "right_wrist_roll_rubber_hand", + ) + ee_body_names: tuple[str, ...] = ( + "left_ankle_roll_link", + "right_ankle_roll_link", + "left_wrist_roll_rubber_hand", + "right_wrist_roll_rubber_hand", + ) + + +registry.register_env("G1WBTObs23Dof", G1WBTObsEnv, sim_backend="mujoco") +registry.register_env("G1WBTObs23Dof", G1WBTObsEnv, sim_backend="motrix") diff --git a/src/unilab/envs/motion_tracking/g1/tracking_sac.py b/src/unilab/envs/motion_tracking/g1/tracking_sac.py index ff08530b8..db968b287 100644 --- a/src/unilab/envs/motion_tracking/g1/tracking_sac.py +++ b/src/unilab/envs/motion_tracking/g1/tracking_sac.py @@ -16,7 +16,7 @@ from unilab.base import registry from unilab.dtype_config import get_global_dtype -from .tracking import G1MotionTrackingCfg, G1MotionTrackingEnv +from .tracking import G1MotionTracking23DofCfg, G1MotionTrackingCfg, G1MotionTrackingEnv @registry.envcfg("G1MotionTrackingSAC") @@ -69,3 +69,15 @@ def _compute_obs( # Append base_lin_vel to critic observations. obs["critic"] = np.concatenate([obs["critic"], linvel], axis=1, dtype=get_global_dtype()) # type: ignore[call-overload] return obs + + +@registry.envcfg("G1MotionTrackingSAC23Dof") +@dataclass +class G1MotionTrackingSAC23DofCfg(G1MotionTracking23DofCfg): + pass + + +@registry.env("G1MotionTrackingSAC23Dof", sim_backend="mujoco") +@registry.env("G1MotionTrackingSAC23Dof", sim_backend="motrix") +class G1MotionTrackingSAC23DofEnv(G1MotionTrackingSACEnv): + _cfg: G1MotionTrackingSAC23DofCfg diff --git a/tests/envs/test_env_configs.py b/tests/envs/test_env_configs.py index 3d9b0009f..87be7a06e 100644 --- a/tests/envs/test_env_configs.py +++ b/tests/envs/test_env_configs.py @@ -1947,7 +1947,11 @@ def test_g1_motion_tracking_reset_and_step(sim_backend: str): if not npz_files: pytest.skip(f"No .npz motion files in {motion_dir}") - motion_file = str(npz_files[0]) + # Filter out 23-DoF motion files — G1MotionTracking uses 29-DoF config + non_23dof = [f for f in npz_files if "_23dof" not in f.name] + if not non_23dof: + pytest.skip("No non-23-DoF motion files available for 29-DoF config") + motion_file = str(non_23dof[0]) env = cast( Any, registry.make( @@ -1997,13 +2001,17 @@ def test_g1_motion_tracking_deploy_reset_and_step_mujoco(): if not npz_files: pytest.skip(f"No .npz motion files in {motion_dir}") + # Filter out 23-DoF motion files — G1MotionTrackingDeploy uses 29-DoF config + non_23dof = [f for f in npz_files if "_23dof" not in f.name] + if not non_23dof: + pytest.skip("No non-23-DoF motion files available for 29-DoF deploy config") env = cast( Any, registry.make( "G1MotionTrackingDeploy", num_envs=2, sim_backend="mujoco", - env_cfg_override={"motion_file": str(npz_files[0])}, + env_cfg_override={"motion_file": str(non_23dof[0])}, ), ) try: