ADBLib  0.5
A simple library for rapid robot code development
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
ADBLib::TractionDrive Class Reference

Simple TractionDrive class for driving with a traction drive. Discards x velocity. More...

#include <TractionDrive.h>

Inheritance diagram for ADBLib::TractionDrive:
Collaboration diagram for ADBLib::TractionDrive:

Public Member Functions

 TractionDrive (SpeedController *mFrontLeft, SpeedController *mFrontRight, SpeedController *mBackRight, SpeedController *mBackLeft)
 
void drive (float x=0.0, float y=0.0, float r=0.0)
 Uses traction wheels to drive. Capable of forward/reverse and left/right. More...
 
- Public Member Functions inherited from ADBLib::Drivebase
 Drivebase (SpeedController *mFrontLeft, SpeedController *mFrontRight, SpeedController *mBackRight, SpeedController *mBackLeft)
 Constructor; sets all motors. More...
 
virtual ~Drivebase ()
 Deletes all motors. More...
 
virtual void stop ()
 Disables the drivebase and sets the command to zero the motor. More...
 
bool getEnabled ()
 Gets the status of the drivebase. More...
 

Additional Inherited Members

- Public Types inherited from ADBLib::Drivebase
enum  MotorPos { frontLeft, frontRight, backRight, backLeft }
 
- Public Attributes inherited from ADBLib::Drivebase
const string MotorNames [4] = {"Front-left", "Front-Right", "Back-Right", "Back-Left"}
 Motor names that correspond to the MotorPos array; can be used for debug purposes. More...
 
- Protected Member Functions inherited from ADBLib::Drivebase
void normSpeeds ()
 Internal function; normalizes wheel speeds to be between -1 and 1. More...
 
- Protected Attributes inherited from ADBLib::Drivebase
SpeedController * motors [4]
 
bool enabled
 
float speeds [4]
 

Detailed Description

Simple TractionDrive class for driving with a traction drive. Discards x velocity.

Constructor & Destructor Documentation

ADBLib::TractionDrive::TractionDrive ( SpeedController *  mFrontLeft,
SpeedController *  mFrontRight,
SpeedController *  mBackRight,
SpeedController *  mBackLeft 
)
inline

Member Function Documentation

void ADBLib::TractionDrive::drive ( float  x = 0.0,
float  y = 0.0,
float  r = 0.0 
)
virtual

Uses traction wheels to drive. Capable of forward/reverse and left/right.

Parameters
xDiscarded; traction drive incapable of strafing.
yForward/Reverse. Positive is forward, negative is reverse. From 1 to -1.
rRotation. Positive is clockwise, negative is counterclockwise. From 1 to -1.
Todo:
Test with a real traction drive (or any similar drive)

Implements ADBLib::Drivebase.

Here is the call graph for this function:


The documentation for this class was generated from the following files: