障害物回避走行プログラム

Files at this revision

API Documentation at this revision

Comitter:
tomotsugu
Date:
Wed Jul 22 03:25:17 2020 +0000
Parent:
2:3a891c8d5b82
Child:
4:3de68a2ed879
Commit message:
avoidance

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jul 22 03:23:50 2020 +0000
+++ b/main.cpp	Wed Jul 22 03:25:17 2020 +0000
@@ -88,10 +88,10 @@
 void avoidance(){
     Thread ws_thread(watchsurrounding);     // watchsurroundingをスレッド化
     while(1){
-        if(flag == 0){          // 障害物がない場合
-            run = ADVANCE;      // 前進
+        if(flag == 0){                      // 障害物がない場合
+            run = ADVANCE;                  // 前進
         }
-        else{                   // 障害物がある場合                   
+        else{                               // 障害物がある場合                   
             i = 0;
             if(SC < 15){                    // 正面15cm以内に障害物が現れた場合
                 run = BACK;                 // 後退