Ejemplo n.º 1
0
  /** Sets the navigator to move along x and y by X and Y. */
  public void setTarget(double x, double y) {
    if (!calibrator.isCalibrated()) return;
    MathUtils.set(target, x, y);
    MathUtils.set(offtarget, target);
    calibrator.getRequiredSteps(target);
    targetSet = true;
    steps.x = (steps.x > 0) ? (int) (steps.x + 0.5) : (int) (steps.x - 0.5); // round no. of steps
    steps.y = (steps.y > 0) ? (int) (steps.y + 0.5) : (int) (steps.y - 0.5);

    calibrator.adjustBacklash(steps);
  }
Ejemplo n.º 2
0
 /** The navigator will move to the target specified by setTarget() */
 public void start() {
   System.out.println("initiate navigation");
   if (!calibrator.isCalibrated()
       || !stage.bluetoothConnected()
       || calibrator.isRunning()
       || autofocus.isRunning()
       || isRunning()
       || !targetSet) return;
   System.out.println("prerequisites fulfilled");
   targetSet = false;
   moving = true;
   tracker.start();
 }