From 68197a2fea2f5f523f58e349a56aa4f5a26917c1 Mon Sep 17 00:00:00 2001 From: Alexis DUBURCQ Date: Sun, 18 Feb 2024 02:29:56 +0100 Subject: [PATCH] [gym/common] Do not enforce 'dtMax'. (#727) --- data/bipedal_robots/atlas/atlas_v4_options.toml | 1 - .../common/gym_jiminy/common/envs/env_generic.py | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/data/bipedal_robots/atlas/atlas_v4_options.toml b/data/bipedal_robots/atlas/atlas_v4_options.toml index c45caa779..49c402981 100644 --- a/data/bipedal_robots/atlas/atlas_v4_options.toml +++ b/data/bipedal_robots/atlas/atlas_v4_options.toml @@ -8,7 +8,6 @@ tolRel = 1e-4 sensorsUpdatePeriod = 0.005 controllerUpdatePeriod = 0.005 logInternalStepperSteps = false -successiveIterFailedMax = 1000 randomSeedSeq = [0,] # ============== Contact dynamics =============== diff --git a/python/gym_jiminy/common/gym_jiminy/common/envs/env_generic.py b/python/gym_jiminy/common/gym_jiminy/common/envs/env_generic.py index da852ac2c..74434e133 100644 --- a/python/gym_jiminy/common/gym_jiminy/common/envs/env_generic.py +++ b/python/gym_jiminy/common/gym_jiminy/common/envs/env_generic.py @@ -60,6 +60,12 @@ from .internal import loop_interactive +# Maximum realtime slowdown of simulation steps before triggering timeout error +TIMEOUT_RATIO = 50 + +# Absolute tolerance when checking that observations are valid +OBS_CONTAINS_TOL = 0.01 + # Define universal bounds for the observation space FREEFLYER_POS_TRANS_MAX = 1000.0 FREEFLYER_VEL_LIN_MAX = 1000.0 @@ -73,8 +79,6 @@ SENSOR_GYRO_MAX = 100.0 SENSOR_ACCEL_MAX = 10000.0 -OBS_CONTAINS_TOL = 0.01 - LOGGER = logging.getLogger(__name__) @@ -1286,13 +1290,12 @@ def _setup(self) -> None: # Configure the low-level integrator engine_options = self.simulator.engine.get_options() engine_options["stepper"]["iterMax"] = 0 - engine_options["stepper"]["dtMax"] = min(0.02, self.step_dt) if self.debug: engine_options["stepper"]["verbose"] = True engine_options["stepper"]["logInternalStepperSteps"] = True # Set maximum computation time for single internal integration steps - engine_options["stepper"]["timeout"] = 2.0 + engine_options["stepper"]["timeout"] = self.step_dt * TIMEOUT_RATIO if self.debug: engine_options["stepper"]["timeout"] = 0.0