-
Notifications
You must be signed in to change notification settings - Fork 1
Simulation considerations
Although the implementation proves to be robust and accurate, it is not perfect and has several limitations, for example:
- Car transmission is not simulated in detail; instead, the “engine” applies a constant torque to the wheels;
- Parameter values used (such as car mass, car size/shape, friction factors, etc.) are neither normalised nor particularly realistic;
- Due to Bullet’s current integrator parameters, the system never reaches a full rest state despite a reasonable damping value is applied to rigid bodies;
- When turning left and right, the car always drifts a little since steering implementation means just rotating front wheels. To prevent this issue and provide more stability and handling, Ackermann steering geometry must be taken into account so that wheels have different steering circle radii.
- Code is not fully optimised.
Bullet's built-in btRaycastVehicle
class implements a ready-made rigid body and constraint system used for simulating vehicles. It differs from the current implementation because it does not model a vehicle using rigid bodies, but instead it computes interactions between its collision shapes and the external world and updates its internal state accordingly.
Such differences show up when focusing on the stability of the simulation under stress conditions: while the btGeneric6DofSpringConstraints
in the current simulation are computed by the constraint solver - which is a soft-constraint solver, thus it may stop before the constraints are solved, if the maximum number of iterations is reached - the btRaycastVehicle
deals with constraints in a slightly different way, giving higher priority to the parent relationship between the “frame” and its “wheels”, resulting in a visually more compact (and constrained) vehicle.
Simulating a vehicle using the rigid bodies approach is not recommended because of performance issues. Nonetheless, the current simulation succeeds when it comes to stability and - to a certain degree - realism.