Simulating Robot Wheels

Hello everyone,

I’m trying to create a navigation simulation for a 4-wheeled robot but I’m getting stuck on how to approach setting up the wheels. Ideally, I’d like to simulate as closely to reality as possible, so I’d like to be able to specify a torque on each wheel that causes it to rotate. So far, I’ve tried mostly wheel colliders, but I’ve played with putting rigid bodies on each wheel with a high friction physic material (without much luck).

Rotating the front wheels to create what the wheel collider calls a “steer angle” isn’t an option for the physical robot, so I don’t plan to use that in the simulation. To make the robot turn, I put more torque on the wheels on one side so they run faster than the wheels on the other. Unfortunately, this causes the robot to jitter quite a bit, and the object doesn’t turn as quickly as I would expect (even when difference in torque is very large).

I get the feeling that this isn’t what the wheel collider is intended to be used for… Does anyone have any advice as to how I would either resolve the issue with the wheel collider, or maybe a more clever way to achieve behavior I’m looking for?

Thanks in advance!

Alright, I think I’ve figured it out. The trick was not to use wheel colliders but to use actual wheel objects with rigidbodies instead. I tried this approach before but didn’t do it correctly. The key was adding angular drag on the rigidbodies of the wheels. This prevents the slower moving wheels from just rotating at the same speed as the fast moving ones.

I am looking for help:

Is there a set of equations for calculating motion when only two mecanum wheels are touching, i.e. when the robot moves over a bump and gets lifted up a bit.

Then we can use the wheel colliders to determine grounded-ness and change the force vectors based on how many wheels are touching

Note It is computationally intensive to accurately simulate true mecanum wheel friction / torque. Instead we calculate the motion and apply the force to the whole robot.