diff --git a/examples/src/OpenDis7Examples/EspduReceiver.java b/examples/src/OpenDis7Examples/EspduReceiver.java index c4cb5cfd8cd84bd414371bb8ab51202496b0c2f6..274209e36c6d3a8950d8ec927c13598bda5b4762 100644 --- a/examples/src/OpenDis7Examples/EspduReceiver.java +++ b/examples/src/OpenDis7Examples/EspduReceiver.java @@ -52,24 +52,23 @@ public class EspduReceiver socket.receive(packet); List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData()); - System.out.println("Bundle size is " + pduBundle.size()); - + if (pduBundle.size() > 1) + System.out.println("Bundle size is " + pduBundle.size()); Iterator iterator = pduBundle.iterator(); while(iterator.hasNext()) { Pdu aPdu = (Pdu)iterator.next(); - System.out.print("got PDU of type: " + aPdu.getClass().getName()); + System.out.println("received PDU " + aPdu.getPduType().getValue() + " " + aPdu.getPduType().name() + " of type " + aPdu.getClass().getName()); if(aPdu instanceof EntityStatePdu) { EntityID eid = ((EntityStatePdu)aPdu).getEntityID(); Vector3Double position = ((EntityStatePdu)aPdu).getEntityLocation(); - System.out.print(" EID:[" + eid.getSiteID()+ ", " + eid.getApplicationID()+ ", " + eid.getEntityID()+ "] "); - System.out.print(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + System.out.println(" ID triplet: [" + eid.getSiteID()+ ", " + eid.getApplicationID()+ ", " + eid.getEntityID()+ "] "); + System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); } - System.out.println(); - } // end trop through PDU bundle + } // end iterator loop through PDU bundle } // end while } // End try catch (IOException e) diff --git a/examples/src/OpenDis7Examples/EspduTerminalLog.txt b/examples/src/OpenDis7Examples/EspduTerminalLog.txt index 1925747ec59f0115aad9587ca9efe3b43d85a204..11f368cf3ce2f8dd335a6140b323c85dbf718412 100644 --- a/examples/src/OpenDis7Examples/EspduTerminalLog.txt +++ b/examples/src/OpenDis7Examples/EspduTerminalLog.txt @@ -2,92 +2,129 @@ Invocation instructions: 1. run/debug EspduReceiver.java (since sender does not block, be ready to listen) 2. run/debug EspduSender.java +TODO troubleshooting note: +debugging reveals that "PDU not implemented. Type = OTHER" appears to be +caused by OpenDIS7 library reading trailing zeros in a datagram following +initial PDU parsing. + Program responses: =================================================== run: -DisExamples.EspduSender started... send 5 ESPDUs, initial index=0 + +DisExamplesOpenDis7.EspduSender started... send 5 ESPDUs, initial index=0 Sending 5 ESPDU packets to /239.1.2.3 -121.87693999999999 lat, lon:36.595517, -121.87693999999999 -DIS coord:-2707488.3677768684, -4353666.735244379, 3781450.3202754413 +DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 Sending broadcast datagram packet to /127.255.255.255 -Sending broadcast datagram packet to /172.20.83.255 +Sending broadcast datagram packet to /172.20.220.105 +Sending broadcast datagram packet to /10.0.0.255 Espdu #0 EID=[1,1,2] - DIS coordinates location=[-2707488.3677768684,-4353666.735244379,3781450.3202754413] + DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] -121.877 lat, lon:36.595517, -121.877 DIS coord:-2707492.9269245286, -4353663.899966802, 3781450.3202754413 Sending broadcast datagram packet to /127.255.255.255 -Sending broadcast datagram packet to /172.20.83.255 +Sending broadcast datagram packet to /172.20.220.105 +Sending broadcast datagram packet to /10.0.0.255 Espdu #1 EID=[1,1,2] DIS coordinates location=[-2707492.9269245286,-4353663.899966802,3781450.3202754413] -121.87693999999999 lat, lon:36.595517, -121.87693999999999 -DIS coord:-2707488.3677768684, -4353666.735244379, 3781450.3202754413 +DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 Sending broadcast datagram packet to /127.255.255.255 -Sending broadcast datagram packet to /172.20.83.255 +Sending broadcast datagram packet to /172.20.220.105 +Sending broadcast datagram packet to /10.0.0.255 Espdu #2 EID=[1,1,2] - DIS coordinates location=[-2707488.3677768684,-4353666.735244379,3781450.3202754413] + DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] -121.877 lat, lon:36.595517, -121.877 DIS coord:-2707492.9269245286, -4353663.899966802, 3781450.3202754413 Sending broadcast datagram packet to /127.255.255.255 -Sending broadcast datagram packet to /172.20.83.255 +Sending broadcast datagram packet to /172.20.220.105 +Sending broadcast datagram packet to /10.0.0.255 Espdu #3 EID=[1,1,2] DIS coordinates location=[-2707492.9269245286,-4353663.899966802,3781450.3202754413] -121.87693999999999 lat, lon:36.595517, -121.87693999999999 -DIS coord:-2707488.3677768684, -4353666.735244379, 3781450.3202754413 +DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 Sending broadcast datagram packet to /127.255.255.255 -Sending broadcast datagram packet to /172.20.83.255 +Sending broadcast datagram packet to /172.20.220.105 +Sending broadcast datagram packet to /10.0.0.255 Espdu #4 EID=[1,1,2] - DIS coordinates location=[-2707488.3677768684,-4353666.735244379,3781450.3202754413] -BUILD SUCCESSFUL (total time: 5 seconds) + DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] +BUILD SUCCESSFUL (total time: 8 seconds) =================================================== run: -DisExamples.EspduReceiver started... -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.EntityStatePdu EID:[1, 1, 2] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244379, 3781450.3202754413] -Bundle size is 1 -got PDU of type: edu.nps.moves.dis.FirePdu + +DisExamplesOpenDis7.EspduReceiver started... +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER + +received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu + ID triplet: [1, 1, 2] + Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413] +PDU not implemented. Type = OTHER + +received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu +PDU not implemented. Type = OTHER ===================================================