A non-transitory computer-readable medium comprising instructions which, when executed by a processor of a vehicle, cause the processor to perform operations comprising:
- determining, using at least one sensor of the vehicle, at least one vehicle current state parameter associated with a current state of the vehicle while driving, wherein the at least one vehicle current state parameter comprises a current position of the vehicle and a current side-slip angle of the vehicle;
- receiving a destination parameter describing a destination to be reached by the vehicle;
- receiving at least one route parameter describing a route starting at the current position of the vehicle and ending at the destination;
- determining a reference trajectory within one or more lanes along the route that minimizes an estimated power loss of the vehicle when traveling from the current position to the destination based on at least one vehicle estimated state parameter associated with estimated states of the vehicle along the route, the destination parameter and a traveling time, wherein the at least one vehicle estimated state parameter comprises at least one estimated side-slip angle of the vehicle;
- and
- controlling the driving of the vehicle along the reference trajectory.