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: Harurobo_CAN_1_19 mbed Maxon_setting_1_11 move4wheel2 EC PathFollowing_2_8 CruizCore_R1370P
main.cpp
00001 #include <mbed.h> 00002 #include "EC.h" 00003 #include "R1370P.h" 00004 #include "move4wheel.h" 00005 #include "PathFollowing.h" 00006 #include "Maxon_setting.h" 00007 #include "Harurobo_CAN.h" 00008 00009 #define PROGRAM_INFO //プログラム使用時に使用プログラムの情報を最初に表示する際に定義 00010 00011 #define HARUROBO_TEST_MODE //テスト自動プログラム(練習・動作確認用)使用時に定義 00012 //#define HARUROBO_RIGHT_MODE //本番用自動プログラム(右側フィールド)使用時に定義 00013 //#define HARUROBO_LEFT_MODE //本番用自動プログラム(左側フィールド)使用時に定義 00014 00015 Ticker ticker; 00016 00017 //////////////////////////////////////////////////////////////以下main文///////////////////////////////////////////////////////////////// 00018 00019 int main() 00020 { 00021 UserLoopSetting(); //Maxon関連設定関数 00022 UserLoopSetting2(); //PathFollowing関連設定関数 00023 00024 #ifdef PROGRAM_INFO //プログラム使用時に使用プログラムの情報を最初に表示 00025 00026 printf("ソースファイル名 : %s\n\r", __FILE__); 00027 printf("作成日付 : %s\n\r", __DATE__); 00028 printf("作成時刻 : %s\n\r", __TIME__); //イギリスの時間(9時間前)の時間が表示される。 00029 00030 #endif 00031 00032 00033 00034 00035 /////////////以下自動モードプログラム///////////// 00036 00037 #ifdef HARUROBO_TEST_MODE //テスト自動プログラム(練習・動作確認用) 00038 00039 //Debug_Control(); 00040 00041 gogo_straight(1,1,0,0,0,-300,200,1000,5,0.1,10,0.1,600,0); 00042 purecurve2(6,1,1,0,-300,-600,-1000,9,1000,5,0.1,10,0.1,600,0); 00043 purecurve2(5,1,1,-600,-1000,-1200,-1700,9,1000,5,0.1,10,0.1,600,0); 00044 gogo_straight(1,1,-1200,-1700,-1200,-2000,1000,200,5,0.1,10,0.1,600,0); 00045 MotorControl(0,0,0,0); 00046 pos_correction(-1200,-2000,0,1,1); 00047 wait(0.5); 00048 00049 gogo_straight(1,1,-1200,-2000,-1200,-1700,200,1000,5,0.1,10,0.1,600,0); 00050 purecurve2(2,1,1,-1200,-1700,-600,-1000,9,1000,5,0.1,10,0.1,600,0); 00051 purecurve2(1,1,1,-600,-1000,0,-300,9,1000,5,0.1,10,0.1,600,90); 00052 gogo_straight(1,1,0,-300,0,300,1000,200,5,0.1,10,0.1,600,90); 00053 MotorControl(0,0,0,0); 00054 pos_correction(0,300,90,1,1); 00055 00056 gogo_straight(1,1,0,300,-200,300,200,200,5,0.1,10,0.1,800,90); 00057 MotorControl(0,0,0,0); 00058 pos_correction(-200,300,90,1,1); 00059 wait(0.5); 00060 00061 gogo_straight(1,1,-200,300,0,600,200,1000,5,0.1,10,0.1,800,90); 00062 purecurve2(3,1,1,0,600,-400,1000,9,1000,5,0.1,10,0.1,800,90); 00063 purecurve2(4,1,1,-400,1000,-800,1400,9,1000,5,0.1,10,0.1,800,90); 00064 purecurve2(2,1,1,-800,1400,-400,1800,9,1000,5,0.1,10,0.1,800,90); 00065 gogo_straight(1,1,-400,1800,-300,1800,1000,1000,5,0.1,10,0.1,800,90); 00066 gogo_straight(1,1,-300,1800,0,1800,1000,200,5,0.1,10,0.1,800,90); 00067 MotorControl(0,0,0,0); 00068 pos_correction(0,1800,90,1,1); 00069 wait(0.5); 00070 00071 gogo_straight(1,1,0,1800,-300,1800,200,1000,5,0.1,10,0.1,800,90); 00072 gogo_straight(1,1,-300,1800,-900,1800,1000,1000,5,0.1,10,0.1,800,90); 00073 purecurve2(5,1,1,-900,1800,-1300,1400,9,1000,5,0.1,10,0.1,600,180); 00074 gogo_straight(1,1,-1300,1400,-1300,900,1000,1000,5,0.1,10,0.1,600,180); 00075 gogo_straight(1,1,-1300,900,-1300,600,1000,200,5,0.1,10,0.1,800,180); 00076 MotorControl(0,0,0,0); 00077 pos_correction(-1300,600,180,1,1); 00078 00079 00080 //ticker.attach(&can_read,0.01); 00081 00082 //can_start(); 00083 //set_cond(1,0,0,1,-1000); 00084 //gogo_straight(1,1,0,0,0,-300,500,500,5,0.1,10,0.1,600,0); 00085 //pos_correction(100,0,0,1,1); 00086 //{ 00087 00088 //while(1); 00089 00090 // MotorControl(0,0,0,0); 00091 00092 #endif 00093 00094 00095 #ifdef HARUROBO_RIGHT_MODE //本番用自動プログラム(右側フィールド用) 00096 00097 //ここに本番用自動プログラム(右側フィールド用)を書く 00098 00099 #endif 00100 00101 00102 #ifdef HARUROBO_LEFT_MODE //本番用自動プログラム(左側フィールド用) 00103 00104 //ここに本番用自動プログラム(左側フィールド用)を書く 00105 00106 #endif 00107 00108 00109 /////////自動モードプログラム終了///////// 00110 00111 }
Generated on Tue Aug 9 2022 11:46:28 by
1.7.2