RSeries astromech firmware
TankDriveRoboteq Class Reference

#include <drive/TankDriveRoboteq.h>

+ Inheritance diagram for TankDriveRoboteq:
+ Collaboration diagram for TankDriveRoboteq:

Public Member Functions

 TankDriveRoboteq (HardwareSerial &serial, JoystickController &driveStick)
 Constructor. More...
 
 TankDriveRoboteq (HardwareSerial &serial, ServoDispatch &dispatch, int leftNum, int rightNum, JoystickController &driveStick)
 Constructor. More...
 
 TankDriveRoboteq (HardwareSerial &serial, ServoDispatch &dispatch, int leftNum, int rightNum, int throttleNum, JoystickController &driveStick)
 Constructor. More...
 
 TankDriveRoboteq (ServoDispatch &dispatch, int leftNum, int rightNum, JoystickController &driveStick)
 Constructor. More...
 
 TankDriveRoboteq (ServoDispatch &dispatch, int leftNum, int rightNum, int throttleNum, JoystickController &driveStick)
 Constructor. More...
 
virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
virtual void stop () override
 
virtual bool enterCommandMode ()
 
virtual void leaveCommandMode ()
 
virtual bool isCommandModeActive ()
 
virtual void moveMillimeters (double mm, float speed=0.1)
 
virtual void turnDegrees (double degrees, float speed=0.1)
 
- Public Member Functions inherited from TankDrive
 TankDrive (JoystickController &driveStick)
 Constructor. More...
 
bool getEnable ()
 
void setEnable (bool enable)
 
uint32_t getSerialLatency ()
 
void setSerialLatency (uint32_t ms)
 
bool getChannelMixing ()
 
void setChannelMixing (bool mixing)
 
bool getThrottleInverted ()
 
void setThrottleInverted (bool invert)
 
bool getTurnInverted ()
 
void setTurnInverted (bool invert)
 
bool getScaling ()
 
void setScaling (bool scaling)
 
float getMaxSpeed ()
 
void setMaxSpeed (float modifier)
 
unsigned getThrottleAccelerationScale ()
 
void setThrottleAccelerationScale (unsigned scale)
 
unsigned getThrottleDecelerationScale ()
 
void setThrottleDecelerationScale (unsigned scale)
 
unsigned getTurnAccelerationScale ()
 
void setTurnAccelerationScale (unsigned scale)
 
unsigned getTurnDecelerationScale ()
 
void setTurnDecelerationScale (unsigned scale)
 
void setAccelerationScale (unsigned scale)
 
void setDecelerationScale (unsigned scale)
 
void setDriveStick (JoystickController &driveStick)
 
void setGuestStick (JoystickController &guestStick)
 
float getGuestSpeedModifier ()
 
void setGuestSpeedModifier (float maxGuestSpeed)
 
void setTargetSteering (TargetSteering *target)
 
bool useThrottle ()
 
bool useHardStop ()
 
bool useLeftStick ()
 
bool useRightStick ()
 
void setUseThrottle (bool use)
 
void setUseHardStop (bool use)
 
void setUseLeftStick ()
 
void setUseRightStick ()
 
JoystickControllergetActiveStick ()
 
virtual void animate () override
 Dispatch any received i2c event to CommandEvent. More...
 
- Public Member Functions inherited from SetupEvent
 SetupEvent ()
 Default Constructor. More...
 
- Public Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 
- Public Member Functions inherited from TurtleDrive
double getDroidDiameterMM ()
 
double getWheelCircumferenceMM ()
 
double getWheelTurnCount ()
 
double getDroidCircumference ()
 
int getMoveDistanceCount (double millimeters)
 
int getTurnDistanceCount (double turnDegrees)
 
void moveInches (double inches)
 
void moveFeet (double feet)
 
void moveMeters (double meters)
 
void moveCentimeters (double meters)
 

Protected Member Functions

virtual void motor (float left, float right, float throttle) override
 
virtual bool hasThrottle () override
 
void writeIntCmd (const char *cmd, int arg1)
 
void writeIntCmd (const char *cmd, int arg1, int arg2)
 
void write (const char *cmd)
 
- Protected Member Functions inherited from TankDrive
virtual float getThrottle ()
 
virtual float throttleSpeed (float speedModifier)
 
void driveStick (JoystickController *stick, float speedModifier)
 

Static Protected Member Functions

static float map (float x, float in_min, float in_max, float out_min, float out_max)
 

Protected Attributes

HardwareSerial * fSerial = NULL
 
ServoDispatchfDispatch = NULL
 
bool fCommandMode = false
 
int fLeft = -1
 
int fRight = -1
 
int fThrottle = -1
 
- Protected Attributes inherited from TankDrive
JoystickControllerfDriveStick
 
JoystickControllerfGuestStick
 
TargetSteeringfTargetSteering
 
bool fEnabled = false
 
bool fWasConnected = false
 
bool fMotorsStopped = false
 
bool fChannelMixing = false
 
bool fScaling = false
 
bool fUseLeftStick = true
 
bool fUseThrottle = true
 
bool fUseHardStop = true
 
bool fThrottleInverted = false
 
bool fTurnInverted = false
 
float fSpeedModifier = 0
 
float fGuestSpeedModifier = 0
 
uint32_t fSerialLatency = 0
 
uint32_t fLastCommand = 0
 
unsigned fThrottleAccelerationScale = 0
 
unsigned fThrottleDecelerationScale = 0
 
unsigned fTurnAccelerationScale = 0
 
unsigned fTurnDecelerationScale = 0
 
float fDriveThrottle = 0
 
float fDriveTurning = 0
 
- Protected Attributes inherited from TurtleDrive
double fDroidDiameterMM = 558.8
 
double fWheelCircumferenceMM = 381
 
double fWheelTurnCount = 610
 

Additional Inherited Members

- Static Public Member Functions inherited from SetupEvent
static void ready ()
 Calls setup() for each created AnimatedEvent subclass. More...
 
- Static Public Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 

Constructor & Destructor Documentation

◆ TankDriveRoboteq() [1/5]

TankDriveRoboteq::TankDriveRoboteq ( HardwareSerial &  serial,
JoystickController driveStick 
)
inline

Constructor.

Only a single instance of WifiSerialBridge should be created per sketch.

Parameters
portthe port number of this service

◆ TankDriveRoboteq() [2/5]

TankDriveRoboteq::TankDriveRoboteq ( HardwareSerial &  serial,
ServoDispatch dispatch,
int  leftNum,
int  rightNum,
JoystickController driveStick 
)
inline

Constructor.

Will drive PWM pins

◆ TankDriveRoboteq() [3/5]

TankDriveRoboteq::TankDriveRoboteq ( HardwareSerial &  serial,
ServoDispatch dispatch,
int  leftNum,
int  rightNum,
int  throttleNum,
JoystickController driveStick 
)
inline

Constructor.

Will drive PWM pins

◆ TankDriveRoboteq() [4/5]

TankDriveRoboteq::TankDriveRoboteq ( ServoDispatch dispatch,
int  leftNum,
int  rightNum,
JoystickController driveStick 
)
inline

Constructor.

Will drive PWM pins

◆ TankDriveRoboteq() [5/5]

TankDriveRoboteq::TankDriveRoboteq ( ServoDispatch dispatch,
int  leftNum,
int  rightNum,
int  throttleNum,
JoystickController driveStick 
)
inline

Constructor.

Will drive PWM pins

Member Function Documentation

◆ enterCommandMode()

virtual bool TankDriveRoboteq::enterCommandMode ( )
inlinevirtual

Implements TurtleDrive.

◆ hasThrottle()

virtual bool TankDriveRoboteq::hasThrottle ( )
inlineoverrideprotectedvirtual

Reimplemented from TankDrive.

◆ isCommandModeActive()

virtual bool TankDriveRoboteq::isCommandModeActive ( )
inlinevirtual

Implements TurtleDrive.

◆ leaveCommandMode()

virtual void TankDriveRoboteq::leaveCommandMode ( )
inlinevirtual

Implements TurtleDrive.

◆ map()

static float TankDriveRoboteq::map ( float  x,
float  in_min,
float  in_max,
float  out_min,
float  out_max 
)
inlinestaticprotected

◆ motor()

virtual void TankDriveRoboteq::motor ( float  left,
float  right,
float  throttle 
)
inlineoverrideprotectedvirtual

Implements TankDrive.

◆ moveMillimeters()

virtual void TankDriveRoboteq::moveMillimeters ( double  mm,
float  speed = 0.1 
)
inlinevirtual

Implements TurtleDrive.

◆ setup()

virtual void TankDriveRoboteq::setup ( )
inlineoverridevirtual

Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor.

Reimplemented from TankDrive.

◆ stop()

virtual void TankDriveRoboteq::stop ( )
inlineoverridevirtual

Reimplemented from TankDrive.

◆ turnDegrees()

virtual void TankDriveRoboteq::turnDegrees ( double  degrees,
float  speed = 0.1 
)
inlinevirtual

Implements TurtleDrive.

◆ write()

void TankDriveRoboteq::write ( const char *  cmd)
inlineprotected

◆ writeIntCmd() [1/2]

void TankDriveRoboteq::writeIntCmd ( const char *  cmd,
int  arg1 
)
inlineprotected

◆ writeIntCmd() [2/2]

void TankDriveRoboteq::writeIntCmd ( const char *  cmd,
int  arg1,
int  arg2 
)
inlineprotected

Member Data Documentation

◆ fCommandMode

bool TankDriveRoboteq::fCommandMode = false
protected

◆ fDispatch

ServoDispatch* TankDriveRoboteq::fDispatch = NULL
protected

◆ fLeft

int TankDriveRoboteq::fLeft = -1
protected

◆ fRight

int TankDriveRoboteq::fRight = -1
protected

◆ fSerial

HardwareSerial* TankDriveRoboteq::fSerial = NULL
protected

◆ fThrottle

int TankDriveRoboteq::fThrottle = -1
protected

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