Explanation of Sky Higher Source Code

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
shayan moradkhani
Posts: 41
Joined: Fri May 05, 2017 5:12 pm

Explanation of Sky Higher Source Code

Post by shayan moradkhani » Thu Jul 13, 2017 1:27 pm

hi,
on "http://simtk-confluence.stanford.edu:80 ... ource+Code" there is code to get the velocity of center of mass: " Vec3 COM_velocity = osimModel.getMultibodySystem().getMatterSubsystem().calcSystemMassCenterVelocityInGround(osimState);"

and on "http://simtk-confluence.stanford.edu:80 ... timization" there is another one:
"osimModel.getSimbodyEngine().getVelocity(s,osimModel.getBodySet().get("r_ulna_radius_hand"),
massCenter, velocity);"

i dont get the difference between these two?
do both of them give velocity at each time of simulation?

also there is a settleTime defined for sky higher. if the simulation starts from the feet having contact with ground and then jumping why this is needed: " A settleTime is added so that the feet can come off initially without the event handler terminating the simulation early"?
i appreciate your help

regards
Shayan

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Explanation of Sky Higher Source Code

Post by jimmy d » Thu Jul 13, 2017 2:11 pm

One uses the Simbody MatterSubsystem() to get Velocity, and the other uses the SimbodyEngine() to get the Velocity.

The difference in the examples is probably due to when the tutorials were built (one may be newer than the other).
A settleTime is added so that the feet can come off initially without the event handler terminating the simulation early"?
yes

Code: Select all

	// keep returning a positive value while the contact settles out
        double simTime = s.getTime();
        if (simTime < settleTime) {
            return 100.0;
        }

POST REPLY