#include <Drivebase.h>
|
| | Drivebase (SpeedController *mFrontLeft, SpeedController *mFrontRight, SpeedController *mBackRight, SpeedController *mBackLeft) |
| | Constructor; sets all motors. More...
|
| |
| virtual | ~Drivebase () |
| | Deletes all motors. More...
|
| |
| virtual void | drive (float x=0.0, float y=0.0, float r=0.0)=0 |
| | Pure virtual function; override this for drivebase-specific behavior. 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...
|
| |
|
| 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...
|
| |
|
| void | normSpeeds () |
| | Internal function; normalizes wheel speeds to be between -1 and 1. More...
|
| |
| Enumerator |
|---|
| frontLeft |
|
| frontRight |
|
| backRight |
|
| backLeft |
|
| ADBLib::Drivebase::Drivebase |
( |
SpeedController * |
mFrontLeft, |
|
|
SpeedController * |
mFrontRight, |
|
|
SpeedController * |
mBackRight, |
|
|
SpeedController * |
mBackLeft |
|
) |
| |
Constructor; sets all motors.
- Parameters
-
| mFrontLeft | The front left motor. |
| mFrontRight | The front right motor. |
| mBackRight | The back right motor. |
| mBackLeft | The back left motor. |
- Note
- Accepts anything that inherits a SpeedController, so go wild.
| ADBLib::Drivebase::~Drivebase |
( |
| ) |
|
|
virtual |
| virtual void ADBLib::Drivebase::drive |
( |
float |
x = 0.0, |
|
|
float |
y = 0.0, |
|
|
float |
r = 0.0 |
|
) |
| |
|
pure virtual |
| bool ADBLib::Drivebase::getEnabled |
( |
| ) |
|
Gets the status of the drivebase.
- Returns
- True if enabled, false if disabled.
| void ADBLib::Drivebase::normSpeeds |
( |
| ) |
|
|
protected |
Internal function; normalizes wheel speeds to be between -1 and 1.
| void ADBLib::Drivebase::stop |
( |
| ) |
|
|
virtual |
Disables the drivebase and sets the command to zero the motor.
Reimplemented in ADBLib::OmniDrive.
| bool ADBLib::Drivebase::enabled |
|
protected |
| const string ADBLib::Drivebase::MotorNames[4] = {"Front-left", "Front-Right", "Back-Right", "Back-Left"} |
Motor names that correspond to the MotorPos array; can be used for debug purposes.
| SpeedController* ADBLib::Drivebase::motors[4] |
|
protected |
| float ADBLib::Drivebase::speeds[4] |
|
protected |
The documentation for this class was generated from the following files: