From 075e4cc5c7700f6a208d4fe3125d5015197c09f5 Mon Sep 17 00:00:00 2001 From: wty-yy Date: Tue, 10 Feb 2026 16:52:27 +0800 Subject: [PATCH] v1.1.3; fix friction calc err (x0.4) --- CMD.md | 8 ++++---- README.md | 2 +- README_zh.md | 2 +- UPDATE.md | 3 +++ resources/terrains/flat.xml | 2 +- robogauge/scripts/server.py | 2 +- robogauge/tasks/simulator/mujoco_config.py | 2 +- robogauge/tasks/simulator/mujoco_simulator.py | 12 ++++++------ setup.py | 2 +- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CMD.md b/CMD.md index 3815bdb..01566a9 100644 --- a/CMD.md +++ b/CMD.md @@ -38,7 +38,7 @@ python robogauge/scripts/run.py \ --multi \ --num-processes 5 \ --seeds 0 1 2 \ - --frictions 0.5 1.0 1.5 2.0 2.5 \ + --frictions 0.2 0.4 0.6 0.8 1.0 \ --compress-logs \ --headless @@ -49,7 +49,7 @@ python robogauge/scripts/run.py \ --multi \ --num-processes 5 \ --seeds 0 1 2 \ - --frictions 2.0 \ + --frictions 0.8 \ --level 10 \ --spawn-type level_eval \ --goals max_velocity diagonal_velocity\ @@ -68,7 +68,7 @@ python robogauge/scripts/run.py \ --search-max-level \ --seeds 0 1 2 \ --search-seeds 0 1 2 3 4 \ - --frictions 1.0 \ + --frictions 0.4 \ --compress-logs \ --headless ``` @@ -85,7 +85,7 @@ python robogauge/scripts/run.py \ --num-processes 50 \ --seeds 0 1 2 \ --search-seeds 0 1 2 3 4 \ - --frictions 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 \ + --frictions 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 \ --compress-logs \ --headless ``` diff --git a/README.md b/README.md index 6dfb02d..9045649 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ All evaluations are run with configured domain randomization (DR). Below are com | - | - | - | | Random action execution delay | `action delay` | `<= RL control interval` | | Base payload mass | `base mass` | `-1, 0, 1, 2, 3 kg` | -| Ground friction | `friction` | `0.4, 0.7, 1.0, 1.3, 1.6` | +| Ground friction | `friction` | `0.2 ~ 1.0 (step 0.1)` | #### Terrains diff --git a/README_zh.md b/README_zh.md index 8e804a5..1649c83 100644 --- a/README_zh.md +++ b/README_zh.md @@ -100,7 +100,7 @@ while True: | - | - | - | | 电机动作执行随机延迟 | `action delay` | `<= RL控制间隔` | | base负重 | `base mass` | `-1, 0, 1, 2, 3 kg` | -| 地面摩擦力 | `friction` | `0.4, 0.7, 1.0, 1.3, 1.6` | +| 地面摩擦力 | `friction` | `0.2 ~ 1.0 (step 0.1)` | #### 地形 1. 支持legged_gym中的部分地形, 包括: `wave, slope, stairs up, stairs down, obstacles, flat`, 除`flat`地形外其他地形可进行难度系数提升 diff --git a/UPDATE.md b/UPDATE.md index d1e2a66..e888f46 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -1,4 +1,7 @@ # UPDATE +## 20260210 +### v1.1.3 +1. 修复摩擦计算问题,之前的所有stress的摩擦*0.4后才是真实摩擦系数,所以之前用的摩擦范围是0.2~1.0,步长0.1 ## 20260204 ### v1.1.2 1. 加入手柄JoystickGoal功能 diff --git a/resources/terrains/flat.xml b/resources/terrains/flat.xml index 37afcce..6fda676 100644 --- a/resources/terrains/flat.xml +++ b/resources/terrains/flat.xml @@ -18,6 +18,6 @@ - + \ No newline at end of file diff --git a/robogauge/scripts/server.py b/robogauge/scripts/server.py index 2c1ba85..bc879a8 100644 --- a/robogauge/scripts/server.py +++ b/robogauge/scripts/server.py @@ -42,7 +42,7 @@ default_args_list = [ # '--num-processes', '30', # Set in CLI '--seeds', '0', '1', '2', '--search-seeds', '0', '1', '2', '3', '4', - '--frictions', '0.5', '0.75', '1.0', '1.25', '1.5', '1.75', '2.0', '2.25', '2.5', + '--frictions', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0', '--compress-logs', '--headless', ] diff --git a/robogauge/tasks/simulator/mujoco_config.py b/robogauge/tasks/simulator/mujoco_config.py index 9750e05..7a9a33d 100644 --- a/robogauge/tasks/simulator/mujoco_config.py +++ b/robogauge/tasks/simulator/mujoco_config.py @@ -36,7 +36,7 @@ class MujocoConfig(Config): # Setup by config file, ensure evaluation coverage base_mass = 0.0 # [kg], {-1, 0, 1, 2, 3} - friction = 1.0 # [N.s/m], {0.4, 0.7, 1.0, 1.3, 1.6} + friction = 0.0 # [N.s/m], {0.4, 0.7, 1.0, 1.3, 1.6} class noise: # Uniform noise diff --git a/robogauge/tasks/simulator/mujoco_simulator.py b/robogauge/tasks/simulator/mujoco_simulator.py index 1b73113..6301df8 100644 --- a/robogauge/tasks/simulator/mujoco_simulator.py +++ b/robogauge/tasks/simulator/mujoco_simulator.py @@ -126,13 +126,13 @@ class MujocoSimulator: logger.info(f"Randomized base mass: {original_mass:.3f} -> {new_mass:.3f} kg") # Domain randomization: friction - if self.cfg.domain_rand.friction != 1.0: + if self.cfg.domain_rand.friction != 0.0: for i in range(self.mj_model.ngeom): - # Both change robot friction and terrain friction, usually robot friction < 1.0 - # Mujoco friction calculation takes the *max* between two contacting geoms - geom_friction = self.mj_model.geom_friction[i] - geom_friction[0] *= self.cfg.domain_rand.friction - self.mj_model.geom_friction[i] = geom_friction + # Both change robot friction and terrain friction + # If one of the two geoms has higher priority, the friction of that geom is used. + # If both geoms have the save priopirty, the maximum of the two friction is used. + # (Go2 foot friction is 0.4 and priority is 1, terrain priority is 0 except floor) + self.mj_model.geom_friction[i][0] = self.cfg.domain_rand.friction logger.info(f"Scaled geom friction by factor: {self.cfg.domain_rand.friction:.3f}") mujoco.mj_forward(self.mj_model, self.mj_data) diff --git a/setup.py b/setup.py index 8ff0ea2..54a4676 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="robogauge", # 包名 - version="1.1.2", # 版本号 + version="1.1.3", # 版本号 author="Wu Tianyang", # 你的名字 author_email="993660140@qq.com", description="A generic robot RL model evaluation library based on MuJoCo",