-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1da6f8c
commit 3e35827
Showing
3 changed files
with
13 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
import gym | ||
import myosuite | ||
import time | ||
from deprl import env_wrappers | ||
from deprl.dep_controller import DEP | ||
|
||
import gym | ||
import myosuite # noqa | ||
|
||
from deprl import env_wrappers | ||
from deprl.dep_controller import DEP | ||
|
||
env = gym.make('myoLegWalk-v0') | ||
env = gym.make("myoLegWalk-v0") | ||
env = env_wrappers.GymWrapper(env) | ||
|
||
# You can also use SconeWrapper for Wrapper | ||
# env = env_wrappers.SconeWrapper(env) | ||
dep = DEP() | ||
dep.initialize(env.observation_space, env.action_space) | ||
|
||
env.reset() | ||
for i in range(1000): | ||
action = dep.step(env.muscle_lengths())[0,:] | ||
print(action.shape) | ||
action = dep.step(env.muscle_lengths())[0, :] | ||
next_state, reward, done, _ = env.step(action) | ||
time.sleep(0.01) | ||
time.sleep(0.005) | ||
env.mj_render() | ||
|
||
|
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