CylinderShape collision bumpy, unstable

SagiCZ
Posts: 4
Joined: Tue May 06, 2014 10:31 pm

CylinderShape collision bumpy, unstable

Post by SagiCZ »

Hello,

I am trying to simulate wheels using CylinderShape. However the wheel sometimes hits non-existence objects and stops abruptly. I have limited my scene to a tilted floor and single wheel only. The problem persist.

Should I use any collision margin?

How can I increase the number of sides my cylinder has? I don't see any options in the constructor aside from half extents.

How can I solve the bumpy collisions?

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

Re: CylinderShape collision bumpy, unstable

Post by Basroil »

Looks like you are using a triangle mesh for the ground, sure it's not just stopping at the triangle edges?
SagiCZ
Posts: 4
Joined: Tue May 06, 2014 10:31 pm

Re: CylinderShape collision bumpy, unstable

Post by SagiCZ »

I am positive it is not hiting the edge on the floor, because the weird behavior occurs way after it passes this edge.

Also I did not aim for triangle floor, I have used simple BoxShape so I don't understand why it consist of triangles. :(
SagiCZ
Posts: 4
Joined: Tue May 06, 2014 10:31 pm

Re: CylinderShape collision bumpy, unstable

Post by SagiCZ »

Okay, I guess I found some solutions. For anyone trying to use collision cylinders as wheels on your vehicles (especially robots), this is what I did. Note that I am a beginner and some of these might not help you.
  • Crank up your precision if you can afford it. Don't overdo it or the whole simulation slows down.
  • Change broadphase type to axis sweep
  • Make sure that your vehicle parts have comparable sizes and weights. Keep them close real-life sizes.
  • Fiddle with friction values of wheels, add some angular damping to them. Increase floor friction.
  • Add collision margins to your cylinders, around 5% of their diameter to avoid internal edge collisions.
  • Make sure you zero out all restitution of your floor and wheels.
  • Disable auto-sleeping for debugging to see if there are some phantom collisions.
  • To disable free-running of your motors, enable joint motor with high impulse but zero speed.
I have also found out that the cylinders have infinite number of subdivisions, because the collision algorithm checks the distance from the center. Some debug visualization just show some simple cylinder mesh with not enough subdivisions to be even round.