Ejemplo n.º 1
0
  @Override
  protected void doRun() {
    connectToVideoDataPort();
    initializeCommunication();
    setReady();

    while (!isStopped()) {
      try {
        udpComponent.receive(incomingDataPacket);
        processData();

        udpComponent.sendKeepAlivePacket();
      } catch (RuntimeException e) {
        // This happens sometimes, but does not hinder the video data from being displayed
      }
    }

    disconnectFromVideoDataPort();
  }
Ejemplo n.º 2
0
 private void initializeCommunication() {
   udpComponent.sendKeepAlivePacket();
   sleep(1000);
 }
Ejemplo n.º 3
0
 private void connectToVideoDataPort() {
   logger.info(String.format("Connecting to video data port %d", getVideoDataPort()));
   udpComponent.connect(getDroneAddress(), getVideoDataPort());
 }
Ejemplo n.º 4
0
 private void disconnectFromVideoDataPort() {
   logger.info(String.format("Disconnecting from video data port %d", getVideoDataPort()));
   udpComponent.disconnect();
 }