Used to track the robot's position and initialise an m3pi object to drive the robot
Diff: Navigate_Pololu.h
- Revision:
- 2:1255feea1c59
- Parent:
- 1:b6c1de65e591
- Child:
- 3:c5dff598fea4
--- a/Navigate_Pololu.h Sun Jan 31 16:08:34 2016 +0000 +++ b/Navigate_Pololu.h Sun Jan 31 21:02:13 2016 +0000 @@ -1,18 +1,16 @@ #include "mbed.h" +#include "m3pi.h" class Navigate_Pololu{ private: -const float PI = 3.14159f; +const float PI = 3.14159f; //declare constants for pi and 2pi const float TWO_PI = PI * 2.0f; float distancePerCount; float radiansPerCount; float X; float Y; float heading; -//const float wheelDiameter = 3.2f; -//const float trackWidth = 8.25f; -//const int countsPerRevolution = 3; int previousLeftCounts; int previousRightCounts; float deltaDistance; @@ -28,7 +26,10 @@ public: +m3pi robot; //create robot object, make it public so it can be accessed by main program + Navigate_Pololu(PinName leftIn, PinName rightIn, int countsPerRevolution, float wheelDiameter, float trackWidth,PinName robotTx, PinName robotRx); +//constuctor void leftWheelInterrupt(); //IRQ for left wheel sensor @@ -47,6 +48,6 @@ int getHeading(); //returns heading -void calibratePos(PinName robotTx, PinName robotRx); +void calibratePos(); //aligns wheels }; \ No newline at end of file