public static void main(String[] args) { LCDWriter lcd = LCDWriter.getInstance(); lcd.start(); UltrasonicPoller up = UltrasonicPoller.getInstance(); Odometer odo = Odometer.getInstance(); Driver.setSpeed(30); Driver dr = Driver.getInstance(); ObjRec or = new ObjRec(); up.start(); odo.start(); Trajectory block = searchTile(); // lcd.writeToScreen("here", 1); if (block != null) { dr.turnTo(odo.getTheta() + block.theta); dr.forward(Math.abs(block.distance - 5)); try { // if(or == null) lcd.writeToScreen("NO!", 1); ArrayList<ObjRec.blockColor> color = or.detect(); // if (color == null || color.size() == 0) lcd.writeToScreen("EMPTY", 1); else { int count = 1; for (ObjRec.blockColor c : color) if (c != null) lcd.writeToScreen(c.name(), count++); } } catch (Exception e) { lcd.writeToScreen("EXCEPTION", 1); } } // lcd.writeToScreen("fin", 1); // indicate finish Sound.beepSequenceUp(); }