# Extended Reality Application Framework for a Digital-Twin-Based Smart Crane
## 2 Materials and Methods
### Simulation Model  
Physical-field-based simulation model represents the complicated working condition of a machine, providing an overall picture of performance even in the face of unprecedented conditions, thus realizing the potential of DTs. DT always contains a simulation model that not only reflects how the machine works but also predicts how the machine will perform [16]. Furthermore, the simulation model enables the reflection of the real-time states of the operating machine [48]. Additionally, compared to numerical and analytical models, simulation models are most often applied in Industry 4.0 [49]. Considering the research requirements, the characteristics of the simulation model shall be high compatibility, scalability, interoperability, and open source. ROS (Robot Operating System) originated from the Personal Robots Programs, a collaboration between the AI laboratory at Stanford University and robot technology company Willow Garage in 2007 [50], aiming to improve the reusability and modularity of the code in the robotics field. ROS is a distributed framework of processes, enabling loosely coupled network connection of the modules from package to package. To simplify the robot development, ROS 1.0 [51] designs a series of communication mechanisms, including asynchronous streaming of data over a topic, RPC (synchronous Remote Procedure Call) over service, continuous response over action, and a parameterization server to store design parameters. The latest version of ROS 1.0 was released in 2020 as Noetic and the EOL (End of Life) date is 2025. However, in ROS 1.0, all the components and functions are connected through one center node \"ROS Master\", so once the ROS Master is down, the whole system communication will be abnormal, which is a hidden danger for industrial use. To solve this fatal defect, ROS 2.0 was launched in 2015. In the OS (Operation System) \begin{table}
\begin{tabular}{c c c} \hline \hline
**Subcomponent** & **Feature** & **Value** \\ \hline \multirow{2}{*}{Hoist} & Lifting height & 3.0 m \\  & Lifting speed & 8.0 m/min steps \\ \hline \multirow{2}{*}{Trolley} & Movement range & 9.0 m \\  & Movement speed & 20.0 m/min steps \\ \hline \multirow{2}{*}{Bridge} & Movement range & 19.8 m \\  & Movement speed & 32.0 m/min steps \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hardware of the crane: subsystems and their basic functional properties. Figure 2: The description of the overhead crane. layer, the new support platforms involve Windows, Mac, and RTOS (Real Time Operating System). Meanwhile, in the middleware layer, it adapts the message distributed mechanism based on DDS (Data Distribution Service) to decentralize ROS Master [52], which enhances real-time, persistence, and reliability. Gazebo [53] is an open-source and free 3D physical simulation platform designed for ROS, which supports various high-performance physical engines, 3D visualization environments, sensor simulations, TCP/IP transmission, and cloud simulation. Therefore, ROS 2.0 (Foxy version) and Gazebo are selected for the simulation platform in the research. In our research, the purpose of the ROS-based simulation platform was to validate the feasibility of the architecture and test the middleware performance; therefore, only the bridge and trolley moving parts were developed and simplified in the 3D modeling software Siemens NX according to the comprehensive crane model from Konecranes. SDF (Simulation Description Format) is designed specifically for Gazebo, which describes everything from the world to the robot in XML (Extensible Markup Language) format [53], while URDF (Unified Robot Description Format) is a format for describing robot structures based on the XML specification. SolidWorks to URDF Exporter, an open-source SolidWorks add-in, allows for the export of Assembles in SolidWorks into a URDF file. Moreover, Gazebo enables conversion from the modified URDF to SDF automatically [53]. Figure 3 illustrates the workflow that converts the 3D model to the URDF file used in Gazebo.