Takeuchi Issei
/
4Omunisleeve3
メカナムのコード
shared/OdometryWheel/OdometryWheel.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 | #ifndef ODMETRYWHEEL_H_ |
e2011220 | 0:ee7e9405e1c7 | 2 | #define ODMETRYWHEEL_H_ |
e2011220 | 0:ee7e9405e1c7 | 3 | |
e2011220 | 0:ee7e9405e1c7 | 4 | #ifndef _USE_MATH_DEFINES |
e2011220 | 0:ee7e9405e1c7 | 5 | #define _USE_MATH_DEFINES |
e2011220 | 0:ee7e9405e1c7 | 6 | #endif |
e2011220 | 0:ee7e9405e1c7 | 7 | #include <math.h> |
e2011220 | 0:ee7e9405e1c7 | 8 | |
e2011220 | 0:ee7e9405e1c7 | 9 | #include <shared/OdometryUnit/OdometryUnit.h> |
e2011220 | 0:ee7e9405e1c7 | 10 | #include <shared/QEI/QEI.h> |
e2011220 | 0:ee7e9405e1c7 | 11 | |
e2011220 | 0:ee7e9405e1c7 | 12 | #define EIGEN_NO_DEBUG // コード内のassertを無効化. |
e2011220 | 0:ee7e9405e1c7 | 13 | #include <Core.h> |
e2011220 | 0:ee7e9405e1c7 | 14 | |
e2011220 | 0:ee7e9405e1c7 | 15 | #define M_PI 3.14159265358979323846 |
e2011220 | 0:ee7e9405e1c7 | 16 | |
e2011220 | 0:ee7e9405e1c7 | 17 | class OdometryWheel : public OdometryUnit |
e2011220 | 0:ee7e9405e1c7 | 18 | { |
e2011220 | 0:ee7e9405e1c7 | 19 | public: |
e2011220 | 0:ee7e9405e1c7 | 20 | OdometryWheel(QEI *qei, double wheel_angle, double wheel_radius, double position_angle, double position_radius); |
e2011220 | 0:ee7e9405e1c7 | 21 | virtual ~OdometryWheel(){}; |
e2011220 | 0:ee7e9405e1c7 | 22 | |
e2011220 | 0:ee7e9405e1c7 | 23 | virtual Eigen::Vector3d get_coefficient_elements(); |
e2011220 | 0:ee7e9405e1c7 | 24 | virtual double read_wheel_velocity(); |
e2011220 | 0:ee7e9405e1c7 | 25 | |
e2011220 | 0:ee7e9405e1c7 | 26 | enum CoefficientElements{ |
e2011220 | 0:ee7e9405e1c7 | 27 | X, |
e2011220 | 0:ee7e9405e1c7 | 28 | Y, |
e2011220 | 0:ee7e9405e1c7 | 29 | Yaw |
e2011220 | 0:ee7e9405e1c7 | 30 | }; |
e2011220 | 0:ee7e9405e1c7 | 31 | |
e2011220 | 0:ee7e9405e1c7 | 32 | private: |
e2011220 | 0:ee7e9405e1c7 | 33 | void _calculate_coefficient_elements(); |
e2011220 | 0:ee7e9405e1c7 | 34 | |
e2011220 | 0:ee7e9405e1c7 | 35 | QEI *_qei; |
e2011220 | 0:ee7e9405e1c7 | 36 | Eigen::Vector3d _coefficient_elements; |
e2011220 | 0:ee7e9405e1c7 | 37 | |
e2011220 | 0:ee7e9405e1c7 | 38 | double _wheel_angle, _wheel_radius, _position_angle, _position_radius; |
e2011220 | 0:ee7e9405e1c7 | 39 | }; |
e2011220 | 0:ee7e9405e1c7 | 40 | |
e2011220 | 0:ee7e9405e1c7 | 41 | #endif |