v0.1.13 finish all goals eval (even crash)

This commit is contained in:
wty-yy
2025-12-22 20:37:43 +08:00
parent 989332b951
commit 6bbdceee2f
13 changed files with 94 additions and 29 deletions

View File

@@ -45,3 +45,6 @@ class BaseRobot:
action = np.zeros(self.num_action, dtype=np.float32)
return action, self.p_gains, self.d_gains, self.control_type
def reset(self):
""" Reset model state/history if needed """
pass

View File

@@ -53,6 +53,10 @@ class Go2(BaseRobot):
raise NotImplementedError(f"Goal type '{goal_data.goal_type}' not implemented in Go2 robot.")
return obs
def reset(self):
self.last_action = np.zeros(self.num_action, dtype=np.float32)
self.model.reset() # reset history
def get_action(self, obs: np.ndarray):
obs_tensor = torch.tensor(obs, dtype=torch.float32).unsqueeze(0).to(self.device)
action = self.model(obs_tensor).detach().cpu().numpy().squeeze(0)[self.model2mj_idx]

View File

@@ -48,7 +48,7 @@ class Go2Config(RobotConfig):
class commands(RobotConfig.commands):
lin_vel_x = [-2.0, 2.0] # min max [m/s]
lin_vel_y = [-1.0, 1.0] # min max [m/s]
lin_vel_y = [-2.0, 2.0] # min max [m/s]
lin_vel_z = None # min max [m/s]
ang_vel_roll = None # min max [rad/s]
ang_vel_pitch = None # min max [rad/s]