John Lam / Mbed 2 deprecated rosserial_mbed_carbase

Dependencies:   mbed mbed-rtos ros_lib_melodic

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MotorDrive.h Source File

MotorDrive.h

00001 #ifndef MOTOR_DRIVE
00002 #define MOTOR_DRIVE
00003 
00004 // Mbed Library
00005 #include <cmath>
00006 #include <vector>
00007 #include "OmniWheel.h"
00008 
00009 #define M_PI 3.14159265358979323846f
00010 
00011 using namespace std;
00012 
00013 class MotorDrive {
00014     private:
00015         const static double max_rpm = 5000;
00016         const static double rads_to_rpm = 30.0 / M_PI;
00017         const static double robot_radius = 0.19;
00018         const static double wheel_radius = 0.05;
00019         const static int wheel_num = 3;
00020         
00021         double offset_angle;
00022         double offset_x;
00023         double offset_y;
00024         double pwm_coeff;
00025         double wheel_radius_inv;
00026         
00027         OmniWheel omniWheel;
00028         
00029         vector<vector<double> > jacobian_matrix;
00030         
00031     public:
00032         // Initialize MotorDrive
00033         MotorDrive();
00034         virtual ~MotorDrive();
00035         // Function
00036         OmniWheel getOmniWheelData(double linear_x, double linear_y, double angular_z);
00037 };
00038 
00039 #endif