DriveVectorScaler

public class DriveVectorScaler

This is the DriveVectorScaler class. This class takes in inputs Vectors for driving, heading correction, and translational/centripetal correction and returns an array with wheel powers.

Author

Anyi Lin - 10158 Scott's Bots

Aaron Yang - 10158 Scott's Bots

Harrison Womack - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void DriveVectorScaler(Vector frontLeftVector)
This creates a new DriveVectorScaler, which takes in various movement vectors and outputs the wheel drive powers necessary to move in the intended direction, given the true movement vector for the front left mecanum wheel.

Properties

Link copied to clipboard
public double maxPowerScaling

Functions

Link copied to clipboard
public double findNormalizingScaling(Vector staticVector, Vector variableVector)
This takes in two Vectors, one static and one variable, and returns the scaling factor that, when multiplied to the variable Vector, results in magnitude of the sum of the static Vector and the scaled variable Vector being the max power scaling.
Link copied to clipboard
public Array<double> getDrivePowers(Vector correctivePower, Vector headingPower, Vector pathingPower, double robotHeading)
This takes in vectors for corrective power, heading power, and pathing power and outputs an Array of four doubles, one for each wheel's motor power.
Link copied to clipboard
public double getMaxPowerScaling()
Gets the maximum power that can be used by the drive vector scaler.
Link copied to clipboard
public void setMaxPowerScaling(double maxPowerScaling)
Sets the maximum power that can be used by the drive vector scaler.