v1.1.3; fix friction calc err (x0.4)

This commit is contained in:
wty-yy
2026-02-10 16:52:27 +08:00
parent 4086357ad5
commit 075e4cc5c7
9 changed files with 19 additions and 16 deletions

View File

@@ -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',
]

View File

@@ -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

View File

@@ -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)