![]() |
VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
|
Public Member Functions | |
drivetrain (motor_group &l, motor_group &r, double wheelTravel=200, double trackWidth=200, double wheelBase=50, distanceUnits unit=distanceUnits::mm, double externalGearRatio=1.0) | |
drivetrain (vex::motor &l, vex::motor &r, double wheelTravel=200, double trackWidth=200, double wheelBase=50, distanceUnits unit=distanceUnits::mm, double externalGearRatio=1.0) | |
void | setGearRatio (double ratio) |
void | setDriveVelocity (double velocity, velocityUnits units) |
Sets the velocity of the drive based on the parameters set in the command. This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value. | |
void | setDriveVelocity (double velocity, percentUnits units) |
void | setTurnVelocity (double velocity, velocityUnits units) |
Sets the turn velocity of the drive based on the parameters set in the command. This command will not run the motor. | |
void | setTurnVelocity (double velocity, percentUnits units) |
void | setTimeout (int32_t time, timeUnits units) |
Sets the timeout for the motor group. If the motor group does not reach its' commanded position prior to the completion of the timeout, the motors will stop. | |
void | setStopping (brakeType mode) |
Sets the stopping mode of the motor group by passing a brake mode as a parameter. | |
void | drive (directionType dir) |
Turns the motors on, and drive in the specified direction. | |
void | drive (directionType dir, double velocity, velocityUnits units) |
Turn on the motors and drive in the specified direction and a specified velocity. | |
bool | driveFor (double distance, distanceUnits units, bool waitForCompletion=true) |
Turn on the motors and drive a distance at the default velocity. | |
bool | driveFor (directionType dir, double distance, distanceUnits units, bool waitForCompletion=true) |
bool | driveFor (double distance, distanceUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turn on the motors and drive a distance at a specified velocity. | |
bool | driveFor (directionType dir, double distance, distanceUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
void | turn (turnType dir) |
Turns the motors on, and rotate in the specified direction. | |
void | turn (turnType dir, double velocity, velocityUnits units) |
Turns the motors on, and rotate in the specified direction and a specified velocity. | |
virtual bool | turnFor (double angle, rotationUnits units, bool waitForCompletion=true) |
Turn on the motors and rotate an angle at the default velocity. | |
virtual bool | turnFor (turnType dir, double angle, rotationUnits units, bool waitForCompletion=true) |
virtual bool | turnFor (double angle, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turn on the motors and rotate an angle at a specified velocity. | |
virtual bool | turnFor (turnType dir, double angle, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
virtual bool | isMoving (void) |
Checks to see if any of the motors are rotating to a specific target. | |
bool | isDone (void) |
Checks to see if all the motor are done rotating to a specific target. | |
void | stop () |
Stops the drive using the default brake mode. | |
void | stop (brakeType mode) |
Stops the drive using a specified brake mode. | |
void | arcade (double drivePower, double turnPower, percentUnits units=percentUnits::pct) |
double | velocity (velocityUnits units) |
Gets the average velocity of the drivetrain;. | |
double | velocity (percentUnits units) |
double | current (currentUnits units=currentUnits::amp) |
Gets the total current of the drivetrain;. | |
double | current (percentUnits units) |
Gets the electrical current of the drivetrain as percentage of maximum. | |
double | voltage (voltageUnits units=voltageUnits::volt) |
Gets the average voltage of the drivetrain;. | |
double | power (powerUnits units=powerUnits::watt) |
Gets the average power of the drivetrain;. | |
double | torque (torqueUnits units=torqueUnits::Nm) |
Gets the average torque of the drivetrain;. | |
double | efficiency (percentUnits units=percentUnits::pct) |
Gets the average efficiency of the drivetrain;. | |
double | temperature (percentUnits units) |
Gets the average temperature of the drivetrain;. | |
Protected Member Functions | |
double | distanceToMm (double distance, distanceUnits units) |
double | angleToDeg (double angle, rotationUnits units) |
int32_t | timeoutGet () |
Protected Attributes | |
double | _turnvelocity |
velocityUnits | _turnvelocityUnits |
uint8_t | _turnmode |
Definition at line 26 of file vex_drivetrain.h.
double vex::drivetrain::current | ( | currentUnits | units = currentUnits::amp | ) |
Gets the total current of the drivetrain;.
units | The measurement unit for the current. |
double vex::drivetrain::current | ( | percentUnits | units | ) |
Gets the electrical current of the drivetrain as percentage of maximum.
units | The measurement unit for the current. |
void vex::drivetrain::drive | ( | directionType | dir | ) |
Turns the motors on, and drive in the specified direction.
dir | The direction to drive. |
void vex::drivetrain::drive | ( | directionType | dir, |
double | velocity, | ||
velocityUnits | units ) |
Turn on the motors and drive in the specified direction and a specified velocity.
dir | The direction to drive. |
velocity | Sets the amount of velocity. |
units | The measurement unit for the velocity value. |
bool vex::drivetrain::driveFor | ( | double | distance, |
distanceUnits | units, | ||
bool | waitForCompletion = true ) |
Turn on the motors and drive a distance at the default velocity.
distance | Sets the distance to drive. |
units | The measurement unit for the distance value. |
waitForCompletion | (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true. |
bool vex::drivetrain::driveFor | ( | double | distance, |
distanceUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v, | ||
bool | waitForCompletion = true ) |
Turn on the motors and drive a distance at a specified velocity.
distance | Sets the distance to drive. |
units | The measurement unit for the distance value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
waitForCompletion | (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true. |
double vex::drivetrain::efficiency | ( | percentUnits | units = percentUnits::pct | ) |
Gets the average efficiency of the drivetrain;.
units | (Optional) The measurement unit for the efficiency. By default, this parameter is a percentage. |
bool vex::drivetrain::isDone | ( | void | ) |
Checks to see if all the motor are done rotating to a specific target.
|
virtual |
Checks to see if any of the motors are rotating to a specific target.
Reimplemented in vex::smartdrive.
double vex::drivetrain::power | ( | powerUnits | units = powerUnits::watt | ) |
Gets the average power of the drivetrain;.
units | The measurement unit for the power. |
void vex::drivetrain::setDriveVelocity | ( | double | velocity, |
velocityUnits | units ) |
Sets the velocity of the drive based on the parameters set in the command. This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value.
velocity | Sets the amount of velocity. |
units | The measurement unit for the velocity value. |
void vex::drivetrain::setStopping | ( | brakeType | mode | ) |
Sets the stopping mode of the motor group by passing a brake mode as a parameter.
mode | The stopping mode can be set to coast, brake, or hold. |
void vex::drivetrain::setTimeout | ( | int32_t | time, |
timeUnits | units ) |
Sets the timeout for the motor group. If the motor group does not reach its' commanded position prior to the completion of the timeout, the motors will stop.
time | Sets the amount of time. |
units | The measurement unit for the time value. |
void vex::drivetrain::setTurnVelocity | ( | double | velocity, |
velocityUnits | units ) |
Sets the turn velocity of the drive based on the parameters set in the command. This command will not run the motor.
velocity | Sets the amount of velocity. |
units | The measurement unit for the velocity value. |
void vex::drivetrain::stop | ( | brakeType | mode | ) |
Stops the drive using a specified brake mode.
mode | The brake mode can be set to coast, brake, or hold. |
double vex::drivetrain::temperature | ( | percentUnits | units | ) |
Gets the average temperature of the drivetrain;.
units | The measurement unit for the temperature. |
double vex::drivetrain::torque | ( | torqueUnits | units = torqueUnits::Nm | ) |
Gets the average torque of the drivetrain;.
units | The measurement unit for the torque. |
void vex::drivetrain::turn | ( | turnType | dir | ) |
Turns the motors on, and rotate in the specified direction.
dir | The direction to rotate the robot. |
void vex::drivetrain::turn | ( | turnType | dir, |
double | velocity, | ||
velocityUnits | units ) |
Turns the motors on, and rotate in the specified direction and a specified velocity.
dir | The direction to rotate the robot. |
velocity | Sets the amount of velocity. |
units | The measurement unit for the velocity value. |
|
virtual |
Turn on the motors and rotate an angle at the default velocity.
angle | Sets the angle to turn. |
units | The measurement unit for the angle value. |
waitForCompletion | (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true. |
Reimplemented in vex::smartdrive.
|
virtual |
Turn on the motors and rotate an angle at a specified velocity.
angle | Sets the angle to turn. |
units | The measurement unit for the angle value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
waitForCompletion | (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true. |
Reimplemented in vex::smartdrive.
|
virtual |
Reimplemented in vex::smartdrive.
|
virtual |
Reimplemented in vex::smartdrive.
|
inline |
Definition at line 188 of file vex_drivetrain.h.
double vex::drivetrain::velocity | ( | velocityUnits | units | ) |
Gets the average velocity of the drivetrain;.
units | The measurement unit for the velocity. |
double vex::drivetrain::voltage | ( | voltageUnits | units = voltageUnits::volt | ) |
Gets the average voltage of the drivetrain;.
units | The measurement unit for the voltage. |
|
protected |
Definition at line 252 of file vex_drivetrain.h.
|
protected |
Definition at line 250 of file vex_drivetrain.h.
|
protected |
Definition at line 251 of file vex_drivetrain.h.