@@ -74,21 +74,21 @@ def __call__(self, env: ManagerBasedRLEnv, term_keys: str | list[str] = ".*") ->
74
74
75
75
76
76
def lin_vel_z_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
77
- """Penalize z-axis base linear velocity using L2- kernel."""
77
+ """Penalize z-axis base linear velocity using L2 squared kernel."""
78
78
# extract the used quantities (to enable type-hinting)
79
79
asset : RigidObject = env .scene [asset_cfg .name ]
80
80
return torch .square (asset .data .root_lin_vel_b [:, 2 ])
81
81
82
82
83
83
def ang_vel_xy_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
84
- """Penalize xy-axis base angular velocity using L2- kernel."""
84
+ """Penalize xy-axis base angular velocity using L2 squared kernel."""
85
85
# extract the used quantities (to enable type-hinting)
86
86
asset : RigidObject = env .scene [asset_cfg .name ]
87
87
return torch .sum (torch .square (asset .data .root_ang_vel_b [:, :2 ]), dim = 1 )
88
88
89
89
90
90
def flat_orientation_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
91
- """Penalize non-flat base orientation using L2- kernel.
91
+ """Penalize non-flat base orientation using L2 squared kernel.
92
92
93
93
This is computed by penalizing the xy-components of the projected gravity vector.
94
94
"""
@@ -100,7 +100,7 @@ def flat_orientation_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = Scen
100
100
def base_height_l2 (
101
101
env : ManagerBasedRLEnv , target_height : float , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )
102
102
) -> torch .Tensor :
103
- """Penalize asset height from its target using L2- kernel.
103
+ """Penalize asset height from its target using L2 squared kernel.
104
104
105
105
Note:
106
106
Currently, it assumes a flat terrain, i.e. the target height is in the world frame.
@@ -123,9 +123,9 @@ def body_lin_acc_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEnt
123
123
124
124
125
125
def joint_torques_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
126
- """Penalize joint torques applied on the articulation using L2- kernel.
126
+ """Penalize joint torques applied on the articulation using L2 squared kernel.
127
127
128
- NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint torques contribute to the L2 norm .
128
+ NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint torques contribute to the term .
129
129
"""
130
130
# extract the used quantities (to enable type-hinting)
131
131
asset : Articulation = env .scene [asset_cfg .name ]
@@ -140,19 +140,19 @@ def joint_vel_l1(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg) -> torch.Ten
140
140
141
141
142
142
def joint_vel_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
143
- """Penalize joint velocities on the articulation using L1- kernel.
143
+ """Penalize joint velocities on the articulation using L2 squared kernel.
144
144
145
- NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint velocities contribute to the L1 norm .
145
+ NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint velocities contribute to the term .
146
146
"""
147
147
# extract the used quantities (to enable type-hinting)
148
148
asset : Articulation = env .scene [asset_cfg .name ]
149
149
return torch .sum (torch .square (asset .data .joint_vel [:, asset_cfg .joint_ids ]), dim = 1 )
150
150
151
151
152
152
def joint_acc_l2 (env : ManagerBasedRLEnv , asset_cfg : SceneEntityCfg = SceneEntityCfg ("robot" )) -> torch .Tensor :
153
- """Penalize joint accelerations on the articulation using L2- kernel.
153
+ """Penalize joint accelerations on the articulation using L2 squared kernel.
154
154
155
- NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint accelerations contribute to the L2 norm .
155
+ NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their joint accelerations contribute to the term .
156
156
"""
157
157
# extract the used quantities (to enable type-hinting)
158
158
asset : Articulation = env .scene [asset_cfg .name ]
@@ -232,12 +232,12 @@ def applied_torque_limits(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = Sc
232
232
233
233
234
234
def action_rate_l2 (env : ManagerBasedRLEnv ) -> torch .Tensor :
235
- """Penalize the rate of change of the actions using L2- kernel."""
235
+ """Penalize the rate of change of the actions using L2 squared kernel."""
236
236
return torch .sum (torch .square (env .action_manager .action - env .action_manager .prev_action ), dim = 1 )
237
237
238
238
239
239
def action_l2 (env : ManagerBasedRLEnv ) -> torch .Tensor :
240
- """Penalize the actions using L2- kernel."""
240
+ """Penalize the actions using L2 squared kernel."""
241
241
return torch .sum (torch .square (env .action_manager .action ), dim = 1 )
242
242
243
243
0 commit comments