Package sk.fiit.jim.agent.parsing

Examples of sk.fiit.jim.agent.parsing.ParsedData


    seeBallIn(1.0, 1.0, 0.0);
  }


  private void seeBallIn(double x, double y, double z){
    ParsedData data = new ParsedData();
    data.fixedObjects.put(FixedObject.OUR_LOWER_CORNER, FixedObject.OUR_LOWER_CORNER.getAbsolutePosition().rotateOverZ(-PI / 2.0));
    data.fixedObjects.put(FixedObject.OUR_UPPER_POST, FixedObject.OUR_UPPER_POST.getAbsolutePosition().rotateOverZ(-PI / 2.0));
    data.fixedObjects.put(FixedObject.OUR_LOWER_POST, FixedObject.OUR_LOWER_POST.getAbsolutePosition().rotateOverZ(-PI / 2.0));
   
    data.ballRelativePosition = Vector3D.cartesian(x, y, z);
View Full Code Here


    assertThat(message, containsString("(he1 8"));
  }

  @Test
  public void shouldReflectChangesInAgentModel(){
    ParsedData parsed = new ParsedData();
    parsed.agentsJoints = Collections.singletonMap(Joint.HE1, 20.0);
    me.processNewServerMessage(parsed);

    Phase phase = createDummyPhase();
    JointPlacement.calculateNewTargetState(phase);
View Full Code Here

  private ParsedData newData;

  @Before
  public void setup(){
    kalman = new KalmanAdjuster();
    data = new ParsedData();
    data.SIMULATION_TIME = 100.0;
    newData = new ParsedData();
    newData.SIMULATION_TIME = 100.0;
  }
View Full Code Here

    assertCorrectRotations(PI / 2.0, 0.0, 3.0*PI/2.0);
    assertCorrectRotations(PI / 2.0, PI, 3.0*PI/2.0);
  }

  private void assertCorrectRotations(double rotationX, double rotationY, double rotationZ){
    ParsedData data = new ParsedData();
    data.fixedObjects.put(THEIR_UPPER_CORNER,
      THEIR_UPPER_CORNER.getAbsolutePosition().rotateOverZ(-rotationZ).rotateOverY(-rotationY).rotateOverX(-rotationX));
    data.fixedObjects.put(THEIR_LOWER_CORNER,
      THEIR_LOWER_CORNER.getAbsolutePosition().rotateOverZ(-rotationZ).rotateOverY(-rotationY).rotateOverX(-rotationX));
    data.fixedObjects.put(THEIR_UPPER_POST,
View Full Code Here

  }
 
  @Test
  public void gyroscope(){
    //initial rotation = 0.0, 0.0, 3*PI / 2.0
    ParsedData gyro = new ParsedData();
    assertRotationChanged(gyro, 180.0 / 20.0, 0, 180.0 / 20.0);
  }
View Full Code Here

    assertPosition(Vector3D.cartesian(-1.0, 0.0, 0.0), 3.0*PI / 2.0);
    assertPosition(Vector3D.cartesian(1.0, 0.0, 0.0), 3.0*PI / 2.0);
  }

  private void assertPosition(Vector3D ourPosition, double rotationZ){
    ParsedData data = new ParsedData();
    data.fixedObjects.put(THEIR_UPPER_CORNER, THEIR_UPPER_CORNER.getAbsolutePosition().subtract(ourPosition).rotateOverZ(-rotationZ));
    data.fixedObjects.put(THEIR_LOWER_CORNER, THEIR_LOWER_CORNER.getAbsolutePosition().subtract(ourPosition).rotateOverZ(-rotationZ));
    data.fixedObjects.put(THEIR_LOWER_POST, THEIR_LOWER_POST.getAbsolutePosition().subtract(ourPosition).rotateOverZ(-rotationZ));
    model.processNewServerMessage(data);
   
View Full Code Here

    assertThat(getDefensivePosition(), is(equalTo(Vector3D.cartesian(-7.5, 0.0, 0.0))));
  }

  private void positionMyTeammateCloserToTheBall(Vector3D ball) {
    me.setPosition(Vector3D.cartesian(-2.0, 2.0, 0.0));
    ParsedData data = new ParsedData();
    data.ballRelativePosition = me.relativize(ball);
    data.teammates.put(2, Collections.singletonMap("head", Vector3D.cartesian(1.0, 1.0, 0.0)));
    model.processNewServerMessage(data);
  }
View Full Code Here

  private ParsedData newData;

  @Before
  public void setup(){
    kalman = new KalmanAdjuster();
    data = new ParsedData();
    data.SIMULATION_TIME = 100.0;
    newData = new ParsedData();
    newData.SIMULATION_TIME = 100.0;
  }
View Full Code Here

    assertCorrectRotations(PI / 2.0, 0.0, 3.0*PI/2.0);
    assertCorrectRotations(PI / 2.0, PI, 3.0*PI/2.0);
  }

  private void assertCorrectRotations(double rotationX, double rotationY, double rotationZ){
    ParsedData data = new ParsedData();
    data.fixedObjects.put(THEIR_UPPER_CORNER,
      THEIR_UPPER_CORNER.getAbsolutePosition().rotateOverZ(-rotationZ).rotateOverY(-rotationY).rotateOverX(-rotationX));
    data.fixedObjects.put(THEIR_LOWER_CORNER,
      THEIR_LOWER_CORNER.getAbsolutePosition().rotateOverZ(-rotationZ).rotateOverY(-rotationY).rotateOverX(-rotationX));
    data.fixedObjects.put(THEIR_UPPER_POST,
View Full Code Here

  }

  @Test
  public void gyroscope(){
    model.setRotationZ(0.0);
    ParsedData gyro = new ParsedData();
    assertRotationChanged(gyro, 180.0 / 20.0, 0, 180.0 / 20.0);
  }
View Full Code Here

TOP

Related Classes of sk.fiit.jim.agent.parsing.ParsedData

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.