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: CruizCore_R1370P
Fork of PathFollowing1 by
Revision 1:9858517eef98, committed 2018-10-31
- Comitter:
- yuki0701
- Date:
- Wed Oct 31 10:13:49 2018 +0000
- Parent:
- 0:3d9101dd0061
- Commit message:
- a;
Changed in this revision
| PathFollowing1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PathFollowing1.cpp Wed Oct 31 09:56:08 2018 +0000
+++ b/PathFollowing1.cpp Wed Oct 31 10:13:49 2018 +0000
@@ -49,9 +49,10 @@
old_timeR=now_timeR;
//////////////////////////<XYRmotorout関数内>以下、x軸方向、y軸方向、旋回の出力をそれぞれad_x_out,ad_y_out,ad_r_outの指すアドレスに書き込む/////////////////////////////
+////////////////////////////////////////////その際、x軸方向、y軸方向の出力はフィールドの座標系から機体の座標系に変換する。///////////////////////////////////////////////
- *ad_x_out = VectorOut_P[0]+VectorOut_Q[0];
- *ad_y_out = VectorOut_P[1]+VectorOut_Q[1];
+ *ad_x_out = (VectorOut_P[0]+VectorOut_Q[0])*cos(now_angle)-(VectorOut_P[1]+VectorOut_Q[1])*sin(now_angle);
+ *ad_y_out = (VectorOut_P[0]+VectorOut_Q[0])*sin(now_angle)+(VectorOut_P[1]+VectorOut_Q[1])*cos(now_angle);
*ad_r_out = out_dutyR;
}
