first
Dependents: 17robo_fuzi 17robo_tokyo_kaede
mecanum.h@0:f3c5ba43a1aa, 2017-09-24 (annotated)
- Committer:
- echo_piyo
- Date:
- Sun Sep 24 05:24:12 2017 +0000
- Revision:
- 0:f3c5ba43a1aa
????2??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
echo_piyo | 0:f3c5ba43a1aa | 1 | /* |
echo_piyo | 0:f3c5ba43a1aa | 2 | Mecanum mecanum |
echo_piyo | 0:f3c5ba43a1aa | 3 | |
echo_piyo | 0:f3c5ba43a1aa | 4 | Sbdbtの入力 +y↑ -y↓ +x→ -x← |
echo_piyo | 0:f3c5ba43a1aa | 5 | .setupdeg([float]Deg) //角度センサの初期値設定 |
echo_piyo | 0:f3c5ba43a1aa | 6 | .sbdbt_cal([float]Vx, [float]Vy, [int]con_rl, [int]con_l1, [float]w, [float]angle) //使わない部分は0を代入 |
echo_piyo | 0:f3c5ba43a1aa | 7 | .xy_cal([float]Vx, [float]Vy) //xyの代入値(-1.0 ~ 1.0) |
echo_piyo | 0:f3c5ba43a1aa | 8 | |
echo_piyo | 0:f3c5ba43a1aa | 9 | .v1 //(返り値[float] -1.0 ~ 1.0) モータ1用出力 |
echo_piyo | 0:f3c5ba43a1aa | 10 | .v2 //(返り値[float] -1.0 ~ 1.0) モータ2用出力 |
echo_piyo | 0:f3c5ba43a1aa | 11 | .v3 //(返り値[float] -1.0 ~ 1.0) モータ3用出力 |
echo_piyo | 0:f3c5ba43a1aa | 12 | .v4 //(返り値[float] -1.0 ~ 1.0) モータ4用出力 |
echo_piyo | 0:f3c5ba43a1aa | 13 | |
echo_piyo | 0:f3c5ba43a1aa | 14 | メカナム設置図 |
echo_piyo | 0:f3c5ba43a1aa | 15 | ↑→ →↓ |
echo_piyo | 0:f3c5ba43a1aa | 16 | O---O |
echo_piyo | 0:f3c5ba43a1aa | 17 | O---O |
echo_piyo | 0:f3c5ba43a1aa | 18 | ←↑ ↓← |
echo_piyo | 0:f3c5ba43a1aa | 19 | |
echo_piyo | 0:f3c5ba43a1aa | 20 | |
echo_piyo | 0:f3c5ba43a1aa | 21 | */ |
echo_piyo | 0:f3c5ba43a1aa | 22 | |
echo_piyo | 0:f3c5ba43a1aa | 23 | #define rotaPower 0.6 |
echo_piyo | 0:f3c5ba43a1aa | 24 | #define rotaStickPower 0.35 |
echo_piyo | 0:f3c5ba43a1aa | 25 | #define boost_A 0.5 |
echo_piyo | 0:f3c5ba43a1aa | 26 | #define boost_K 0.9 |
echo_piyo | 0:f3c5ba43a1aa | 27 | #define PI 3.141592 |
echo_piyo | 0:f3c5ba43a1aa | 28 | |
echo_piyo | 0:f3c5ba43a1aa | 29 | #ifndef MBED_MECANUM_H |
echo_piyo | 0:f3c5ba43a1aa | 30 | #define MBED_MECANUM_H |
echo_piyo | 0:f3c5ba43a1aa | 31 | |
echo_piyo | 0:f3c5ba43a1aa | 32 | #include "mbed.h" |
echo_piyo | 0:f3c5ba43a1aa | 33 | |
echo_piyo | 0:f3c5ba43a1aa | 34 | class Mecanum{ |
echo_piyo | 0:f3c5ba43a1aa | 35 | public: |
echo_piyo | 0:f3c5ba43a1aa | 36 | void sbdbt_cal(float Vx, float Vy, int r1, int l1,float w, float angle); |
echo_piyo | 0:f3c5ba43a1aa | 37 | void setupdeg(float Deg); |
echo_piyo | 0:f3c5ba43a1aa | 38 | void boost(); |
echo_piyo | 0:f3c5ba43a1aa | 39 | void boost_forward(); |
echo_piyo | 0:f3c5ba43a1aa | 40 | void boost_back(); |
echo_piyo | 0:f3c5ba43a1aa | 41 | void boost_right(); |
echo_piyo | 0:f3c5ba43a1aa | 42 | void boost_left(); |
echo_piyo | 0:f3c5ba43a1aa | 43 | void xy_cal(float Vx, float Vy); |
echo_piyo | 0:f3c5ba43a1aa | 44 | float v1(); |
echo_piyo | 0:f3c5ba43a1aa | 45 | float v2(); |
echo_piyo | 0:f3c5ba43a1aa | 46 | float v3(); |
echo_piyo | 0:f3c5ba43a1aa | 47 | float v4(); |
echo_piyo | 0:f3c5ba43a1aa | 48 | float VX(); |
echo_piyo | 0:f3c5ba43a1aa | 49 | float VY(); |
echo_piyo | 0:f3c5ba43a1aa | 50 | private: |
echo_piyo | 0:f3c5ba43a1aa | 51 | float V1, V2, V3, V4, vx, vy; |
echo_piyo | 0:f3c5ba43a1aa | 52 | float first_deg, rad; |
echo_piyo | 0:f3c5ba43a1aa | 53 | }; |
echo_piyo | 0:f3c5ba43a1aa | 54 | |
echo_piyo | 0:f3c5ba43a1aa | 55 | #endif |