Class WheeledChassis.Modeler

  • All Implemented Interfaces:
    Wheel
    Enclosing class:
    WheeledChassis

    public static class WheeledChassis.Modeler
    extends java.lang.Object
    implements Wheel
    The Modeler class helps to model a wheel. Wheel attributes can be modeled using methods.
    • offset() specifes the location of the wheel along the y-axis
    • gearRatio() specifes 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
    • Field Detail

      • diameter

        protected double diameter
      • gearRatio

        protected double gearRatio
      • offset

        protected double offset
      • angle

        protected double angle
      • invert

        protected boolean invert
    • Constructor Detail

      • Modeler

        public Modeler​(RegulatedMotor motor,
                       double diameter)
        Creates a modeler object to model a robot wheel
        Parameters:
        motor - The regulated motor that drives the wheel
        diameter - The diameter of the wheel (Lego wheels have the diameter printed on the side)
    • Method Detail

      • offset

        public WheeledChassis.Modeler offset​(double val)
        Defines the offset off the wheel
        Parameters:
        val - The distance between the robots yPose-axis and the center of the wheel
        Returns:
        the modeler
      • gearRatio

        public WheeledChassis.Modeler gearRatio​(double val)
        Defines the gear train between motor and wheel.
        Parameters:
        val - The ratio between wheel speed and motor speed
        Returns:
        the modeler
      • invert

        public WheeledChassis.Modeler invert​(boolean val)
        Inverts the motor direction
        Parameters:
        val -
        Returns:
        the modeler
      • getFactors

        public Matrix getFactors()
        Description copied from interface: Wheel
        Returns 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:
        getFactors in interface Wheel
        Returns:
        the factors as a matrix