Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Joints feedback
PostPosted: Mon Feb 22, 2010 4:57 pm 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hi,

I'm trying to get joints feedback to know how many force/torque the joint applied on bodies in order to preserve the constraint.

By looking at the code it seems that i have to use btVector3& getAppliedLinearImpulse() to retrieve the value(s).

But the returned vector is always = 0 ! (i've activated the needsfeedback).

Looking at where the variable btTypedConstraint::m_appliedLinearImpulse is filled, i found that this variable is never filled in.
It is used in :

Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(55): btVector3 m_appliedLinearImpulse;
Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(193): return m_appliedLinearImpulse;
Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(199): return m_appliedLinearImpulse;

And getAppliedAngularImpulse :
Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(176):
Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(190): const btVector3& getAppliedLinearImpulse() const
Bullet\src\BulletDynamics\ConstraintSolver\btTypedConstraint.h(196): btVector3& getAppliedLinearImpulse()

So, it seems that this variable is never used, never filled ....

I'm missing something ?

Thank you for your help (using Bullet 2.75)


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Mon Feb 22, 2010 11:55 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
You need to use btTypedConstaint::getAppliedImpulse.

Joint feedback was broken in 2.75. Can you try latest Bullet trunk or wait for Bullet 2.76 later this week?
Thanks,
Erwin


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Tue Feb 23, 2010 9:58 am 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hi,

If i understand, btTypedConstaint::getAppliedImpulse returns a scalar. in my case i need the 3 length of the force ...

I will wait for the 2.76 and will give a feedback about that.

Thank you for the response !


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Thu Mar 11, 2010 4:51 pm 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hi, i come back with the JointFeedback:

As suggested i've installed the 2.76 and i don't find the Joints feedback. I've found the
Code:
btScalar   getAppliedImpulse() const


But it gives a 'scalar' (instead of vectors) : it is not possible to deduce the force and torque applied on X,Y and Z for body BBB...

Is there another function i missed ?

Thank you.


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Sun Mar 14, 2010 10:39 am 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hi,

Really not idea on how to get joint feedback ?

Thanks


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Wed Mar 17, 2010 12:32 am 
Offline
User avatar

Joined: Sat Mar 08, 2008 12:37 am
Posts: 56
Hello,

Unfortunately for now there are no functions that return applied impulse in vector form.
However it looks like they could be added easily.
I'll do that soon and post a notice here.

Thanks,
Roman


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Wed Mar 17, 2010 11:02 am 
Offline

Joined: Mon Feb 09, 2009 12:55 pm
Posts: 2
That would be great cause we are also needed this feedback.


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Wed Mar 17, 2010 7:09 pm 
Offline
User avatar

Joined: Sat Mar 08, 2008 12:37 am
Posts: 56
Hello,

As of r2069 I've added several access functions to get velocities applied by solver to rigid body
at one simulation step. These functions are defined as:

Code:
const btVector3& btRigidBody::getDeltaLinearVelocity() const;
const btVector3& btRigidBody::getDeltaAngularVelocity() const;
const btVector3& btRigidBody::getPushVelocity() const;
const btVector3& btRigidBody::getTurnVelocity() const;


The last two functions works only if Split Impulse Mode is set.

Note, that these functions returns the result of ALL constraint forces acting to body.
IMHO, forces that are added by a single constraint row during the solving process are considered as an intermediate result and has no useful meaning

Thanks,
Roman


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Wed Mar 17, 2010 9:58 pm 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hi,

Thank you for this information.

Quote:
forces that are added by a single constraint row during the solving process are considered as an intermediate result and has no useful meaning


In fact we use to work with the JointFeedback in ODE (every joint can collect the force/torque applied to body(ies)).

Getting the TOTAL forces/torque applied to the body is not very useful for us, because we have to know what is the joint/axe that is the origin of the force/torque.

when you say "as an intermediate result and has no useful meaning" : does it mean that the result, for each joint, has really no meaning ? or is it only your opinion ?

Thank you


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Thu Mar 18, 2010 6:46 pm 
Offline
User avatar

Joined: Mon Nov 03, 2008 9:57 pm
Posts: 96
To give an example of why I would also like to know constraint force, our robot can sense torque on the servos, and can use this information for adaptive manipulation as a "sense of touch". It would be useful if the simulation could provide corresponding information, otherwise we cannot simulate torque and pressure sensors, and therefore cannot test and debug algorithms which use this data in simulation.


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Thu Mar 18, 2010 10:03 pm 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
It is exactly the same for me: i would like to create torque/force sensor along and around joint axes ...


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Fri Mar 19, 2010 6:42 pm 
Offline
User avatar

Joined: Sat Mar 08, 2008 12:37 am
Posts: 56
Hello,

OK, I understand now what is needed.
I'll add this possibility soon and keep you posted.

Thanks,
Roman


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Fri Mar 19, 2010 7:52 pm 
Offline
User avatar

Joined: Sat Mar 08, 2008 12:37 am
Posts: 56
Hello again,

Looks like ODE keeps the sum of constraint forces applied by joint to bodies in world space,
and not for each constraint axis.

http://opende.sourceforge.net/wiki/inde ... _Functions)

Code:
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;


As far as I understand you need them separated for each axis.
Is this correct?

Thanks,
Roman


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Sat Mar 20, 2010 5:04 pm 
Offline

Joined: Mon Jul 20, 2009 12:58 pm
Posts: 35
Hello,

yes, each joint stores in a structure dJointFeedback the force and torque applied to body1 and body2 separately.
The values are stored in world space.

Another thing very interesting: because contact-points are joints-like constraints, it is also possible to get force/torque information from contacts points feedback. the result is that it is possible to create force/torque sensors from:
-> joint axes
-> contacts points.

Thank you for your interest in this feature, i'm ready to test BETAs if you need ! :)


Top
 Profile  
 
 Post subject: Re: Joints feedback
PostPosted: Mon Mar 22, 2010 11:14 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
bonjovi,

ODE accumulates the feedback, and doesn't split them along individual axis. Are you happy with the dJointFeedback from ODE?

Note that Bullet can already provide the joint feedback from contact points: each contact stores the accumulated impulse and contact/friction directions.
Thanks,
Erwin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], jamesm6162 and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group