stanfordnmbl / osim-rl

Reinforcement learning environments with musculoskeletal models
http://osim-rl.stanford.edu/
MIT License
894 stars 249 forks source link

Update osim.py #102

Closed gautam1858 closed 6 years ago

gautam1858 commented 6 years ago

Here at each time you are creating different random targets, so changing it to make a single target so that the arm can try to reach the specified target position

kidzik commented 6 years ago

Thank you for your contribution @gautam1858. The point of the generate_new_target function is really to set a new random target. If you don't want to change targets after reset then it's probably better to parametrize the reset function https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/osim.py#L535-L539

to something like

def reset(self, random_target = True):
    obs = super(Arm2DEnv, self).reset()
    if random_target:
        self.generate_new_target()
    self.osim_model.reset_manager()
    return obs

and then in your code yau can call env.reset(random_target = False)

gautam1858 commented 6 years ago

ok cool :)