Wyatt  1.0.1
Public Member Functions | List of all members
DriveRobotCommand Class Reference
Inheritance diagram for DriveRobotCommand:
Inheritance graph
[legend]
Collaboration diagram for DriveRobotCommand:
Collaboration graph
[legend]

Public Member Functions

 DriveRobotCommand (Communicator *comm, EncoderSensor *leftEncoder, EncoderSensor *rightEncoder, double radius, double rotationRate, int duration_ms, double wheelDiameter, double drivetrainDiameter)
 
bool execute () override
 
bool cleanup (bool canceled) override
 
- Public Member Functions inherited from Command
 Command ()
 
virtual ~Command ()
 
void init ()
 
void cancel ()
 
void stop ()
 
bool isRunning ()
 
bool isInitialized ()
 
void setIsRunning (bool value)
 
bool isFinished ()
 

Additional Inherited Members

- Protected Attributes inherited from Command
std::mutex m_lock
 Lock for managing access to member variables in a thread-safe manner.
 

Detailed Description

Definition at line 11 of file DriveRobotCommand.h.

Constructor & Destructor Documentation

DriveRobotCommand::DriveRobotCommand ( Communicator comm,
EncoderSensor leftEncoder,
EncoderSensor rightEncoder,
double  radius,
double  rotationRate,
int  duration_ms,
double  wheelDiameter,
double  drivetrainDiameter 
)

Constructor

Parameters
commCommunicator
leftEncoderLeftEncoder object
rightEncoderRightEncoder object
radiusDistance from center of robot to turning center in cm. Right = positive, left = negative
rotationRateThe rate of rotation in rads/second
duration_msThe time in milliseconds to run this command for
wheelDiameterThe diameter of the wheels in cm
drivetrainDiameterThe distance between the wheels in cm

Definition at line 9 of file DriveRobotCommand.cpp.

Member Function Documentation

bool DriveRobotCommand::cleanup ( bool  canceled)
overridevirtual

Stop the respective motor commands. Will no longer perform PD control. Does not change the last motor write value.

Parameters
canceled
Returns
True

Implements Command.

Definition at line 59 of file DriveRobotCommand.cpp.

bool DriveRobotCommand::execute ( )
overridevirtual

Return true until time is expired

Returns
True.

Implements Command.

Definition at line 34 of file DriveRobotCommand.cpp.


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