/** * Called when the FovTracker has a result on exactly how much the screen moved by. Calculates * which direction the stage should move for the next stride, then executes the move. */ public void motionResult(Point result) { tracker.pause(); MathUtils.subtract(offtarget, result); if (targetReached()) { stop(); } else if (steps.y > steps.x) { steps.y -= STRIDE_SIZE; stage.swipeY(STRIDE_SIZE); } else if (steps.x > steps.y) { steps.x -= STRIDE_SIZE; stage.swipeX(STRIDE_SIZE); } }
/** 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(); }