-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gym_jiminy/rllib] Fix eval runner connector states. (#870)
* [gym_jiminy/common] Fix 'MechanicalPowerConsumption' not exposed. * [gym_jiminy/common] Add support of 'horizon=None' to MechanicalPowerConsumptionTermination. * [gym_jiminy/rllib] Rename 'build_eval_runner_from_checkpoint' in 'build_runner_from_checkpoint'. * [gym_jiminy/rllib] Fix eval runner connector stats not sync w/ eval. * [gym_jiminy/rllib] Fix eval runner connector updated during sample collection. * [misc] Add pipeline benchmark script. * [misc] Fix Sphinx doc (github-pages) broken refs.
- Loading branch information
Showing
12 changed files
with
141 additions
and
30 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 |
---|---|---|
|
@@ -5,4 +5,6 @@ Quantities | |
:maxdepth: 1 | ||
|
||
generic | ||
manager | ||
transform | ||
locomotion |
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,6 @@ | ||
Manager | ||
======= | ||
|
||
.. automodule:: gym_jiminy.common.quantities.manager | ||
:members: | ||
:show-inheritance: |
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,6 @@ | ||
Transform | ||
========= | ||
|
||
.. automodule:: gym_jiminy.common.quantities.transform | ||
:members: | ||
:show-inheritance: |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Observation Layout Adaptation | ||
============================= | ||
|
||
.. automodule:: gym_jiminy.common.wrappers.observation_filter | ||
.. automodule:: gym_jiminy.common.wrappers.observation_layout | ||
:members: | ||
:show-inheritance: |
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,52 @@ | ||
import os | ||
|
||
os.environ["OMP_NUM_THREADS"] = "1" | ||
os.environ["OPENBLAS_NUM_THREADS"] = "1" | ||
os.environ["MKL_NUM_THREADS"] = "1" | ||
os.environ["VECLIB_MAXIMUM_THREADS"] = "1" | ||
os.environ["NUMEXPR_NUM_THREADS"] = "1" | ||
os.environ["NUMBA_NUM_THREADS"] = "1" | ||
|
||
import time | ||
from functools import reduce, partial | ||
|
||
from gym_jiminy.envs import AtlasPDControlJiminyEnv | ||
from gym_jiminy.common.wrappers import ( | ||
FilterObservation, | ||
NormalizeAction, | ||
NormalizeObservation, | ||
FlattenAction, | ||
FlattenObservation) | ||
|
||
env = reduce( | ||
lambda env, wrapper: wrapper(env), ( | ||
FlattenObservation, | ||
FlattenAction, | ||
partial(NormalizeObservation, ignore_unbounded=True), | ||
NormalizeAction | ||
), FilterObservation( | ||
AtlasPDControlJiminyEnv( | ||
# std_ratio={'disturbance': 4.0}, | ||
debug=False | ||
), | ||
nested_filter_keys=( | ||
# 't', | ||
# ('states', 'agent', 'q'), | ||
# ('states', 'agent', 'v'), | ||
("states", "pd_controller"), | ||
# ('states', 'mahony_filter'), | ||
# ('measurements', 'ImuSensor'), | ||
# ('measurements', 'ForceSensor'), | ||
("measurements", "EncoderSensor"), | ||
("features", "mahony_filter"), | ||
), | ||
), | ||
) | ||
|
||
# Run in 30.7s on jiminy==1.8.11 (29.7s with PGO, 28.4s with eigen-dev) | ||
env.reset() | ||
action = env.action | ||
time_start = time.time() | ||
for _ in range(100000): | ||
env.step(action) | ||
print("time elapsed:", time.time() - time_start) |
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