Bullet vs ODE for simulating robotic systems

edualbu
Posts: 3
Joined: Tue Aug 05, 2014 11:06 pm

Re: Bullet vs ODE for simulating robotic systems

Post by edualbu »

Thanks a lot, Basroil.

I'm also interested in the questions Yvan Bourquin asked about Bullet a long time ago. Here are the questions:

"...
1. (Can Bullet Engine) Find out how much force is applied on a specific body and what is the direction (vector) of that force, in order to implement "force" or "pressure" sensors. Something equivalent to ODE's dJointFeedback struct.

2. Find out the position and normal vectors of contact points/edges of collision detection. This is necessary to provide visual feedback about the collision to our users. Something equivalent to ODE's dContactGeom.

3. Find out how much torque/force is currently used by a hinge/slider motor while moving or maintaining the current position (motor force feedback).
..."

These points are very important for my project. Do someone has any information about that?

Thanks for the help,

Eduardo
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Bullet vs ODE for simulating robotic systems

Post by Basroil »

edualbu wrote: 1. (Can Bullet Engine) Find out how much force is applied on a specific body and what is the direction (vector) of that force, in order to implement "force" or "pressure" sensors. Something equivalent to ODE's dJointFeedback struct.
Does it? Not really in 2.82. Can it be modified to include it? Sure, though the difficulty will vary depending on what you want to do. Applied forces are based on the body center, so if you need the force vectors at the contact point (rather than equivalent forces), you'll have to work backwards a bit (might impact performance). You could also intercept the constraints results themselves, though you risk problems if you aren't careful.
edualbu wrote: 2. Find out the position and normal vectors of contact points/edges of collision detection. This is necessary to provide visual feedback about the collision to our users. Something equivalent to ODE's dContactGeom.
There are plenty of contact demos included in the bullet code base, and there's just about every case covered.
edualbu wrote: 3. Find out how much torque/force is currently used by a hinge/slider motor while moving or maintaining the current position (motor force feedback).
..."

These points are very important for my project. Do someone has any information about that?

Thanks for the help,

Eduardo
Since motors are just constraints, the question is identical to question 1. Though, you might not even have to worry about that if you use imperfect motors (non-infinite torque), since any proportional motor can give you basic feedback simply in the motor error (low accuracy, but usually good enough).
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by Erwin Coumans »

Basroil wrote:
edualbu wrote: 1. (Can Bullet Engine) Find out how much force is applied on a specific body and what is the direction (vector) of that force, in order to implement "force" or "pressure" sensors. Something equivalent to ODE's dJointFeedback struct.
Does it? Not really in 2.82. Can it be modified to include it? Sure, though the difficulty will vary depending on what you want to do. Applied forces are based on the body center, so if you need the force vectors at the contact point (rather than equivalent forces), you'll have to work backwards a bit (might impact performance). You could also intercept the constraints results themselves, though you risk problems if you aren't careful.
You can use setJointFeedback on each constraint, similar to ODE, see
https://github.com/bulletphysics/bullet ... aint.h#274
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Bullet vs ODE for simulating robotic systems

Post by Basroil »

Erwin Coumans wrote: You can use setJointFeedback on each constraint, similar to ODE, see
https://github.com/bulletphysics/bullet ... aint.h#274
Misread his statement as saying "by a specific body" rather than "on a specific body" :(

Edualbu, disregard my other answer, it was just my mistake.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Bullet vs ODE for simulating robotic systems

Post by Basroil »

Erwin Coumans wrote: You can use setJointFeedback on each constraint, similar to ODE, see
https://github.com/bulletphysics/bullet ... aint.h#274
Rereading one more time and following through all affected code, I noticed that only sequential impulse and multibody solvers seem to have joint feedback actually implemented (modifies 4 variables from m_appliedForceBodyA to m_appliedTorqueBodyB in some way, looks like an exact copy for all intents and purposes). Would it be safe to assume that the c.m_appliedImpulse for MLCP can be used identically to the one found at the end of group solve finish in multibody and sequential impulse?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by Erwin Coumans »

Basroil wrote:
Erwin Coumans wrote: You can use setJointFeedback on each constraint, similar to ODE, see
https://github.com/bulletphysics/bullet ... aint.h#274
Rereading one more time and following through all affected code, I noticed that only sequential impulse and multibody solvers seem to have joint feedback actually implemented (modifies 4 variables from m_appliedForceBodyA to m_appliedTorqueBodyB in some way, looks like an exact copy for all intents and purposes). Would it be safe to assume that the c.m_appliedImpulse for MLCP can be used identically to the one found at the end of group solve finish in multibody and sequential impulse?
Basroil, you are reading the code of the latest https://github.com/bulletphysics/bullet3 trunk/master version, right?
I recall hooking up the MLCP joint feedback, but haven't looked into it recently.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Bullet vs ODE for simulating robotic systems

Post by Basroil »

Erwin Coumans wrote:
Basroil wrote: Basroil, you are reading the code of the latest https://github.com/bulletphysics/bullet3 trunk/master version, right?
I recall hooking up the MLCP joint feedback, but haven't looked into it recently.
Yes, github bullet3 master with commit af5883c being the last modification to that file. I would have assumed that joint feedback would have been done within a solver finish function but none exists. Is the underlying SI code (inherited) being used in place of a dedicated solver finish and i'm just confusing the need for a custom version? (very likely, since it it's mostly cleanup)
Post Reply