v1.1.3; fix friction calc err (x0.4)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user