v1.0.2; fix init reset forever bug

This commit is contained in:
wty-yy
2025-12-31 13:14:17 +08:00
parent de7d740012
commit ad339f9466
4 changed files with 22 additions and 3 deletions

18
.vscode/launch.json vendored
View File

@@ -24,7 +24,7 @@
"request": "launch",
"program": "${workspaceFolder}/robogauge/scripts/run.py",
"args": [
"--task", "go2_moe.slope",
"--task", "go2_moe.slope_bd",
"--experiment-name", "debug",
"--seed", "0",
// "--search-max-level",
@@ -34,5 +34,21 @@
],
"console": "integratedTerminal"
},
{
"name": "go2 mcp stairs_bd load",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/robogauge/scripts/run.py",
"args": [
"--task", "go2_moe.stairs_bd",
"--model-path", "/data/user/wutianyang/Coding/robotics/go2_rl_gym/logs/go2_mcp_cts/Dec31_01-21-01_/jit_models/policy_jit_0.pt",
"--experiment-name", "mcp_debug",
"--seed", "3",
"--level", "8",
"--frictions", "0.5",
],
"env": {"DISPLAY": ":1"},
"console": "integratedTerminal"
},
]
}

View File

@@ -1,4 +1,7 @@
# UPDATE
## 20251231
### v1.0.2
Fix Bug: 当reset初始化静止站立, 可能存在模型连站都站不住, 导致机器人侧翻, 并恰好让target投影到本体坐标系下的xy接近0, 误以为到达了终点, 修改静止站立过程中不让重置环境
## 20251230
### v1.0.1
1. quality_score到每个step时计算, 结果更加准确, 可以有效避免站立也能获得高score得分的问题 (因为平均后的score可能相对比较高, 而每一步的score都非常低)

View File

@@ -36,7 +36,7 @@ class BaseGauge:
self.goals_cfg = class_to_dict(self.cfg.goals)
self.metrics_cfg = class_to_dict(self.cfg.metrics)
self.goal_str = ""
self.goal_str = "Init"
self.goal_idx = 0
self.goals: List[BaseGoal] = []
self.metrics: List[function] = []

View File

@@ -107,7 +107,7 @@ class BasePipeline:
self.sim.setup_action(action, p_gains, d_gains, control_type)
sim_data = self.sim.step()
self.gauge.update_metrics(sim_data, goal_data)
if self.gauge.is_reset(sim_data):
if not self.first_reset and self.gauge.is_reset(sim_data):
sim_data = self.reset_sim_and_robot(sim_data)
except Exception as e:
if str(e).startswith("[Penetration Error]"):