Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: PathFollowing.cpp
- Revision:
- 12:0d84e47bb8a0
- Parent:
- 11:8407c616b1a8
--- 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;