Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
budzianowski committed Oct 31, 2024
1 parent e0b84a8 commit 986c053
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions sim/envs/base/legged_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def post_physics_step(self):
if self.imu_indices:
self.base_quat = quat_mul(origin, self.rigid_state[:, self.imu_indices, 3:7])
self.base_lin_vel[:] = quat_rotate_inverse(self.base_quat, self.rigid_state[:, self.imu_indices, 7:10])
self.base_ang_vel[:] = quat_rotate_inverse(self.base_quat, self.rigid_state[:, self.imu_indices, 10:13])
self.base_ang_vel[:] = quat_rotate_inverse(self.base_quat, self.rigid_state[:, self.imu_indices, 10:13])
else:
self.base_quat = self.root_states[:, 3:7]
self.base_lin_vel[:] = quat_rotate_inverse(self.base_quat, self.root_states[:, 7:10])
Expand Down Expand Up @@ -490,15 +490,15 @@ def _init_buffers(self):
self.dof_pos = self.dof_state.view(self.num_envs, self.num_dof, 2)[..., 0]
self.dof_vel = self.dof_state.view(self.num_envs, self.num_dof, 2)[..., 1]

self.rigid_state = gymtorch.wrap_tensor(rigid_body_state)#.view(self.num_envs, -1, 13)
self.rigid_state = gymtorch.wrap_tensor(rigid_body_state) # .view(self.num_envs, -1, 13)
self.rigid_state = self.rigid_state.view(self.num_envs, -1, 13)
# TODO(pfb30): debug this
# self.base_quat = self.root_states[:, 3:7]
origin = torch.tensor(self.cfg.init_state.rot, device=self.device).repeat(self.num_envs, 1)
origin = quat_conjugate(origin)

if self.imu_indices:
self.base_quat = quat_mul(origin, self.rigid_state[:, self.imu_indices, 3:7])
self.base_quat = quat_mul(origin, self.rigid_state[:, self.imu_indices, 3:7])
else:
self.base_quat = quat_mul(origin, self.root_states[:, 3:7])

Expand All @@ -508,7 +508,6 @@ def _init_buffers(self):
self.num_envs, -1, 3
) # shape: num_envs, num_bodies, xyz axis


# initialize some data used later on
self.common_step_counter = 0
self.extras = {}
Expand Down
2 changes: 1 addition & 1 deletion sim/envs/humanoids/stompypro_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class asset(LeggedRobotCfg.asset):

class terrain(LeggedRobotCfg.terrain):
# mesh_type = "plane"
mesh_type = 'trimesh'
mesh_type = "trimesh"
curriculum = False
# rough terrain only:
measure_heights = False
Expand Down
1 change: 0 additions & 1 deletion sim/sim2sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def run_mujoco(
input_data["imu_ang_vel.1"] = omega.astype(np.float32)
input_data["imu_euler_xyz.1"] = eu_ang.astype(np.float32)


input_data["buffer.1"] = hist_obs.astype(np.float32)

positions, actions, hist_obs = policy.run(None, input_data)
Expand Down

0 comments on commit 986c053

Please sign in to comment.