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.21
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
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 @@ -80,7 +80,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 @@ -130,7 +130,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
2 changes: 1 addition & 1 deletion tools/mjlab_integration/full_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _align_by_jointname(a: RolloutResult, b: RolloutResult):
import mujoco

def _short(n: str) -> str:
return n.split("/")[-1]
return n.rsplit("/", maxsplit=1)[-1]

a_short = [_short(n) for n in a.joint_names]
b_short = [_short(n) for n in b.joint_names]
Expand Down
Loading