Branch data Line data Source code
1 : : #include "calibration.h" 2 : : #include "vehicle.h" 3 : : 4 : 10 : DriverIntention getDriverIntention(const Vehicle vehicle){ 5 : : 6 : 10 : DriverIntention driverIntention = DRIVE_INTENTION_NOTHING; 7 : : 8 [ + + ]: 10 : if( vehicle.angleBrakePedal > VehicleMinBrakePedal ) 9 : : { 10 : 3 : driverIntention = DRIVE_INTENTION_REDUCE_SPEED; 11 : : } 12 : : else 13 : : { 14 [ + + ]: 7 : if( vehicle.angleAccPedal > VehicleMinAccPedal ) 15 : : { 16 : 3 : driverIntention = DRIVE_INTENTION_INCREASE_SPEED; 17 : : } 18 : : else 19 : : { 20 : 4 : driverIntention = DRIVE_INTENTION_NOTHING; 21 : : } 22 : : } 23 : : 24 : 10 : return driverIntention; 25 : : }