JSBSim dynamics model plug-in for UE4 cluster simulation
By integrating the JSBSim dynamics model plugin into the UE4 cluster simulation system, the problems of low accuracy in dynamics simulation and data transmission delay were solved, achieving high-precision, real-time cluster simulation and improving system compatibility and development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YANGTZE DEITA GRADUATE SCHOOI OF BEIJING INST OF TECH (JIAXING)
- Filing Date
- 2025-09-01
- Publication Date
- 2026-05-01
AI Technical Summary
Existing cluster simulation systems have low accuracy in dynamic simulation, and the official JSBSim plugin only supports UE5, resulting in high data transmission latency and system instability between UE4 and external algorithm systems, making it difficult to achieve large-scale cluster flight experiments.
This paper provides a JSBSim dynamic model plugin for UE4 cluster simulation, including an initialization module, a data interaction layer module, a simulation loop module, and a UE4 cluster simulation system module. It enables bidirectional data interaction between JSBSim and UE4 and fixed-frequency dynamic calculations, and enhances simulation accuracy and stability through geographic coordinate adaptation and wind field simulation.
It improves the dynamic accuracy and real-time performance of cluster simulation, reduces data transmission latency and system instability risks, supports real-time simulation of high-precision dynamic models and compatibility in multi-machine cluster environments, and improves development efficiency and system robustness.
Smart Images

Figure CN121052164B_ABST
Abstract
Description
A JSBSim dynamics model plugin for UE4 cluster simulation Technical Field
[0001] This invention belongs to the field of UAV swarm flight simulation technology, and in particular relates to a JSBSim dynamics model plugin for UE4 swarm simulation. Background Technology
[0002] In recent years, distributed computing-based cluster simulation systems have been widely used in aerospace, intelligent transportation, and other fields. These systems typically require the collaborative operation of dynamic simulation and real-time rendering in large-scale scenarios. Taking aircraft cluster simulation as an example, the system not only needs to simulate the aerodynamic characteristics of a single aircraft but also needs to support state synchronization, collision detection, and collaborative decision-making among multiple nodes.
[0003] The core key to whether a swarm simulation system can effectively map real combat scenarios lies in the accuracy of its dynamic simulation. In current engineering practice, to balance computational efficiency and swarm size, point mass models are commonly used to simplify the aerodynamic model of a single aircraft. While this method, by ignoring attitude dynamics and environmental interaction effects, can support large-scale swarm simulations, it leads to distortion in the modeling of key dynamic features, resulting in systematic deviations between simulation results and actual experimental data. Furthermore, in some hardware-in-the-loop simulation systems, although high-fidelity dynamic models are constructed using real aircraft models, their computational load increases non-linearly with swarm size, making large-scale swarm flight experiments difficult.
[0004] Currently, there is a large-scale cluster simulation system called SigmaFree based on UE4. However, its aircraft dynamics model is calculated using an external algorithm system, while UE4 is mainly responsible for rendering the cluster aircraft. Therefore, the simulation system requires the transfer of a large amount of data between UE4 and the external algorithm system, which may result in high transmission latency and system instability. Summary of the Invention
[0005] The purpose of this invention is to provide a JSBSim dynamics model plugin for UE4 cluster simulation, which solves the problem of low dynamics simulation accuracy in existing cluster simulation systems and the problem that the official JSBSim plugin only supports UE5.
[0006] To achieve the above objectives, this invention provides a JSBSim dynamic model plugin for UE4 cluster simulation, including an initialization module, a data interaction layer module, a simulation loop module, and a UE4 cluster simulation system module;
[0007] The initialization module is responsible for building the basic simulation environment. It completes the framework construction by starting the core components of JSBSim, parses the aircraft XML model file, initializes the core components, converts the position information of the Actor components in UE4 into latitude, longitude and high-order geographic coordinates, and provides JSBSim with initial simulation conditions that match the actual scene, ensuring the accuracy of model parameters and geographic information.
[0008] The data interaction layer module enables bidirectional data flow, converting control commands from the UE4 terminal into control signals recognizable by JSBSim via interface calls (such as FCS->SetDaCmd). This drives the aerodynamics, propulsion system, and other modules within the JSBSim dynamics model to perform dynamic calculations. The data interaction layer module extracts key state data from the JSBSim simulation results, providing a data foundation for subsequent visualization rendering and system feedback. Control commands include, but are not limited to, control surface deflection and throttle adjustment. Key state data includes, but is not limited to, aircraft position, attitude, and velocity.
[0009] The simulation loop module drives the simulation process at a fixed frequency, obtains the aircraft's altitude and collision point coordinates through ground detection technology, and combines the wind field simulation module to convert UE4 wind field parameters into JSBSim wind field model parameters, dynamically updates environmental conditions, and finally outputs real-time simulation results through JSBSim's comprehensive dynamic calculation, ensuring the stability and physical accuracy of the simulation.
[0010] The UE4 cluster simulation system module uses Actors as the physical carriers. Through coordinate transformation, it adapts the data output by JSBSim to the coordinates and rotation values in the local coordinate system of UE4, updates the position and attitude information of Actors in real time, and visualizes the simulation results, forming a complete closed loop from physical calculation to visualization. This effectively solves the compatibility problem between JSBSim and UE4 in a multi-machine cluster environment and enables real-time simulation applications of high-precision dynamic models. The data output by JSBSim includes, but is not limited to, geocentric coordinates and Euler angle attitude.
[0011] Preferably, the initialization module includes the InitializeJSBSim function, LoadAircraft function, PrepareJSBSim function, and the core components of JSBSim, which rely on the UE4 georeferencing system (GeoReferencingSystem) to complete coordinate transformation; the core components include, but are not limited to, FGFDMExec, the flight control system (FCS), and the propulsion system (Propulsion).
[0012] Preferably, the data interaction layer module enables bidirectional data flow between UE4 and JSBSim. CopyToJSBSim converts UE4 control commands into JSBSim signals to drive calculations; CopyFromJSBSim extracts JSBSim state data for UE4 rendering and feedback; control commands include, but are not limited to, throttle and control surfaces; state data includes, but is not limited to, position, attitude, and velocity.
[0013] Preferably, the simulation loop module is responsible for driving the core calculations of JSBSim. The simulation loop module executes JSBSim dynamic calculations (Exec->Run loop) at a fixed frequency, integrates ground detection and wind field simulation functions, and outputs real-time status data.
[0014] Preferably, the UE4 cluster simulation system module is used to realize the visualization of simulation results. Based on the GeoReferencingSystem coordinate transformation interface and the UE4Acto component update logic, it includes coordinate adaptation code in UpdateLocalTransforms and TickComponent.
[0015] Preferably, the initialization module sequentially implements three functions: JSBSim environment setup, aircraft model loading, and initial condition configuration.
[0016] JSBSim environment setup: In the InitializeJSBSim function, create a JSBSim::FGFDMExec instance, obtain pointers to core components, and configure the model resource path through the function;
[0017] Aircraft model loading: The LoadAircraft function parses the aircraft XML model file through Exec->LoadModel, verifies the model's validity (such as the number of landing gears), initializes the subsystem's default parameters, and outputs an error log when loading fails; the subsystem's default parameters include, but are not limited to, engine parameters and fuel tank parameters;
[0018] Initialization condition configuration: Initial conditions are configured for the data interaction layer. The PrepareJSBSim function obtains the world coordinates of the Actor component in UE4. The GeoReferencingSystem converts the world coordinates into geocentric and geofixed coordinates EDEF and geographic coordinates (latitude, longitude, and altitude). The IC->SetLongitudeDegIC interface is used to set the initial position and attitude of JSBSim. The Exec->RunIC is called to complete the initial condition calculation, ensuring that the simulation starting point is consistent with the UE4 scene.
[0019] The initialization module provides pointers to the JSBSim components for initialization in the data interaction layer module throughout the system, and lays the foundation for geographic coordinates and models for the simulation loop module.
[0020] Preferably, the data interaction layer module includes two parts: downlink control commands and uplink status data;
[0021] Downlink control commands: The CopyToJSBSim function maps the actuator commands (such as the ActuatorCommands array) from the UE4 side to the JSBSim interface. For example, it updates the engine throttle through FCS->SetThrottleCmd(i,ActuatorCommands[i]) or controls the aileron deflection through FCS->SetDaCmd. It supports multi-channel command adaptation (such as ActuatorPlugin::SetActuatorConfigs parsing the XML configuration file and establishing the mapping relationship between command index and JSBSim attributes).
[0022] State data uplink: The CopyFromJSBSim function extracts key state data from JSBSim, obtains airspeed via Auxiliary->GetVcalibratedKTS, ECEF coordinates via Propagate->GetLocation, and Euler angles via Propagate->GetEuler; it also extracts parameters such as control surface position, ground speed, and altitude rate, and encapsulates them into the AircraftState structure in the UE4 local coordinate system. The parameters contained in the structure are not limited to position, attitude, velocity, and flight control system state, for use in rendering and collision detection; finally, when the data interaction layer module detects invalid coordinates, it triggers CrashedEvent, pauses the simulation, and broadcasts the collision event to improve system robustness.
[0023] The data interaction layer module mainly serves as a bidirectional data bridge between UE4 and JSBSim in the system. It receives component references from the initialization module, provides instruction input to the simulation loop module, and feeds back simulation results to the UE4 cluster simulation system module.
[0024] Preferably, the simulation loop module includes three specific functions: fixed frequency drive, ground effect simulation, and dynamic environmental update.
[0025] Fixed frequency drive: The simulation step size is calculated by simDtime, so that JSBSim runs at a frequency of 120Hz; multi-frame iteration is achieved by simloops to match the real-time requirements of UE4 under variable frame rate.
[0026] Ground effect simulation: The GetAGLevel function obtains the aircraft's altitude above ground (HAT), collision point coordinates (ECEFContactPoint), and normal vector (ECEFNormal) through LineTrace ray detection, which are used for landing gear stress calculation and ground collision detection; the range of the LineTrace ray is dynamically adjusted based on the Earth's ellipsoid radius (6,378,137 meters).
[0027] Dynamic environmental updates: Reserved wind field simulation interfaces (such as the SetWind function) can convert UE4 turbulence type (ETurbType) to JSBSim wind field model parameters (FGWinds::ttStandard, etc.), dynamically update wind speed and turbulence intensity, and enhance the realism of the simulation environment;
[0028] The simulation loop module is responsible for driving the JSBSim core calculation in the whole system, receiving the instruction input from the data interaction layer, outputting status data to the data interaction layer, and completing the coordinate transformation in collaboration with the UE4 cluster module through the geographic reference system.
[0029] Preferably, the UE4 cluster simulation system module sequentially implements three functions: coordinate system adaptation, actor state update, and cluster synchronization support.
[0030] Coordinate system adaptation: Convert the ECEF coordinates of JSBSim to UE4 local coordinates (CGWorldPosition) through GeoReferencingSystem->ECEFToEngine, obtain the ENU tangential transformation matrix using GetTangentTransformAtECEFLocation, convert the Euler angles of JSBSim (LocalEulerAngles) to UE4 quaternions (EngineRotationQuat), and correct the heading angle deviation (0° for North in JSBSim and 0° for East in UE4, so LocalUERotation.Yaw-=90.0);
[0031] Actor state update: The position and attitude of the Actor in UE4 are updated in real time through Parent->SetActorLocationAndRotation(EngineLocation,EngineRotationQuat), where EngineLocation is the coordinate after the centroid offset (CGWorldPosition-CGOffsetWorld), ensuring that the aircraft model is synchronized with the dynamic calculation results.
[0032] Cluster synchronization support: In multi-machine scenarios, each Actor independently runs coordinate system adaptation and Actor state updates, achieving coordinate consistency based on a unified geographic reference system, and supporting synchronous rendering and collision detection in large-scale cluster simulations;
[0033] The UE4 cluster simulation system module receives the state data output by the simulation loop module in the whole system, converts the coordinates into UE4 rendering input, and forms a closed loop of "physical calculation - coordinate adaptation - visualization".
[0034] Preferably, the simulation loop module includes a wind field simulation unit, which converts UE4 wind field parameters into JSBSim wind field model parameters.
[0035] Therefore, the JSBSim dynamic model plugin and method for UE4 cluster simulation described above have the following beneficial effects:
[0036] (1) By constructing a collaborative architecture of initialization module, data interaction layer, simulation loop module and UE4 cluster simulation system module, the JSBSim high-precision dynamic model is integrated into UE4 in the form of C++ plugin, realizing bidirectional data interaction, fixed frequency dynamic calculation and geographic coordinate adaptation between UE4 and JSBSim, thereby improving the dynamic accuracy, real-time performance and development efficiency of cluster simulation while retaining the original project ecosystem of UE4.
[0037] (2) High-precision dynamic simulation capability: By integrating the JSBSim high-precision dynamic model, the aerodynamics, propulsion system and other modules are driven by a fixed frequency of 120Hz in the simulation loop module. The environmental conditions are dynamically updated through ground detection and wind field simulation to ensure the physical accuracy of the simulation results, thus solving the core problem of modeling distortion in the existing technology.
[0038] (3) Improved UE4 compatibility and development efficiency: Through the plug-in architecture, the core functions of JSBSim are natively integrated into UE4; the dynamic calculation is embedded in UE4 as a C++ plug-in, which reduces data transmission delay and system instability risk, while supporting modular development of blueprint functions and lowering the development threshold of the simulation system.
[0039] (4) System robustness and scalability: The system stability is improved through anomaly detection and modular design in the data interaction layer; the reserved wind field simulation interface and multi-engine control logic can be flexibly extended to complex scenarios, such as multi-rotor and fixed-wing hybrid clusters.
[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0041] Figure 1 is a schematic diagram of the structure of a JSBSim dynamic model plugin for UE4 cluster simulation according to the present invention.
[0042] Figure 2 is a flowchart of the initialization module of the present invention;
[0043] Figure 3 is a flowchart of the data interaction layer of the present invention;
[0044] Figure 4 is a flowchart of the simulation loop module of the present invention;
[0045] Figure 5 is a flowchart of the UE4 cluster simulation system module of the present invention. Detailed Implementation
[0046] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0047] Please refer to Figures 1-5, which show a JSBSim dynamics model plugin for UE4 cluster simulation, including an initialization module, a data interaction layer module, a simulation loop module, and a UE4 cluster simulation system module.
[0048] The initialization module is responsible for building the basic simulation environment. It completes the framework construction by starting the core components of JSBSim, parses the aircraft XML model file, initializes the core components, converts the position information of the Actor components in UE4 into latitude, longitude and high-order geographic coordinates, and provides JSBSim with initial simulation conditions that match the actual scene, ensuring the accuracy of model parameters and geographic information.
[0049] The data interaction layer module enables bidirectional data flow, converting UE4 control commands into JSBSim-recognizable control signals via interface calls (such as FCS->SetDaCmd) to drive the system. Aerodynamics, Propulsion System The system performs dynamic calculations in modules such as JSBSim simulation; the data interaction layer module extracts key state data from the JSBSim simulation results to provide a data foundation for subsequent visualization rendering and system feedback; control commands include, but are not limited to, control surface deflection and throttle adjustment; key state data includes, but is not limited to, aircraft position, attitude and velocity.
[0050] The simulation loop module drives the simulation process at a fixed frequency, obtains the aircraft's altitude and collision point coordinates through ground detection technology, and combines the wind field simulation module to convert UE4 wind field parameters into JSBSim wind field model parameters, dynamically updates environmental conditions, and finally outputs real-time simulation results through JSBSim's comprehensive dynamic calculation, ensuring the stability and physical accuracy of the simulation.
[0051] The UE4 cluster simulation system module uses Actors as the physical carriers. Through coordinate transformation, it adapts the data output by JSBSim to the coordinates and rotation values in the local coordinate system of UE4, updates the position and attitude information of Actors in real time, and visualizes the simulation results, forming a complete closed loop from physical calculation to visualization. This effectively solves the compatibility problem between JSBSim and UE4 in a multi-machine cluster environment and enables real-time simulation applications of high-precision dynamic models. The data output by JSBSim includes, but is not limited to, geocentric coordinates and Euler angle attitude.
[0052] The initialization module includes the InitializeJSBSim function, LoadAircraft function, PrepareJSBSim function, and the core components of JSBSim, which rely on the UE4 georeferencing system (GeoReferencingSystem) to complete coordinate transformation; the core components include, but are not limited to, FGFDMExec, the flight control system (FCS), and the propulsion system (Propulsion).
[0053] The data interaction layer module enables bidirectional data flow between UE4 and JSBSim. CopyToJSBSim converts UE4 control commands into JSBSim signals to drive calculations; CopyFromJSBSim extracts JSBSim state data for UE4 rendering and feedback; control commands include, but are not limited to, throttle and control surfaces; state data includes, but is not limited to, position, attitude, and velocity.
[0054] The simulation loop module is responsible for driving the core calculations of JSBSim. The simulation loop module executes JSBSim dynamic calculations (Exec->Run loop) at a fixed frequency, integrates ground detection and wind field simulation functions, and outputs real-time status data.
[0055] The UE4 cluster simulation system module is used to visualize the simulation results. It is based on the GeoReferencingSystem coordinate transformation interface and the UE4Acto component update logic, and includes coordinate adaptation code in UpdateLocalTransforms and TickComponent.
[0056] The initialization module sequentially implements three functions: setting up the JSBSim environment, loading the aircraft model, and configuring initial conditions.
[0057] JSBSim environment setup: In the InitializeJSBSim function, create a JSBSim::FGFDMExec instance, obtain pointers to core components, and configure the model resource path through the function;
[0058] Aircraft model loading: The LoadAircraft function parses the aircraft XML model file through Exec->LoadModel, verifies the model's validity (such as the number of landing gears), initializes the subsystem's default parameters, and outputs an error log when loading fails; the subsystem's default parameters include, but are not limited to, engine parameters and fuel tank parameters;
[0059] Initialization condition configuration: Initial conditions are configured for the data interaction layer. The PrepareJSBSim function obtains the world coordinates of the Actor component in UE4. The GeoReferencingSystem converts the world coordinates into geocentric and geofixed coordinates EDEF and geographic coordinates (latitude, longitude, and altitude). The IC->SetLongitudeDegIC interface is used to set the initial position and attitude of JSBSim. The Exec->RunIC is called to complete the initial condition calculation, ensuring that the simulation starting point is consistent with the UE4 scene.
[0060] The initialization module provides pointers to the JSBSim components for initialization in the data interaction layer module throughout the system, and lays the foundation for geographic coordinates and models for the simulation loop module.
[0061] The data interaction layer module consists of two parts: downlink control commands and uplink status data.
[0062] Downlink control commands: The CopyToJSBSim function maps the actuator commands (such as the ActuatorCommands array) from the UE4 side to the JSBSim interface. For example, it updates the engine throttle through FCS->SetThrottleCmd(i,ActuatorCommands[i]) or controls the aileron deflection through FCS->SetDaCmd. It supports multi-channel command adaptation (such as ActuatorPlugin::SetActuatorConfigs parsing the XML configuration file and establishing the mapping relationship between command index and JSBSim attributes).
[0063] State data uplink: The CopyFromJSBSim function extracts key state data from JSBSim, obtains airspeed via Auxiliary->GetVcalibratedKTS, ECEF coordinates via Propagate->GetLocation, and Euler angles via Propagate->GetEuler; it also extracts parameters such as control surface position, ground speed, and altitude rate, and encapsulates them into the AircraftState structure in the UE4 local coordinate system. The parameters contained in the structure are not limited to position, attitude, velocity, and flight control state, and are used for rendering and collision detection; finally, when the data interaction layer module detects invalid coordinates, it triggers CrashedEvent, pauses the simulation, and broadcasts the collision event to improve system robustness.
[0064] The data interaction layer module mainly serves as a bidirectional data bridge between UE4 and JSBSim in the system. It receives component references from the initialization module, provides instruction input to the simulation loop module, and feeds back simulation results to the UE4 cluster simulation system module.
[0065] The simulation loop module includes three specific functions: fixed frequency drive, ground effect simulation, and dynamic environmental update.
[0066] Fixed frequency drive: The simulation step size is calculated by simDtime, so that JSBSim runs at a frequency of 120Hz; multi-frame iteration is achieved by simloops to match the real-time requirements of UE4 under variable frame rate.
[0067] Ground effect simulation: The GetAGLevel function obtains the aircraft's altitude above ground (HAT), collision point coordinates (ECEFContactPoint), and normal vector (ECEFNormal) through LineTrace ray detection, which are used for landing gear stress calculation and ground collision detection; the range of the LineTrace ray is dynamically adjusted based on the Earth's ellipsoid radius (6,378,137 meters).
[0068] Dynamic environmental updates: Reserved wind field simulation interfaces (such as the SetWind function) can convert UE4 turbulence type (ETurbType) to JSBSim wind field model parameters (FGWinds::ttStandard, etc.), dynamically update wind speed and turbulence intensity, and enhance the realism of the simulation environment;
[0069] The simulation loop module is responsible for driving the JSBSim core calculation in the whole system, receiving the instruction input from the data interaction layer, outputting status data to the data interaction layer, and completing the coordinate transformation in collaboration with the UE4 cluster module through the geographic reference system.
[0070] The UE4 cluster simulation system module sequentially implements three functions: coordinate system adaptation, actor state update, and cluster synchronization support.
[0071] Coordinate system adaptation: Convert the ECEF coordinates of JSBSim to UE4 local coordinates (CGWorldPosition) through GeoReferencingSystem->ECEFToEngine, obtain the ENU tangential transformation matrix using GetTangentTransformAtECEFLocation, convert the Euler angles of JSBSim (LocalEulerAngles) to UE4 quaternions (EngineRotationQuat), and correct the heading angle deviation (0° for North in JSBSim and 0° for East in UE4, so LocalUERotation.Yaw-=90.0);
[0072] Actor status update: via Parent->SetActorLocationAndRotation
[0073] (EngineLocation, EngineRotationQuat) updates the position and attitude of the Actor in UE4 in real time, where EngineLocation is the coordinate after the centroid offset (CGWorldPosition-CGOffsetWorld), ensuring that the aircraft model is synchronized with the dynamic calculation results.
[0074] Cluster synchronization support: In multi-machine scenarios, each Actor independently runs coordinate system adaptation and Actor state updates, achieving coordinate consistency based on a unified geographic reference system, and supporting synchronous rendering and collision detection in large-scale cluster simulations;
[0075] The UE4 cluster simulation system module receives the state data output by the simulation loop module in the whole system, converts the coordinates into UE4 rendering input, and forms a closed loop of "physical calculation - coordinate adaptation - visualization".
[0076] The simulation loop module includes a wind field simulation unit, which converts UE4 wind field parameters into JSBSim wind field model parameters.
[0077] Therefore, this invention employs the aforementioned JSBSim dynamics model plugin for UE4 cluster simulation. By constructing a collaborative architecture comprising an initialization module, a data interaction layer, a simulation loop module, and a UE4 cluster simulation system module, the JSBSim high-precision dynamics model is integrated into UE4 as a C++ plugin. This enables bidirectional data interaction between UE4 and JSBSim, fixed-frequency dynamics calculation, and geographic coordinate adaptation. Thus, while preserving the original UE4 project ecosystem, it improves the dynamics accuracy, real-time performance, and development efficiency of cluster simulation. High-precision dynamics simulation capability: By integrating the JSBSim high-precision dynamics model, the aerodynamics and propulsion systems modules are driven at a fixed frequency of 120Hz within the simulation loop module. Comprehensive calculations and dynamic updates of environmental conditions through ground detection and wind field simulation ensure the physical accuracy of simulation results, solving the core problem of modeling distortion in existing technologies. Improved UE4 compatibility and development efficiency: Through a plug-in architecture, the core functions of JSBSim are natively integrated into UE4; embedding dynamic calculations into UE4 as a C++ plug-in reduces data transmission latency and system instability risks, while supporting modular development of blueprint functions, lowering the development threshold of the simulation system; Enhanced system robustness and scalability: Anomaly detection and modular design in the data interaction layer improve system stability; Reserved wind field simulation interfaces and multi-engine control logic allow for flexible expansion to complex scenarios, such as multi-rotor and fixed-wing hybrid clusters.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A JSBSim dynamic system for UE4 cluster simulation, characterized in that: The system comprises an initialization module, a data interaction layer module, a simulation loop module, and a UE4 cluster simulation system module. The initialization module is responsible for building the basic simulation environment. It completes the framework setup by starting the core components of JSBSim, parsing the aircraft XML model file, initializing the core components, and converting the position information of the Actor components in UE4 into latitude, longitude, and altitude geographic coordinates. The data interaction layer module enables bidirectional data flow, converting UE4 control commands into JSBSim-recognizable control signals for dynamic calculations via interface calls. It also extracts key state data from the JSBSim simulation results. Furthermore, the data interaction layer module facilitates bidirectional data flow between UE4 and JSBSim. `CopyToJSBSim` converts UE4 control commands into JSBSim signals to drive calculations, while `CopyFromJSBSim` extracts JSBSim state data for UE4 rendering and feedback. The simulation loop module drives the simulation process at a fixed frequency, acquiring the aircraft's altitude and collision point coordinates through ground detection technology, converting UE4 wind field parameters into JSBSim wind field model parameters, dynamically updating environmental conditions, and outputting real-time simulation results through JSBSim's comprehensive dynamic calculations. The simulation loop module is responsible for driving the core calculations of JSBSim. It executes JSBSim dynamic calculations at a fixed frequency, integrates ground detection and wind field simulation functions, and outputs real-time status data. The UE4 cluster simulation system module uses Actors as physical carriers. Through coordinate transformation, it adapts the data output by JSBSim to the coordinates and rotation values in the local coordinate system of UE4, updates the position and attitude information of Actors in real time, and visualizes the simulation results.
2. The JSBSim dynamics system for UE4 cluster simulation according to claim 1, characterized in that: The initialization module includes the InitializeJSBSim function, LoadAircraft function, PrepareJSBSim function, and the core components of JSBSim, which rely on the UE4 georeferencing system GeoReferencingSystem to complete coordinate transformation.
3. The JSBSim dynamics system for UE4 cluster simulation according to claim 2, characterized in that: The UE4 cluster simulation system module is used to visualize the simulation results. It is based on the GeoReferencingSystem coordinate transformation interface and the UE4Acto component update logic, and includes coordinate adaptation code in UpdateLocalTransforms and TickComponent.
4. The JSBSim dynamics system for UE4 cluster simulation according to claim 3, characterized in that: The initialization module sequentially implements three functions: JSBSim environment setup, aircraft model loading, and initial condition configuration. JSBSim environment setup: In the InitializeJSBSim function, a JSBSim::FGFDMExec instance is created, core component pointers are obtained, and model resource paths are configured through functions. Aircraft model loading: The LoadAircraft function parses the aircraft XML model file using Exec->LoadModel, verifies model validity, initializes subsystem default parameters, and outputs error logs when loading fails. Initial condition configuration: The PrepareJSBSim function obtains the world coordinates of the Actor component in UE4, converts the world coordinates to EDEF (Earth-centric and Earth-fixed) coordinates and geographic coordinates using GeoReferencingSystem, sets the initial position and attitude of JSBSim using the IC->SetLongitudeDegIC interface, and calls Exec->RunIC to complete the initial condition calculation.
5. The JSBSim dynamic system for UE4 cluster simulation according to claim 4, characterized in that: The data interaction layer module consists of two parts: downlink control commands and uplink state data. Downlink control commands: The CopyToJSBSim function maps the actuator commands from the UE4 side to the JSBSim interface, supporting multi-channel command adaptation. Uplink state data: The CopyFromJSBSim function extracts key state data from JSBSim, obtaining airspeed via Auxiliary->GetVcalibratedKTS, ECEF coordinates via Propagate->GetLocation, and Euler angles via Propagate->GetEuler. Simultaneously, it extracts control surface position, ground speed, and altitude rate parameters, encapsulating them into an AircraftState structure in the UE4 local coordinate system. This structure contains parameters for position, attitude, velocity, and flight control system state. Finally, when the data interaction layer module detects invalid coordinates, it triggers a CrashedEvent, pausing the simulation and broadcasting a collision event.
6. The JSBSim dynamic system for UE4 cluster simulation according to claim 5, characterized in that: The simulation loop module includes three specific functions: fixed frequency drive, ground effect simulation, and dynamic environment update. Fixed frequency drive: The simulation step size is calculated using simDtime, enabling JSBSim to run at a frequency of 120Hz. Multi-frame iteration is achieved through simloops to match the real-time requirements of UE4 under variable frame rates. Ground effect simulation: The GetAGLevel function obtains the aircraft's altitude, collision point coordinates, and normal vector through LineTrace ray detection. The LineTrace ray range is dynamically adjusted using the Earth's ellipsoid radius. Dynamic environment update: A wind field simulation interface is reserved to convert UE4 turbulence types to JSBSim wind field model parameters and dynamically update wind speed and turbulence intensity.
7. The JSBSim dynamics system for UE4 cluster simulation according to claim 6, characterized in that: The UE4 cluster simulation system module sequentially implements three functions: coordinate system adaptation, actor state update, and cluster synchronization support. Coordinate system adaptation: The JSBSim ECEF coordinates are converted to UE4 local coordinates via GeoReferencingSystem->ECEFToEngine. The ENU tangential transformation matrix is obtained using GetTangentTransformAtECEFLocation, converting the JSBSim Euler angles to UE4 quaternions and correcting heading angle deviations. Actor state update: The position and attitude of the actor in UE4 are updated in real time via Parent->SetActorLocationAndRotation, where EngineLocation is the coordinate after the centroid offset. Cluster synchronization support: In multi-machine scenarios, each actor independently runs coordinate system adaptation and actor state updates.
8. The JSBSim dynamics system for UE4 cluster simulation according to claim 7, characterized in that: The simulation loop module includes a wind field simulation unit, which converts UE4 wind field parameters into JSBSim wind field model parameters.
Citation Information
Patent Citations
Digital twin model construction system and method based on UE4
CN120374897A
Method and system for virtual inspection and simulation of rare earth production process
US20230335225A1