Amend success rewards

This commit is contained in:
2026-03-22 02:32:58 -04:00
parent 2e2d68a933
commit 616dd06e78

View File

@@ -135,13 +135,6 @@ def is_standing_still(
return env.extras["stable_timer"] > standing_time
def joint_deviation_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg) -> torch.Tensor:
"""计算关节相对于默认姿态(default_joint_pos)的偏差平方和"""
# 获取当前关节位置相对于默认位置的差值
# mdp.joint_pos_rel 返回的是 (current_pos - default_pos)
diff = mdp.joint_pos_rel(env, asset_cfg)
return torch.sum(torch.square(diff), dim=-1)
# --- 2. 配置类 ---
T1_JOINT_NAMES = [
@@ -250,9 +243,15 @@ class T1GetUpRewardCfg:
# 6. 成功终极大奖
is_success = RewTerm(
func=lambda env, keys: env.termination_manager.get_term(keys).float(),
weight=1000.0,
params={"keys": "standing_success"}
func=is_standing_still,
weight=2000.0,
params={
"min_head_height": 1.05,
"min_pelvis_height": 0.75,
"max_angle_error": 0.3,
"standing_time": 0.2,
"velocity_threshold": 0.5
}
)
@configclass