예제 #1
0
  public void startService() {
    super.startService();

    try {
      serial = getSerial();
      // setting callback / message route
      serial.addListener("publishByte", getName(), "byteReceived");
      serial.startService();
      if (model == null) {
        model = MODEL_SICK_LMS200;
      }

      // start LIDAR hardware initialization here
      // data coming back from the hardware will be in byteRecieved
      if (MODEL_SICK_LMS200.equals(model)) {
        serial.write(new byte[] {1, 38, 32, 43});
      }
      state = STATE_INITIALIZATION_STAGE_1;
    } catch (Exception e) {
      error(e.getMessage());
    }
  }
 @Override
 public void startService() {
   super.startService();
   arduino.startService();
   attach(arduino);
 }