Joints feedback
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Joints feedback
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)
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)
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Joints feedback
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
Joint feedback was broken in 2.75. Can you try latest Bullet trunk or wait for Bullet 2.76 later this week?
Thanks,
Erwin
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
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 !
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 !
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
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
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.
As suggested i've installed the 2.76 and i don't find the Joints feedback. I've found the
Code: Select all
btScalar getAppliedImpulse() const
Is there another function i missed ?
Thank you.
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
Hi,
Really not idea on how to get joint feedback ?
Thanks
Really not idea on how to get joint feedback ?
Thanks
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: Joints feedback
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
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
-
- Posts: 2
- Joined: Mon Feb 09, 2009 12:55 pm
Re: Joints feedback
That would be great cause we are also needed this feedback.
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: Joints feedback
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:
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
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: Select all
const btVector3& btRigidBody::getDeltaLinearVelocity() const;
const btVector3& btRigidBody::getDeltaAngularVelocity() const;
const btVector3& btRigidBody::getPushVelocity() const;
const btVector3& btRigidBody::getTurnVelocity() const;
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
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
Hi,
Thank you for this information.
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
Thank you for this information.
In fact we use to work with the JointFeedback in ODE (every joint can collect the force/torque applied to body(ies)).forces that are added by a single constraint row during the solving process are considered as an intermediate result and has no useful meaning
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
-
- Posts: 96
- Joined: Mon Nov 03, 2008 9:57 pm
Re: Joints feedback
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.
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
It is exactly the same for me: i would like to create torque/force sensor along and around joint axes ...
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: Joints feedback
Hello,
OK, I understand now what is needed.
I'll add this possibility soon and keep you posted.
Thanks,
Roman
OK, I understand now what is needed.
I'll add this possibility soon and keep you posted.
Thanks,
Roman
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: Joints feedback
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)
As far as I understand you need them separated for each axis.
Is this correct?
Thanks,
Roman
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: Select all
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;
Is this correct?
Thanks,
Roman
-
- Posts: 35
- Joined: Mon Jul 20, 2009 12:58 pm
Re: Joints feedback
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 !
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 !
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Joints feedback
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
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