NOTE: the image gathering code in this repository is meant for a monitor with resolution 1920x1080 running in full screen mode. You can change back and forth from full screen mode is X-Plane 11 by opening the settings (second from the left in the upper right toolbar), opening the Graphics tab, and modifying the Monitor usage option under MONITER CONFIGURATION. For any other monitor configuration, the code would need to be modified. To navigate between terminals and X-Plane 11 when it is in full screen mode, use the ALT + TAB
keyboard shortcut.
The data generation code consists of three python files. If you would like to specify some settings and collect data, the main file you will want to familiarize yourself with is settings.py
, which controls the settings used in the other two files. The file sinusoidal.py
contains the code to send the aircraft down the runway in a sinusoidal pattern, and the file data_recorder.py
saves screenshots and non-image data as the trajectories are run.
This tutorial assumes that you are already followed the steps here and that X-Plane 11 is currently running in the proper configuration for taxinet.
-
Modify the settings file based on your desired simulation parameters
Modifiable parameters:
OUT_DIR
- Directory to save output data
- NOTE: CSV file and images will be overwritten if already exists in that directory, but extra images (for time steps that do not occur in the new episodes) will not be deleted
TIME_OF_DAY
- Time of day in local time, e.g. 8.0 = 8AM, 17.0 = 5PM
CLOUD_COVER
- Cloud cover (higher numbers are cloudier/darker)
- 0 = Clear, 1 = Cirrus, 2 = Scattered, 3 = Broken, 4 = Overcast
case
- Cases to run (determines how other variables are set)
example
- runs 2 short trajectories (used for initial testing)smallset
- runs 5 sinusoidal trajectories centered at zero crosstrack error with varying amplitude and frequency (ideal for collecting OoD data)largeset
- runs 20 sinusoidal trajectories with varying amplitude and frequency and centered at different crosstrack errorsvalidation
- runs 5 sinusoidal trajectories centered at zero crosstrack error with varying amplitude and frequencytest
- runs 3 sinusoidal trajectories center at 3 different crosstrack errors- the last five trajectories of the largeset have the same parameter settings as the largeset
FREQUENCY
- Frequency with which to record data (in Hz)
- NOTE: this is approximate due to computational overhead
-
Open two separate terminals and navigate to
NASA_ULI_Xplane_Simulator/src/data_generation
in each of them. -
In the first terminal, run
python3 sinusoidal.py
-
Quickly after, in the second terminal, run
python3 data_recorder.py
-
Quickly minimize both terminals so that they are not in the way of the data recorder. There should be a five second buffer since starting the
sinusoidal.py
script. -
Once all episodes are finished, the data will be saved to the folder you specified in
settings.py
.