Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Sat Dec 17, 2011 7:14 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
Mako_energy02 wrote:
The tray is a single rigid body, but it does have a compound shape composed of a few boxes.

I would doubt whether this is the root for this problem. If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?


Top
 Profile  
 
PostPosted: Sat Dec 17, 2011 10:30 pm 
Offline

Joined: Sun Jan 17, 2010 4:47 am
Posts: 143
Quote:
If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?


I get all the information for the constraint from the btPersistentManifold for the two objects. I have a somewhat complicated collision reporting system built around the construction and destruction of collision algorithms and their manifolds. Totally unrelated but that was harder to pull off then it should have been and I kinda wish that system would be improved. =\

Anyway, when one of my collision report classes is constructed, it gets the data of the two objects from the collision algorithm/contact manifold.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 7:43 am 
Offline

Joined: Mon Jul 19, 2010 3:11 am
Posts: 49
If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)

have you done any of those things?


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 10:02 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
Mako_energy02 wrote:
Quote:
If you initialize the GenericConstraint, you need to specify two rigid objects, how did you do that ?


I get all the information for the constraint from the btPersistentManifold for the two objects. I have a somewhat complicated collision reporting system built around the construction and destruction of collision algorithms and their manifolds. Totally unrelated but that was harder to pull off then it should have been and I kinda wish that system would be improved. =\

Anyway, when one of my collision report classes is constructed, it gets the data of the two objects from the collision algorithm/contact manifold.

Actually, I am not asking how you retrieve the collision information, but how you initialize the constraint ?


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 10:03 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
marios wrote:
If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)

have you done any of those things?

I can understand that the second step may help avoid unnecessary collisions. But how the first one helps ?


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 11:52 am 
Offline

Joined: Mon Jul 19, 2010 3:11 am
Posts: 49
Dr.Shepherd wrote:
marios wrote:
If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)

have you done any of those things?

I can understand that the second step may help avoid unnecessary collisions. But how the first one helps ?


no,no, these things are not how to avoid the problem but I think that they may cause it. So I am asking if Mako_energy02 has set any of these


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 8:08 pm 
Offline

Joined: Sun Jan 17, 2010 4:47 am
Posts: 143
Dr.Shepherd wrote:
Actually, I am not asking how you retrieve the collision information, but how you initialize the constraint ?


Well the information in the collision is 90% of everything the constraint needs. Unless you are asking what other functions I call on to configure it...which all I call on is locking all linear and angular axes.

Exact code:
Code:
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);
NewSticky->SetAngularLimitLower(Vector3());
NewSticky->SetAngularLimitUpper(Vector3());
NewSticky->SetLinearLimitLower(Vector3());
NewSticky->SetLinearLimitUpper(Vector3());


"this" is the actual object set to stick to other things. Both are rigid bodies internally. As I said the transforms are from the btPersistentManifold of the collision, as are the rigid bodies. Vector3's automatically set themselves to (0,0,0) when initialized without parameters.

marios wrote:
If this help: this issue also happen to me, and only customized things I have are:
- world scaled by 64, so sphere with radius 64 corresponds to the sphere with radius 1 while normal usage of bullet
- simulation locked to pure 2d setLinearFactor(1,1,0) and setAnguarFactor(0,0,1)

have you done any of those things?


I actually do both. I have my world scaled by 100 though, trying to simulate down to centimeters. And all the objects that move are locked out of moving on the Z axis(setLinearFactor(1,1,0)), but are free to rotate on all axes.

Edit: following this vein of thought I disabled the locking of the Z axis movement to see if that had an impact and it did not. Constraint is still extremely erratic and unstable with completely free movement.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 10:27 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
Code:
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);

Yeah, actually, this is what I asked for. I suppose "ActorA" is the green stone, and "this" is the tray ? Or the other way around ?

The question is that your tray is a compound shape, and it is composed of several rigidbodies (Ra, Rb, Rc). Assuming that you initialize your constraint with (Ra, Stone), even though you disable the collision detection between Ra and Stone, the collision between Rb, Rc and Stone will result in this erratic rotation.


Top
 Profile  
 
PostPosted: Sun Dec 18, 2011 10:55 pm 
Offline

Joined: Sun Jan 17, 2010 4:47 am
Posts: 143
Dr.Shepherd wrote:
Code:
Generic6DofConstraint* NewSticky = new Generic6DofConstraint(ActorA,this,TransA,TransB);

Yeah, actually, this is what I asked for. I suppose "ActorA" is the green stone, and "this" is the tray ? Or the other way around ?


Other way around.

Dr.Shepherd wrote:
The question is that your tray is a compound shape, and it is composed of several rigidbodies (Ra, Rb, Rc). Assuming that you initialize your constraint with (Ra, Stone), even though you disable the collision detection between Ra and Stone, the collision between Rb, Rc and Stone will result in this erratic rotation.


This is very incorrect. A compound collision shape does not need or use multiple rigid bodies. It just has child collision shapes. There are only two collision objects involved in this collision whatsoever.


Top
 Profile  
 
PostPosted: Mon Dec 19, 2011 9:14 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
Oh, yeah, Sorry, I messed up with the notion of Collisionshapes and collisionobjects.

Emmm, then I am lost right now....


Top
 Profile  
 
PostPosted: Mon Dec 19, 2011 4:58 pm 
Offline

Joined: Sun Jan 17, 2010 4:47 am
Posts: 143
Dr.Shepherd wrote:
Oh, yeah, Sorry, I messed up with the notion of Collisionshapes and collisionobjects.

Emmm, then I am lost right now....


Regarding the setup and initialization? Or regarding the cause of the issue?

If the latter then I am right there with you. Honestly this seems to be some obscure low level thing that only Erwin can probably comment on. But he hardly checks the forums anymore.


Top
 Profile  
 
PostPosted: Mon Dec 19, 2011 7:33 pm 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
I mean the latter one...

We lack help from the people who wrote these codes at the earliest. It makes some problems difficult to deal with.


Top
 Profile  
 
PostPosted: Tue Dec 20, 2011 8:54 pm 
Offline

Joined: Tue Dec 20, 2011 7:46 pm
Posts: 2
I've encountered what appears to be the exact same behavior in a slightly different context. In the process of experimenting with the various types of constraints, I created two identical cubes with a constraint between them as seen in figs 3, 4, and 5 of the Bullet User Manual. All the other constraints seemed to work fine, but when I tried the btGeneric6DofConstraint I ended up with a crazily colliding system like Mako described.

For example, this slider constraint behaved exactly as I expected:

Code:
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();

btSliderConstraint *slider = new btSliderConstraint(bodyA, bodyB, localA, localB, true);
slider->setLowerLinLimit(3.0f);
slider->setUpperLinLimit(10.0f);
slider->setLowerAngLimit(0.0f);
slider->setUpperAngLimit(0.0f);
mWorld->addConstraint(slider, true);


While this generic6dof constraint caused the two-cube system to cartwheel wildly all over the place, constantly gaining energy:

Code:
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btGeneric6DofConstraint *genericConst = new btGeneric6DofConstraint(bodyA,bodyB, localA, localB,true);
genericConst->setLinearLowerLimit(btVector3(3,0,0));
genericConst->setLinearUpperLimit(btVector3(10,0,0));
genericConst->setAngularLowerLimit(btVector3(1,0,0));
genericConst->setAngularUpperLimit(btVector3(0,0,0));
mWorld->addConstraint(genericConst, true);


Mako, it sounds like you could get away with a btSliderConstraint constraint with a locked linear limit; based on my observations, you might want to try that. I'd still love to know what's going wrong though.


Top
 Profile  
 
PostPosted: Wed Dec 21, 2011 2:18 am 
Offline

Joined: Sun Jan 17, 2010 4:47 am
Posts: 143
Demarche wrote:
Mako, it sounds like you could get away with a btSliderConstraint constraint with a locked linear limit; based on my observations, you might want to try that. I'd still love to know what's going wrong though.


This was a really good idea, and I updated my code to test this...but it doesn't appear to have changed the behavior. I triple checked the modified code and even built clean because it seems unlikely that the behavior would be completely unchanged, but none of that seems to have worked. =\


Top
 Profile  
 
PostPosted: Wed Dec 21, 2011 10:17 am 
Offline
User avatar

Joined: Tue Jan 04, 2011 11:47 pm
Posts: 165
Demarche wrote:
While this generic6dof constraint caused the two-cube system to cartwheel wildly all over the place, constantly gaining energy:

Code:
btTransform localA, localB;
localA.setIdentity();
localB.setIdentity();
btGeneric6DofConstraint *genericConst = new btGeneric6DofConstraint(bodyA,bodyB, localA, localB,true);
genericConst->setLinearLowerLimit(btVector3(3,0,0));
genericConst->setLinearUpperLimit(btVector3(10,0,0));
genericConst->setAngularLowerLimit(btVector3(1,0,0));
genericConst->setAngularUpperLimit(btVector3(0,0,0));
mWorld->addConstraint(genericConst, true);


Hi, in your code, I noticed that the upper limit for angular is less than the lower limit. Would you please edit these values and try again to see if that works ?

Cheers !


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

All times are UTC


Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 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