Advanced Topic 7

Table of Contents

◄PREVIOUS NEXT►

The Last Position File

MiniSim creates a file ending with the string “.lastpos.txt” in the DAQ folder when the simulation ends. This file is used in certain specific applications where an external application launches miniSim from the command line (see Advanced Topic 8), and monitors its status by looking for a specific process running (i.e. SimopServer.exe) and reading the lastpos.txt file. When the simulation exists, the external system then decides, based on the content of the lastpos file, weather the drive is 'complete' of if a 'restart is needed'. The external system can also log the status of each drive, DAQ file names, number of restarts, etc.

  1. The restart will only work if the scenario is set up to stop the scenario when the vehicle either leaves the roadway or has a collision.

Example trigger Actions:

Drive complete:

Name: End Drive Actions:

Action 1, Type=Set Variable, Variable=VisualDisplaytext, Value=End of Drive, Please Come To a Stop, Delay=5s

Action 2, Type=Terminate Simulation, Delay=0s

Action 3, Type=Set Variable, Variable=FinishedDrive, Value=1, Delay=0s Action 4, Type=Log Data, Variable=Stream 2, Value=1

  1. The drive complete indicator is defined in scenario.
  2. The restart file will be named the same as the daq filename that is passed into the MiniSim but with a “.lastpos.txt” so “my.daq” would produce a restart file of “my.daq.lastpos.txt”. An example of the contents of a .lastpos.txt file is as follows:
3040.png

The 1st number indicates 1 if the scenario successfully finished:

               0 = not complete
               1 = successfully finished

The 2nd number is a number signifies the following when the simulation terminates:

              0 = Default, nothing specified
              1 = Collision with vehicle
              2 = Car drives off road
              4 = Operator abort - with restart
              5 = Operator abort - no restart
              6 = DAQ collection failure

Note: The Operator Abort (4, 5) are set when the miniSim is launched from the command line with the -AutoDrive option. If the operator clicks on the 'Stop' button, a GUI pops up with two options: 'Restart and 'Stop'. The collision and off road crash codes are set by trigger actions writing to log stream 2. The DAQ Collection failure is code is generated by the DAQMonitor.exe subsystem.

The 3rd number is the external driver X position [feet] The 4th number is the external driver Y position [feet] The 5th number is the external driver Z position [feet]

The 6th number is the elapsed time in 1/60 sec counts from the scenario start and the participant exceeds a speed trigger (ie 10mph).

The customer’s launch application checks to see if the MiniSim has exited, then reads the contents of the lastpos file and initiates a restart through the command line.

The X,Y,Z position is the ‘last known good’ location of the driver on the roadway and when the customer’s launch application initiates a restart through the command line, the MiniSim ‘backs’ the driver up 1000’ from this last known good location.

The second line will indicate the name of the .daq file that was recorded. This is needed in case the same name on the daq file is passed, the daq will rename the new file as not to over-write an existing file. If the customer sends the same DAQ file name twice, the MiniSim re-names the DAQ file to prevent over-writing.

[#top|TOP]]

Advanced Topic 8

The Route Table

The Route Table for the NADS MiniSim provides the functionality for forwarding cell data over UDP “datagrams” to a specified location. The datagrams are sent at 60 Hz. The route table is specified by the routetable.txt file. This file must exist in the “MiniSimDir\bin” directory; if the file does not exist the MiniSim will operate normally, although no data will be forwarded.

The following is an example of a route table:

Rem.png

For more information, see the Route Table page.