Skip to content

Commit

Permalink
make sure we can extend the wrappers config
Browse files Browse the repository at this point in the history
  • Loading branch information
Armandpl committed Jan 18, 2024
1 parent 57c85c7 commit bb25273
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
15 changes: 7 additions & 8 deletions scripts/configs/wrappers/base_wrappers.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
- _target_: gymnasium.wrappers.TimeLimit
max_episode_steps: 1000

- _target_: furuta.rl.wrappers.HistoryWrapper
steps: 2
use_continuity_cost: True

- _target_: stable_baselines3.common.monitor.Monitor
wrappers:
- _target_: gymnasium.wrappers.TimeLimit
max_episode_steps: 1000
- _target_: furuta.rl.wrappers.HistoryWrapper
steps: 2
use_continuity_cost: True
- _target_: stable_baselines3.common.monitor.Monitor
7 changes: 4 additions & 3 deletions scripts/configs/wrappers/real_wrappers.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# import common wrappers between sim/real
defaults:
- base_wrappers
- base_wrappers@_here_

- _target_: furuta.rl.wrappers.GentlyTerminating
- _target_: furuta.rl.wrappers.ControlFrequency
wrappers:
- _target_: furuta.rl.wrappers.GentlyTerminating
- _target_: furuta.rl.wrappers.ControlFrequency
# - _target_: furuta.rl.wrappers.MCAPLogger
# use_sim_time: False
2 changes: 1 addition & 1 deletion scripts/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main(cfg: DictConfig):
seed_everything(env, cfg.seed, cfg.cudnn_deterministic)

# setup wrappers
for wrapper in cfg.wrappers:
for wrapper in cfg.wrappers.wrappers:
env = hydra.utils.instantiate(wrapper, env=env)

# don't paralelize if it's the real robot
Expand Down

0 comments on commit bb25273

Please sign in to comment.