harurobo_mbed_undercarriage_sub
PathFollowing.h@6:efe1bc381434, 2018-12-22 (annotated)
- Committer:
- yuki0701
- Date:
- Sat Dec 22 02:50:28 2018 +0000
- Revision:
- 6:efe1bc381434
- Parent:
- 5:babe249ce482
a; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
la00noix | 0:591749f315ac | 1 | #ifndef HARUROBO2019_PATHFOLLOWING_H |
la00noix | 0:591749f315ac | 2 | #define HARUROBO2019_PATHFOLLOWING_H |
la00noix | 0:591749f315ac | 3 | #include <EC.h> |
la00noix | 0:591749f315ac | 4 | |
yuki0701 | 6:efe1bc381434 | 5 | |
la00noix | 0:591749f315ac | 6 | extern double now_x,now_y,now_angle; //main.cppにこれらの値の読み込みを書くこと |
la00noix | 0:591749f315ac | 7 | extern double now_timeQ,now_timeR; |
yuki0701 | 6:efe1bc381434 | 8 | extern double usw_data1,usw_data2,usw_data3,usw_data4; |
la00noix | 0:591749f315ac | 9 | |
yuki0701 | 5:babe249ce482 | 10 | |
yuki0701 | 6:efe1bc381434 | 11 | void UserLoopSetting2(); |
yuki0701 | 6:efe1bc381434 | 12 | |
yuki0701 | 4:69775231687c | 13 | void XYRmotorout(double plot_x1, double plot_y1, double plot_x2, double plot_y2, double *ad_x_out, double *ad_y_out, double *ad_r_out,double speed1,double speed2); |
yuki0701 | 5:babe249ce482 | 14 | //出発地点、目標地点の座標から機体のx軸方向、y軸方向、旋回の出力を算出する関数(エンコーダ/ジャイロ使用) |
la00noix | 0:591749f315ac | 15 | /* |
la00noix | 0:591749f315ac | 16 | *1.main分内でx_out,y_out,r_outをdouble型で定義 |
la00noix | 0:591749f315ac | 17 | *2.XYRmotorout関数使用時は、num番目のx、y座標、num+1番目のx,y座標に加え、 |
la00noix | 0:591749f315ac | 18 | x_out,y_out,r_outのアドレス(&x_out,&y_out,&r_out)を渡す→(XYRmotorout(座標×4つ,&x_out,&y_out,&r_out)) |
la00noix | 0:591749f315ac | 19 | */ |
la00noix | 0:591749f315ac | 20 | |
la00noix | 0:591749f315ac | 21 | //次の関数のパラメーターを定義すること |
la00noix | 0:591749f315ac | 22 | |
yuki0701 | 4:69775231687c | 23 | //void set_p_out(double p); |
la00noix | 0:591749f315ac | 24 | //ベクトルABに平行方向の出力値設定関数 |
la00noix | 0:591749f315ac | 25 | |
la00noix | 0:591749f315ac | 26 | void q_setPDparam(double q_p,double q_d); |
la00noix | 0:591749f315ac | 27 | //ベクトルABに垂直な方向の誤差を埋めるPD制御のパラメータ設定関数 |
la00noix | 0:591749f315ac | 28 | |
la00noix | 0:591749f315ac | 29 | void r_setPDparam(double r_p,double r_d); |
la00noix | 0:591749f315ac | 30 | //機体角度と目標角度の誤差を埋めるPD制御のパラメータ設定関数 |
la00noix | 0:591749f315ac | 31 | |
la00noix | 0:591749f315ac | 32 | void set_r_out(double r); |
la00noix | 0:591749f315ac | 33 | //旋回時の最大出力値設定関数 |
la00noix | 0:591749f315ac | 34 | |
la00noix | 0:591749f315ac | 35 | void set_target_angle(double t); |
la00noix | 0:591749f315ac | 36 | //機体目標角度設定関数 |
la00noix | 0:591749f315ac | 37 | |
yuki0701 | 6:efe1bc381434 | 38 | void calOmega(); |
yuki0701 | 6:efe1bc381434 | 39 | |
yuki0701 | 6:efe1bc381434 | 40 | void output(double FL,double BL,double BR,double FR); |
yuki0701 | 6:efe1bc381434 | 41 | |
yuki0701 | 6:efe1bc381434 | 42 | void base(double FL,double BL,double BR,double FR,double Max); |
yuki0701 | 6:efe1bc381434 | 43 | |
yuki0701 | 6:efe1bc381434 | 44 | void calc_xy_enc(); |
yuki0701 | 6:efe1bc381434 | 45 | |
yuki0701 | 6:efe1bc381434 | 46 | void set_cond(int t, int px, double bx, int py, double by); |
yuki0701 | 6:efe1bc381434 | 47 | |
yuki0701 | 6:efe1bc381434 | 48 | void calc_xy_usw(double tgt_angle); |
yuki0701 | 6:efe1bc381434 | 49 | |
yuki0701 | 6:efe1bc381434 | 50 | void calc_xy(double tgt_angle, double u, double v); |
yuki0701 | 6:efe1bc381434 | 51 | |
yuki0701 | 6:efe1bc381434 | 52 | void purecurve2(int type,double u, double v, //正面を変えずに円弧or楕円を描いて曲がる |
yuki0701 | 6:efe1bc381434 | 53 | double point_x1,double point_y1, |
yuki0701 | 6:efe1bc381434 | 54 | double point_x2,double point_y2, |
yuki0701 | 6:efe1bc381434 | 55 | int theta, |
yuki0701 | 6:efe1bc381434 | 56 | double speed, |
yuki0701 | 6:efe1bc381434 | 57 | double q_p,double q_d, |
yuki0701 | 6:efe1bc381434 | 58 | double r_p,double r_d, |
yuki0701 | 6:efe1bc381434 | 59 | double r_out_max, |
yuki0701 | 6:efe1bc381434 | 60 | double target_angle); |
yuki0701 | 6:efe1bc381434 | 61 | |
yuki0701 | 6:efe1bc381434 | 62 | void gogo_straight(double u, double v, double x1_point,double y1_point, //直線運動プログラム |
yuki0701 | 6:efe1bc381434 | 63 | double x2_point,double y2_point, |
yuki0701 | 6:efe1bc381434 | 64 | double speed1,double speed2, |
yuki0701 | 6:efe1bc381434 | 65 | double q_p,double q_d, |
yuki0701 | 6:efe1bc381434 | 66 | double r_p,double r_d, |
yuki0701 | 6:efe1bc381434 | 67 | double r_out_max, |
yuki0701 | 6:efe1bc381434 | 68 | double target_angle); |
yuki0701 | 6:efe1bc381434 | 69 | |
yuki0701 | 6:efe1bc381434 | 70 | |
la00noix | 0:591749f315ac | 71 | |
la00noix | 0:591749f315ac | 72 | |
la00noix | 0:591749f315ac | 73 | #endif |