メカナムのコード

Dependencies:   mbed Eigen

Revision:
0:ee7e9405e1c7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shared/Wheel/Wheel.h	Wed Apr 14 07:26:19 2021 +0000
@@ -0,0 +1,30 @@
+
+#ifndef WHEEL_H_
+#define WHEEL_H_
+
+#include <mbed.h>
+#include <shared/MD/MD.h>
+
+class Wheel
+{
+public:
+    Wheel(MD *md, double wheel_angle, double position_angle);
+    Wheel(MD *md, double wheel_angle, double position_x, double position_y, double wheel_radius = 0);
+    
+    void set_position(double position_x, double position_y);
+    
+    double wheel_speed(double move_angle, double move_radius, double yaw);
+    
+    void drive(double duty);
+private:
+    MD *md;
+
+    double position_angle, position_radius;
+    double wheel_angle, wheel_radius;
+};
+    
+#endif
+
+#ifndef M_PI
+#define M_PI 3.1415926535
+#endif