align hip_pos_penalty reward with isaacgym (switch to hip_pos_penalty_l1).
This commit is contained in:
@@ -431,8 +431,8 @@ class RewardsCfg:
|
|||||||
weight=-1.0,
|
weight=-1.0,
|
||||||
params={"sensor_cfg": SceneEntityCfg("contact_forces", body_names=".*_thigh|.*_calf"), "threshold": 5.0},
|
params={"sensor_cfg": SceneEntityCfg("contact_forces", body_names=".*_thigh|.*_calf"), "threshold": 5.0},
|
||||||
)
|
)
|
||||||
hip_pos_penalty = RewTerm(
|
hip_pos_penalty_l1 = RewTerm(
|
||||||
func=mdp.hip_pos_penalty,
|
func=mdp.hip_pos_penalty_l1,
|
||||||
weight=-0.05,
|
weight=-0.05,
|
||||||
params={
|
params={
|
||||||
"command_name": "base_velocity",
|
"command_name": "base_velocity",
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ def flat_orientation_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = Scen
|
|||||||
return reward
|
return reward
|
||||||
|
|
||||||
|
|
||||||
def hip_pos_penalty(
|
def hip_pos_penalty_l1(
|
||||||
env: ManagerBasedRLEnv,
|
env: ManagerBasedRLEnv,
|
||||||
command_name: str,
|
command_name: str,
|
||||||
asset_cfg: SceneEntityCfg,
|
asset_cfg: SceneEntityCfg,
|
||||||
@@ -547,7 +547,7 @@ def hip_pos_penalty(
|
|||||||
command = env.command_manager.get_command(command_name)[:, [1, 2]]
|
command = env.command_manager.get_command(command_name)[:, [1, 2]]
|
||||||
cmd_large = torch.any(torch.abs(command) > command_threshold, dim=1)
|
cmd_large = torch.any(torch.abs(command) > command_threshold, dim=1)
|
||||||
running_reward = torch.linalg.norm(
|
running_reward = torch.linalg.norm(
|
||||||
(asset.data.joint_pos[:, asset_cfg.joint_ids] - asset.data.default_joint_pos[:, asset_cfg.joint_ids]), dim=1
|
(asset.data.joint_pos[:, asset_cfg.joint_ids] - asset.data.default_joint_pos[:, asset_cfg.joint_ids]), dim=1, ord=1
|
||||||
)
|
)
|
||||||
reward = torch.where(
|
reward = torch.where(
|
||||||
cmd_large,
|
cmd_large,
|
||||||
|
|||||||
Reference in New Issue
Block a user