public static class WheeledChassis.Modeler extends java.lang.Object implements Wheel
| Modifier and Type | Field and Description |
|---|---|
protected double |
angle |
protected double |
diameter |
protected double |
gearRatio |
protected boolean |
invert |
protected RegulatedMotor |
motor |
protected double |
offset |
| Constructor and Description |
|---|
Modeler(RegulatedMotor motor,
double diameter)
Creates a modeler object to model a robot wheel
|
| Modifier and Type | Method and Description |
|---|---|
WheeledChassis.Modeler |
gearRatio(double val)
Defines the gear train between motor and wheel.
|
Matrix |
getFactors()
Returns the x,y and r factors to calculate motor speed from wheel linear and angular speed.
|
RegulatedMotor |
getMotor() |
WheeledChassis.Modeler |
invert(boolean val)
Inverts the motor direction
|
WheeledChassis.Modeler |
offset(double val)
Defines the offset off the wheel
|
protected RegulatedMotor motor
protected double diameter
protected double gearRatio
protected double offset
protected double angle
protected boolean invert
public Modeler(RegulatedMotor motor, double diameter)
motor - The regulated motor that drives the wheeldiameter - The diameter of the wheel (Lego wheels have the diameter printed
on the side)public WheeledChassis.Modeler offset(double val)
val - The distance between the robots yPose-axis and the center of the
wheelpublic WheeledChassis.Modeler gearRatio(double val)
val - The ratio between wheel speed and motor speedpublic WheeledChassis.Modeler invert(boolean val)
val - public Matrix getFactors()
WheelThe factors form the row of a forward matrix
getFactors in interface Wheelpublic RegulatedMotor getMotor()