diff --git a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py index 647b6a5..544ff61 100644 --- a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py +++ b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py @@ -410,11 +410,16 @@ class DreamWaQTask(Go1WalkTask): # 游戏启发式地形课程(per-env,与上游一致) if not hasattr(self, '_terrain_origins'): - all_levels = np.repeat(np.arange(self._num_rows), self._num_cols) - all_indices = np.tile(np.arange(self._num_cols), self._num_rows) - all_origins = self._make_origins(all_levels, all_indices) - self._terrain_origins = all_origins.reshape(self._num_rows, self._num_cols, 2) - self._max_init_level = 0 # 从平地起步,靠课程升级 + all_origins = np.zeros((self._num_rows, self._num_cols, 2), dtype=np.float32) + half_x = self._border + self._num_cols * self._cell_size / 2.0 + half_y = self._border + self._num_rows * self._cell_size / 2.0 + for row in range(self._num_rows): + for col in range(self._num_cols): + cx = -half_x + self._border + col * self._cell_size + self._cell_size / 2 + cy = half_y - self._border - row * self._cell_size - self._cell_size / 2 + all_origins[row, col] = [cx, cy] + self._terrain_origins = all_origins + self._max_init_level = 5 # 上游原值,随机 0-5 起步 if num_reset > 0 and self._init_done and state is not None and hasattr(state, 'info'): old_info = state.info diff --git a/motrix_rl/src/motrix_rl/tasks/go1.py b/motrix_rl/src/motrix_rl/tasks/go1.py index ae4cd2e..681f5bd 100644 --- a/motrix_rl/src/motrix_rl/tasks/go1.py +++ b/motrix_rl/src/motrix_rl/tasks/go1.py @@ -112,7 +112,7 @@ class rslrl: # Runner 设置(严格对齐上游 LeggedRobotCfgPPO + Go1RoughCfgPPO) runner.seed = 5 # 上游 seed=5 - runner.max_iterations = 3000 + runner.max_iterations = 5000 # 2048 envs 需要更多迭代补偿采样量 runner.num_steps_per_env = 24 runner.experiment_name = "go1_dreamwaq_walk" runner.save_interval = 50 @@ -126,7 +126,7 @@ class rslrl: runner.algorithm.entropy_coef = 0.01 # 上游 Go1RoughCfgPPO runner.algorithm.desired_kl = 0.01 # 上游 0.01 (默认 0.008) runner.algorithm.clip_param = 0.2 - runner.algorithm.schedule = "fixed" # 固定 schedule,防止 noise_std 发散 + runner.algorithm.schedule = "adaptive" # 上游原值,前期 bug 已修 runner.algorithm.gamma = 0.99 runner.algorithm.lam = 0.95 runner.algorithm.max_grad_norm = 1.0 @@ -136,7 +136,7 @@ class rslrl: runner.actor.class_name = ( "motrix_rl.rslrl.torch.models.cenet_actor:CENetActorModel") runner.actor.hidden_dims = [512, 256, 128] - runner.actor.init_noise_std = 0.5 # 降低探索噪声,1024 envs 不需要太高 + runner.actor.init_noise_std = 1.0 # 上游原值,adaptive 会自行调节 # Critic:标准 MLPModel,输入 privileged_obs runner.critic.class_name = "MLPModel"