Package de.nordakademie.nxtsimulation.sensor

Examples of de.nordakademie.nxtsimulation.sensor.LightSensorStub


  LightSensorStub lightSensorStub;

  @Before
  public void setUp() throws Exception {
    lightSensorStub = new LightSensorStub();
  }
View Full Code Here


  }
 
  @Test
  public void testSetSensorPositions(){
    simPilot.setSimPos(new SimPosition(35, 10, 12));
    LightSensorStub l = new LightSensorStub(simPilot.getSimPos());
    simPilot.setLightSensor(0, l);   
    simPilot.setSensorPosition(); //DISTANCE_OF_SENSOR = 25
    assertEquals((int)(simPilot.getPosX() + Math.cos(Math.toRadians(simPilot.getHeading()))*25), l.getPosX(), 0.4);
    assertEquals((int)(simPilot.getPosY() + Math.sin(Math.toRadians(simPilot.getHeading()))*25), l.getPosY(), 0.4);
    assertEquals(simPilot.getHeading(), l.getHeading());
   
 
View Full Code Here

        new NxtMotorStub(configController.getRightMotorPortNr()));

    // Sensoren
    int sensorPort = configController.getLightSensorPortNr();
    if (sensorPort != -1) { // -1 => kein Sensor
      LightSensorStub lightSensor = new LightSensorStub();
      lightSensor.setImage(mainGui.getArenaGui().getImgBackground());
      pilot.setLightSensor(sensorPort, lightSensor);
    }

    sensorPort = configController.getUltraSonicSensorPortNr();
    if (sensorPort != -1) { // -1 => kein Sensor
View Full Code Here

TOP

Related Classes of de.nordakademie.nxtsimulation.sensor.LightSensorStub

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.