|
| HDrive (float track_width, float wheel_radius, float center_wheel_radius, vex::motor_group left, vex::motor_group right, vex::motor_group center, float drive_gear_ratio) |
| Construct a new HDrive object.
|
|
void | setStraightPID (PID pid) override |
| Sets the straight PID object.
|
|
void | setTurnPID (PID pid) override |
| Sets the turning PID object.
|
|
void | setStrafePID (PID pid) |
| Sets the strafing PID object.
|
|
void | spin (int left_velocity, int right_velocity, int center_velocity) |
| Spin the entire chassis by specified velocities for each side of the chassis. Negative values spin the wheel backwards.
|
|
void | spin (int sides, int center) |
| Spin the entire chassis by specified velocities for each side of the chassis. Negative values spin the wheel backwards.
|
|
void | straight (float distance, int max_speed) override |
| Move the chassis forward a specific distance with PID. Chassis will always stay at or below the maximum speed.
|
|
void | straightAsync (float distance, int max_speed) override |
| Move the chassis forward asynchronously a specific distance with PID. Chassis will always stay at or below the maximum speed.
|
|
void | turn (int target_angle, int max_speed) override |
| Turn the chassis on the spot with PID. Chassis will always stay at or below the maximum speed.
|
|
void | turnAsync (float target_angle, int max_speed) override |
| Turn the chassis on the spot asynchronously with PID. Chassis will always stay at or below the maximum speed.
|
|
void | strafe (float distance, int max_speed) |
| Strafe the chassis sideways with PID. Chassis will always stay at or below the maximum speed.
|
|
void | strafeAsync (float distance, int max_speed) |
| Strafe the chassis sideways asynchronously with PID. Chassis will always stay at or below the maximum speed.
|
|
void | diagonal (float straight_distance, float strafe_distance, int straight_max_speed) |
| Move the chassis on a diagonal a specific distance with PID. Chassis will always stay at or below the maximum speed. The speed of the center wheel is calculated in the function as being proportional to the distance traveled. If the straight distance is 100, and center is 30, the center wheel will spin at 30% the speed of straight_max_speed.
|
|
void | diagonalAsync (float straight_distance, float strafe_distance, int straight_max_speed) |
| Move the chassis on a diagonal asynchronously a specific distance with PID. Chassis will always stay at or below the maximum speed. The speed of the center wheel is calculated in the function as being proportional to the distance traveled. If the straight distance is 100, and center is 30, the center wheel will spin at 30% the speed of straight_max_speed.
|
|
void | stop () override |
| Stops the chassis using the default brake mode.
|
|
void | waitUntilSettled () override |
| Waits for the robot to finish a motion.
|
|
float | getLeftPosition (vex::rotationUnits units) |
| Gets the current position of the left side of the chassis.
|
|
float | getRightPosition (vex::rotationUnits units) |
| Gets the current position of the right side of the chassis.
|
|
float | getCenterPosition (vex::rotationUnits units) |
| Gets the current position of the center wheel of the chassis.
|
|
void | resetPosition () override |
| Reset all encoders to 0.
|
|
void | setBrakeType (vex::brakeType type) |
| Sets the brake type of the chassis.
|
|
void | setMaxAcceleration (float straight_max_accel, float c_max_accel) |
| Set the max acceleration of the chassis. Every time the PID loop executes, it increments the speed of the mechanism by this value until the mechanism reaches it's maximum speed. Increase the value if the robot is ramping too slow, or decrease if it causes too much jerk.
|
|
void | setOffset (float straight, float turn, float strafe) |
| Set the offset for the straight and turn functions. This value is in inches, and will add to the input of each movement function.
|
|
void | setTimeout (int timeout) |
| Set the timeout to use for PID movement. If the timeout is exceeded, the system will stop regardless of the current error or speed. A value of -1 will disable timeouts.
|
|
void | setMeasurementUnits (Conversion::measurement preferred_units) |
| Set the measurement units for chassis values.
|
|
| Tank (float track_width, float wheel_radius, vex::motor_group left, vex::motor_group right, float drive_gear_ratio) |
| Construct a new Tank object.
|
|
void | setStraightPID (PID pid) override |
| Sets the straight PID object.
|
|
void | setTurnPID (PID pid) override |
| Sets the turning PID constants.
|
|
void | spin (int left_velocity, int right_velocity) |
| Spin the entire chassis by specified velocities for each side of the chassis. Negative values spin the wheel backwards.
|
|
void | spin (int velocity) |
| Spin the entire chassis by specified velocities for both sides.
|
|
void | straight (float distance, int max_speed) override |
| Move the chassis forward a specific distance with PID. Chassis will always stay at or below the maximum speed.
|
|
void | straightAsync (float distance, int max_speed) override |
| Move the chassis forward asynchronously a specific distance with PID. Chassis will always stay at or below the maximum speed.
|
|
void | turn (int target_angle, int max_speed) override |
| Turn the chassis on the spot with PID. Chassis will always stay at or below the maximum speed.
|
|
void | turnAsync (float target_angle, int max_speed) override |
| Turn the chassis on the spot asynchronously with PID. Chassis will always stay at or below the maximum speed.
|
|
void | stop () override |
| Stops the chassis using the default brake mode.
|
|
void | waitUntilSettled () override |
| Waits for the robot to finish a motion.
|
|
float | getLeftPosition (vex::rotationUnits units) override |
| Gets the current position of the left side of the chassis.
|
|
float | getRightPosition (vex::rotationUnits units) override |
| Gets the current position of the right side of the chassis.
|
|
void | resetPosition () override |
| Reset the left and right encoders to 0.
|
|
void | setBrakeType (vex::brakeType type) override |
| Sets the brake type of the chassis by passing a brake type as a parameter.
|
|
void | setMaxAcceleration (float max_accel) |
| Set the max acceleration of the chassis. Every time the PID loop executes, it increments the speed of the mechanism by this value until the mechanism reaches it's maximum speed. Increase the value if the robot is ramping too slow, or decrease if it causes too much jerk.
|
|
void | setOffset (float straight, float turn) |
| Set the offset for the straight and turn functions. This value is in inches, and will add to the input of each movement function.
|
|
void | setTimeout (int timeout) |
| Set the timeout to use for PID movement. If the timeout is exceeded, the system will stop regardless of the current error or speed. A value of -1 will disable timeouts.
|
|
void | setMeasurementUnits (Conversion::measurement preferred_units) |
| Set the measurement units for chassis values.
|
|
An HDrive chassis class that inherits from the Tank class. Contains functions for strafing sideways, and moving diagonally along with all Tank related motion. Utilizes PID for all motion.