Codes Used

 

Code Used in AR&D:

//Coasting Run Using Design 3
reverse(2);
celerate(4,0,30,3);
motorSpeed(4,30);
goFor(3);
brake(4);

//Power Braking Run Using Design 2
reverse(2);
celerate(4,0,30,3);
motorSpeed(4,30);
goFor(3);
reverse(4);
motorSpeed(4,30);
goFor(2);

//Coasting Run Using Design 4
celerate(1,0,50,3);
motorSpeed(1,50);
goFor(3);
brake(4);

// Power Braking Run Using Design 4
celerate(1,0,50,3);
motorSpeed(1,50);
goFor(3);
brake(1);
goFor(1);
motorSpeed(2,50);
goFor(2);

Code Used in Performance Test 1:

reverse(2);

celerate(2,0,50,1);

motorSpeed(2,50);

goToAbsolutePosition(181);

brake(2);

reverse(2);

int direction1 = getVehicleDirection();

while(direction1 == 1){

motorSpeed(2,50);

direction1 = getVehicleDirection();

}

//goFor(2);

brake(2);

goFor(7);

reverse(2);

motorSpeed(2,50);

goFor(2);

brake(2);

Code Used in Performance Test 2:

//AEV to gate

 

reverse(2);

celerate(2,0,58,1);

motorSpeed(2,58);

goToAbsolutePosition(135);

brake(2);

reverse(2);

goToAbsolutePosition(268);

int direction1 = getVehicleDirection();

while(direction1 == 1){

motorSpeed(2,43);

direction1 = getVehicleDirection();

}

brake(2);

 

//AEV at gate

 

goFor(7);

 

//AEV to Caboose

 

reverse(2);

motorSpeed(2,55);

goFor(2);

brake(2);

 

//AEV at Caboose

 

goFor(10);

 

//AEV to gate with caboose

 

reverse(4);

motorSpeed(4,58);

goFor(2);

Code Used in the Final Performance Test:

//AEV to gate

celerate(1,0,56,1);

motorSpeed(1,56);

goToAbsolutePosition(175);

brake(1);

reverse(1);

goToAbsolutePosition(290);

int direction1 = getVehicleDirection();

while(direction1 == 1){

motorSpeed(1,41);

direction1 = getVehicleDirection();

}

brake(1);

//AEV at gate

goFor(7);

//AEV to Caboose

reverse(1);

motorSpeed(1,55);

goFor(2.8);

brake(1);

//AEV at Caboose

reverse(4);

goToAbsolutePosition(630);

int direction2 = getVehicleDirection();

while(direction2 == 1){

motorSpeed(1,47);

direction2 = getVehicleDirection();

}

brake(1);

goFor(5);

//AEV to gate with caboose

//reverse(4);

motorSpeed(1,60);

goToRelativePosition(-171)

brake(1);

reverse(1);

goToRelativePosition(-49);

int direction3 = getVehicleDirection();

while(direction3 == 0){

motorSpeed(1,58);

direction3 = getVehicleDirection();

}

brake(1);

//AEV at gate with caboose

goFor(7);

//AEV to start with caboose

reverse(1);

motorSpeed(1,60);

goToAbsolutePosition(210);

brake(1);

reverse(1);

goToAbsolutePosition(140);

int direction4 = getVehicleDirection();

while(direction4 == 0){

motorSpeed(1,60);

direction4 = getVehicleDirection();

}

brake(1);

//AEV at start with caboose