Interface MoveController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double WHEEL_SIZE_EV3
      EV3 kit wheel diameter, in centimeters
      static double WHEEL_SIZE_NXT1
      NXT 1.0 kit wheel diameter, in centimeters
      static double WHEEL_SIZE_NXT2
      NXT 2.0 kit wheel diameter, in centimeters
      static double WHEEL_SIZE_RCX
      White RCX "motorcycle" wheel diameter, in centimeters
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void backward()
      Starts the NXT robot moving backwards.
      void forward()
      Starts the NXT robot moving forward.
      double getLinearAcceleration()
      Returns the acceleration at which the robot accelerates at the start of a move and decelerates at the end of a move.
      double getLinearSpeed()
      Returns the speed at which the robot will travel forward and backward (and to some extent arcs, although actual arc speed is slightly less).
      double getMaxLinearSpeed()
      Returns the maximum speed at which this robot is capable of traveling forward and backward.
      boolean isMoving()
      true if the robot is moving
      void setLinearAcceleration​(double acceleration)
      Sets the acceleration at which the robot will accelerate at the start of a move and decelerate at the end of a move.
      void setLinearSpeed​(double speed)
      Sets the speed at which the robot will travel forward and backward (and to some extent arcs, although actual arc speed is slightly less).
      void stop()
      Halts the NXT robot
      void travel​(double distance)
      Moves the NXT robot a specific distance.
      void travel​(double distance, boolean immediateReturn)
      Moves the NXT robot a specific distance.
    • Field Detail

      • WHEEL_SIZE_NXT1

        static final double WHEEL_SIZE_NXT1
        NXT 1.0 kit wheel diameter, in centimeters
        See Also:
        Constant Field Values
      • WHEEL_SIZE_NXT2

        static final double WHEEL_SIZE_NXT2
        NXT 2.0 kit wheel diameter, in centimeters
        See Also:
        Constant Field Values
      • WHEEL_SIZE_EV3

        static final double WHEEL_SIZE_EV3
        EV3 kit wheel diameter, in centimeters
        See Also:
        Constant Field Values
      • WHEEL_SIZE_RCX

        static final double WHEEL_SIZE_RCX
        White RCX "motorcycle" wheel diameter, in centimeters
        See Also:
        Constant Field Values
    • Method Detail

      • forward

        void forward()
        Starts the NXT robot moving forward.
      • backward

        void backward()
        Starts the NXT robot moving backwards.
      • stop

        void stop()
        Halts the NXT robot
      • isMoving

        boolean isMoving()
        true if the robot is moving
        Returns:
        true if the robot is moving under power.
      • travel

        void travel​(double distance)
        Moves the NXT robot a specific distance. A positive value moves it forward and a negative value moves it backward. Method returns when movement is done.
        Parameters:
        distance - The positive or negative distance to move the robot.
      • travel

        void travel​(double distance,
                    boolean immediateReturn)
        Moves the NXT robot a specific distance. A positive value moves it forward and a negative value moves it backward.
        Parameters:
        distance - The positive or negative distance to move the robot, in wheel diameter units.
        immediateReturn - If immediateReturn is true then the method returns immediately.
      • setLinearSpeed

        void setLinearSpeed​(double speed)
        Sets the speed at which the robot will travel forward and backward (and to some extent arcs, although actual arc speed is slightly less). Speed is measured in units/second. e.g. If wheel diameter is cm, then speed is cm/sec.
        Parameters:
        speed - In chosen units per second (e.g. cm/sec)
      • getLinearSpeed

        double getLinearSpeed()
        Returns the speed at which the robot will travel forward and backward (and to some extent arcs, although actual arc speed is slightly less). Speed is measured in units/second. e.g. If wheel diameter is cm, then speed is cm/sec.
        Returns:
        Speed in chosen units per second (e.g. cm/sec)
      • getMaxLinearSpeed

        double getMaxLinearSpeed()
        Returns the maximum speed at which this robot is capable of traveling forward and backward. Speed is measured in units/second. e.g. If wheel diameter is cm, then speed is cm/sec.
        Returns:
        Speed in chosen units per second (e.g. cm/sec)
      • setLinearAcceleration

        void setLinearAcceleration​(double acceleration)
        Sets the acceleration at which the robot will accelerate at the start of a move and decelerate at the end of a move. Acceleration is measured in units/second^2. e.g. If wheel diameter is cm, then acceleration is cm/sec^2.

        If acceleration is set during a move it will not be in used for the current move, it will be in effect with the next move.

        Parameters:
        acceleration - in chosen units/second^2
      • getLinearAcceleration

        double getLinearAcceleration()
        Returns the acceleration at which the robot accelerates at the start of a move and decelerates at the end of a move.
        Returns:
        acceleration in chosen units/second^2