Class CompassPilot

    • Field Detail

      • regulator

        protected lejos.robotics.navigation.CompassPilot.Regulator regulator
        Deprecated.
      • _heading

        protected float _heading
        Deprecated.
      • _estimatedHeading

        protected float _estimatedHeading
        Deprecated.
      • _traveling

        protected boolean _traveling
        Deprecated.
      • _distance

        protected float _distance
        Deprecated.
      • _direction

        protected byte _direction
        Deprecated.
      • _heading0

        protected float _heading0
        Deprecated.
    • Constructor Detail

      • CompassPilot

        public CompassPilot​(DirectionFinder compass,
                            float wheelDiameter,
                            float trackWidth,
                            RegulatedMotor leftMotor,
                            RegulatedMotor rightMotor)
        Deprecated.
        Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
        Assumes Motor.forward() causes the robot to move forward); Parameters
        Parameters:
        compass - : a compass sensor;
        wheelDiameter - Diameter of the tire, in any convenient units. (The diameter in mm is usually printed on the tire).
        trackWidth - Distance between center of right tire and center of left tire, in same units as wheelDiameter
        leftMotor -
        rightMotor -
      • CompassPilot

        public CompassPilot​(DirectionFinder compass,
                            float wheelDiameter,
                            float trackWidth,
                            RegulatedMotor leftMotor,
                            RegulatedMotor rightMotor,
                            boolean reverse)
        Deprecated.
        Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
        Assumes Motor.forward() causes the robot to move forward); Parameters
        Parameters:
        compass - : a compass sensor;
        wheelDiameter - Diameter of the tire, in any convenient units. (The diameter in mm is usually printed on the tire).
        trackWidth - Distance between center of right tire and center of left tire, in same units as wheelDiameter
        leftMotor -
        rightMotor -
        reverse - if true of motor.forward() drives the robot backwards
    • Method Detail

      • isTraveling

        public boolean isTraveling()
        Deprecated.
        returns returns true if the robot is travelling for a specific distance;
      • getCompass

        public DirectionFinder getCompass()
        Deprecated.
        Return the compass
        Returns:
        the compass
      • getAngleIncrement

        public float getAngleIncrement()
        Deprecated.
        Returns the change in robot heading since the last call of reset() normalized to be within -180 and _180 degrees
        Overrides:
        getAngleIncrement in class DifferentialPilot
        Returns:
        The angle rotated since rotation began.
      • getHeading

        public float getHeading()
        Deprecated.
        Returns direction of desired robot facing
      • getCompassHeading

        public float getCompassHeading()
        Deprecated.
        Method returns the current compass heading
        Returns:
        Compass heading in degrees.
      • setHeading

        public void setHeading​(float angle)
        Deprecated.
        sets direction of desired robot facing in degrees
      • calibrate

        public void calibrate()
        Deprecated.
        Rotates the robot 360 degrees while calibrating the compass resets compass zero to heading at end of calibration
      • resetCartesianZero

        public void resetCartesianZero()
        Deprecated.
      • getHeadingError

        public float getHeadingError()
        Deprecated.
        Determines the difference between actual compass direction and desired heading in degrees
        Returns:
        error (in degrees)
      • travel

        public void travel​(float distance,
                           boolean immediateReturn)
        Deprecated.
        Moves the NXT robot a specific distance. A positive value moves it forwards and a negative value moves it backwards. The robot steers to maintain its compass heading.
        Parameters:
        distance - The positive or negative distance to move the robot, same units as _wheelDiameter
        immediateReturn - iff true, the method returns immediately.
      • travel

        public void travel​(float distance)
        Deprecated.
        Moves the NXT robot a specific distance;
        A positive distance causes forward motion; negative distance moves backward. Robot steers to maintain its compass heading;
        Parameters:
        distance - of robot movement. Unit of measure for distance must be same as wheelDiameter and trackWidth
      • rotate

        public void rotate​(float angle,
                           boolean immediateReturn)
        Deprecated.
        robot rotates to the specified compass heading;
        Parameters:
        immediateReturn - - if true, method returns immediately. Robot stops when specified angle is reached or when stop() is called
      • rotate

        public void rotate​(float angle)
        Deprecated.
        Rotates the NXT robot through a specific angle; Rotates left if angle is positive, right if negative, Returns when angle is reached. Wheels turn in opposite directions producing a zero radius turn.
        Parameters:
        angle - degrees. Positive angle rotates to the left (clockwise); negative to the right.
        Requires correct values for wheel diameter and track width.
      • stopNow

        protected void stopNow()
        Deprecated.
      • stop

        public void stop()
        Deprecated.
        Stops the robot soon after the method is executed. (It takes time for the motors to slow to a halt)
        Specified by:
        stop in interface MoveController
        Overrides:
        stop in class DifferentialPilot
      • normalize

        protected float normalize​(float angle)
        Deprecated.