Package lejos.robotics.chassis
Class WheeledChassis.HolonomicModeler
- java.lang.Object
-
- lejos.robotics.chassis.WheeledChassis.HolonomicModeler
-
- All Implemented Interfaces:
Wheel
- Enclosing class:
- WheeledChassis
public static class WheeledChassis.HolonomicModeler extends java.lang.Object implements Wheel
The Modeler class helps to model a wheel. Wheel attributes can be modeled using methods.- polarPosition() specifies the location of the wheel
- gearRatio() specifies the gear ratio of the gear train between motor and wheel
- invert() inverts the direction of the motor. Equivalent to a negative gearing
- Author:
- Aswin Bouwmeester
-
-
Constructor Summary
Constructors Constructor Description HolonomicModeler(RegulatedMotor motor, double diameter)Creates a modeler object to model a robot wheel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WheeledChassis.HolonomicModelercartesianPosition(double x, double y, double angle)Specifies the location and orientation of the wheel using a cartesian coordinatesWheeledChassis.HolonomicModelergearRatio(double val)Defines the gear train between motor and wheel.MatrixgetFactors()Returns the x,y and r factors to calculate motor speed from wheel linear and angular speed.RegulatedMotorgetMotor()WheeledChassis.HolonomicModelerinvert(boolean val)Inverts the motor directionWheeledChassis.HolonomicModelerpolarPosition(double angle, double radius)Specifies the location and orientation of the wheel using polar coordinates
-
-
-
Field Detail
-
motor
protected RegulatedMotor motor
-
diameter
protected double diameter
-
gearRatio
protected double gearRatio
-
offset
protected double offset
-
pose
protected Pose pose
-
invert
protected boolean invert
-
-
Constructor Detail
-
HolonomicModeler
public HolonomicModeler(RegulatedMotor motor, double diameter)
Creates a modeler object to model a robot wheel- Parameters:
motor- The regulated motor that drives the wheeldiameter- The diameter of the wheel (Lego wheels have the diameter printed on the side)
-
-
Method Detail
-
polarPosition
public WheeledChassis.HolonomicModeler polarPosition(double angle, double radius)
Specifies the location and orientation of the wheel using polar coordinatesUse this method only when the wheel axis points to the center of the robot.
- Parameters:
angle- Angle between wheel axis and the robots x-axisradius- Distance between center of the wheel and center of the robot- Returns:
- the modeler
-
cartesianPosition
public WheeledChassis.HolonomicModeler cartesianPosition(double x, double y, double angle)
Specifies the location and orientation of the wheel using a cartesian coordinates- Parameters:
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-axis- Returns:
- the modeler
-
gearRatio
public WheeledChassis.HolonomicModeler gearRatio(double val)
Defines the gear train between motor and wheel.- Parameters:
val- The ratio between wheel speed and motor speed. A ratio greater than 1 means the wheel turns faster than the motor.- Returns:
- the modeler
-
invert
public WheeledChassis.HolonomicModeler invert(boolean val)
Inverts the motor direction- Parameters:
val-- Returns:
- the modeler
-
getFactors
public Matrix getFactors()
Description copied from interface:WheelReturns the x,y and r factors to calculate motor speed from wheel linear and angular speed.The factors form the row of a forward matrix
- Specified by:
getFactorsin interfaceWheel- Returns:
- the factors as a matrix
-
getMotor
public RegulatedMotor getMotor()
-
-