public static class WheeledChassis.HolonomicModeler extends java.lang.Object implements Wheel
Modifier and Type | Field and Description |
---|---|
protected double |
diameter |
protected double |
gearRatio |
protected boolean |
invert |
protected RegulatedMotor |
motor |
protected double |
offset |
protected Pose |
pose |
Constructor and Description |
---|
HolonomicModeler(RegulatedMotor motor,
double diameter)
Creates a modeler object to model a robot wheel
|
Modifier and Type | Method and Description |
---|---|
WheeledChassis.HolonomicModeler |
cartesianPosition(double x,
double y,
double angle)
Specifies the location and orientation of the wheel using a cartesian coordinates
|
WheeledChassis.HolonomicModeler |
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.HolonomicModeler |
invert(boolean val)
Inverts the motor direction
|
WheeledChassis.HolonomicModeler |
polarPosition(double angle,
double radius)
Specifies the location and orientation of the wheel using polar coordinates
|
protected RegulatedMotor motor
protected double diameter
protected double gearRatio
protected double offset
protected Pose pose
protected boolean invert
public HolonomicModeler(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.HolonomicModeler polarPosition(double angle, double radius)
Use this method only when the wheel axis points to the center of the robot.
angle
- Angle between wheel axis and the robots x-axisradius
- Distance between center of the wheel and center of the robotpublic WheeledChassis.HolonomicModeler cartesianPosition(double x, double y, double angle)
x
- X-position of the center of the wheel in respect to the robots originy
- Y-position of the center of the wheel in respect to the robots originangle
- Angle between the driving direction of the wheel and the robots x-axispublic WheeledChassis.HolonomicModeler gearRatio(double val)
val
- The ratio between wheel speed and motor speed. A ratio greater than 1 means the wheel turns faster than the motor.public WheeledChassis.HolonomicModeler invert(boolean val)
val
- public Matrix getFactors()
Wheel
The factors form the row of a forward matrix
getFactors
in interface Wheel
public RegulatedMotor getMotor()