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

Simple omni drive class that uses omni wheels and a translational omni wheel for strafing. More...

#include <OmniDrive.h>

Inheritance diagram for ADBLib::OmniDrive:
Collaboration diagram for ADBLib::OmniDrive:

Public Member Functions

 OmniDrive (SpeedController *mFrontLeft, SpeedController *mFrontRight, SpeedController *mBackRight, SpeedController *mBackLeft, SpeedController *newTransMotor)
 Constructor; sets all motors, including the translation motor. More...
 
 ~OmniDrive ()
 Deletes all motors, including the translation motor. More...
 
void drive (float x=0.0, float y=0.0, float r=0.0)
 Uses omni wheels to drive in combination with a translational omni wheel. Capable of full translation and rotation. More...
 
void setTransMotor (SpeedController *newMotor)
 Set the translation motor. More...
 
void stop ()
 Disables the drivebase and sets the command to zero the motor. 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...
 
bool getEnabled ()
 Gets the status of the drivebase. More...
 

Protected Attributes

SpeedController * transMotor
 
- Protected Attributes inherited from ADBLib::Drivebase
SpeedController * motors [4]
 
bool enabled
 
float speeds [4]
 

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...
 

Detailed Description

Simple omni drive class that uses omni wheels and a translational omni wheel for strafing.

Constructor & Destructor Documentation

ADBLib::OmniDrive::OmniDrive ( SpeedController *  mFrontLeft,
SpeedController *  mFrontRight,
SpeedController *  mBackRight,
SpeedController *  mBackLeft,
SpeedController *  newTransMotor 
)

Constructor; sets all motors, including the translation motor.

Parameters
mFrontLeftThe front left motor.
mFrontRightThe front right motor.
mBackRightThe back right motor.
mBackLeftThe back left motor.
newTransMotorThe translation motor.
ADBLib::OmniDrive::~OmniDrive ( )

Deletes all motors, including the translation motor.

Member Function Documentation

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

Uses omni wheels to drive in combination with a translational omni wheel. Capable of full translation and rotation.

Parameters
xStrafing. Negative is left, positive is right. From -1 to 1.
yForward/Reverse. Positive is forward, negative is reverse. From 1 to -1.
rRotation. Positive is clockwise, negative is counterclockwise. From 1 to -1.

Implements ADBLib::Drivebase.

Here is the call graph for this function:

void ADBLib::OmniDrive::setTransMotor ( SpeedController *  newMotor)

Set the translation motor.

Parameters
newMotorThe translational motor. Should be set perendicular to the set of regular omni wheels.
void ADBLib::OmniDrive::stop ( )
virtual

Disables the drivebase and sets the command to zero the motor.

Reimplemented from ADBLib::Drivebase.

Member Data Documentation

SpeedController* ADBLib::OmniDrive::transMotor
protected

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