Development of ROS-based Flight and Mission State Communication Node For X-Plane 11-Based Flight Simulation Environment
Development of ROS-based Flight and Mission State Communication Node For X-Plane 11-Based Flight Simulation Environment
EISSN 2508-7150
Journal of Aerospace System Engineering http://dx.doi.org/10.20910/JASE.2021.15.4.75
Vol.15, No.4, pp.75-84 (2021)
Abstract
A novel robot-operating-system-based flight and mission state communication node for X-Plane 11 flight control
simulation environments and its simulation results were discussed. Although the proposed communication method
requires considerable implementation steps compared with the conventional MATLAB/Simulink-based User Datagram
Protocol (UDP) block utilization method, the proposed method enables a direct comparison of cockpit-view images
captured during flight with the flight data. This comparison is useful for data acquisition under virtual environments and
for the development of flight control systems. The fixed/rotary-wing and ground terrain elements simulated in virtual
environments exhibited excellent visualization outputs, which can overcome time and space constraints on flight
experiments and validation of missionary algorithms with complex logic.
Fig. 1 Block diagram for the X-Plane 11-based flight simulator (red box/line: proposed contribution)
Fig. 2 X-Plane 11-based UDP Rx/Tx system using robot operated system
Development of ROS-Based Flight and Mission State Communication Node
77
for X-Plane 11-Based Flight Simulation Environment
applied in embedded systems that are continuously 3.2 State Information Reception and Control Input
minimized/alleviated, 2) the information exchange between
Transmitter Node Development
nodes or blocks following the widening scope of flight control
systems R&D, resulting from the rapid development of various
In this study, the Tx/Rx data were received in the ROS
machine/deep learning-based algorithms, and 3) the
environment through the UDP. The joystick-based control input
collaboration-based software R&D process management in
was connected to the corresponding fixed/rotary-wing airframe
large development organizations.
to control the input data to the previously selected Tx/Rx-
To overcome such difficulties, this study proposed a CLI-
permitted data. A node that transmits this data to X-Plane 11
based development environment using Ubuntu ROS. A flight
was developed. The node structure (including the Tx/Rx node)
control simulation environment was proposed by integrating X-
and the Tx/Rx node file configuration are displayed in Figures
Plane 11 to the proposed environment.
4–5.
78 Sungwook Cho
Table. 2 DATA command of X-Plane 11 UDP Table. 4 Selected flight and mission state data in the X-
communication Plane 11
Table. 3 GETT command of X-Plane 11 UDP variable of the general flight dynamics, the angle of attack, the
communication sideslip angle, the horizontal and vertical path angle, and the
control input. The mission state indicates the state variable of
aircraft instrument/electronics/electricity and control
surface/engine. We simulated control surface failure for
controlling the surface angle such that it corresponded to the
mission state and the rest to flight state. Moreover, the '-' sign
indicates the calculated data through received data, not the data
In this study, the DATA command was used in the UDP communicated through X-Plane.
communication [16–18]. Although an additional Software The files of the Tx/Rx node were arranged in folders, as
Development Kit is provided in X-Plane 11, the kit is complex. displayed in Figure 5. In this study, the C/C++-based variables
Thus, the required data were communicated in packets through and functions were categorized as the header files in the
the corresponding command language, and an explicit code was "include" folder, cpp files in the "lib" folder, and then accessed
implemented. Table 2 presents a scheme of the packet as inherited forms in the main function in the "src" folder. In the
configuration of the DATA command. "config" folder, the parameters required to run the Tx/Rx node
The DATA command used the first five bytes to identify the (e.g., Tx/Rx IP address, port number, pub/sub, and topic
communication method, as displayed in Table 2. Up to eight name/type) were declared and used within the node as
pairs consisting of a four-byte Tx/Rx information index and a encapsulated forms. In the “launch” folder, launch files were
four-byte value were communicated [14]. The ASCII code was placed to use the Tx/Rx node in individual/integrated forms. In
used and the UDP interface was used to index input matched the “msg/srv” folder, the protocol file that is necessary to use
the left-side data order on the network. Furthermore, four-byte the Publisher/Subscriber/service communication of the ROS
data were transformed to a 32-bit float using dynamic casting was placed. Typically, in ROS communication node
in C++. However, in the case of GPS data, the actual location development, C-language and Python-based process-oriented
may not match the map location because the DATA command development process is standardized and used on the official
returns as a float form. This mismatch was resolved by first ROS website. However, in this study, the object-oriented usage
receiving the 0th aircraft's GPS information in the 64-bit form method of ROS functions was directly determined and
through the GETT command, as listed in Table 3. Next, encapsulation/classification/inheritance was performed to
dynamic casting was used to convert this result into the double recycle key function codes and maximize the debugging
format. The flight and mission states were communicated, as performance between them. This object-oriented development
displayed in Table 4 to develop a basic flight control system. If method enabled code reusability and maximized capacity when
the order changed by adding/editing/deleting the assigned various ROS communication methods were applied on a node.
Tx/Rx data in X-Plane, then it was reflected in the ROS Tx/Rx
node. Furthermore, additional information, such as the rotation 3.3 Control Input Node Development Using a
speed*, quaternion, etc., was calculated using the received data. Joystick
The flight state assigned in this study indicates the flight state
Four types of joysticks were used in the study, as illustrated
Development of ROS-Based Flight and Mission State Communication Node
79
for X-Plane 11-Based Flight Simulation Environment
near-real-time simulation are displayed in the upper right-hand wing/multirotor/tiltrotor control results. In addition, all the
corner of Figure 10. systems realized in this study were interlinked with the actual
X-Plane 11 and ROS-based environment results to conduct
3.5.3 UDP Tx Node communication performance verification and result analysis. The primary
control surface was categorized into four major components in
The communication of the UDP Tx node between X-Plane 11 the current study, but each control surface was controlled
and ROS is displayed in Figure 11. For the joystick connected independently in X-Plane 11, allowing the design of unique
to the ROS, the Extreme 3D Pro of Logitech was used, as control distribution. Moreover, control surface breakdowns
displayed in Figure 9(a), and the ROS-based UDP Tx node was were reproduced in X-Plane 11 for control systems R&D.
applied to the fixed-wing, multirotor, and tiltrotor. In X-Plane Furthermore, aircraft electrical/electronic/instrumental system
11, the self-configured control allocation algorithm of the normal operation/breakdown circumstances were reproduced
simulator was applied, which enabled the control of the aircraft and used to research flight control system response to various
by transmitting four primary control surface information scenarios. The quantitative values of the time delay information
through UDP Tx from the ROS. However, during take- that occurs when image information is interlocked were
offs/landings, the secondary flight surface control and the calculated based on reference literature, but we plan to devise
tiltrotor’s thrust vector control were managed separately. an alternative method and seek its approval through continuous
Additional flight control surface information through the UDP research.
Tx/Rx node was enabled for this secondary control, as
illustrated in Table. 4. Therefore, when starting the X-Plane, the Acknowledgement
fixed-wing, multirotor, and tiltrotor of values displayed in
Figure 9(b) were used for moderate control of all the aircraft This work was supported by the research grant of Research
with a single joystick, as displayed in Figures 11(a)–(d). Institute of Industrial Sciences at Cheongju University
Furthermore, a function that configures the real-time (2019.09.01~2021.08.31).
automatic/manual control modes was implemented through the
joystick buttons. Figure 11(e) displays the conversion between
the automatic and manual modes, and all were made to produce
zero because a loop that generates automatic commands was not
References
implemented.
[1] Media cover letter, Ministry of Land, Infrastructure and
3.5.4 Control Surface Breakdown Reproduction Transport (MOLIT), https://www.molit.go.kr/USR /NEW
S/m_71/dtl.jsp?lcmspage=1&id=95084990, 29th, Dec.
The control surface breakdown was reproduced by 2020
communication the UDP Tx node of X-Plane 11 and ROS, and [2] Media cover letter, Ministry of Land, Infrastructure and
the results are displayed in Figure 12. The breakdown was Transport (MOLIT), https://www.molit.go.kr/USR/NEW
reproduced by transmitting a random constant value to the X- S/ m_71/dtl.jsp?lcmspage=1&id=95083976, 4th, Jun. 2020
Plane 11, with the left-side aileron of the fixed-wing aircraft [3] Media cover letter, Ministry of Land, Infrastructure and
stuck at the assigned angle through the ROS-based Transport (MOLIT), https://www.molit.go.kr/USR/NEW
communication node. In this instance, for such motion to be S/ m_71/dtl.jsp?lcmspage=1&id=95084057, 24th, Jun.
implemented, the aileron embedded on the main wing must be 2020
randomly divided and the range of motion must be previously [4] MOLIT and Joint Consortium, “K-UAM roadmap”, May
configurated through Plane Maker; aircraft with certain textures 2020.
assigned cannot replicate such motion as observed in some [5] Media cover letter, Ministry of Trade, Industry and Energy
cases. Therefore, the desired function was successfully (MOTIE), http://www.motie.go.kr/motie/ne/press e/press
implemented through the ROS-based communication node 2/bbs/bbsView.do?bbs_seq_n=163382&bbs_cd_n=81&cu
developed in this study. rrentPage=1&search_key_n=&cate_n=&dept_v=&search
_val_v=, 12th, Oct. 2020
[6] Media cover letter, Ministry of Land, Infrastructure and
4. Conclusion
Transport (MOLIT), https://www.molit.go.kr/USR/NEW
S/ m_71/dtl.jsp?lcmspage=1&id=95084962, 25th, Dec.,
In this study, an ROS communication node was developed
2020.
for an X-Plane 11-based flight control simulation environment,
and a realistic simulation environment was developed to
describe the UDP-based Tx/Rx, screen capture-based forward
image utilization, and joystick-based fixed-
82 Sungwook Cho
Fig. 9 Development results of the ROS/X-Plane 11-based flight simulation environment; (a) proposed flight simulation
environment; (b) applied vehicles (fixed-wing, multirotor, tiltrotor type); (c) flight state receive results using ROS-
based UDP Rx node; (d) X-Plane 11 flight state result; (e) calculated flight state results
Fig. 10 Development results using the image and multiplot viewer in ROS; (a) subscribed image result using the image
viewer (i.e., rqt_image_viewer, in ROS), (b) multiplot results with respect to the flight states (rqt_plot, in ROS,
upper: roll/pitch angle[deg.], middle: true heading angle[deg.], lower: true airspeed[m/s])
Development of ROS-Based Flight and Mission State Communication Node
83
for X-Plane 11-Based Flight Simulation Environment
Fig. 11 Development results of the ROS/X-Plane 11-based flight simulation environment, UDP-Tx node, (a) fixed-wing
type aircraft (Diamond DA-62), (b) multirotor type aircraft (DJI Mavic 2), (c) tiltrotor type aircraft, hovering
(open-source), (d) tiltrotor type aircraft, cruise flight (open-source), (e) auto(manualAutoState:2) and
manual(manualAutoState:1) engagement test result
Fig. 12 Development results of the control surface stuck scenario based on the proposed ROS/X-Plane 11-based flight
simulation environment (a: normal operation of the control surface, b: malfunction state of the left aileron,
control surface stuck)
84 Sungwook Cho