VEX V5 C++ API
|
Public Member Functions | |
~motor_group () | |
template<typename... Args> | |
motor_group (vex::motor &m1, Args &... m2) | |
template<typename... Args> | |
void | operator() (vex::motor &m1, Args &... m2) |
int32_t | count (void) |
return the number of motors in the motor group More... | |
void | setVelocity (double velocity, velocityUnits units) |
Sets the velocity of the motor group 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. More... | |
void | setVelocity (double velocity, percentUnits units) |
void | setStopping (brakeType mode) |
Sets the stopping mode of the motor group by passing a brake mode as a parameter. More... | |
void | resetRotation (void) |
Resets all motor encoders to the value of zero. More... | |
void | resetPosition (void) |
Resets the motor's encoder to the value of zero. More... | |
void | setRotation (double value, rotationUnits units) |
Sets the value of all motor encoders to the value specified in the parameter. More... | |
void | setPosition (double value, rotationUnits units) |
Sets the value of all motor encoders to the value specified in the parameter. More... | |
void | setTimeout (double 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. More... | |
double | timeout (timeUnits units) |
void | spin (directionType dir) |
Turns the motors on, and spins them in the specified direction. More... | |
void | spin (directionType dir, double velocity, velocityUnits units) |
Turn on the motors and spins them in the specified direction and a specified velocity. More... | |
void | spin (directionType dir, double velocity, percentUnits units) |
void | spin (directionType dir, double voltage, voltageUnits units) |
Turn on the motors and spins them in the specified direction and a specified voltage. More... | |
bool | spinTo (double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turns on the motors and spin them to an absolute target rotation value at a specified velocity. More... | |
bool | spinTo (double rotation, rotationUnits units, bool waitForCompletion=true) |
Turn on the motors and spin them to an absolute target rotation value. More... | |
bool | spinToPosition (double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turns on the motors and spin them to an absolute target rotation value at a specified velocity. More... | |
bool | spinToPosition (double rotation, rotationUnits units, bool waitForCompletion=true) |
Turn on the motors and spin them to an absolute target rotation value. More... | |
bool | spinFor (double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turn on the motors and spin them to a relative target rotation value at a specified velocity. More... | |
bool | spinFor (directionType dir, double rotation, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true) |
Turn on the motors and spin them to a relative target rotation value at a specified velocity. More... | |
bool | spinFor (double rotation, rotationUnits units, bool waitForCompletion=true) |
Turn on the motors and spin them to a relative target rotation value. More... | |
bool | spinFor (directionType dir, double rotation, rotationUnits units, bool waitForCompletion=true) |
Turn on the motors and spin them to a relative target rotation value. More... | |
void | spinFor (double time, timeUnits units, double velocity, velocityUnits units_v) |
Turn on the motors and spin them to a relative target time value at a specified velocity. More... | |
void | spinFor (directionType dir, double time, timeUnits units, double velocity, velocityUnits units_v) |
Turn on the motors and spin them to a relative target time value at a specified velocity. More... | |
void | spinFor (double time, timeUnits units) |
Turn on the motors and spin them to a relative target time value. More... | |
void | spinFor (directionType dir, double time, timeUnits units) |
Turn on the motors and spin them to a relative target time value. More... | |
void | startSpinTo (double rotation, rotationUnits units, double velocity, velocityUnits units_v) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target. More... | |
void | startSpinTo (double rotation, rotationUnits units) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target.. More... | |
void | startSpinToPosition (double rotation, rotationUnits units, double velocity, velocityUnits units_v) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target. Same as startSpinTo . More... | |
void | startSpinToPosition (double rotation, rotationUnits units) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target. Same as startSpinTo . More... | |
void | startSpinFor (double rotation, rotationUnits units, double velocity, velocityUnits units_v) |
Starts spinning the motors to a relative target rotation but does not wait for the motors to reach that target. More... | |
void | startSpinFor (directionType dir, double rotation, rotationUnits units, double velocity, velocityUnits units_v) |
Starts spinning the motors to a relative target rotation but does not wait for the motors to reach that target. More... | |
void | startSpinFor (double rotation, rotationUnits units) |
Starts spinning the motors to a relative target but does not wait for the motors to reach that target. More... | |
void | startSpinFor (directionType dir, double rotation, rotationUnits units) |
Starts spinning the motors to a relative target but does not wait for the motors to reach that target. More... | |
bool | isSpinning (void) |
Checks to see if any of the motors are rotating to a specific target. More... | |
bool | isDone (void) |
Checks to see if all the motor are done rotating to a specific target. More... | |
void | stop (void) |
Stops all motors using the default brake mode. More... | |
void | stop (brakeType mode) |
Stops all motors using a specified brake mode. More... | |
void | setMaxTorque (double value, percentUnits units) |
Sets the max torque of the motors. More... | |
void | setMaxTorque (double value, torqueUnits units) |
Sets the max torque of the motors. More... | |
void | setMaxTorque (double value, currentUnits units) |
Sets the max torque of the motors. More... | |
directionType | direction (void) |
Gets which direction the first motor in the group is spinning. More... | |
double | rotation (rotationUnits units) |
Gets the current rotation of the first motor in the group's encoder. More... | |
double | position (rotationUnits units) |
Gets the current position of the first motor in the group's encoder. More... | |
double | velocity (velocityUnits units) |
Gets the current velocity of the first motor in the group. More... | |
double | velocity (percentUnits units) |
double | current (currentUnits units=currentUnits::amp) |
Gets the sum electrical current for all motors in the group. More... | |
double | power (powerUnits units=powerUnits::watt) |
Gets the power of the first motor in the group. More... | |
double | torque (torqueUnits units=torqueUnits::Nm) |
Gets the torque of the first motor in the group. More... | |
double | efficiency (percentUnits units=percentUnits::pct) |
Gets the efficiency of the first motor in the group. More... | |
double | temperature (percentUnits units=percentUnits::pct) |
Gets the temperature of the first motor in the group. More... | |
double | temperature (temperatureUnits units) |
Gets the temperature of the motor. More... | |
Friends | |
class | drivetrain |
vex::motor_group::~motor_group | ( | ) |
|
inline |
|
inline |
int32_t vex::motor_group::count | ( | void | ) |
return the number of motors in the motor group
void vex::motor_group::setVelocity | ( | double | velocity, |
velocityUnits | units | ||
) |
Sets the velocity of the motor group 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. |
|
inline |
void vex::motor_group::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::motor_group::resetRotation | ( | void | ) |
Resets all motor encoders to the value of zero.
void vex::motor_group::resetPosition | ( | void | ) |
Resets the motor's encoder to the value of zero.
void vex::motor_group::setRotation | ( | double | value, |
rotationUnits | units | ||
) |
Sets the value of all motor encoders to the value specified in the parameter.
value | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
void vex::motor_group::setPosition | ( | double | value, |
rotationUnits | units | ||
) |
Sets the value of all motor encoders to the value specified in the parameter.
value | Sets the current position of the motor. |
units | The measurement unit for the position value. |
void vex::motor_group::setTimeout | ( | double | 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. |
double vex::motor_group::timeout | ( | timeUnits | units | ) |
void vex::motor_group::spin | ( | directionType | dir | ) |
Turns the motors on, and spins them in the specified direction.
dir | The direction to spin the motors. |
void vex::motor_group::spin | ( | directionType | dir, |
double | velocity, | ||
velocityUnits | units | ||
) |
Turn on the motors and spins them in the specified direction and a specified velocity.
dir | The direction to spin the motors. |
velocity | Sets the amount of velocity. |
units | The measurement unit for the velocity value. |
|
inline |
void vex::motor_group::spin | ( | directionType | dir, |
double | voltage, | ||
voltageUnits | units | ||
) |
Turn on the motors and spins them in the specified direction and a specified voltage.
dir | The direction to spin the motors. |
voltage | Sets the amount of volts. |
units | The measurement unit for the voltage value. |
bool vex::motor_group::spinTo | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v, | ||
bool | waitForCompletion = true |
||
) |
Turns on the motors and spin them to an absolute target rotation value at a specified velocity.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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. |
bool vex::motor_group::spinTo | ( | double | rotation, |
rotationUnits | units, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to an absolute target rotation value.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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::motor_group::spinToPosition | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v, | ||
bool | waitForCompletion = true |
||
) |
Turns on the motors and spin them to an absolute target rotation value at a specified velocity.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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. |
bool vex::motor_group::spinToPosition | ( | double | rotation, |
rotationUnits | units, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to an absolute target rotation value.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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::motor_group::spinFor | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to a relative target rotation value at a specified velocity.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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. |
bool vex::motor_group::spinFor | ( | directionType | dir, |
double | rotation, | ||
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to a relative target rotation value at a specified velocity.
dir | The direction to spin the motors. |
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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. |
bool vex::motor_group::spinFor | ( | double | rotation, |
rotationUnits | units, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to a relative target rotation value.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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::motor_group::spinFor | ( | directionType | dir, |
double | rotation, | ||
rotationUnits | units, | ||
bool | waitForCompletion = true |
||
) |
Turn on the motors and spin them to a relative target rotation value.
dir | The direction to spin the motors. |
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation 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. |
void vex::motor_group::spinFor | ( | double | time, |
timeUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Turn on the motors and spin them to a relative target time value at a specified velocity.
time | Sets the amount of time. |
units | The measurement unit for the time value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::spinFor | ( | directionType | dir, |
double | time, | ||
timeUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Turn on the motors and spin them to a relative target time value at a specified velocity.
dir | The direction to spin the motors. |
time | Sets the amount of time. |
units | The measurement unit for the time value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::spinFor | ( | double | time, |
timeUnits | units | ||
) |
Turn on the motors and spin them to a relative target time value.
time | Sets the amount of time. |
units | The measurement unit for the time value. |
void vex::motor_group::spinFor | ( | directionType | dir, |
double | time, | ||
timeUnits | units | ||
) |
Turn on the motors and spin them to a relative target time value.
dir | The direction to spin the motors. |
time | Sets the amount of time. |
units | The measurement unit for the time value. |
void vex::motor_group::startSpinTo | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::startSpinTo | ( | double | rotation, |
rotationUnits | units | ||
) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target..
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
void vex::motor_group::startSpinToPosition | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target. Same as startSpinTo
.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::startSpinToPosition | ( | double | rotation, |
rotationUnits | units | ||
) |
Starts spinning the motors to an absolute target rotation but does not wait for the motors to reach that target. Same as startSpinTo
.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
void vex::motor_group::startSpinFor | ( | double | rotation, |
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Starts spinning the motors to a relative target rotation but does not wait for the motors to reach that target.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::startSpinFor | ( | directionType | dir, |
double | rotation, | ||
rotationUnits | units, | ||
double | velocity, | ||
velocityUnits | units_v | ||
) |
Starts spinning the motors to a relative target rotation but does not wait for the motors to reach that target.
dir | The direction to spin the motor. |
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
velocity | Sets the amount of velocity. |
units_v | The measurement unit for the velocity value. |
void vex::motor_group::startSpinFor | ( | double | rotation, |
rotationUnits | units | ||
) |
Starts spinning the motors to a relative target but does not wait for the motors to reach that target.
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
void vex::motor_group::startSpinFor | ( | directionType | dir, |
double | rotation, | ||
rotationUnits | units | ||
) |
Starts spinning the motors to a relative target but does not wait for the motors to reach that target.
dir | The direction to spin the motor. |
rotation | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
bool vex::motor_group::isSpinning | ( | void | ) |
Checks to see if any of the motors are rotating to a specific target.
bool vex::motor_group::isDone | ( | void | ) |
Checks to see if all the motor are done rotating to a specific target.
void vex::motor_group::stop | ( | void | ) |
Stops all motors using the default brake mode.
void vex::motor_group::stop | ( | brakeType | mode | ) |
Stops all motors using a specified brake mode.
mode | The brake mode can be set to coast, brake, or hold. |
void vex::motor_group::setMaxTorque | ( | double | value, |
percentUnits | units | ||
) |
Sets the max torque of the motors.
value | Sets the amount of torque. |
units | The measurement unit for the torque value. |
void vex::motor_group::setMaxTorque | ( | double | value, |
torqueUnits | units | ||
) |
Sets the max torque of the motors.
value | Sets the amount of torque. |
units | The measurement unit for the torque value. |
void vex::motor_group::setMaxTorque | ( | double | value, |
currentUnits | units | ||
) |
Sets the max torque of the motors.
value | Sets the amount of torque. |
units | The measurement unit for the torque value. |
directionType vex::motor_group::direction | ( | void | ) |
Gets which direction the first motor in the group is spinning.
double vex::motor_group::rotation | ( | rotationUnits | units | ) |
Gets the current rotation of the first motor in the group's encoder.
units | The measurement unit for the rotation. |
double vex::motor_group::position | ( | rotationUnits | units | ) |
Gets the current position of the first motor in the group's encoder.
units | The measurement unit for the position. |
double vex::motor_group::velocity | ( | velocityUnits | units | ) |
Gets the current velocity of the first motor in the group.
units | The measurement unit for the velocity. |
|
inline |
double vex::motor_group::current | ( | currentUnits | units = currentUnits::amp | ) |
Gets the sum electrical current for all motors in the group.
units | The measurement unit for the current. |
double vex::motor_group::power | ( | powerUnits | units = powerUnits::watt | ) |
Gets the power of the first motor in the group.
units | The measurement unit for the power. |
double vex::motor_group::torque | ( | torqueUnits | units = torqueUnits::Nm | ) |
Gets the torque of the first motor in the group.
units | The measurement unit for the torque. |
double vex::motor_group::efficiency | ( | percentUnits | units = percentUnits::pct | ) |
Gets the efficiency of the first motor in the group.
units | (Optional) The measurement unit for the efficiency. By default, this parameter is a percentage. |
double vex::motor_group::temperature | ( | percentUnits | units = percentUnits::pct | ) |
Gets the temperature of the first motor in the group.
units | The measurement unit for the temperature. |
double vex::motor_group::temperature | ( | temperatureUnits | units | ) |
Gets the temperature of the motor.
units | The measurement unit for the temperature. |
|
friend |