From 5badea0c32eb99a7f6d528f96637215a936ac462 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Tue, 24 Sep 2024 14:41:20 +0200 Subject: [PATCH] threaded the movement of the robot --- src/C++/Driver/src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/C++/Driver/src/main.cpp b/src/C++/Driver/src/main.cpp index 7feb324..a12d8b9 100644 --- a/src/C++/Driver/src/main.cpp +++ b/src/C++/Driver/src/main.cpp @@ -16,6 +16,7 @@ int main() cout << "Enter commando"; thread mv(movement); usleep(30 * 1000 * 1000); + mv.join(); //only exit once thread one is done running } int checkCenterCliff() @@ -35,7 +36,7 @@ int movement() if (text == 1) { - robot.goStraight(1); + robot.goStraight(10); } else if (text == 2) { @@ -59,4 +60,4 @@ int movement() } } } -} \ No newline at end of file +}