Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ smpl_retarget/motion_data/
smpl_retarget/retargeted_motion_data

*.txt

*~
22 changes: 17 additions & 5 deletions humanoidverse/deploy/urcirobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def Reset(self):


self.UpdateObs()
self.motion_time = 0.0
self.ref_init_yaw[0] = self.rpy[2]

def _apply_action(self, target_q):
raise NotImplementedError("Not implemented")
Expand Down Expand Up @@ -306,10 +308,13 @@ def _kick_motion_res(self)->Dict[str, torch.Tensor]:

self._kick_motion_res_counter = self.timer

motion_times = torch.tensor((self.timer+1) * self.dt, dtype=torch.float32)
motion_ids = torch.zeros((1), dtype=torch.int32)
self._kick_motion_res_buffer = self.motion_lib.get_motion_state(motion_ids, motion_times)
t0 = max(self.timer - 1, 0) * self.dt
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?


self._kick_motion_res_buffer = {k: v[-1:].contiguous() for k, v in seq.items()}
return self._kick_motion_res_buffer


Expand Down Expand Up @@ -339,7 +344,14 @@ def KickMotionLib(self):


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

else:
local_ref_rigid_body_vel_flat = my_quat_rotate(
heading_inv_rot_expand.view(-1, 4),
global_ref_body_vel.view(-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))

## diff compute - kinematic joint position
self.dif_joint_angles = (ref_joint_pos - self.q).to(dtype=torch.float32).view(-1)
Expand Down Expand Up @@ -698,4 +710,4 @@ def _get_obs_history_critic(self,):
history_tensor = self.history_handler.query(key)[:, :history_length]
history_tensor = history_tensor.reshape(history_tensor.shape[0], -1)
history_tensors.append(history_tensor)
return torch.cat(history_tensors, dim=1).reshape(-1)
return torch.cat(history_tensors, dim=1).reshape(-1)