**4. Interface between the Real and Virtual Quadcopters (Mixed Reality Simulation Setup)**

The MR simulation makes a connection between the real and virtual quadcopters. Herein, we connected our real quadcopter to the ground control station (GCS) through a radio telemetry device. The radio telemetry device contains two parts; one is a ground module which is connected to the computer with GCS, and the second is an air module which is connected to the real quadcopter. Here, we used Mission Planner (version: 1.3.66) [33] as a GCS. Mission Planner is a GCS software for a plane, copter, and rover developed by Michael Osborne. Through the radio telemetry device, the real quadcopter sends real-time data to the Mission Planner GCS. As we mentioned previously, X-Plane is our simulation platform, so in this work, we developed a connection interface between X-Plane and the Mission Planner GCS in MATLAB for mixed reality simulation.

Figure 8 shows the MR simulation setup. The outline of the developed connection interface is shown in Figure 9. The developed connection interface is the combination of three MATLAB program sets, viz., TCP/IP client program, data converter program, and UDP server program. First, we set up Mission Planner as a TCP/IP server and the developed connection interface as a TCP/IP client. Then, Mission Planner sends the real quadcopter's real-time flight data in the National Marine Electronics Association (NMEA) format.

**Figure 8.** Mixed reality simulation setup.

**Figure 9.** Outline of the developed connection interface.

Note that the NMEA is a standard data format supported by all GPS manufacturers [34]. The TCP/IP client program set in the developed connection interface collects the real-time NMEA formatted data from Mission Planner. The NMEA formatted data contains several interpreted sentences; the sentences contain the real-time flight data of the real quadcopter. The received NMEA formatted sentences are, GPGGA, GPGLL, GPHDG, GPVTG, GPRMC, and GPRPY. For MR simulation, we need only the real-time position and attitude data of the real quadcopter. Therefore, by using our data converter program (please see the link provided in the Supplementary Materials) set in the developed connection interface, we selected, split, and converted the GPGGA and GPRPY sentences from the NMEA formatted data, because the GPGGA sentence contains real-time latitude, longitude, and altitude data of the real quadcopter and the GPRPY sentence contains the real-time pitch, roll, and heading data of the real quadcopter. For the MR simulation, before running the program it is essential to set up X-Plane as the UDP client. Then, through the UDP server program set in the developed connection interface, the real-time latitude, longitude, altitude, pitch, roll, and heading data of the real quadcopter are sent to the X-Plane. Note that all the receiving, converting, and transmitting processes are in the real-time mode.
