Optimal Real-Time Velocity Planner of a Battery Electric Vehicle in V2V Driving