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

Octocanum drive class that allows for variable drive modes. Allows driving with both traction and mecanum wheels. This is accompished by using a form of rockers and pneumatic pistons to switch out wheels. More...

#include <OctocanumDrive.h>

Inheritance diagram for ADBLib::OctocanumDrive:
Collaboration diagram for ADBLib::OctocanumDrive:

Public Types

enum  driveMode { mecanum, traction }
 
- Public Types inherited from ADBLib::Drivebase
enum  MotorPos { frontLeft, frontRight, backRight, backLeft }
 

Public Member Functions

 OctocanumDrive (SpeedController *mFrontLeft, SpeedController *mFrontRight, SpeedController *mBackRight, SpeedController *mBackLeft, SimplePneumatic *pFrontLeft, SimplePneumatic *pFrontRight, SimplePneumatic *pBackRight, SimplePneumatic *pBackLeft)
 Constructor; sets up all motors and pneumatics. Do NOT give it invalid pointers! More...
 
 ~OctocanumDrive ()
 Destructor, deletes all the motors and pneumatics. More...
 
void drive (float x=0.0, float y=0.0, float r=0.0)
 Drives with full translational and rotational capability. More...
 
void switchMode (driveMode newMode)
 Switches modes. Will. More...
 
driveMode getMode ()
 Gets the current mode of the drivebase. 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...
 

Protected Attributes

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

Additional Inherited Members

- 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

Octocanum drive class that allows for variable drive modes. Allows driving with both traction and mecanum wheels. This is accompished by using a form of rockers and pneumatic pistons to switch out wheels.

Member Enumeration Documentation

Enumerator
mecanum 
traction 

Constructor & Destructor Documentation

ADBLib::OctocanumDrive::OctocanumDrive ( SpeedController *  mFrontLeft,
SpeedController *  mFrontRight,
SpeedController *  mBackRight,
SpeedController *  mBackLeft,
SimplePneumatic pFrontLeft,
SimplePneumatic pFrontRight,
SimplePneumatic pBackRight,
SimplePneumatic pBackLeft 
)

Constructor; sets up all motors and pneumatics. Do NOT give it invalid pointers!

Parameters
mFrontLeftThe front-left motor.
mFrontRightThe front-right motor.
mBackRightThe back-right motor.
mBackLeftThe back left motor.
pFrontLeftThe front-left pneumatic, corresponding to the front-left motor.
pFrontRightThe front-right pneumatic, corresponding to the front-right motor.
pBackRightThe back-right pneumatic, correpsonding to the back-right motor.
pBackLeftThe back-left pneumatic, corresponding to the back-left motor.
ADBLib::OctocanumDrive::~OctocanumDrive ( )

Destructor, deletes all the motors and pneumatics.

Member Function Documentation

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

Drives with full translational and rotational capability.

Parameters
xStrafing. Negative is left, positive is right. From -1 to 1. Only available in mecanum mode.
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:

OctocanumDrive::driveMode ADBLib::OctocanumDrive::getMode ( )

Gets the current mode of the drivebase.

Returns
The mode.
void ADBLib::OctocanumDrive::switchMode ( driveMode  newMode)

Switches modes. Will.

Parameters
newModeThe mode to switch to.

Member Data Documentation

driveMode ADBLib::OctocanumDrive::mode
protected
SimplePneumatic* ADBLib::OctocanumDrive::solenoids[4]
protected

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