v0.1.13; add 2.5 rad trunctation; add LevelPipeline binary search maximum terrain levels

This commit is contained in:
wty-yy
2025-12-22 22:57:20 +08:00
parent 6bbdceee2f
commit 50126ec9aa
24 changed files with 144 additions and 22 deletions

View File

@@ -152,7 +152,9 @@ class BaseGauge:
self.results['summary'][metric_name][quantile] = f"{mean:.4f} ± {std:.4f}"
save_path = Path(logger.log_dir) / "results.yaml"
self.results["terrain"] = f"{self.cfg.assets.terrain_name}"
self.results["terrain_name"] = self.cfg.assets.terrain_name
self.results["terrain_level"] = self.cfg.assets.terrain_level
with open(save_path, 'w') as file:
yaml.dump(self.results, file, allow_unicode=True, sort_keys=False)
yaml_str = yaml.dump(self.results, allow_unicode=True, sort_keys=False)

View File

@@ -14,7 +14,8 @@ class BaseGaugeConfig(Config):
write_tensorboard = False # Whether to write tensorboard logs
class assets:
terrain_name = "flat_0" # {type}_{level}
terrain_name = "flat"
terrain_level = 0
terrain_xml = '{ROBOGAUGE_ROOT_DIR}/resources/terrains/flat.xml'
terrain_spawn_pos = [0, 0, 0] # x y z [m], robot freejoint spawn position on the terrain

View File

@@ -13,6 +13,7 @@ class FlatGaugeConfig(BaseGaugeConfig):
gauge_class = 'BaseGauge'
class assets(BaseGaugeConfig.assets):
terrain_name = "flat_0" # {type}_{level}
terrain_name = "flat"
terrain_level = 0
terrain_xml = '{ROBOGAUGE_ROOT_DIR}/resources/terrains/flat.xml'
terrain_spawn_pos = [0, 0, 0] # x y z [m], robot freejoint spawn position on the terrain

View File

@@ -13,14 +13,15 @@ class SlopeGaugeConfig(BaseGaugeConfig):
gauge_class = 'BaseGauge'
class assets(BaseGaugeConfig.assets):
terrain_name = "slope_5" # {type}_{level}
terrain_name = "slope"
terrain_level = 10 # 1-10
terrain_xml = '{ROBOGAUGE_ROOT_DIR}/resources/terrains/slope/slope_10.xml'
terrain_spawn_pos = [0, 0, 0] # x y z [m], robot freejoint spawn position on the terrain
class goals:
class goals(BaseGaugeConfig.goals):
class target_pos_velocity: # goal to reach a target position by velocity command
enabled = True
target_pos = [4, 0, 2.0] # x y z [m], target position in the environment, used for target position goal
target_pos = [5, 0, 2.28] # x y z [m], target position in the environment, used for target position goal
lin_vel_x = 1.0 # +/- m/s
lin_vel_y = 1.0 # +/- m/s
ang_vel_yaw = 1.5 # +/- rad/s

View File

@@ -0,0 +1,26 @@
from robogauge.utils.config import Config
class TerrainLevelsConfig(Config):
class flat:
levels = [0]
targets = [[4, 0, 0]] # target positions for each level, if target goal is used
class slope:
levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
targets = [
[5, 0, 0.588],
[5, 0, 0.776],
[5, 0, 0.964],
[5, 0, 1.152],
[5, 0, 1.340],
[5, 0, 1.528],
[5, 0, 1.716],
[5, 0, 1.904],
[5, 0, 2.092],
[5, 0, 2.280],
]
class wave:
levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
targets = []

View File

@@ -13,7 +13,8 @@ class WaveGaugeConfig(BaseGaugeConfig):
gauge_class = 'BaseGauge'
class assets(BaseGaugeConfig.assets):
terrain_name = "wave_1" # {type}_{level}
terrain_name = "wave"
terrain_level = 1 # 1-10
terrain_xml = '{ROBOGAUGE_ROOT_DIR}/resources/terrains/wave/wave_1.xml'
terrain_spawn_pos = [1.5, 0, 1] # x y z [m], robot freejoint spawn position on the terrain