春ロボ1班(元F3RC4班+) / PathFollowing_2_26

Files at this revision

API Documentation at this revision

Comitter:
yuki0701
Date:
Mon Feb 25 15:27:10 2019 +0000
Parent:
11:8407c616b1a8
Commit message:
a

Changed in this revision

PathFollowing.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/PathFollowing.cpp	Fri Feb 08 06:53:01 2019 +0000
+++ b/PathFollowing.cpp	Mon Feb 25 15:27:10 2019 +0000
@@ -41,7 +41,8 @@
 
 static int16_t m_1=0, m_2=0, m_3=0, m_4=0;  //int16bit = int2byte
 
-double xy_type,pm_typeX,pm_typeY,x_base,y_base;
+int xy_type;
+double pm_typeX,pm_typeY,x_base,y_base;
 
 
 ///////////////////機体情報をメンバとする構造体"robo_data"と構造体型変数info(←この変数に各センサーにより求めた機体情報(機体位置/機体角度)を格納する)の宣言/////////////////
@@ -361,12 +362,9 @@
     
    calc_xy_enc();
    
-   if(u != 1){
+   if(u != 1 || v != 1){
       calc_xy_usw(target_angle); //エンコーダの値しか使用しない場合は超音波センサーによる座標計算は行わずに計算量を減らす。
    }
-   if(v != 1){
-      calc_xy_usw(target_angle);
-    }
     
     now_x = u * info.nowX.enc + (1-u) * info.nowX.usw;
     now_y = v * info.nowY.enc + (1-v) * info.nowY.usw;