Skip to content

Commit dd38c28

Browse files
hawkinspcopybara-github
authored andcommitted
[JAX] Replace jnp.clip(..., a_min=..., a_max=...) with jnp.clip(..., min=..., max=...).
a_min and a_max are deprecated parameter names to jax.numpy.clip. PiperOrigin-RevId: 891776337 Change-Id: I5692b7fbb6d16c62eae188c012d9450463b4b6dd
1 parent 7f94611 commit dd38c28

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

mujoco_playground/_src/manipulation/franka_emika_panda_robotiq/push_cube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def _get_reward(
469469
def _orientation_error(self, object_quat, target_quat) -> jax.Array:
470470
quat_diff = math.quat_mul(object_quat, math.quat_inv(target_quat))
471471
quat_diff = math.normalize(quat_diff)
472-
ori_error = 2.0 * jp.asin(jp.clip(math.norm(quat_diff[1:]), a_max=1.0))
472+
ori_error = 2.0 * jp.asin(jp.clip(math.norm(quat_diff[1:]), max=1.0))
473473
return ori_error
474474

475475
def _get_obs(self, state: mjx_env.State) -> jax.Array:

mujoco_playground/_src/manipulation/leap_hand/reorient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def _cube_orientation_error(self, data: mjx.Data):
423423
cube_goal_ori = self.get_cube_goal_orientation(data)
424424
quat_diff = math.quat_mul(cube_ori, math.quat_inv(cube_goal_ori))
425425
quat_diff = math.normalize(quat_diff)
426-
return 2.0 * jp.asin(jp.clip(math.norm(quat_diff[1:]), a_max=1.0))
426+
return 2.0 * jp.asin(jp.clip(math.norm(quat_diff[1:]), max=1.0))
427427

428428
def _reward_cube_orientation(self, data: mjx.Data) -> jax.Array:
429429
ori_error = self._cube_orientation_error(data)

0 commit comments

Comments
 (0)