![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Code to drive Team 1's robot for the 2016 R5 robotics competition.
Dependencies: mbed navigation R5_StepperDrive LongRangeSensor DistanceSensor scanner Gripper ColorSensor
Diff: r5driver.cpp
- Revision:
- 41:029135230ebf
- Parent:
- 40:2d33bb4d6d6f
- Child:
- 42:1284491771ff
diff -r 2d33bb4d6d6f -r 029135230ebf r5driver.cpp --- a/r5driver.cpp Fri Apr 08 01:36:13 2016 +0000 +++ b/r5driver.cpp Fri Apr 08 04:36:00 2016 +0000 @@ -44,7 +44,7 @@ bluetooth.printf("\nLong Range Sensors created"); StepperDrive drive(bluetooth, PTE19, PTE18, 1, PTE3, PTE2, 0, 10.0625, - 8.2, 700); // 8.4800 + 8.1875, 700); // 8.4800 /* (serial &, stepPinLeft, dirPinLeft, invertLeft, stepPinRight, dirPinRight, invertRight, wheelCircum, wheelSepar, periodUs) */ @@ -230,7 +230,7 @@ pc.printf("\nBack up to a safe turn around location"); bluetooth.printf("\nBack up to a safe turn around location"); r5map.localizeLeftReverse(); - reverseMove(drive, 6.0, 0); + reverseMove(drive, 8.0, 0); // wait for move to complete while(!drive.isMoveDone()) { @@ -242,7 +242,7 @@ // turn 180 degrees to left pc.printf("\nTurn left 180 degrees"); bluetooth.printf("\nTurn left 180 degrees"); - drive.move(0, -180.0*(3.14159/180)); + drive.move(0, -185.0*(3.14159/180)); // wait for move to complete while(!drive.isMoveDone()) { @@ -270,7 +270,7 @@ /* back up to safe turn-around location */ pc.printf("\nBack up to a safe turn around location"); bluetooth.printf("\nBack up to a safe turn around location"); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); reverseMove(drive, 2.0, 0); // wait for move to complete while(!drive.isMoveDone()) @@ -278,7 +278,7 @@ wait(1e-6); } r5map.setVertex(34); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); reverseMove(drive, 7.0, 0); // wait for move to complete while(!drive.isMoveDone()) @@ -286,7 +286,7 @@ wait(1e-6); } r5map.setVertex(33); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); reverseMove(drive, 7.0, 0); // wait for move to complete while(!drive.isMoveDone()) @@ -294,7 +294,7 @@ wait(1e-6); } r5map.setVertex(32); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); reverseMove(drive, 7.0, 0); // wait for move to complete while(!drive.isMoveDone()) @@ -302,7 +302,7 @@ wait(1e-6); } r5map.setVertex(31); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); reverseMove(drive, 6.0, 0); // wait for move to complete while(!drive.isMoveDone()) @@ -310,7 +310,7 @@ wait(1e-6); } r5map.setVertex(30); - r5map.localizeLeftReverse(); + r5map.newLocalizeLeftReverse(); target = RED_DROP_ZONE;