Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: check-yaml
- id: check-toml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
rev: v0.15.12
hooks:
- id: ruff
args: [ --fix ]
Expand Down
3 changes: 2 additions & 1 deletion get_started/rl/fast_td3/fttd3_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ def projection(
next_dist = F.softmax(self.forward(obs, actions), dim=1)
proj_dist = torch.zeros_like(next_dist)
offset = (
torch.linspace(0, (batch_size - 1) * self.num_atoms, batch_size, device=device)
torch
.linspace(0, (batch_size - 1) * self.num_atoms, batch_size, device=device)
.unsqueeze(1)
.expand(batch_size, self.num_atoms)
.long()
Expand Down
2 changes: 1 addition & 1 deletion metasim/randomization/core/isaacsim_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def apply_mdl_material(
# - material_name: Variant within MDL (optional, e.g., "Plywood::Oak")
# - mtl_prim_name: Unique prim name to avoid conflicts
mdl_basename = os.path.basename(mdl_path).removesuffix(".mdl")
prim_basename = prim_path.split("/")[-1]
prim_basename = prim_path.rsplit("/", maxsplit=1)[-1]
mtl_prim_unique = f"{mdl_basename}_{prim_basename}_{id(prim_path)}" # Fully unique

_, mtl_prim_path = get_material_prim_path(mtl_prim_unique)
Expand Down
3 changes: 2 additions & 1 deletion metasim/sim/newton/newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,8 @@ def _render_tiled_cameras(self, env_ids: list[int]) -> dict:
depth_tensor = depth_tensor[use_env_ids]

intrinsics = (
torch.tensor(cam_cfg.intrinsics, dtype=torch.float32, device=self.device)
torch
.tensor(cam_cfg.intrinsics, dtype=torch.float32, device=self.device)
.unsqueeze(0)
.expand(len(use_env_ids), -1, -1)
)
Expand Down
6 changes: 4 additions & 2 deletions metasim/utils/kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def _solve_ik_jax_with_seed(robot, target_link_index, target_wxyz, target_positi
]

sol = (
jaxls.LeastSquaresProblem(factors, [joint_var])
jaxls
.LeastSquaresProblem(factors, [joint_var])
.analyze()
.solve(
initial_vals=jaxls.VarValues.make([joint_var.with_value(prev_cfg)]),
Expand All @@ -130,7 +131,8 @@ def _solve_ik_jax_without_seed(robot, target_link_index, target_wxyz, target_pos
]

sol = (
jaxls.LeastSquaresProblem(factors, [joint_var])
jaxls
.LeastSquaresProblem(factors, [joint_var])
.analyze()
.solve(
verbose=False,
Expand Down
3 changes: 2 additions & 1 deletion roboverse_pack/callback_funcs/humanoid/step_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def push_by_setting_velocity(
/ env.step_dt
).to(torch.int)
push_env_ids = (
torch.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
torch
.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
.nonzero(as_tuple=False)
.flatten()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def _instantiate_cfg(self):

# per-actuator action scale
self.action_scale = (
torch.tensor(list(self.robot.action_scale.values()), device=self.device)
torch
.tensor(list(self.robot.action_scale.values()), device=self.device)
.unsqueeze(0)
.repeat(self.num_envs, 1)
)
Expand Down
3 changes: 2 additions & 1 deletion roboverse_pack/tasks/beyondmimic/metasim/mdp/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def push_by_setting_velocity(
).to(torch.int)
# TODO different from how interval events are triggered in Isaac Lab, consider adapting this
push_env_ids = (
torch.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
torch
.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
.nonzero(as_tuple=False)
.flatten()
)
Expand Down
5 changes: 2 additions & 3 deletions roboverse_pack/tasks/beyondmimic/metasim/mdp/rewards.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ def undesired_contacts(
contact_forces: ContactForces = env_states.extras["contact_forces"][env.name]
is_contact = (
# TODO check correspondence with `contact_sensor.data.net_forces_w_history`
contact_forces.contact_forces_history[
:, :, indexes, :
] # [n_envs, history_length, n_indexes, 3] -> [n_envs, 3, 26, 3]
contact_forces
.contact_forces_history[:, :, indexes, :] # [n_envs, history_length, n_indexes, 3] -> [n_envs, 3, 26, 3]
.norm(dim=-1)
.max(dim=1)[0]
> threshold
Expand Down