Takeuchi Issei
/
4Omunisleeve3
メカナムのコード
shared/Wheel/Wheel.h@0:ee7e9405e1c7, 2021-04-14 (annotated)
- Committer:
- e2011220
- Date:
- Wed Apr 14 07:26:19 2021 +0000
- Revision:
- 0:ee7e9405e1c7
first
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
e2011220 | 0:ee7e9405e1c7 | 1 | |
e2011220 | 0:ee7e9405e1c7 | 2 | #ifndef WHEEL_H_ |
e2011220 | 0:ee7e9405e1c7 | 3 | #define WHEEL_H_ |
e2011220 | 0:ee7e9405e1c7 | 4 | |
e2011220 | 0:ee7e9405e1c7 | 5 | #include <mbed.h> |
e2011220 | 0:ee7e9405e1c7 | 6 | #include <shared/MD/MD.h> |
e2011220 | 0:ee7e9405e1c7 | 7 | |
e2011220 | 0:ee7e9405e1c7 | 8 | class Wheel |
e2011220 | 0:ee7e9405e1c7 | 9 | { |
e2011220 | 0:ee7e9405e1c7 | 10 | public: |
e2011220 | 0:ee7e9405e1c7 | 11 | Wheel(MD *md, double wheel_angle, double position_angle); |
e2011220 | 0:ee7e9405e1c7 | 12 | Wheel(MD *md, double wheel_angle, double position_x, double position_y, double wheel_radius = 0); |
e2011220 | 0:ee7e9405e1c7 | 13 | |
e2011220 | 0:ee7e9405e1c7 | 14 | void set_position(double position_x, double position_y); |
e2011220 | 0:ee7e9405e1c7 | 15 | |
e2011220 | 0:ee7e9405e1c7 | 16 | double wheel_speed(double move_angle, double move_radius, double yaw); |
e2011220 | 0:ee7e9405e1c7 | 17 | |
e2011220 | 0:ee7e9405e1c7 | 18 | void drive(double duty); |
e2011220 | 0:ee7e9405e1c7 | 19 | private: |
e2011220 | 0:ee7e9405e1c7 | 20 | MD *md; |
e2011220 | 0:ee7e9405e1c7 | 21 | |
e2011220 | 0:ee7e9405e1c7 | 22 | double position_angle, position_radius; |
e2011220 | 0:ee7e9405e1c7 | 23 | double wheel_angle, wheel_radius; |
e2011220 | 0:ee7e9405e1c7 | 24 | }; |
e2011220 | 0:ee7e9405e1c7 | 25 | |
e2011220 | 0:ee7e9405e1c7 | 26 | #endif |
e2011220 | 0:ee7e9405e1c7 | 27 | |
e2011220 | 0:ee7e9405e1c7 | 28 | #ifndef M_PI |
e2011220 | 0:ee7e9405e1c7 | 29 | #define M_PI 3.1415926535 |
e2011220 | 0:ee7e9405e1c7 | 30 | #endif |