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

updated open-dis7 libraries, tested satisfactorily, provide example output

parent cb6e52c4
No related branches found
No related tags found
No related merge requests found
ant -f C:\\x-nps-gitlab\\NetworkedGraphicsMV3500\\examples\\DisDemo -Dnb.internal.action.name=run run
init:
Deleting: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\DisDemo\build\built-jar.properties
deps-jar:
Updating property file: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\DisDemo\build\built-jar.properties
Compiling 1 source file to C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\DisDemo\build\classes
warning: [options] system modules path not set in conjunction with -source 11
1 warning
compile:
run:
Sending 20 ESPDU packets on broadcast address=[/192.168.1.255] port 3000
Current position: 0.0, 1.0, 0.0
... sent 1
Current position: 0.0, 2.0, 0.0
... sent 2
Current position: 0.0, 3.0, 0.0
... sent 3
Current position: 0.0, 4.0, 0.0
... sent 4
Current position: 0.0, 5.0, 0.0
... sent 5
Current position: 0.0, 6.0, 0.0
... sent 6
Current position: 0.0, 7.0, 0.0
... sent 7
Current position: 0.0, 8.0, 0.0
... sent 8
Current position: 0.0, 9.0, 0.0
... sent 9
Current position: 0.0, 10.0, 0.0
... sent 10
Current position: 0.0, 11.0, 0.0
... sent 11
Current position: 0.0, 12.0, 0.0
... sent 12
Current position: 0.0, 13.0, 0.0
... sent 13
Current position: 0.0, 14.0, 0.0
... sent 14
Current position: 0.0, 15.0, 0.0
... sent 15
Current position: 0.0, 16.0, 0.0
... sent 16
Current position: 0.0, 17.0, 0.0
... sent 17
Current position: 0.0, 18.0, 0.0
... sent 18
Current position: 0.0, 19.0, 0.0
... sent 19
Current position: 0.0, 20.0, 0.0
... sent 20
BUILD SUCCESSFUL (total time: 21 seconds)
...@@ -28,6 +28,9 @@ public class DisDemo { ...@@ -28,6 +28,9 @@ public class DisDemo {
public static void main(String[] args) throws Exception public static void main(String[] args) throws Exception
{ {
EntityStatePdu espdu = new EntityStatePdu(); EntityStatePdu espdu = new EntityStatePdu();
int NUMBER_OF_SENDS = 20;
int PORT = 3000;
// Create a new coordinate system at the give latitude, longitude, and altitude // Create a new coordinate system at the give latitude, longitude, and altitude
RangeCoordinates rangeCoordinates = new RangeCoordinates(31.435, 45.223, 17.0); RangeCoordinates rangeCoordinates = new RangeCoordinates(31.435, 45.223, 17.0);
...@@ -53,7 +56,7 @@ public class DisDemo { ...@@ -53,7 +56,7 @@ public class DisDemo {
espdu.getMarking().setCharacters("lulz".getBytes()); espdu.getMarking().setCharacters("lulz".getBytes());
espdu.setForceId(ForceID.FRIENDLY); espdu.setForceId(ForceID.FRIENDLY);
try (DatagramSocket socket = new DatagramSocket(3001)) try (DatagramSocket socket = new DatagramSocket(PORT))
{ {
// We set the starting position to (0,0,0) in the local coordinate // We set the starting position to (0,0,0) in the local coordinate
...@@ -75,7 +78,8 @@ public class DisDemo { ...@@ -75,7 +78,8 @@ public class DisDemo {
DatagramPacket packet; DatagramPacket packet;
// Do some movement for a while // Do some movement for a while
for(int idx = 0; idx < 500; idx++) System.out.println ("Sending " + NUMBER_OF_SENDS + " ESPDU packets on broadcast address=" + allBcasts + " port " + PORT);
for(int index = 1; index <= NUMBER_OF_SENDS; index++)
{ {
mover.step(); mover.step();
...@@ -94,12 +98,12 @@ public class DisDemo { ...@@ -94,12 +98,12 @@ public class DisDemo {
for(InetAddress aBcast: allBcasts) for(InetAddress aBcast: allBcasts)
{ {
packet = new DatagramPacket(buffer.array(), buffer.array().length, aBcast, 3000); packet = new DatagramPacket(buffer.array(), buffer.array().length, aBcast, PORT);
socket.send(packet); socket.send(packet);
} }
Thread.sleep(1000); Thread.sleep(1000);
System.out.println("sent " + idx); System.out.println("... sent " + index);
} }
} }
catch(IOException | InterruptedException e) catch(IOException | InterruptedException e)
......
This diff is collapsed.
# Finish, ENCODING_PLAINTEXT, 20201115_145232, DIS capture file, pduLog\PduCaptureLog1.dislog
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