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:
- 6:fac3dcaebe83
- Parent:
- 5:333ed75dd3f1
- Child:
- 7:9b9d488ebcfd
diff -r 333ed75dd3f1 -r fac3dcaebe83 OmniMove.h --- a/OmniMove.h Sat Mar 27 11:14:59 2021 +0000 +++ b/OmniMove.h Mon Mar 29 09:13:27 2021 +0000 @@ -8,7 +8,7 @@ オムニ・メカナム等の全方位移動ベクトル演算ライブラリ Designer: Watanabe Yuuto -このライブラリは極座標で表したマシンの走行速度、進行方向から +このライブラリは極座標(or直交座標)で表したマシンの走行速度、進行方向から 各車輪の回転速度を演算するライブラリです。 3~8輪までの車輪数や車輪の位置などを指定できます。 @@ -47,47 +47,47 @@ /* セットアップ関数 nWheel:車輪の個数(3~8),fstWheelAng:0番目のx軸と車輪軸のなす角度(deg) */ - void setup(int nWheel,double fstWheelAng); + void setup(int nWheel,float fstWheelAng); /* 全方位移動入力関数(極座標) r:マシンの速度(0~1),theta:マシンの進行方向(角度deg ex.90,-45) Vroll:マシンの回転速度(-1~1),roll_ratio:回転速度の重み(0~1) */ - void input_polar(double r,double theta,double Vroll,double roll_ratio); + void input_polar(float r,float theta,float Vroll,float roll_ratio); /* マシンの傾き角度を考慮した全方位移動入力関数(極座標) MachineAng:マシンの現在角度(角度deg ex.90,-45) */ - void input_polar(double r,double theta,double Vroll,double roll_ratio,double MachineAng); + 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(double x,double y,double Vroll,double roll_ratio); + void input_cartesian(float x,float y,float Vroll,float roll_ratio); /* マシンの傾き角度を考慮した全方位移動入力関数(直交座標) MachineAng:マシンの現在角度(角度deg ex.90,-45) */ - void input_cartesian(double x,double y,double Vroll,double roll_ratio,double MachineAng); + void input_cartesian(float x,float y,float Vroll,float roll_ratio,float MachineAng); /* 全方位移動出力関数(アドレスよくわからん人用) 引数:n番目の車輪の回転速度 */ - double output_(int n); + float output_(int n); /* 全方位移動出力関数 *v:車輪回転速度の配列の先頭アドレス */ - void output(double *V); + void output(float *V); private: int i,nWheel; - double Vx_wheel[8],Vy_wheel[8],Vx,Vy,Vroll,r,theta; + float Vx_wheel[8],Vy_wheel[8],Vx,Vy,Vroll,r,theta; - double limit(double min,double max,double _value); - double conv_deg(double _rad); - double conv_rad(double _deg); + float limit(float min,float max,float _value); + float conv_deg(float _rad); + float conv_rad(float _deg); }; #endif \ No newline at end of file