Report the positions of a body using markers

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Nithin Kurup
Posts: 149
Joined: Sat Jan 18, 2014 5:13 am

Report the positions of a body using markers

Post by Nithin Kurup » Fri Sep 11, 2015 7:45 am

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

User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: Report the positions of a body using markers

Post by Jiang Ping » Fri Sep 11, 2015 8:57 pm

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;


User avatar
Nithin Kurup
Posts: 149
Joined: Sat Jan 18, 2014 5:13 am

Re: Report the positions of a body using markers

Post by Nithin Kurup » Sat Sep 12, 2015 6:32 am

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

POST REPLY