From 0db8ab3e2ff7c75a0bb817ddc4cb25fd4f3497a9 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Mon, 23 Sep 2024 13:50:14 +0200 Subject: [PATCH] movement test --- src/C++/Driver/src/main.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/C++/Driver/src/main.cpp b/src/C++/Driver/src/main.cpp index ad06838..8ec94c6 100644 --- a/src/C++/Driver/src/main.cpp +++ b/src/C++/Driver/src/main.cpp @@ -9,19 +9,27 @@ CKobuki robot; int main() { unsigned char * null_ptr(0); - + int text; robot.startCommunication("/dev/ttyUSB0", true, null_ptr); usleep(1*1000*1000); - - robot.goStraight(1); - - - + cout << "Enter commando"; + cin >> text; + if (text == 1) { + robot.goStraight(10); + } + if (text == 2) { + robot.doRotation(90); + } + if (text == 3) { + robot.doRotation(90); + } + else { + cout << "no text specified"; + } usleep(30*1000*1000); } - int checkCenterCliff() { while(true) { std::cout << "cliffsensordata:" << robot.data.CliffSensorCenter << std::endl;