Post
by shayan moradkhani » Thu Jun 29, 2017 11:41 pm
hi,
thank you very much indeed for your help. it takes quite a long time till i get the handle of OpenSim. the current state of my model is now it falls with gravity and hits the ground bodies and fairly raches static equilibrium. my ultimate goal is to tell the system: start the simulation from 1st resting position and see what is maximum force you can tolerate before slip, then start with 2nd resting position and tell your Fmax, then 3rd,.... (the rest position must have contact with both ground bodies)
my resting positions take only x,y, and z letting three rotational coordinates to change with x,y,and z.
for the force i suppose i have to use: "void setPointFunctions (Function *pointX, Function *pointY, Function *pointZ)
Set the functions which specify the point at which to apply the force. More... "
and "void setForceFunctions (Function *forceX, Function *forceY, Function *forceZ)
Set the functions which specify the force to apply. More..."
i suppose those above functions give me the ability to define my force function, point, and direction.
how can i access the velocity of center of mass of my body during simulation? i am trying to design a controller which takes the velocity of center of mass as input, compares it with a limit for the velocity of center of mass (which i define), and if not exceeding the limit, applying a force (as output) and increasing it over time until the body starts to move. as soon as the velocity goes over the limit, simulation needs to be stopped, printing the maximum force.
i read about body kinematics, but it looks like, that the kinematics will be stored somewhere after simulation. what i need is velocity during simulation.
i also found the following codes on "re. getVelocity() function" and i dont really know if it is useful for me:
Vec3 massCenter;Vec3 velocity;
osimModel.getBodySet().get("hand").getMassCenter(massCenter);
osimModel.getMultibodySystem().realize(s, Stage::Velocity);
osimModel.getSimbodyEngine().getVelocity(s,osimModel.getBodySet()
.get("hand"),massCenter, velocity);
at this stage, I want to be able to run this simulation once, then i will try to start simulation with different coordinate values.
in advance i appreciate your help once more
regards
Shayan
Last edited by
shayan moradkhani on Tue Jul 04, 2017 4:44 am, edited 2 times in total.