Skip to content

Commit 1da714a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 17cd825 commit 1da714a

8 files changed

Lines changed: 17 additions & 11 deletions

File tree

get_started/rl/fast_td3/fttd3_module.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ def projection(
425425
next_dist = F.softmax(self.forward(obs, actions), dim=1)
426426
proj_dist = torch.zeros_like(next_dist)
427427
offset = (
428-
torch.linspace(0, (batch_size - 1) * self.num_atoms, batch_size, device=device)
428+
torch
429+
.linspace(0, (batch_size - 1) * self.num_atoms, batch_size, device=device)
429430
.unsqueeze(1)
430431
.expand(batch_size, self.num_atoms)
431432
.long()

metasim/randomization/core/isaacsim_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def apply_mdl_material(
263263
# - material_name: Variant within MDL (optional, e.g., "Plywood::Oak")
264264
# - mtl_prim_name: Unique prim name to avoid conflicts
265265
mdl_basename = os.path.basename(mdl_path).removesuffix(".mdl")
266-
prim_basename = prim_path.split("/")[-1]
266+
prim_basename = prim_path.rsplit("/", maxsplit=1)[-1]
267267
mtl_prim_unique = f"{mdl_basename}_{prim_basename}_{id(prim_path)}" # Fully unique
268268

269269
_, mtl_prim_path = get_material_prim_path(mtl_prim_unique)

metasim/sim/newton/newton.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,8 @@ def _render_tiled_cameras(self, env_ids: list[int]) -> dict:
11781178
depth_tensor = depth_tensor[use_env_ids]
11791179

11801180
intrinsics = (
1181-
torch.tensor(cam_cfg.intrinsics, dtype=torch.float32, device=self.device)
1181+
torch
1182+
.tensor(cam_cfg.intrinsics, dtype=torch.float32, device=self.device)
11821183
.unsqueeze(0)
11831184
.expand(len(use_env_ids), -1, -1)
11841185
)

metasim/utils/kinematics.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def _solve_ik_jax_with_seed(robot, target_link_index, target_wxyz, target_positi
103103
]
104104

105105
sol = (
106-
jaxls.LeastSquaresProblem(factors, [joint_var])
106+
jaxls
107+
.LeastSquaresProblem(factors, [joint_var])
107108
.analyze()
108109
.solve(
109110
initial_vals=jaxls.VarValues.make([joint_var.with_value(prev_cfg)]),
@@ -130,7 +131,8 @@ def _solve_ik_jax_without_seed(robot, target_link_index, target_wxyz, target_pos
130131
]
131132

132133
sol = (
133-
jaxls.LeastSquaresProblem(factors, [joint_var])
134+
jaxls
135+
.LeastSquaresProblem(factors, [joint_var])
134136
.analyze()
135137
.solve(
136138
verbose=False,

roboverse_pack/callback_funcs/humanoid/step_funcs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def push_by_setting_velocity(
7777
/ env.step_dt
7878
).to(torch.int)
7979
push_env_ids = (
80-
torch.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
80+
torch
81+
.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
8182
.nonzero(as_tuple=False)
8283
.flatten()
8384
)

roboverse_pack/tasks/beyondmimic/metasim/envs/base_legged_robot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def _instantiate_cfg(self):
129129

130130
# per-actuator action scale
131131
self.action_scale = (
132-
torch.tensor(list(self.robot.action_scale.values()), device=self.device)
132+
torch
133+
.tensor(list(self.robot.action_scale.values()), device=self.device)
133134
.unsqueeze(0)
134135
.repeat(self.num_envs, 1)
135136
)

roboverse_pack/tasks/beyondmimic/metasim/mdp/events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def push_by_setting_velocity(
6666
).to(torch.int)
6767
# TODO different from how interval events are triggered in Isaac Lab, consider adapting this
6868
push_env_ids = (
69-
torch.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
69+
torch
70+
.logical_and(env._episode_steps % env.push_interval == 0, env._episode_steps > 0)
7071
.nonzero(as_tuple=False)
7172
.flatten()
7273
)

roboverse_pack/tasks/beyondmimic/metasim/mdp/rewards.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,8 @@ def undesired_contacts(
109109
contact_forces: ContactForces = env_states.extras["contact_forces"][env.name]
110110
is_contact = (
111111
# TODO check correspondence with `contact_sensor.data.net_forces_w_history`
112-
contact_forces.contact_forces_history[
113-
:, :, indexes, :
114-
] # [n_envs, history_length, n_indexes, 3] -> [n_envs, 3, 26, 3]
112+
contact_forces
113+
.contact_forces_history[:, :, indexes, :] # [n_envs, history_length, n_indexes, 3] -> [n_envs, 3, 26, 3]
115114
.norm(dim=-1)
116115
.max(dim=1)[0]
117116
> threshold

0 commit comments

Comments
 (0)