Patent attributes
The technology relates to controlling a vehicle in an autonomous driving mode. In one instance, sensor data identifying an object in an environment of the vehicle may be received. A first path of a first trajectory where the vehicle will pass the object may be determined. A function is used to determining a first maximum speed of the vehicle based on a predetermined minimum lateral clearance between the object and the vehicle. The first maximum speed may be used to determine whether an actual lateral clearance between the object and the vehicle will meet the predetermined minimum lateral clearance. The determination of whether the actual lateral clearance will meet the predetermined minimum lateral clearance may be used to generate a first speed plan for the first trajectory. The vehicle may be controlled in the autonomous driving mode according to the first trajectory including the first speed plan and the first path.