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.
Dependencies: mbed YKNCT_Movement SBDBT BNO055 YKNCT_MD YKNCT_I2C
Diff: main.cpp
- Revision:
- 3:b77f51108bf1
- Parent:
- 2:ec149525ec2a
- Child:
- 4:05a6bda2e11f
--- a/main.cpp Tue Mar 17 05:17:59 2020 +0000
+++ b/main.cpp Tue Mar 17 06:05:28 2020 +0000
@@ -307,6 +307,9 @@
double theta_tar=0.0;
while(1) {
+ /* 自己位置更新 */
+ LocEstimate();
+
x_vel = ABS((tar_x - NowLoc.X) * 0.06);
y_vel = ABS((tar_y - NowLoc.Y) * 0.06);
@@ -331,7 +334,7 @@
theta_tar = (((double)log_distance - remain) / log_distance) * (tar_theta - NowLoc.theta) + NowLoc.theta;;
/* 合わせるthetaと現在thetaの差分からtheta補整をかける */
t_vel = (theta_tar - NowLoc.theta) * 1.5;
-
+
t_vel = Rest(t_vel, 20);
omuni.XmarkOmni_Move(x_vel,y_vel,t_vel);
@@ -351,7 +354,7 @@
/* タイマー停止 */
P_fin.stop();
P_fin.reset();
-
+
break;
}
}