BaseDrive Class Reference

#include <BaseDrive.h>

List of all members.

Public Member Functions

 BaseDrive (__in TrcAccel *accel, __in Gyro *gyro, __in SpeedController *frontLeftMotor, __in SpeedController *rearLeftMotor, __in SpeedController *frontRightMotor, __in SpeedController *rearRightMotor, __in DriveNotify *notify=NULL, __in float sensitivity=0.5)
virtual ~BaseDrive (void)
void DriveInit (void)
void DriveStop (void)
void SetAccelEnabled (__in bool fEnabled)
void DrivePID (__in float distance, __in float direction, __in float turn, __in float toleranceDrive=0.3, __in float toleranceTurn=2.0, __in float settlingPeriod=0.25, __in float timeout=0.0)
void DrivePIDDistance (__in float distance, __in float direction, __in float tolerance=0.3, __in float settlingPeriod=0.25, __in float timeout=0.0)
void DrivePIDAngle (__in float angle, __in float tolerance=2.0, __in float settlingPeriod=0.25, __in float timeout=0.0)
TrcPIDControl * GetTurnControl (void)
double PIDGet (void)

Detailed Description

This class defines and implements the BaseDrive object. This object inherits the TrcDrive object. It allows us to override the PIDWrite method for the PID control drive. The BaseDrive object supports telop control by joysticks and also PID control drive for autonomous mode.


Constructor & Destructor Documentation

BaseDrive::BaseDrive ( __in TrcAccel *  accel,
__in Gyro *  gyro,
__in SpeedController *  frontLeftMotor,
__in SpeedController *  rearLeftMotor,
__in SpeedController *  frontRightMotor,
__in SpeedController *  rearRightMotor,
__in DriveNotify *  notify = NULL,
__in float  sensitivity = 0.5 
) [inline]

Constructor for the BaseDrive class.

Parameters:
accel Points to the accelerometer object.
gyro Points to the gyro object.
frontLeftMotor Specifies the speed controller for the front left motor.
rearLeftMotor Specifies the speed controller for the rear left motor.
frontRightMotor Specifies the speed controller for the front right motor.
rearRightMotor Specifies the speed controller for the rear right motor.
notify Specifies the drive notification object.
sensitivity Specifies the turning sensitivity.
virtual BaseDrive::~BaseDrive ( void   )  [inline, virtual]

Destructor for the BaseDrive class.


Member Function Documentation

void BaseDrive::DriveInit ( void   )  [inline]

This function initializes the BaseDrive subsystem.

void BaseDrive::DrivePID ( __in float  distance,
__in float  direction,
__in float  turn,
__in float  toleranceDrive = 0.3,
__in float  toleranceTurn = 2.0,
__in float  settlingPeriod = 0.25,
__in float  timeout = 0.0 
) [inline]

This function drives the robot with both Drive and Turn PID.

Parameters:
distance Specifies the distance to drive in feet.
direction Specifies the direction to travel.
turn Specifies the heading of the robot.
toleranceDrive Specifies how close to the drive target we consider on-target.
toleranceTurn Specifies how close to the turn target we consider on-target.
settlingPeriod Specifies the settling period before declaring on target.
timeout Optionally specifies the maximum time allowed for the PID operation. If not zero, we will stop PID if timeout has expired even though we have not reached target.
void BaseDrive::DrivePIDAngle ( __in float  angle,
__in float  tolerance = 2.0,
__in float  settlingPeriod = 0.25,
__in float  timeout = 0.0 
) [inline]

This function turns the robot for a given angle with PID control.

Parameters:
angle Specifies the angle to turn in degrees.
tolerance Specifies how close to the target we consider on-target.
settlingPeriod Specifies the settling period before declaring on target.
timeout Optionally specifies the maximum time allowed for the PID operation. If not zero, we will stop PID if timeout has expired even though we have not reached target.
void BaseDrive::DrivePIDDistance ( __in float  distance,
__in float  direction,
__in float  tolerance = 0.3,
__in float  settlingPeriod = 0.25,
__in float  timeout = 0.0 
) [inline]

This function drives the robot for a given distance with PID control.

Parameters:
distance Specifies the distance to drive in feet.
direction Specifies the direction to travel.
tolerance Specifies how close to the target we consider on-target.
settlingPeriod Specifies the settling period before declaring on target.
timeout Optionally specifies the maximum time allowed for the PID operation. If not zero, we will stop PID if timeout has expired even though we have not reached target.
void BaseDrive::DriveStop ( void   )  [inline]

This function stops the BaseDrive subsystem.

TrcPIDControl* BaseDrive::GetTurnControl ( void   )  [inline]

This function returns the pointer to the turn PID control object.

Returns:
Returns pointer to turn PID control.
double BaseDrive::PIDGet ( void   )  [inline]

This function returns the current distance value for PID control in the unit of feet.

Returns:
Returns the distance value.
void BaseDrive::SetAccelEnabled ( __in bool  fEnabled  )  [inline]

This function enables the accelerometer for PID control.

Parameters:
fEnabled If true, enables the accelerometer, false otherwise.

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

Generated by  doxygen 1.6.2