Examples of DifferentialPilot


Examples of lejos.robotics.navigation.DifferentialPilot

       
        //initialize colorHTsensor and bind to port 1
        cs = new ColorHTSensor(SensorPort.S1);
       
        //initialize DifferentialPilot object with standardized properties
        pilot = new DifferentialPilot(wheelDiameter, trackWidth, leftMotor,
            rightMotor, reverse);

    }
View Full Code Here

Examples of lejos.robotics.navigation.DifferentialPilot

              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);
    }
   
    return tester;
  }
View Full Code Here

Examples of lejos.robotics.navigation.DifferentialPilot

            PilotProps.KEY_RIGHTMOTOR, "C"));
       
        boolean reverse = Boolean.parseBoolean(pp.getProperty(
            PilotProps.KEY_REVERSE,"true"));
       
        pilot =  new DifferentialPilot(wheelDiameter, trackWidth, leftMotor,
            rightMotor, reverse);
       
       
        leftMotor.resetTachoCount();
        rightMotor.resetTachoCount();
View Full Code Here

Examples of lejos.robotics.navigation.DifferentialPilot

        leftMotor = new NXTRegulatedMotor(leftMotorPort);
        rightMotor = new NXTRegulatedMotor(rightMotorPort);
        centerMotor = new NXTRegulatedMotor(centerMotorPort);
       
       
        pilot = new DifferentialPilot(2.2f, 6.25f, leftMotor, rightMotor);
        pilot.setRotateSpeed(maxRotationSpeed);
        centerMotor.setSpeed(maxRotationSpeed);
       
        Drive.speed = maxRotationSpeed;
      }
View Full Code Here

Examples of lejos.robotics.navigation.DifferentialPilot

  //RotateMoveController object
  public Robot(){
    left = Motor.C;
    right = Motor.A;
    light = new LightSensor(SensorPort.S1);
    pilot = new DifferentialPilot(2.2f, 6.875f, left, right);
    left.setSpeed(defaultSpeed);
    right.setSpeed(defaultSpeed);
   
  }
View Full Code Here

Examples of lejos.robotics.proposal.DifferentialPilot

   
    //RConsole.openBluetooth(0);
    //System.setOut(new PrintStream(RConsole.openOutputStream()));
   
    // Create the pilot
    DifferentialPilot pilot = new DifferentialPilot(
        TYRE_DIAMETER, AXLE_TRACK, Motor.B, Motor.C, true);
   
    //Create the filter
    KalmanFilter filter = new KalmanFilter(a,b,c,q,r);
   
    // Set the initial state 
    filter.setState(state, covariance);

    // Loop 100 times setting velocity, reading the range and updating the filter
    for(int i=0;i<100;i++) {
      // Generate a random velocity -20 to +20cm/sec
      double velocity = (rand.nextInt(41) - 20);
     
      // Adjust velocity so we keep in range
      double position = filter.getMean().get(0, 0);
      if (velocity < 0 && position < 20) velocity = -velocity;
      if (velocity > 0 && position > 220) velocity = -velocity;
     
      control.set(0, 0, velocity);
      System.out.println("Velocity: " + (int) velocity);

      // Move the robot
      pilot.setMoveSpeed((float) Math.abs(velocity));
      if (velocity > 0) pilot.backward();
      else pilot.forward();
      Thread.sleep(1000);
      pilot.stop();
     
      // Take a reading
      float range = sonic.getRange();
      System.out.println("Range: " + (int) range);
      measurement.set(0,0, (double) range);
View Full Code Here

Examples of lejos.robotics.proposal.DifferentialPilot

  public void run() { 
    //RConsole.openBluetooth(0);
    //System.setOut(new PrintStream(RConsole.openOutputStream()));
   
    // Create the robot and MCL pose provider and get its particle set
    pilot = new DifferentialPilot(
        TYRE_DIAMETER, WHEEL_BASE, Motor.B, Motor.C, true);
    mcl = new MCLPoseProvider(pilot,this, map, NUM_PARTICLES, BORDER);
    particles = mcl.getParticles();
    particles.setDebug(true);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.