stanfordnmbl / osim-rl

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

opensim API changed #89

Closed atypic closed 6 years ago

atypic commented 6 years ago

Hi,

the opensim API has changed (4.0 beta) and osim is now incompatible. In particular (from opensim changelog).

After:

kidzik commented 6 years ago

Hi! In this repository we are using OpenSim 4.0 beta and the new API. Can you tell us more about the error you get when you run the code?

chrisdembia commented 6 years ago

@kidzik this change to the API occurred in the last month or two.

atypic commented 6 years ago

I compiled the latest commit of opensim. The SWIG interface generated does not match the calls in osim-rl/blob/master/osim/env/osim.py.

In particular, python complains that manager no longer has setFinalTime(). This matches with the changelog in opensim, as manager interface now has changed.

I tried naively replacing the integration steps in osim-rl with the suggested replacements in the opensim changelog, but it failed to work with my code. I then abandoned this attempt to wait for you guys to figure out the deeper effects of the API changes :-)

kidzik commented 6 years ago

Thanks for the info! We will have a new conda release soon (in a few weeks), and I will look into the wrapper soon (in a few days). As you mentioned, it should be somewhere here https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/osim.py#L174-L179 Nevertheless, for osim-rl the current conda environment should have all the needed functionality. If you want to recompile, for now you can start from the same opensim-core commit 399c8d57a779dd5dde2916192f8b92bfc959e269

atypic commented 6 years ago

Thanks, I found the magic opensim-core commit that has flags for building python 3 swift-bindings, but still uses the old API by dissecting :-)

I guess this can be closed since there is a plan for moving forward, and maybe there should be a more descriptive issue created than my rambling.

kidzik commented 6 years ago

We've just got it fixed for the new environments https://github.com/stanfordnmbl/osim-rl/blob/be43d746486ead238031cf9105c0e54de23b2133/osim/env/generic.py#L263-L268 Soon all the environments will be mapped to subclasses of GenericEnv.