Wyatt
1.0.1
|
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. | |
Definition at line 11 of file DriveRobotCommand.h.
DriveRobotCommand::DriveRobotCommand | ( | Communicator * | comm, |
EncoderSensor * | leftEncoder, | ||
EncoderSensor * | rightEncoder, | ||
double | radius, | ||
double | rotationRate, | ||
int | duration_ms, | ||
double | wheelDiameter, | ||
double | drivetrainDiameter | ||
) |
Constructor
comm | Communicator |
leftEncoder | LeftEncoder object |
rightEncoder | RightEncoder object |
radius | Distance from center of robot to turning center in cm. Right = positive, left = negative |
rotationRate | The rate of rotation in rads/second |
duration_ms | The time in milliseconds to run this command for |
wheelDiameter | The diameter of the wheels in cm |
drivetrainDiameter | The distance between the wheels in cm |
Definition at line 9 of file DriveRobotCommand.cpp.
|
overridevirtual |
Stop the respective motor commands. Will no longer perform PD control. Does not change the last motor write value.
canceled |
Implements Command.
Definition at line 59 of file DriveRobotCommand.cpp.
|
overridevirtual |
Return true until time is expired
Implements Command.
Definition at line 34 of file DriveRobotCommand.cpp.