s-shape control
Dependents: wheel_test7 2019NHK_A_manual_red 2019NHK_A_manual_blue
proto01.h
00001 #ifndef PROTO01_H 00002 #define PROTO01_H 00003 #define PI 3.141592653589793238462643383219502884 00004 00005 #include "mbed.h" 00006 00007 /** 00008 * S字制御クラス 00009 */ 00010 class Proto1 { 00011 public: 00012 00013 /** 00014 * コンストラクタ 00015 * @param accdis_ 加速距離 00016 * @param decdis_ 減速距離(誤差あり。大きめに調整すると良い) 00017 * @param maxspeed_ 最大速度(?) 00018 */ 00019 Proto1(double accdis_, double decdis_, double maxspeed_, double s_vector_); 00020 00021 /** 00022 * 目標点を設定する 00023 * @param target_ 目標点 00024 * @param start_ 開始地点 00025 */ 00026 void target(double target_, double start_); 00027 00028 /** 00029 * xy座標で目標点を設定する 00030 * @param targetx_ 目標点のx座標 00031 * @param targety_ 目標点のy座標 00032 * @param startx_ 開始地点のx座標 00033 * @param starty_ 開始地点のy座標 00034 */ 00035 void targetXY(int targetx_, int targety_, int startx_, int starty_); 00036 00037 /** 00038 * 現在地点を入力 00039 * @param now_ 現在地点 00040 */ 00041 void Input_now(double now_); 00042 00043 /** 00044 * 現在地点を入力 00045 * @param now_x 現在地点のx座標 00046 * @param now_y 現在地点のy座標 00047 */ 00048 void Input_nowXY(int now_x, int now_y); 00049 00050 /** 00051 * S字に変化する速度を計算 00052 */ 00053 void calculate(); 00054 00055 /** 00056 * x方向のベクトルを返す 00057 */ 00058 double getvalue_x(); 00059 00060 /** 00061 * y方向のベクトルを返す 00062 */ 00063 double getvalue_y(); 00064 00065 /** 00066 * そのまま返す 00067 */ 00068 double getvalue(); 00069 00070 double accdis; 00071 double decdis; 00072 double accdis2; 00073 double decdis2; 00074 double accsec; 00075 double decsec; 00076 double maxspeed; 00077 double maxspeed2; 00078 00079 double s_vector; 00080 double vector; 00081 00082 double startx; 00083 double starty; 00084 double start; 00085 double nowx; 00086 double nowy; 00087 double now; 00088 00089 double targetDis; 00090 double targetRad; 00091 double targetx; 00092 double targety; 00093 double nowDis; 00094 //consdis : 一定速度で走るところ 00095 double consdis; 00096 double counter; 00097 00098 }; 00099 00100 #endif
Generated on Wed Jul 13 2022 14:20:02 by
1.7.2