Package lejos.geom

Examples of lejos.geom.Point


* @param y coordinate
* @param heading direction of robot forward movement
*/
  public void setPose(float x, float y, float heading)
  {
    _pose.setLocation(new Point(x, y));
    _pose.setHeading(heading);
  }
View Full Code Here


*/
  public float distanceTo(float x, float y)
  {
    updatePose();
    _current = !isMoving();
    return _pose.distanceTo(new Point(x, y));
  }
View Full Code Here

*/
  public float angleTo(float x, float y)
  {
    updatePose();
    _current = !isMoving();
    return _pose.angleTo(new Point(x, y));
  }
View Full Code Here

      for (;;) { // infinite loop that we break out of when we have
                 // generated a particle within the mapped area
        x = innerRect.x + (((float) Math.random()) * innerRect.width);
        y = innerRect.y + (((float) Math.random()) * innerRect.height);

        if (map.inside(new Point(x, y))) break;
      }

      // Pick a random angle
      heading = ((float) Math.random()) * 360;
     
View Full Code Here

    }
    return poseProvider.getPose();
  }

  public Pose goTo(float x, float y) {
    return goTo(new Point(x, y));
  }
View Full Code Here

* @param y coordinate
* @param heading direction of robot forward movement
*/
  public void setPose(float x, float y, float heading)
  {
    _pose.setLocation(new Point(x, y));
    _pose.setHeading(heading);
  }
View Full Code Here

*/
  public float distanceTo(float x, float y)
  {
    updatePose();
    _current = !isMoving();
    return _pose.distanceTo(new Point(x, y));
  }
View Full Code Here

*/
  public float angleTo(float x, float y)
  {
    updatePose();
    _current = !isMoving();
    return _pose.angleTo(new Point(x, y));
  }
View Full Code Here

              *  start point to border in placeholder Point, execute rotation and
             *  reset the tach counter */
            if(cs.getColorID() == borderColorNum){
              //RConsole.println("Border Found");
                pilot.stop();
                intermediatePoint = new Point(leftMotor.getTachoCount(), 0);
                //RConsole.println(intermediatePoint.getX() + " " + intermediatePoint.getY());
                pilot.travel(pilotReverse);
                pilot.rotate(leftRotate);              
                resetTachCount();
                firstLeg = false;
                secondLeg = true;
            }
        }
       
        while(secondLeg == true){
            pilot.backward();
            /*  2nd black edge was reached & direction was reversed.  Calculate
             *   start point location from intermediate point and current tach
             *   reading.  Robot is now at (0,0) of a 2D Cartesian graph and
             *   search is now ready to begin. */
            if(cs.getColorID() == borderColorNum){
                pilot.stop();
               
                //RConsole.println("Corner Found");
               
                startPoint = new Point((float)intermediatePoint.getX(),
                    leftMotor.getTachoCount());
             
                xAxis = 0;
                yAxis = 0;
               
View Full Code Here

          if (headLeft)
            xAxis -= leftMotor.getTachoCount();
          else
            xAxis = leftMotor.getTachoCount();
         
          returnHome(new Point(xAxis, yAxis));
        }
      }
    }
View Full Code Here

TOP

Related Classes of lejos.geom.Point

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.