Package components.robot

Examples of components.robot.RobotState


  }

 
  public RobotState getRobotState(int r, int g, int b) throws GPSException
  {
    RobotState state = null;
   
    try
    {
      recognizeRobotr , g , b );
    }
    catch (GPSException e)
    {
      throw new GPSException( e.getMessage() );
    }
   
    gpsSemaphore.WAIT();
    if ( robot != null )
    {
      state      = new RobotState();
      state.position  = new double[] { robot.x , robot.y };
      state.course  = Math.atan2( robot.y-robot.yOld , robot.x-robot.xOld );
    }
    gpsSemaphore.SIGNAL();
   
View Full Code Here


  }
 
 
  private final double computeDeltaNewCourse(int currentPlace)
  {
    RobotState state = getState();
   
    double     newCourse = 0.0
    int      nextPlaceId;

    if ( currentPlace != neuralNet.getCurrentPlace() )
View Full Code Here

        realCourse  += Double.parseDouble(fields[1]);
        realCourse  %= 2.0*Math.PI; // Normaliza el curso entre 0 y 2PI
      }
      else if ( fields[0].equalsIgnoreCase( "advance" ) )
      {
        RobotState robotState  = robot.getState();
        Color color        = new Color(robot.getColor().getRed()  ,
                          robot.getColor().getGreen()  ,
                          robot.getColor().getBlue()  );

        robotState.position[0] += Defines.STEP_SIZE * Math.cos(realCourse);
 
View Full Code Here


  public void run()
  {
    Sensor        sensor;
    RobotState      robotState;
    double[]      pos;
    double        course;
    boolean        finished1, finished2, finished3;
    int          i;
   
View Full Code Here

  public void run()
  {
    Sensor        sensor;
    Integer        sensorValue;
    RobotState      robotState;
    double[]      pos;
    double        course;
    boolean        finished1, finished2, finished3;
    RecognizedItems    sceneItems;
    int          i;
View Full Code Here

  }

 
  public RobotState getRobotState(int r, int g, int b) throws GPSException
  {
    RobotState state = null;
    boolean realSimulationRecognizeFailed =false;
    try
    {
        recognizeRobotr , g , b );     
    }
    catch (GPSException e)
    {
      // Si la simulacion es real, si no se reconoce el color del robot no pasa nada
      if(Simulation.getCurrent().getType() != Defines.REAL_SIMULATION )
        throw new GPSException( e.getMessage() );
      else
        realSimulationRecognizeFailed = true;
    }
   
    gpsSemaphore.WAIT();
    if ( robot != null || realSimulationRecognizeFailed)
    {
      state = new RobotState();
      if(realSimulationRecognizeFailed) {
        state.position  = new double[] { 0 , 0 };
        state.course  = 1;
      } else {
        state.position  = new double[] { robot.x , robot.y };
View Full Code Here

TOP

Related Classes of components.robot.RobotState

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.