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

multiple improvements

parent a34f1c9d
No related branches found
No related tags found
No related merge requests found
...@@ -22,10 +22,10 @@ public class EspduReceiver ...@@ -22,10 +22,10 @@ public class EspduReceiver
public static final int MAX_PDU_SIZE = 8192; public static final int MAX_PDU_SIZE = 8192;
/** Default multicast group address we send on. */ /** Default multicast group address we send on. */
public static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; public static final String DEFAULT_MULTICAST_ADDRESS = EspduSender.DEFAULT_MULTICAST_ADDRESS;
/** Default multicast port used, matches Wireshark DIS capture default */ /** Default multicast port used, matches Wireshark DIS capture default */
public static final int DEFAULT_MULTICAST_PORT = 3000; public static final int DEFAULT_MULTICAST_PORT = EspduSender.DEFAULT_MULTICAST_PORT;
public static void main(String args[]) public static void main(String args[])
{ {
...@@ -39,10 +39,10 @@ public class EspduReceiver ...@@ -39,10 +39,10 @@ public class EspduReceiver
try { try {
// Specify the socket to receive data // Specify the socket to receive data
socket = new MulticastSocket(DEFAULT_MULTICAST_PORT); socket = new MulticastSocket(DEFAULT_MULTICAST_PORT);
socket.setBroadcast(true); // socket.setBroadcast(true);
// address = InetAddress.getByName(EspduSender.DEFAULT_MULTICAST_GROUP); address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS);
// socket.joinGroup(address); socket.joinGroup(address);
while (true) // Loop infinitely, receiving datagrams while (true) // Loop infinitely, receiving datagrams
{ {
...@@ -56,21 +56,33 @@ public class EspduReceiver ...@@ -56,21 +56,33 @@ public class EspduReceiver
System.out.println("Bundle size is " + pduBundle.size()); System.out.println("Bundle size is " + pduBundle.size());
Iterator iterator = pduBundle.iterator(); Iterator iterator = pduBundle.iterator();
while(iterator.hasNext()) while (iterator.hasNext())
{ {
Pdu aPdu = (Pdu)iterator.next(); Pdu aPdu = (Pdu)iterator.next();
String receiptMessage = "received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName();
System.out.println("received PDU " + aPdu.getPduType().getValue() + " " + aPdu.getPduType().name() + " of type " + aPdu.getClass().getName()); if (aPdu instanceof EntityStatePdu)
if(aPdu instanceof EntityStatePdu)
{ {
EntityID eid = ((EntityStatePdu)aPdu).getEntityID(); System.out.println("===============");
System.out.println(receiptMessage);
EntityID entityID = ((EntityStatePdu)aPdu).getEntityID();
Vector3Double position = ((EntityStatePdu)aPdu).getEntityLocation(); Vector3Double position = ((EntityStatePdu)aPdu).getEntityLocation();
System.out.println(" ID triplet: [" + eid.getSiteID()+ ", " + eid.getApplicationID()+ ", " + eid.getEntityID()+ "] "); System.out.println(" entityID triplet: [" + entityID.getSiteID()+ ", " + entityID.getApplicationID()+ ", " + entityID.getEntityID()+ "] ");
System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");
} }
else if (aPdu instanceof FirePdu)
{
System.out.println(receiptMessage);
Vector3Double position = ((FirePdu)aPdu).getLocationInWorldCoordinates();
System.out.println(" FirePdu locationInWorldCoordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]");
}
else
{
System.out.println(receiptMessage);
}
} // end iterator loop through PDU bundle } // end iterator loop through PDU bundle
} // end while } // end while
} // End try } // end try block
catch (IOException e) catch (IOException e)
{ {
System.out.println("Problem with DisExamplesOpenDis7.EspduReceiver, see exception trace:"); System.out.println("Problem with DisExamplesOpenDis7.EspduReceiver, see exception trace:");
......
...@@ -5,28 +5,22 @@ import java.net.*; ...@@ -5,28 +5,22 @@ import java.net.*;
import java.util.*; import java.util.*;
import edu.nps.moves.dis7.*; import edu.nps.moves.dis7.*;
import edu.nps.moves.dis7.util.*;
import edu.nps.moves.dis7.enumerations.Country; import edu.nps.moves.dis7.enumerations.Country;
import edu.nps.moves.dis7.enumerations.EntityKind; import edu.nps.moves.dis7.enumerations.EntityKind;
import edu.nps.moves.dis7.enumerations.PlatformDomain; import edu.nps.moves.dis7.enumerations.PlatformDomain;
import edu.nps.moves.dis7.util.*;
//import edu.nps.moves.disutil.CoordinateConversions;
//import edu.nps.moves.disutil.DisTime;
/** /**
* Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library * Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library
* example package edu.nps.moves.examples * example package edu.nps.moves.examples
* *
* @author DMcG * @author Don McGregor
* @author Don Brutzman
*/ */
public class EspduSender { public class EspduSender
{
public static final int NUMBER_TO_SEND = 5; // 5000 public static final int NUMBER_TO_SEND = 5; // 5000
public enum NetworkMode {
UNICAST, MULTICAST, BROADCAST
};
/** /**
* Default multicast group address we send on. * Default multicast group address we send on.
*/ */
...@@ -37,6 +31,10 @@ public class EspduSender { ...@@ -37,6 +31,10 @@ public class EspduSender {
*/ */
public static final int DEFAULT_MULTICAST_PORT = 3000; public static final int DEFAULT_MULTICAST_PORT = 3000;
public enum NetworkMode {
UNICAST, MULTICAST, BROADCAST
};
/** /**
* Possible system properties, passed in via -Dattr=val networkMode: * Possible system properties, passed in via -Dattr=val networkMode:
* unicast, broadcast, multicast destinationIp: where to send the packet. If * unicast, broadcast, multicast destinationIp: where to send the packet. If
...@@ -50,28 +48,26 @@ public class EspduSender { ...@@ -50,28 +48,26 @@ public class EspduSender {
*/ */
public static void main(String args[]) public static void main(String args[])
{ {
System.out.println("DisExamplesOpenDis7.EspduSender started... send " + NUMBER_TO_SEND + " ESPDUs, initial index=0"); System.out.println("DisExamplesOpenDis7.EspduSender started...");
/**
* an entity state pdu
*/
EntityStatePdu espdu = new EntityStatePdu();
MulticastSocket socket = null; // must be initialized, even if null
DisTime disTime = new DisTime();
int alternator = -1;
// ICBM coordinates for my office
double lat = 36.595517;
double lon = -121.877000;
// Default settings. These are used if no system properties are set. // Default settings. These are used if no system properties are set.
// If system properties are passed in, these are over ridden. // If system properties are passed in, these are overridden later.
int port = DEFAULT_MULTICAST_PORT; NetworkMode networkMode = NetworkMode.BROADCAST;
NetworkMode mode = NetworkMode.BROADCAST; InetAddress address = null; // must be initialized, even if null
InetAddress destinationIp = null; // must be initialized, even if null int port = DEFAULT_MULTICAST_PORT;
MulticastSocket socket = null; // must be initialized to avoid later error, even if null;
EntityStatePdu espdu = new EntityStatePdu();
DisTime disTime = new DisTime();
try { // ICBM coordinates for my office
destinationIp = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS); double latitude = 36.595517;
} catch (UnknownHostException e) { double longitude = -121.877000;
try
{
address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS);
}
catch (UnknownHostException e)
{
System.out.println(e + " Cannot create multicast address"); System.out.println(e + " Cannot create multicast address");
System.exit(0); System.exit(0);
} }
...@@ -88,47 +84,48 @@ public class EspduSender { ...@@ -88,47 +84,48 @@ public class EspduSender {
// Network mode: unicast, multicast, broadcast // Network mode: unicast, multicast, broadcast
String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast
// Set up a socket to send information // Set up socket to send information
try { try
// Port we send to {
if (portString != null) if (portString != null) // Update port we send to, if provided
{ {
port = Integer.parseInt(portString); port = Integer.parseInt(portString);
} }
socket = new MulticastSocket(port); socket = new MulticastSocket(port);
// Where we send packets to, the destination IP address // Where we send packets to, the destination IP address
if (destinationIpString != null) if (destinationIpString != null)
{ {
destinationIp = InetAddress.getByName(destinationIpString); address = InetAddress.getByName(destinationIpString);
} }
// Type of transport: unicast, broadcast, or multicast // Type of transport: unicast, broadcast, or multicast
// TODO convert to String constants if (networkModeString != null)
if (networkModeString != null) { {
if (networkModeString.equalsIgnoreCase("unicast")) if (networkModeString.equalsIgnoreCase("unicast"))
{ {
mode = NetworkMode.UNICAST; networkMode = NetworkMode.UNICAST;
} }
else if (networkModeString.equalsIgnoreCase("broadcast")) { else if (networkModeString.equalsIgnoreCase("broadcast"))
mode = NetworkMode.BROADCAST; {
networkMode = NetworkMode.BROADCAST;
} }
else if (networkModeString.equalsIgnoreCase("multicast")) { else if (networkModeString.equalsIgnoreCase("multicast"))
mode = NetworkMode.MULTICAST; {
if (!destinationIp.isMulticastAddress()) networkMode = NetworkMode.MULTICAST;
if (!address.isMulticastAddress())
{ {
throw new RuntimeException("Sending to multicast address, but destination address " + destinationIp.toString() + "is not multicast"); throw new RuntimeException("*** Error: sending to multicast address, but destination address " + address.toString() + "is not multicast");
} }
socket.joinGroup(destinationIp); socket.joinGroup(address);
} }
} // end networkModeString } // end networkModeString
} }
catch (IOException | RuntimeException e) catch (IOException | RuntimeException e)
{ {
System.out.println("Unable to initialize networking. Exiting."); System.out.println("Unable to initialize network correctly, exiting.");
System.out.println(e); System.out.println(e);
System.exit(-1); System.exit(-1); // outta here
} }
// Initialize values in the Entity State PDU object. The exercise ID is // Initialize values in the Entity State PDU object. The exercise ID is
...@@ -141,10 +138,12 @@ public class EspduSender { ...@@ -141,10 +138,12 @@ public class EspduSender {
// EID should match up with the ID for the object specified in the // EID should match up with the ID for the object specified in the
// VMRL/x3d/virtual world. // VMRL/x3d/virtual world.
EntityID entityID = espdu.getEntityID(); EntityID entityID = espdu.getEntityID(); // initialize, reset, override
entityID.setSiteID((short)1); // TODO check: 0 is apparently not a valid site number, per the spec // TODO check: 0 is apparently not a valid site number, per DIS specification
entityID.setApplicationID((short)1); entityID.setSiteID ((short)1); // TODO utility method to allow int values
entityID.setEntityID((short)2); entityID.setApplicationID((short)2);
entityID.setEntityID ((short)3);
espdu.setEntityID(entityID);
// Set the entity type. SISO has a big list of enumerations, so that by // Set the entity type. SISO has a big list of enumerations, so that by
// specifying various numbers we can say this is an M1A2 American tank, // specifying various numbers we can say this is an M1A2 American tank,
...@@ -153,8 +152,8 @@ public class EspduSender { ...@@ -153,8 +152,8 @@ public class EspduSender {
// enumerations in C++ and Java, but to keep things simple we just use // enumerations in C++ and Java, but to keep things simple we just use
// numbers here. // numbers here.
// New way using entity jar(s) // New way using entity jar(s)
espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2()); espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2());
// Manual way: // Manual way:
/* /*
...@@ -167,10 +166,10 @@ public class EspduSender { ...@@ -167,10 +166,10 @@ public class EspduSender {
entityType.setSpecific((byte) 3); // M1A2 Abrams entityType.setSpecific((byte) 3); // M1A2 Abrams
*/ */
Set<InetAddress> broadcastAddresses; Set<InetAddress> broadcastAddresses;
// Loop through sending N ESPDUs
try try // Loop through sending N ESPDUs
{ {
System.out.println("Sending " + NUMBER_TO_SEND + " ESPDU packets to " + destinationIp.toString()); System.out.println("Sending " + NUMBER_TO_SEND + " sets of packets:"); // + address.toString()
for (int index = 0; index < NUMBER_TO_SEND; index++) { for (int index = 0; index < NUMBER_TO_SEND; index++) {
// DIS time is a pain in the uh, neck. DIS time units are 2^31-1 units per // DIS time is a pain in the uh, neck. DIS time units are 2^31-1 units per
...@@ -214,16 +213,26 @@ public class EspduSender { ...@@ -214,16 +213,26 @@ public class EspduSender {
//lon = lon + (double)((double)idx / 100000.0); //lon = lon + (double)((double)idx / 100000.0);
//System.out.println("lla=" + lat + "," + lon + ", 0.0"); //System.out.println("lla=" + lat + "," + lon + ", 0.0");
double direction = Math.pow((double) (-1.0), (double) (index)); double direction = Math.pow((double) (-1.0), (double) (index));
lon = lon + (direction * 0.00006); longitude = longitude + (direction * 0.00006);
System.out.println(lon);
double disCoordinates[] = CoordinateConversions.getXYZfromLatLonDegrees(lat, lon, 1.0); double disCoordinates[] = CoordinateConversions.getXYZfromLatLonDegrees(latitude, longitude, 1.0);
Vector3Double location = espdu.getEntityLocation(); Vector3Double location = espdu.getEntityLocation();
location.setX(disCoordinates[0]); location.setX(disCoordinates[0]);
location.setY(disCoordinates[1]); location.setY(disCoordinates[1]);
location.setZ(disCoordinates[2]); location.setZ(disCoordinates[2]);
System.out.println("lat, lon:" + lat + ", " + lon); System.out.println("===============");
System.out.println("DIS coord:" + disCoordinates[0] + ", " + disCoordinates[1] + ", " + disCoordinates[2]); System.out.println("Create new PDUs");
System.out.println(" latitude, longitude: [" + latitude + ", " + longitude + "]");
System.out.println(" coordinate conversion: [" + disCoordinates[0] + ", " + disCoordinates[1] + ", " + disCoordinates[2] + "]");
location = espdu.getEntityLocation();
System.out.println("Espdu #" + index + " entityID=[" + entityID.getSiteID()+ "," + entityID.getApplicationID()+ "," + entityID.getEntityID()+ "]");
double c[] = {location.getX(), location.getY(), location.getZ()};
double lla[] = CoordinateConversions.xyzToLatLonDegrees(c);
// System.out.println(" DIS entityLocation: [" + location.getX() + "," + location.getY() + "," + location.getZ() + "]");
String debugString = " Location (latitude/longitude/altitude): [" + lla[0] + ", " + lla[1] + ", " + lla[2] + "]";
// System.out.println(debugString);
// Optionally, we can do some rotation of the entity // Optionally, we can do some rotation of the entity
/* /*
...@@ -239,38 +248,39 @@ public class EspduSender { ...@@ -239,38 +248,39 @@ public class EspduSender {
// packet with that data in it. // packet with that data in it.
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos); DataOutputStream dos = new DataOutputStream(baos);
espdu.marshal(dos); DatagramPacket packet;
FirePdu fire = new FirePdu();
byte[] fireArray = fire.marshal();
// The byte array here is the packet in DIS format. We put that into a // The byte array here is the packet in DIS format. We put that into a
// datagram and send it. // datagram and send it.
byte[] data = baos.toByteArray(); espdu.marshal(dos);
byte[] espduArray = baos.toByteArray();
FirePdu firePdu = new FirePdu();
firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation());
byte[] fireArray = firePdu.marshal();
broadcastAddresses = getBroadcastAddresses(); broadcastAddresses = getBroadcastAddresses();
Iterator iterator = broadcastAddresses.iterator(); Iterator iterator = broadcastAddresses.iterator();
while (iterator.hasNext()) while (iterator.hasNext())
{ {
InetAddress broadcast = (InetAddress) iterator.next(); InetAddress broadcast = (InetAddress) iterator.next();
System.out.println("Sending broadcast datagram packet to " + broadcast); if (espduArray.length > 0)
DatagramPacket packet = new DatagramPacket(data, data.length, broadcast, port); {
socket.send(packet); System.out.println("Sending espdu datagram packet to " + broadcast);
packet = new DatagramPacket(espduArray, espduArray.length, broadcast, port);
socket.send(packet);
}
// TODO experiment with these! 8) // TODO experiment with these! 8)
packet = new DatagramPacket(fireArray, fireArray.length, broadcast, port); // alternate if (fireArray.length > 0)
socket.send(packet); {
System.out.println("Sending fire datagram packet to " + broadcast);
packet = new DatagramPacket(fireArray, fireArray.length, broadcast, port); // alternate
socket.send(packet);
}
} }
// Send every 1 sec. Otherwise all this will be all over in a fraction of a second. // Send every 1 second within loop. Otherwise all this will be all over in a fraction of a second.
Thread.sleep(1000); // msec Thread.sleep(1000); // msec
location = espdu.getEntityLocation();
System.out.println("Espdu #" + index + " EID=[" + entityID.getSiteID()+ "," + entityID.getApplicationID()+ "," + entityID.getEntityID()+ "]");
System.out.println(" DIS coordinates location=[" + location.getX() + "," + location.getY() + "," + location.getZ() + "]");
double c[] = {location.getX(), location.getY(), location.getZ()};
double lla[] = CoordinateConversions.xyzToLatLonDegrees(c);
// debug: System.out.println(" Location (lat/lon/alt): [" + lla[0] + ", " + lla[1] + ", " + lla[2] + "]");
} }
} }
catch (Exception e) catch (Exception e)
...@@ -278,13 +288,14 @@ public class EspduSender { ...@@ -278,13 +288,14 @@ public class EspduSender {
System.out.println("Problem with DisExamplesOpenDis7.EspduSender, see exception trace:"); System.out.println("Problem with DisExamplesOpenDis7.EspduSender, see exception trace:");
System.out.println(e); System.out.println(e);
} }
System.out.println("===============");
System.out.println("DisExamplesOpenDis7.EspduSender complete."); System.out.println("DisExamplesOpenDis7.EspduSender complete.");
} }
/** /**
* A number of sites get all snippy about using 255.255.255.255 for a * A number of sites get all snippy about using 255.255.255.255 for a
* broadcast address; it trips their security software and they kick you off * broadcast address; it trips their security software and they kick you off
* their network. (Comcast, NPS.) This determines the broadcast address for * their network. (Comcast, NPS, etc.) This determines the broadcast address for
* all connected interfaces, based on the IP and subnet mask. If you have a * all connected interfaces, based on the IP and subnet mask. If you have a
* dual-homed host it will return a broadcast address for both. If you have * dual-homed host it will return a broadcast address for both. If you have
* some VMs running on your host this will pick up the addresses for those * some VMs running on your host this will pick up the addresses for those
......
Invocation instructions: Invocation instructions:
1. run/debug EspduReceiver.java (since sender does not block, be ready to listen) 1. run/debug EspduReceiver.java (since sender does not block, first be ready to listen)
2. run/debug EspduSender.java 2. run/debug EspduSender.java
TODO troubleshooting note: Program responses, sender and receiver:
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: run:
DisExamplesOpenDis7.EspduSender started... send 5 ESPDUs, initial index=0
Sending 5 ESPDU packets to /239.1.2.3 DisExamplesOpenDis7.EspduSender started...
-121.87693999999999 Sending 5 sets of packets:
lat, lon:36.595517, -121.87693999999999 ===============
DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 Create new PDUs
Sending broadcast datagram packet to /127.255.255.255 latitude, longitude: [36.595517, -121.87693999999999]
Sending broadcast datagram packet to /172.20.220.105 coordinate conversion: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
Sending broadcast datagram packet to /10.0.0.255 Espdu #0 entityID=[1,2,3]
Espdu #0 EID=[1,1,2] Sending espdu datagram packet to /127.255.255.255
DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] Sending fire datagram packet to /127.255.255.255
-121.877 Sending espdu datagram packet to /172.20.221.218
lat, lon:36.595517, -121.877 Sending fire datagram packet to /172.20.221.218
DIS coord:-2707492.9269245286, -4353663.899966802, 3781450.3202754413 Sending espdu datagram packet to /10.0.0.255
Sending broadcast datagram packet to /127.255.255.255 Sending fire datagram packet to /10.0.0.255
Sending broadcast datagram packet to /172.20.220.105 ===============
Sending broadcast datagram packet to /10.0.0.255 Create new PDUs
Espdu #1 EID=[1,1,2] latitude, longitude: [36.595517, -121.877]
DIS coordinates location=[-2707492.9269245286,-4353663.899966802,3781450.3202754413] coordinate conversion: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
-121.87693999999999 Espdu #1 entityID=[1,2,3]
lat, lon:36.595517, -121.87693999999999 Sending espdu datagram packet to /127.255.255.255
DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 Sending fire datagram packet to /127.255.255.255
Sending broadcast datagram packet to /127.255.255.255 Sending espdu datagram packet to /172.20.221.218
Sending broadcast datagram packet to /172.20.220.105 Sending fire datagram packet to /172.20.221.218
Sending broadcast datagram packet to /10.0.0.255 Sending espdu datagram packet to /10.0.0.255
Espdu #2 EID=[1,1,2] Sending fire datagram packet to /10.0.0.255
DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] ===============
-121.877 Create new PDUs
lat, lon:36.595517, -121.877 latitude, longitude: [36.595517, -121.87693999999999]
DIS coord:-2707492.9269245286, -4353663.899966802, 3781450.3202754413 coordinate conversion: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
Sending broadcast datagram packet to /127.255.255.255 Espdu #2 entityID=[1,2,3]
Sending broadcast datagram packet to /172.20.220.105 Sending espdu datagram packet to /127.255.255.255
Sending broadcast datagram packet to /10.0.0.255 Sending fire datagram packet to /127.255.255.255
Espdu #3 EID=[1,1,2] Sending espdu datagram packet to /172.20.221.218
DIS coordinates location=[-2707492.9269245286,-4353663.899966802,3781450.3202754413] Sending fire datagram packet to /172.20.221.218
-121.87693999999999 Sending espdu datagram packet to /10.0.0.255
lat, lon:36.595517, -121.87693999999999 Sending fire datagram packet to /10.0.0.255
DIS coord:-2707488.3677768684, -4353666.735244378, 3781450.3202754413 ===============
Sending broadcast datagram packet to /127.255.255.255 Create new PDUs
Sending broadcast datagram packet to /172.20.220.105 latitude, longitude: [36.595517, -121.877]
Sending broadcast datagram packet to /10.0.0.255 coordinate conversion: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
Espdu #4 EID=[1,1,2] Espdu #3 entityID=[1,2,3]
DIS coordinates location=[-2707488.3677768684,-4353666.735244378,3781450.3202754413] Sending espdu datagram packet to /127.255.255.255
Sending fire datagram packet to /127.255.255.255
Sending espdu datagram packet to /172.20.221.218
Sending fire datagram packet to /172.20.221.218
Sending espdu datagram packet to /10.0.0.255
Sending fire datagram packet to /10.0.0.255
===============
Create new PDUs
latitude, longitude: [36.595517, -121.87693999999999]
coordinate conversion: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
Espdu #4 entityID=[1,2,3]
Sending espdu datagram packet to /127.255.255.255
Sending fire datagram packet to /127.255.255.255
Sending espdu datagram packet to /172.20.221.218
Sending fire datagram packet to /172.20.221.218
Sending espdu datagram packet to /10.0.0.255
Sending fire datagram packet to /10.0.0.255
===============
DisExamplesOpenDis7.EspduSender complete.
BUILD SUCCESSFUL (total time: 8 seconds) BUILD SUCCESSFUL (total time: 8 seconds)
=================================================== ===================================================
run:
DisExamplesOpenDis7.EspduReceiver started... DisExamplesOpenDis7.EspduReceiver started...
PDU not implemented. Type = OTHER ===============
received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
received PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu entityID triplet: [1, 2, 3]
ID triplet: [1, 1, 2]
Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
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] Location in DIS coordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
PDU not implemented. Type = OTHER received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707492.9269245286, -4353663.899966802, 3781450.3202754413]
received PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu ===============
PDU not implemented. Type = OTHER received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
=================================================== Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
===============
received PDU type 1=ENTITY_STATE edu.nps.moves.dis7.EntityStatePdu
entityID triplet: [1, 2, 3]
Location in DIS coordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
received PDU type 2=FIRE edu.nps.moves.dis7.FirePdu
FirePdu locationInWorldCoordinates: [-2707488.3677768684, -4353666.735244378, 3781450.3202754413]
===================================================
\ No newline at end of file
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