get angular accelerations of mobilized bodies in computeControls method (C++)
Posted: Tue Aug 22, 2017 4:06 pm
Hello,
I was developing my own controller in order to control a joint of a pendulum. I've created class that derives from the Controller class. The thing is that I'm interested in obtain angular acceleration from the "Mobilizedbodies" in the method "void computeControls()", but when I call getBodyAngularAcceleration, an error occours:
terminate called after throwing an instance of 'SimTK::Exception::CacheEntryOutOfDate'
what(): SimTK Exception thrown at StateImpl.h:1678:
State Cache entry was out of date at Stage Dynamics. This entry depends on version 1 of Stage Dynamics but was last updated at version 0.
In order to try to solve this, I've tried calling _model->updMultibodySystem().realize(s,SimTK::Stage::Acceleration) before calling the method that give the accelerations but it doesn't work.
https://www.dropbox.com/s/55sc6i8a5qv1q ... s.png?dl=0
Any idea how to solve this?
Thanks
I was developing my own controller in order to control a joint of a pendulum. I've created class that derives from the Controller class. The thing is that I'm interested in obtain angular acceleration from the "Mobilizedbodies" in the method "void computeControls()", but when I call getBodyAngularAcceleration, an error occours:
terminate called after throwing an instance of 'SimTK::Exception::CacheEntryOutOfDate'
what(): SimTK Exception thrown at StateImpl.h:1678:
State Cache entry was out of date at Stage Dynamics. This entry depends on version 1 of Stage Dynamics but was last updated at version 0.
In order to try to solve this, I've tried calling _model->updMultibodySystem().realize(s,SimTK::Stage::Acceleration) before calling the method that give the accelerations but it doesn't work.
https://www.dropbox.com/s/55sc6i8a5qv1q ... s.png?dl=0
Any idea how to solve this?
Thanks