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
Report the positions of a body using markers
- Nithin Kurup
- Posts: 149
- Joined: Sat Jan 18, 2014 5:13 am
- Jiang Ping
- Posts: 132
- Joined: Sun Aug 26, 2012 4:09 am
Re: Report the positions of a body using markers
hi nithin,
I dont think marker is necessary to calculate the vector.
You can try:
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;
- Nithin Kurup
- Posts: 149
- Joined: Sat Jan 18, 2014 5:13 am
Re: Report the positions of a body using markers
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
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