Page 1 of 1

Report the positions of a body using markers

Posted: Fri Sep 11, 2015 7:45 am
by ex10192
Hi,

I am trying to create a vector eqn, from a fixed point A in ground , to the center of a moving body B. I would like to know if I attach a marker(fixed) to the center point of body B, can I get the relative position data from the marker in global frame during the entire simulation.

Also could you please let me know which code to use to report the position of the marker in c++.

thanks

Nithin

Re: Report the positions of a body using markers

Posted: Fri Sep 11, 2015 8:57 pm
by jp123909
hi nithin,

I dont think marker is necessary to calculate the vector.
You can try:

Code: Select all


	SimTK::Vec3 B_com, B_cominGround;
	Model aModel("aModel");
	OpenSim::Body B_body = aModel.getBodySet().get("B_body");
        B_body.getMassCenter(B_com);
	SimTK::State s = aModel.initSystem();
	aModel.getSimbodyEngine().transformPosition(s, B_body, B_com, aModel.getGroundBody(),B_cominGround);
	
	SimTK::Vec3 PointAinGround;

	SimTK::Vec3 VectorToCalcate = B_cominGround - PointAinGround;


Re: Report the positions of a body using markers

Posted: Sat Sep 12, 2015 6:32 am
by ex10192
Dear Jiang,

Thank you so much for the idea and code. I will try it out and let you know of the result.

thanks a ton.

Nithin