PingPongRealWorldRL / config.yaml
KurisiTOMA's picture
chore: publish H2 real-world RL system
d8290eb verified
Raw History Blame Contribute Delete
4.41 kB
name: h2_online_closd_ball_real_shm
description: H2 native Online-CLoSD reference plus 182-observation tracking policy.
# H2 real-ball n5 recipe. Activated only by --rl-mode train.
# Residual scales are physical joint-target radians, before action-unit conversion.
rl:
seed: 42
learner_device: cuda
warmup_balls: 100
online_balls: 200
checkpoint_interval_balls: 10
action_scales_rad: [0.15, 0.12, 0.12, 0.18, 0.4, 0.3, 0.35]
warmup_sigma: 0.30
exploration_sigma: 0.30
exploration_sigma_final: 0.05
exploration_hold_steps: 10 # Keep noise for applied steps; actor still runs each tick.
batch_size: 256
replay_capacity: 200000
actor_learning_rate: 1.0e-6
actor_residual_l2: 2.0
critic_learning_rate: 1.0e-4
critic_warmup_steps: 1500
critic_updates_per_step: 1
actor_update_delay: 4
discount: 0.99
n_step: 50
target_noise: 0.10
target_noise_clip: 0.3
target_tau: 0.005
hidden_sizes: [256, 256]
layer_norm: true
optimizer_betas: [0.9, 0.999]
optimizer_eps: 1.0e-8
weight_decay: 0.01
gradient_clip: 1.0
normalizer_min_std: 0.1
normalizer_clip: 5.0
hit_reward: 0.0 # First confirmed return direction, not precise contact sensing.
success_bonus: 0.0
success_reward: 60.0
landing_scale_m: 0.4
failure_reward: -20.0
miss_failure_reward: -80.0
position_reward_coefficient: 2.0
position_reward_scale_m: 0.15
position_reward_window_before_s: 0.25
position_reward_window_after_s: 0.30
pre_hit_timeout_s: 0.40
post_hit_timeout_s: 2.0
velocity_window: 5 # Legacy key: landing position window; velocity comes from adapter.
incoming_vx_mps: -0.5
outgoing_vx_mps: 0.3
outgoing_confirmations: 2
table_height_tolerance_m: 0.03
net_x_tolerance_m: 0.04
max_ball_gap_s: 0.05
zmq_endpoint: tcp://127.0.0.1:5556
output_dir: artifacts/real_rl_runs
episode_queue_capacity: 16
logging_queue_capacity: 512
ball_queue_capacity: 4096
max_episode_steps: 500
robot: h2
deployment_version: original # CLI --deployment-version selects the whole bundle.
seed: 0
hardware:
# H2 C++ low-level table installed beside the connected robot.
joint_map_revision: unitree_sdk2@e02dc701-h2-cpp
policy:
# Model path is bound by runtime/deployment_versions.py, never a shared slot.
# The policy is small; CPU avoids depending on an onnxruntime-gpu/CUDA ABI match.
device: cpu
generator:
# Native diffusion generation is latency-sensitive and must not silently fall back.
device: cuda
sampling_steps: null
warmup_steps: 1
command:
target_landing_xy: [2.87, 0.0]
# Optional extra skip in addition to measured generation wall time.
active_latency_skip_s: 0.0
safety:
# The H2 training/export supports x=[0.35,0.45]; predictor defaults to x=0.40.
hit_plane_tolerance_m: 0.01
joint_limit_tolerance_rad: 0.05
# Audited floor; lower values are rejected by both config and H2 contract.
command_joint_margin_rad: 0.01
# A latched software stop uses at most this fraction of the MJCF effort
# envelope. Learned/ready targets follow training and are projected against
# the full envelope by the 1000 Hz bridge on every publication tick.
stop_hold_torque_fraction: 0.90
max_joint_velocity_rad_s: 40.0
max_tilt_rad: 0.80
max_abs_incoming_velocity_mps: 15.0
# Source timestamps are emitted by this project's predictor, not ROS receipt time.
robot_mocap_timeout_s: 0.10
ball_mocap_timeout_s: 0.12
# Must remain below the independently latched 0.10 s C++ watchdog.
max_control_gap_s: 0.06
# The suspended FROZEN_WAIT gate requires a quiet finite state but treats joint
# tracking error as diagnostic because tether gravity produces static PD error.
ready_position_tolerance_rad: 0.10
ready_arm_position_tolerance_rad: 0.55
ready_velocity_tolerance_rad_s: 1.0
ready_settle_duration_s: 0.50
# Fail closed instead of waiting indefinitely for suspension motion to settle.
ready_post_interpolation_timeout_s: 10.0
# Keep the configured base origin. Measured mocap yaw is passed through
# without an absolute heading admission gate.
max_initial_root_xy_error_m: 0.30
# Reject discontinuities in new robot mocap source frames; the fixed jump
# allowance covers measurement noise and the speed/rate term covers motion.
max_mocap_root_jump_m: 0.10
max_mocap_root_speed_mps: 2.0
max_mocap_root_xy_m: 0.75
max_mocap_heading_jump_rad: 0.28
max_mocap_heading_rate_rad_s: 4.0