I’m building a two wheels robotics simulator here https://gears.aposteriori.com.sg but noticed that the robot keeps sliding along the floor very slowly even when the wheels are not turning. I made a simple playground here https://playground.babylonjs.com/#IMD13Q#3 that demonstrates the problem (…the movement is very slow and can be hard to see).
I’m guessing that it’s a artifact cause by floating point inaccuracy, and have tried using setSleepingThresholds, but it doesn’t seem to do anything. I would have expected setSleepingThreshold to completely stop the body if movement is below the threshold. Am I understanding it wrong?
I’ve also tried setDamping, which reduces the sliding but does not eliminate it. It also messes with the movement of the robot when it is meant to move.
Other things I’ve tried unsuccessfully includes:
- Setting a high friction
- SetMotor(0) to stop wheels from turning (…wheels still turn slowly)
- Actively control the wheels to ensure the wheels stay in position (…wheels no longer turn, but the robot still slides along the floor)
Is there anyway to make the body sleep and stay perfectly still if the velocity is below a certain threshold?