Soma Takahashi / prototype01
Revision:
4:40c5ac00bb5b
Parent:
3:c46f084010aa
Child:
5:8dce5092a719
--- a/proto01.h	Thu Aug 22 14:07:24 2019 +0000
+++ b/proto01.h	Mon Aug 26 06:10:05 2019 +0000
@@ -8,71 +8,92 @@
  * S字制御クラス
  */
 class Proto1 {
-    public:
+public:
 
-        /**
-         * コンストラクタ
-         * @param accdis_   加速距離
-         * @param decdis_   減速距離(誤差あり。大きめに調整すると良い)
-         * @param maxspeed_ 最大速度(?)
-         */
-        Proto1(double accdis_, double decdis_, double maxspeed_, double s_vector_);
+    /**
+     * コンストラクタ
+     * @param accdis_   加速距離
+     * @param decdis_   減速距離(誤差あり。大きめに調整すると良い)
+     * @param maxspeed_ 最大速度(?)
+     */
+    Proto1(double accdis_, double decdis_, double maxspeed_, double s_vector_);
+
+    /**
+     * 目標点を設定する
+     * @param target_ 目標点
+     * @param start_  開始地点
+     */
+    void target(double target_, double start_);
 
-        /**
-         * 目標点の設定
-         * @param targetx_ 目標点のx座標
-         * @param targety_ 目標点のy座標
-         * @param startx_  開始地点のx座標
-         * @param starty_  開始地点のy座標
-         */
-        void target_xy(int targetx_, int targety_, int startx_, int starty_);
+    /**
+     * xy座標で目標点を設定する
+     * @param targetx_ 目標点のx座標
+     * @param targety_ 目標点のy座標
+     * @param startx_  開始地点のx座標
+     * @param starty_  開始地点のy座標
+     */
+    void target_xy(int targetx_, int targety_, int startx_, int starty_);
 
-        /**
-         * S字に変化する速度を計算
-         * @param now_x 現在地点のx座標
-         * @param now_y 現在地点のy座標
-         */
-        void calculate(int now_x, int now_y);
+    /**
+     * 現在地点を入力
+     * @param now_ 現在地点
+     */
+    void Input_now(double now_);
 
-        double getvalue_x();
-
-        double getvalue_y();
+    /**
+     * 現在地点を入力
+     * @param now_x 現在地点のx座標
+     * @param now_y 現在地点のy座標
+     */
+    void Input_nowxy(int now_x, int now_y);
 
-/***
- *  accDis   : 加速中に進む距離
- *  decDis   : 減速中に進む距離
- *  maxspeed : 最大速度
- **/
-        double accdis;
-        double decdis;
-        double accdis2;
-        double decdis2;
-        double maxspeed;
+    /**
+     * S字に変化する速度を計算
+     */
+    void calculate();
+
+    /**
+     * x方向のベクトルを返す
+     */
+    double getvalue_x();
 
-        double accsec;
-        double decsec;
+    /**
+     * y方向のベクトルを返す
+     */
+    double getvalue_y();
 
-        double s_vector;
-//  s_vector : start speed
-        double vector;
+    /**
+     * そのまま返す
+     */
+    double getvalue();
 
-        double targetx;
-        double targety;
-        double startx;
-        double starty;
-        double nowx;
-        double nowy;
+    double accdis;
+    double decdis;
+    double accdis2;
+    double decdis2;
+    double accsec;
+    double decsec;
+    double maxspeed;
+    double maxspeed2;
+
+    double s_vector;
+    double vector;
 
-/***
- *  tergetDis : 開始地点から目標点までの距離
- *  tergetRad : 現在地と目標点がなす角度
- *  nowDis    : 進んだ距離
- **/
-        double targetDis;
-        double targetRad;
-        double nowDis;
-        double middledis;
-        double counter;
+    double startx;
+    double starty;
+    double start;
+    double nowx;
+    double nowy;
+    double now;
+
+    double targetDis;
+    double targetRad;
+    double targetx;
+    double targety;
+    double nowDis;
+    //consdis : 一定速度で走るところ
+    double consdis;
+    double counter;
 
 };