Examples of NxtMotorStub


Examples of de.nordakademie.nxtsimulation.motor.NxtMotorStub

  }
  NxtMotorStub motorStub;
  @Before
  public void setUp() throws Exception {
    motorStub = new NxtMotorStub(0);
  }
View Full Code Here

Examples of de.nordakademie.nxtsimulation.motor.NxtMotorStub

   */
  @Test
  public void testCercaContext() throws InterruptedException {
   
   
    NxtMotorStub motorA = new NxtMotorStub(0);
    NxtMotorStub motorB = new NxtMotorStub(1);
    NativeMotorPort np = NativeMotorPort.getInstance();
    np.setBehaviour(new NativeMotorPortStub(motorA, motorB, null));   
    NativeBattery nb = NativeBattery.getInstance();
    nb.setBehaviour(new NativeBatteryStub());
   
    Motor.A.stop();
    Motor.B.stop()
    assertEquals(0, motorA.getTachoCount());
    Motor.A.setSpeed(720);
    Motor.A.forward();
    Thread.sleep(15);
    assertTrue(motorA.getTachoCount() > 0);
    Motor.A.reverseDirection();
    Thread.sleep(200);
    assertTrue(motorA.getTachoCount() < 0);
    assertEquals(0, motorB.getTachoCount());   
    Motor.B.setSpeed(720);
    Motor.B.backward();
    Thread.sleep(15);
   
    assertTrue(motorB.getTachoCount() < 0);
  }
View Full Code Here

Examples of de.nordakademie.nxtsimulation.motor.NxtMotorStub

    simPilot.setWheelDiameter(5.6f);
    simPilot.setMotorPort(motorportStub);
    simPilot.setSensorPort(sensorPortStub);   
   
    //Motoren
    simPilot.setLeftMotor(0, new NxtMotorStub(0));
    simPilot.setRightMotor(2, new NxtMotorStub(2));
    simPilot.setSimPos(new SimPosition(0, 0, 0));   
    Motor.A.stop();
    Motor.C.stop();
    ZPilot zPilot = new ZPilot(5.6f, 11.6f, Motor.A, Motor.C);
   
View Full Code Here

Examples of de.nordakademie.nxtsimulation.motor.NxtMotorStub

    pilot.setMotorPort(motorportStub);
    pilot.setSensorPort(sensorPortStub);

    // Motoren
    pilot.setLeftMotor(configController.getLeftMotorPortNr(),
        new NxtMotorStub(configController.getLeftMotorPortNr()));
    pilot.setRightMotor(configController.getRightMotorPortNr(),
        new NxtMotorStub(configController.getRightMotorPortNr()));

    // Sensoren
    int sensorPort = configController.getLightSensorPortNr();
    if (sensorPort != -1) { // -1 => kein Sensor
      LightSensorStub lightSensor = new LightSensorStub();
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.