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.
Diff: OmniMove.h
- Revision:
- 3:e08a0ee65f69
- Parent:
- 2:4c4ff6bf6282
- Child:
- 4:4d94b6148a0a
diff -r 4c4ff6bf6282 -r e08a0ee65f69 OmniMove.h --- a/OmniMove.h Thu Mar 25 02:34:43 2021 +0000 +++ b/OmniMove.h Thu Mar 25 11:49:16 2021 +0000 @@ -46,12 +46,12 @@ public: /* セットアップ関数 - nWheel:車輪の個数,fstWheelAng:0番目のx軸と車輪軸のなす角度 */ + nWheel:車輪の個数(3~8),fstWheelAng:0番目のx軸と車輪軸のなす角度(deg) */ void setup(int nWheel,float fstWheelAng); /* 全方位移動入力関数(極座標) - r:マシンの速度(-1~1),theta:マシンの進行方向(角度deg ex.90,-45) + r:マシンの速度(0~1),theta:マシンの進行方向(角度deg ex.90,-45) Vroll:マシンの回転速度(-1~1),roll_ratio:回転速度の重み(0~1) */ void input_polar(float r,float theta,float Vroll,float roll_ratio); @@ -61,6 +61,17 @@ void input_polar(float r,float theta,float Vroll,float roll_ratio,float MachineAng); /* + 全方位移動入力関数(直交座標) + x:マシンのx方向速度(-1~1),y:マシンのy方向速度(-1~1) + Vroll:マシンの回転速度(-1~1),roll_ratio:回転速度の重み(0~1) */ + void input_cartesian(float x,float y,float Vroll,float roll_ratio); + + /* + マシンの傾き角度を考慮した全方位移動入力関数(直交座標) + MachineAng:マシンの現在角度(角度deg ex.90,-45) */ + void input_cartesian(float x,float y,float Vroll,float roll_ratio,float MachineAng); + + /* 全方位移動出力関数(アドレスよくわからん人用) 引数:nWheel番目の車輪の回転速度 */ float output_(int nWheel); @@ -72,9 +83,9 @@ private: int i,nWheel; - float Vx_wheel[8],Vy_wheel[8],Vx,Vy,Vroll; - float m_pi; - + float Vx_wheel[8],Vy_wheel[8],Vx,Vy,Vroll,r,theta; + + float limit(float min,float max,float _value); float conv_deg(float _rad); float conv_rad(float _deg); };