Simple controller class for Stinger Robot without using Robotics Connection board.
Diff: Robot.h
- Revision:
- 1:b4d202b471ae
- Parent:
- 0:fc95840345e8
--- a/Robot.h Tue Oct 12 20:51:08 2010 +0000 +++ b/Robot.h Wed Oct 13 03:18:54 2010 +0000 @@ -23,23 +23,67 @@ #define RATE 0.05 #define DPP 14.2 //Pulses per degree of motor rotation +/** + * Robot class. + */ class Robot { public: + /** + * Constructor + */ Robot(); + /** + * Destructor + */ virtual ~Robot(); + /** + * Move Straight + * @param s speed between -1.0 and 1.0 + * @param clix Number of pulses to move + */ void MoveStraightPulses(float s, int clix); + /** + * Move Straight + * @param speed speed between -1.0 and 1.0 + * @param in Number of inches to move + */ void MoveStraightInches(float speed, float in); + /** + * Move Straight + * @param seed speed between -1.0 and 1.0 + * @param rotations Number of wheel rotations to move + */ void MoveStraightRotations(float speed, float rotations); - + /** + * Stop Left Wheel + */ void StopLeft(); + /** + * Stop Right Wheel + */ void StopRight(); + /** + * Stop + */ void Stop(); - + /** + * Pivet left + * @param deg degrees + */ void PivetLeft(float deg); + /** + * Pivet right + * @param deg degrees + */ void PivetRight(float deg); void RotateLeftWheel(float rpm, float deg); //Rotate Wheel <deg> Degrees void RotateRightWheel(float rpm, float deg); //Rotate Wheel <deg> Degrees + /** + * Returns 0 if robot is not moving + * Returns 1 otherwise + * @returns flat + */ int IsBusy(); @@ -51,6 +95,9 @@ PID *leftPid; PID *rightPid; Serial *pc; + /** + * Ticker function + */ void Call(); private: