Package lejos.util

Examples of lejos.util.PilotProps


    "ORANGE", "WHITE", "BLACK", "PINK", "GRAY", "LIGHT GRAY", "DARK GRAY",
    "CYAN"};

    //zero argument constructor, initializes important variables
    public GoalFindOne() throws IOException{
      PilotProps pp = new PilotProps();
        pp.loadPersistentValues();

        //initialize and set pilot properties
        float wheelDiameter = Float.parseFloat(pp.getProperty(
            PilotProps.KEY_WHEELDIAMETER, "2.25"));
       
        float trackWidth = Float.parseFloat(pp.getProperty(
            PilotProps.KEY_TRACKWIDTH, "6.6875"));
       
        leftMotor = PilotProps.getMotor(pp.getProperty(
            PilotProps.KEY_LEFTMOTOR, "C"));
       
        rightMotor = PilotProps.getMotor(pp.getProperty(
            PilotProps.KEY_RIGHTMOTOR, "A"));
       
        boolean reverse = Boolean.parseBoolean(pp.getProperty(
            PilotProps.KEY_REVERSE,"true"));
       
        //initialize colorHTsensor and bind to port 1
        cs = new ColorHTSensor(SensorPort.S1);
       
View Full Code Here


    if (tester == null) {
      tester = new MotorTester();
      timeOut = new TimerTester();
      timer = new Timer(500, timeOut);
     
      PilotProps pp = new PilotProps();
          try {
        pp.loadPersistentValues();
      } catch (IOException e) {
        e.printStackTrace();
      }

          //initialize and set pilot properties
          float wheelDiameter = Float.parseFloat(pp.getProperty(
              PilotProps.KEY_WHEELDIAMETER, "2.25"));
         
          float trackWidth = Float.parseFloat(pp.getProperty(
              PilotProps.KEY_TRACKWIDTH, "6.6875"));
         
          tester.leftMotor = PilotProps.getMotor(pp.getProperty(
              PilotProps.KEY_LEFTMOTOR, "A"));
         
          tester.rightMotor = PilotProps.getMotor(pp.getProperty(
              PilotProps.KEY_RIGHTMOTOR, "C"));
         
          boolean reverse = Boolean.parseBoolean(pp.getProperty(
              PilotProps.KEY_REVERSE, "false"));
         
          tester.pilot = new DifferentialPilot(wheelDiameter, trackWidth,
              tester.leftMotor, tester.rightMotor, reverse);
    }
View Full Code Here

   
    return pc;
  }
 
  private void initializeGoalFindPilot(){
    PilotProps pp = new PilotProps();
        try {
      pp.loadPersistentValues();
    } catch (IOException e) {
      e.printStackTrace();
    }

        //initialize and set pilot properties
        float wheelDiameter = Float.parseFloat(pp.getProperty(
            PilotProps.KEY_WHEELDIAMETER, "2.25"));
       
        float trackWidth = Float.parseFloat(pp.getProperty(
            PilotProps.KEY_TRACKWIDTH, "4.50"));
       
        leftMotor = PilotProps.getMotor(pp.getProperty(
            PilotProps.KEY_LEFTMOTOR, "A"));
       
        rightMotor = PilotProps.getMotor(pp.getProperty(
            PilotProps.KEY_RIGHTMOTOR, "C"));
       
        boolean reverse = Boolean.parseBoolean(pp.getProperty(
            PilotProps.KEY_REVERSE,"true"));
       
        pilot =  new DifferentialPilot(wheelDiameter, trackWidth, leftMotor,
            rightMotor, reverse);
       
View Full Code Here

  public static void main(String[] args) throws Exception {

    // Instanciate PilotProperties instance and save wheel diameter, track
    // width, motor connections
    final PilotProps pilotProperties = new PilotProps();
    pilotProperties.loadPersistentValues();

    float wheelDiameter = Float.parseFloat(pilotProperties.getProperty(
        PilotProps.KEY_WHEELDIAMETER, "2.2"));
   
    float trackWidth = Float.parseFloat(pilotProperties.getProperty(
        PilotProps.KEY_TRACKWIDTH, "6.6875"));
   
    RegulatedMotor leftMotor = PilotProps.getMotor(pilotProperties
        .getProperty(PilotProps.KEY_LEFTMOTOR, "A"));
   
    RegulatedMotor rightMotor = PilotProps.getMotor(pilotProperties
        .getProperty(PilotProps.KEY_RIGHTMOTOR, "C"));

    final RotateMoveController pilot = new DifferentialPilot(wheelDiameter,
        trackWidth, leftMotor, rightMotor, false);
   
View Full Code Here

TOP

Related Classes of lejos.util.PilotProps

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.