test
Dependencies: mbed ros_lib_kinetic nhk19mr2_can_info splitData SerialHalfDuplex_HM
Walk/Walk.h@22:787a764271dd, 2019-02-17 (annotated)
- Committer:
- A0413
- Date:
- Sun Feb 17 14:20:06 2019 +0000
- Revision:
- 22:787a764271dd
- Parent:
- 21:61971fc18b90
- Child:
- 27:79b4b932a6dd
change Walk.cpp & Walk.h ; OneLeg Orbit :: RiseEllipse2; by Inoue
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimizuta | 11:e81425872740 | 1 | #ifndef INCLUDED_WALK_H |
shimizuta | 11:e81425872740 | 2 | #define INCLUDED_WALK_H |
shimizuta | 11:e81425872740 | 3 | #include "OneLeg.h" |
yuto17320508 | 13:e7ecdb20665a | 4 | //足の軌道を設定するクラス。軌道は様々であることを考慮してコンストラクタでの代入は控えたい |
shimizuta | 11:e81425872740 | 5 | class Orbit |
shimizuta | 11:e81425872740 | 6 | { |
shimizuta | 11:e81425872740 | 7 | float stridetime_s_; |
shimizuta | 11:e81425872740 | 8 | float risetime_s_; |
shimizuta | 11:e81425872740 | 9 | float stride_m_; |
shimizuta | 14:d7cb429946f4 | 10 | float height_m_; //足の上げ幅 |
shimizuta | 21:61971fc18b90 | 11 | float ellipse_center_y_m_; //楕円軌道の中心高さ |
shimizuta | 21:61971fc18b90 | 12 | float ellipse_center_x_m_; //楕円軌道の中心x座標 |
shimizuta | 21:61971fc18b90 | 13 | float ground_m_; //地面の高さ |
A0413 | 22:787a764271dd | 14 | float ellipse_long_m_; //楕円の長径 |
A0413 | 22:787a764271dd | 15 | float ellipse_short_m_; //楕円の短径 |
A0413 | 22:787a764271dd | 16 | |
shimizuta | 14:d7cb429946f4 | 17 | OneLeg StrideLine_(OneLeg leg, float phasetime_s); //時間をもとに位置を取得したインスタンスを直接返して代入させる |
shimizuta | 11:e81425872740 | 18 | OneLeg RiseEllipse_(OneLeg leg, float phasetime_s); |
shimizuta | 14:d7cb429946f4 | 19 | OneLeg OrbitEllipse_(OneLeg leg, float phasetime_s); //Stride, Riseを組み合わせて周期を作る |
shimizuta | 21:61971fc18b90 | 20 | OneLeg RiseEllipse2_(OneLeg leg, float phasetime_s); |
shimizuta | 11:e81425872740 | 21 | |
shimizuta | 11:e81425872740 | 22 | public: |
shimizuta | 11:e81425872740 | 23 | Orbit(){}; |
yuto17320508 | 13:e7ecdb20665a | 24 | //このクラスのメイン privateへのアクセス関数 |
shimizuta | 11:e81425872740 | 25 | OneLeg GetOrbit(OneLeg leg, float phasetime_s); |
shimizuta | 21:61971fc18b90 | 26 | void SetStraightParam(float stridetime_s, float risetime_s, |
shimizuta | 21:61971fc18b90 | 27 | float stride_m, float height_m, float ground_m, |
shimizuta | 21:61971fc18b90 | 28 | float ellipse_center_x_m, float ellipse_center_y_m); |
shimizuta | 21:61971fc18b90 | 29 | void SetStandParam(float ground_m); |
shimizuta | 11:e81425872740 | 30 | float GetOneWalkTime(); //足一周の時間 |
shimizuta | 11:e81425872740 | 31 | }; |
shimizuta | 11:e81425872740 | 32 | |
shimizuta | 11:e81425872740 | 33 | //4足の足の動かし方を保存するクラス |
shimizuta | 11:e81425872740 | 34 | class Walk |
shimizuta | 11:e81425872740 | 35 | { |
shimizuta | 11:e81425872740 | 36 | float phasetime_s_; |
shimizuta | 11:e81425872740 | 37 | float offsettime_s_[4]; |
shimizuta | 11:e81425872740 | 38 | |
shimizuta | 11:e81425872740 | 39 | public: |
yuto17320508 | 13:e7ecdb20665a | 40 | //4脚の軌道, 位相を代入して歩行方法を確定する |
yuto17320508 | 13:e7ecdb20665a | 41 | //コンストラクタではメンバの代入のみ行っている |
shimizuta | 11:e81425872740 | 42 | Walk(Orbit orbit[4], float offsettime_s[4], float cycletime_s); |
shimizuta | 14:d7cb429946f4 | 43 | float cycletime_s_; //計算周期 |
shimizuta | 11:e81425872740 | 44 | Orbit orbit_[4]; |
yuto17320508 | 13:e7ecdb20665a | 45 | //参照渡しされたonelegそれぞれにorbit_::GetOrbit関数を代入 |
yuto17320508 | 13:e7ecdb20665a | 46 | //GetOrbit関数にて軌道, 時間をもとに位置を決める |
yuto17320508 | 13:e7ecdb20665a | 47 | //直接参照しているのはこの関数だけ |
shimizuta | 11:e81425872740 | 48 | void Cal4LegsPosi(OneLeg (&leg)[4]); |
shimizuta | 11:e81425872740 | 49 | }; |
shimizuta | 11:e81425872740 | 50 | #endif |