v0.1.12 add all slope levels; plot radar with bar

This commit is contained in:
wty-yy
2025-12-22 00:32:59 +08:00
parent 59522777c9
commit 989332b951
32 changed files with 503 additions and 258 deletions

View File

@@ -21,7 +21,7 @@ class RobotConfig(Config):
class control:
device = 'cpu'
# torch script model path
model_path = "{ROBOGAUGE_ROOT_DIR}/resources/models/go2/go2_cts_83501.pt"
model_path = "{ROBOGAUGE_ROOT_DIR}/resources/models/go2/go2_cts_max2_100k.pt"
control_dt = 0.02 # 50 Hz
control_type = 'P' # Position control
support_goal: Literal['velocity', 'position'] = 'velocity'

View File

@@ -20,7 +20,7 @@ class Go2Config(RobotConfig):
class control(RobotConfig.control):
device = 'cpu'
model_path = "{ROBOGAUGE_ROOT_DIR}/resources/models/go2/go2_cts_83501.pt"
model_path = "{ROBOGAUGE_ROOT_DIR}/resources/models/go2/go2_cts_max2_100k.pt"
# model_path = "{ROBOGAUGE_ROOT_DIR}/resources/models/go2/go2_cts_cmd-1,1_38k.pt"
control_dt = 0.02 # 50 Hz
control_type = 'P' # Position control
@@ -47,8 +47,8 @@ class Go2Config(RobotConfig):
cmd = [2.0, 2.0, 0.25]
class commands(RobotConfig.commands):
lin_vel_x = [-1.5, 1.5] # min max [m/s]
lin_vel_y = [-1, 1] # min max [m/s]
lin_vel_x = [-2.0, 2.0] # min max [m/s]
lin_vel_y = [-1.0, 1.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]

View File

@@ -15,7 +15,12 @@ from robogauge.tasks.robots.go2.go2 import Go2
class Go2MoE(Go2):
def get_action(self, obs: np.ndarray):
obs_tensor = torch.tensor(obs, dtype=torch.float32).unsqueeze(0).to(self.device)
action, weights = self.model(obs_tensor)
action, results = self.model(obs_tensor)
if isinstance(results, tuple):
weights, latent = results
latent = latent.detach().cpu().numpy().squeeze(0)
else:
weights = results
action = action.detach().cpu().numpy().squeeze(0)[self.model2mj_idx]
weights = weights.detach().cpu().numpy().squeeze(0)
self.last_action = action