-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gym/common] Fix filtering and normalization wrappers.
- Loading branch information
Showing
3 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" TODO: Write documentation | ||
""" | ||
import unittest | ||
from functools import reduce | ||
|
||
from gym_jiminy.envs import AtlasPDControlJiminyEnv | ||
from gym_jiminy.common.wrappers import ( | ||
FilterObservation, | ||
NormalizeAction, | ||
NormalizeObservation, | ||
FlattenAction, | ||
FlattenObservation, | ||
) | ||
|
||
|
||
class Wrappers(unittest.TestCase): | ||
""" TODO: Write documentation | ||
""" | ||
def test_filter_normalize_flatten_wrappers(self): | ||
env = reduce( | ||
lambda env, wrapper: wrapper(env), | ||
( | ||
NormalizeObservation, | ||
NormalizeAction, | ||
FlattenObservation, | ||
FlattenAction | ||
), | ||
FilterObservation( | ||
AtlasPDControlJiminyEnv(debug=False), | ||
nested_filter_keys=( | ||
("states", "pd_controller"), | ||
("measurements", "EncoderSensor"), | ||
("features", "mahony_filter"), | ||
), | ||
), | ||
) | ||
env.reset() | ||
env.step(env.action) |