[ode-users] How to measure and output the contact force !

184 views
Skip to first unread message

feist201

unread,
Jul 13, 2010, 7:52:27 AM7/13/10
to ode-...@googlegroups.com

I want to measure the contact force because wheel and ground.So I use
-dJointSetFeedback
-dJointGetFeedback. But I have many questions in those function .

First question!
In NearCallBack(void *data, dGeomID o1, dGeomID o2) ,I use next function to
get the Collision Number :
n = dCollide (o1,o2,N,&contact[0].geom,sizeof(dContact));
But: I think the contact point should be one point because wheel and ground
is flat ,why "n=2" when I debug it .

Second question!
I need find the wheel's ID to output the contactforce ,so I use the next
function to find body:

if (o1==wheel[0].geom && o2==ground||o2==wheel[0].geom && o1== ground).
But I can not entry this If ,because "O1" is not right ,and I use another
function to find the condition!
if (contact[i].geom.g1==wheel[0].geom && contact[i].geom.g2==
ground||contact[i].geom.g2==wheel[0].geom && contact[i].geom.g1== ground)

So why ?It should be use the first condition is OK !

Third question!
When I get the "contact_data->t1" ,I confused the struct from Ode's manual :
typedef struct dJointFeedback {
dVector3 f1; // force that joint applies to body 1
dVector3 t1; // torque that joint applies to body 1
dVector3 f2; // force that joint applies to body 2
dVector3 t2; // torque that joint applies to body 2
} dJointFeedback;

If it is an contact joint ,so Why f1<>f2 and t1<>t2?

furthermore , f1 is a dVector3 , so the force should be f1[0],f1[1],f1[2],
So how to get the force in contact pos Normal vector?
For example ,if Normal vector is P[0],P[1],P[2]
The force should be :P[0]*f1[0]+P[1]*f1[1]+P[2]*f1[2] ?


--
View this message in context: http://old.nabble.com/How-to-measure-and-output-the-contact-force-%21-tp29149498p29149498.html
Sent from the ODE mailing list archive at Nabble.com.

German

unread,
Oct 12, 2011, 11:26:03 AM10/12/11
to feist201, ode-...@googlegroups.com
Hi. Did you happen to solve your third question (regarding differences
in the feedback values)?

> View this message in context:http://old.nabble.com/How-to-measure-and-output-the-contact-force-%21...

dpap...@gmail.com

unread,
Oct 12, 2011, 12:34:03 PM10/12/11
to ode-users
Well the manual seems quite clear: Every joint is attached to two
bodies. You do it yourself so presumably you know which is body is
which but in any case you can find out with dJointGetBodies. So f1 is
the force applied to the first body, and f2 the force applied to the
second body and the same goes for torques.

As for why there are pairs of forces and torques it's because the
third law of Sir Isaac Newton holds for everything, even for contacts
so that for every action there is a reaction. So if the wheel is the
first body and the ground is the second f1 is the force exerted by the
contact (or the ground if you prefer) to the wheel and f2 the force
with which the wheel pushes back on the ground via the joint.

The part about the force along the normal answers itself.

Dimitris
Reply all
Reply to author
Forward
0 new messages