Skip to content

five-on-it / packages/ai/src/steer-vehicle

packages/ai/src/steer-vehicle ​

Driving a car: the route to a goal (a clear straight line over the car's grid, else the road graph from the node ahead to the node nearest the goal with the lane centres as waypoints, else A* over the car grid), pure pursuit of a point ahead on the route that moves out with speed, a speed held to the car's lateral grip in the bend being steered and in the corners coming up, the gap kept behind a target or the ram into its rear quarter, a three-point turn when the goal is behind, and the stall recovery (reverse away, then, for a profile that leaves cars, get out). Everything ends in an ordinary input: throttle, steer (positive turns left), handbrake, boost.

Interfaces ​

Variables ​

Functions ​