Python Joint Control

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 Joint Control

Post by Csongor Barabasi » Mon Nov 26, 2018 6:14 am

Hey people!

I would have a quick question. I manage to retrieve the jointSet of the model through model.getJointSet().

Then I manage to find different joints, for example the shoulder-arm joint through: jointset.get(x) (x is the index of the joint). This returns me a Joint type object.

I would like to ask how could I modify this joints coordinates? For example it has an 'arm_add_r' coordinate which moves the arm upside. And then display this result on the screen?

At the moment I am displaying the result through:
model.getVisualizer().show(model.state)
manager.integrate(10)

P.S: Also during this manager.integrate my model is falling downwards, exiting the screen. Why is it happening?

THANK YOU!

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Python Joint Control

Post by Dimitar Stanev » Mon Nov 26, 2018 10:59 am

I would have a quick question.
A quick question, is no guarantee of a quick answer, nor short.
I would like to ask how could I modify this joints coordinates? And then display this result on the screen?

Code: Select all

model.setUseVisualizer(True)
state = model.initSystem()
model.updCoordinateSet().get('arm_add_r').setValue(state, new_value)
model.getVisualizer().show(state)
P.S: Also during this manager.integrate my model is falling downwards, exiting the screen. Why is it happening?
When you call manager.integrate(10) you are running a forward dynamics simulation from t0 =0s to tf=10s. As gravity is acting on the model the model falls downwards. If you are interested only in visualizing the model you can update the coordinates, realize to position stage and then call the show method.

POST REPLY