Interface
In order to create an environment, use:
from osim.env import ProstheticsEnv
env = ProstheticsEnv(visualize=True)
Parameters:
visualize
- turn the visualizer on and off
Methods of ProstheticsEnv
reset(project = True)
Restart the enivironment.
The function returns:
observation
- a vector (ifproject = True
) or a dictionary describing the state of muscles, joints, and bodies in the biomechanical system.
step(action, project = True)
Make one iteration of the simulation.
action
- a list of continuous values in[0,1]
corresponding to excitation of muscles. The length of the vector is expected to be:22
and18
for3D
and2D
models without the prosthesis;19
and15
with a prosthesis.
The function returns:
-
observation
- a vector (ifproject = True
) or a dictionary describing the state of muscles, joints, and bodies in the biomechanical system. -
reward
- reward gained in the last iteration. -
done
- indicates if the move was the last step of the environment. This happens if either300
iterations were reached or the pelvis height is below0.6
meters. -
info
- for compatibility with OpenAI, currently not used.
change_model(model='3D', prosthetic=True, difficulty=0,seed=None)
Change model parameters. Your solution will be graded in the environment with difficulty = 2, prosthetic = True
and model = 3D
, yet it might be easier to train a simplified model first (where model = 2D
, difficulty = 0, prosthetic = False` is the simplest).
-
model
-3D
model can move in all directions,2D
one dimension is fixed, i.e. the model cannot fall to the left or right. -
prosthetic
- ifTrue
the right leg of the model is a prosthesis. -
difficulty
- For the 3D model:0
- go forward at 3 meters per second, (other values not used for now) -
seed
- starting seed for the random number generator. If the seed isNone
, generation from the previous seed is continued.
This function does not return any value. reset()
must be run after changing the model.