Skip to content

Conversation

@wangyenjen
Copy link

@wangyenjen wangyenjen commented Jun 18, 2025

Thanks for open-sourcing this great project!

While deploying the policy in MuJoCo I hit a few runtime issues—this PR fixes them:

  • Fix dtype bug – cast motion_ids to long before indexing motion-lib
  • Empty-tensor guard – sample two frames and handle batch size 0
  • Size-mismatch fix – skip my_quat_rotate when no data
  • Reset clean-up – reset motion_time and ref_init_yaw on Reset()
  • .gitignore: add *~ backup files.

t1 = self.timer * self.dt
motion_times = torch.tensor([t0, t1], dtype=torch.float32, device='cpu')
motion_ids = torch.zeros(2, dtype=torch.long, device='cpu')
seq = self.motion_lib.get_motion_state(motion_ids, motion_times)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you call get_motion_state with an additional timestep? Can you describe how to reproduce the runtime issue related to it?

global_ref_body_vel = ref_body_vel_extend.view(1, -1, 3)
local_ref_rigid_body_vel_flat = my_quat_rotate(heading_inv_rot_expand.view(-1, 4), global_ref_body_vel.view(-1, 3))
if heading_inv_rot_expand.shape[0] == 0:
local_ref_rigid_body_vel_flat = torch.zeros_like(global_ref_body_vel.view(-1, 3))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will it enter this branch? I think heading_inv_rot and heading_inv_rot_expand should always have the shape [1,4] and [27,4] respectively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants