diff --git a/src/C++/Driver/src/test.cpp b/src/C++/Driver/src/test.cpp index 3a5cc56..411d7a6 100644 --- a/src/C++/Driver/src/test.cpp +++ b/src/C++/Driver/src/test.cpp @@ -15,6 +15,7 @@ int main() { unsigned char *null_ptr(0); robot.startCommunication("/dev/ttyUSB0", true, null_ptr); usleep(1 * 1000 * 1000); + std::cout << "choose between forward and rotate" << endl; thread mv(command); usleep(30 * 1000 * 1000); mv.join(); // only exit once thread one is done running @@ -22,29 +23,26 @@ int main() { int checkCenterCliff() { while (true) { - std::cout << "cliffsensordata:" << robot.parser.data.CliffSensorCenter - << std::endl; + std::cout << "cliffsensordata:" << robot.parser.data.CliffSensorCenter << std::endl; } } int checkWheelDrop() { while (true) { - std::cout << "wheeldropdata:" << robot.parser.data.WheelDropLeft - << std::endl; + std::cout << "wheeldropdata:" << robot.parser.data.WheelDropLeft << std::endl; } } int command() { char input; - std::cout << "choose between forward and rotate" << endl; std::cout << "What must the robot do?"; - cin >> input; + std::cin >> input; switch (input) { case FORWARD: { int distance; std::cout << "Enter distance to move forward: "; - cin >> distance; + std::cin >> distance; robot.goStraight(distance); } break; @@ -53,8 +51,6 @@ int command() { std::cout << "Enter angle to rotate: "; std::cin >> angle; robot.doRotation(angle); - robot.goStraight(-1); - } break; default: