Skip to content
Snippets Groups Projects
Commit c2f67806 authored by brutzman's avatar brutzman
Browse files

improved output, debugging

parent 8cc8629d
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
===================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment