Page 1 of 1

Issue with Vehicle Drifting

Posted: Thu Jun 23, 2022 4:01 pm
by ewmtb
Hi all, so I have been simulating a rover and have created keyboard controls to move the rover, turn its wheels, and adjust its camera. To move/rotate the wheels, the wheel position and corner bracket angle are stepped by a small increment each time the corresponding arrow is pressed. The movement seems pretty smooth; however, I have been having an issue where as the rover moves, it gradually begins to drift towards a cardinal direction. Like if the yaw of the rover is 70 degrees, it will drift until it is traveling at 90 degrees, and if the yaw is 30 degrees, it will drift to 0. To try to prevent this from happening, I have gone into the URDF to ensure that all the wheels are level and adjusted the rolling and spinning friction between the wheels and ground using p.changeDynamics. None of these changes have stopped the rover from drifting. Even when I put spinning friction so high that the rover could no longer turn when its wheels rotated, it still would drift when moving. So it seems like the drift is not caused by the wheels shifting a bit while the rover moves, but rather by the whole body sort of just translationally moving with time. Any ideas on how to stop this?

Re: Issue with Vehicle Drifting

Posted: Mon Jun 27, 2022 4:36 am
by sgold
You probably shouldn't be moving the wheels directly. To control a Bullet raycast vehicle, apply acceleration, steering, and braking using applyEngineForce(), setSteeringValue(), and setBrake().