/** Get current sensor values */ @OPERATION void getCurrentScan() { logger1.info("ArtScan >> getCurrentScan()"); ObsProperty prop = getObsProperty(propertyName); if (currentScan != null) // prop.updateValues(checkNan(currentScan[0]), checkNan(currentScan[(int) // (laserScanSize*0.25)]), checkNan(currentScan[(int) (laserScanSize*0.5)]), // checkNan(currentScan[(int) (laserScanSize*0.75)]), checkNan(currentScan[laserScanSize-1])); // prop.updateValues(checkNan(currentScan[0]), checkNan(currentScan[182]), // checkNan(currentScan[363]), checkNan(currentScan[544]), // checkNan(currentScan[laserScanSize-1])); prop.updateValues( checkNan(currentScan[0]), checkNan(currentScan[127]), checkNan(currentScan[255]), checkNan(currentScan[384]), checkNan(currentScan[laserScanSize - 1])); else prop.updateValues(50000f, 50000f, 50000f, 50000f, 50000f); // logger1.info("ArtScan >> Value:" + prop); logger1.info("ArtScan >> end of getCurrentScan()"); // 182, 363, 544, 725 hokuyo scan // 0, 270, 514, 810, 1080 // 0, 159, 319, 479, 639 // System.out.println("ArtScan >> getCurrentScan()"); // ObsProperty prop = getObsProperty(propertyName); // prop.updateValues(prop.getValues()); signal("tick_scan"); }
/** The command code */ public void exec() { try { ObsProperty prop = getObsProperty(propertyName); prop.updateValues( checkNan(currentScan[0]), checkNan(currentScan[(int) (laserScanSize * 0.25)]), checkNan(currentScan[(int) (laserScanSize * 0.5)]), checkNan(currentScan[(int) (laserScanSize * 0.75)]), checkNan(currentScan[laserScanSize - 1])); // prop.updateValues(checkNan(currentScan[0]), checkNan(currentScan[182]), // checkNan(currentScan[363]), checkNan(currentScan[544]), // checkNan(currentScan[laserScanSize-1])); } catch (Exception ex) { ex.printStackTrace(); } }