Python Scripting Question

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Csongor Barabasi
Posts: 6
Joined: Thu Oct 18, 2018 12:17 am

Python Scripting Question

Post by Csongor Barabasi » Sun Nov 18, 2018 10:07 am

Hey dear community!

I am trying to get my head around OpenSim scripting. Unfortunately the documentation for Python is not perfect. So I would like to ask if anybody could help me in this. I would like to load up a full body model (which I could not find, with upper and lower body muscles) and just visualize it on the screen.

After that my plans are to control those muscle and joint activations from code, so my model starts moving.

Could you help me please?

Thanks!

Tags:

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Python Scripting Question

Post by Christopher Dembia » Sun Nov 18, 2018 1:45 pm

Code: Select all

import opensim
m = opensim.Model('<filename>')
m.setUseVisualizer(True)
state = m.initSystem()
m.getVisualizer().show(state)

User avatar
Csongor Barabasi
Posts: 6
Joined: Thu Oct 18, 2018 12:17 am

Re: Python Scripting Question

Post by Csongor Barabasi » Mon Nov 19, 2018 1:39 am

Thank you for your help! :D

POST REPLY