Construction method of underwater vehicle simulation platform based on unreal engine

By constructing an underwater vehicle simulation platform based on Unreal Engine and Simulink, high-fidelity modeling and simulation of underwater vehicles were achieved. This method addresses the shortcomings of existing virtual simulation platforms, improves the efficiency and reliability of underwater vehicle R&D, and is suitable for verifying complex control strategies and training AI algorithms.

CN120822281APending Publication Date: 2025-10-21HARBIN ENG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510721312.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

Existing technologies make it difficult to build a controllable, repeatable, and low-cost virtual simulation platform for the research and development of underwater vehicles. They are unable to fully model and simulate the real behavior of underwater vehicles, especially in areas such as dynamic modeling, control algorithm verification, perception system simulation, and environmental disturbance reproduction.

Method used

We adopted an underwater vehicle simulation platform construction method based on Unreal Engine. Through multi-tool integration and modular collaborative design, we realized the interactive relationship modeling and simulation of the underwater vehicle body, control system, sensors and external environment. We combined Simulink for dynamic and kinematic modeling and used ROS to realize data closed loop and control interaction, thus building a high-fidelity and low-cost simulation platform.

Benefits of technology

It significantly improves the R&D efficiency and verification reliability of underwater intelligent equipment, lowers the threshold for building simulation systems, and enhances simulation efficiency and flexibility. It is suitable for complex control strategy verification, multi-sensor fusion testing, and AI algorithm training, promoting the practical application and large-scale deployment of underwater intelligent systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822281A_ABST
    Figure CN120822281A_ABST
Patent Text Reader

Abstract

The invention discloses a method for constructing an underwater vehicle simulation platform based on an unreal engine. The method comprises the following steps: step 1, constructing a virtual marine environment and carrying out three-dimensional modeling on an underwater vehicle; step 2, Simulink dynamics and kinematics modeling and control logic realization are carried out; step 3, establishing a data communication network; 4, simulating a virtual sensor; and 5, performing system joint debugging and task verification. According to the method, the flexibility, expansibility and engineering landing performance of the system are greatly improved, a user can quickly complete full-process closed-loop simulation from modeling, control, sensing to algorithm verification, ROS control logic can be conveniently deployed to a physical underwater vehicle, the development period is shortened, and the test risk is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of underwater robot simulation, and in particular to a method for constructing an underwater vehicle simulation platform based on an Unreal Engine. Background Art

[0002] To verify the feasibility and reliability of underwater vehicles in complex natural environments, traditional methods typically rely on extensive field trials at sea. However, these tests are not only costly, time-consuming, and risky, but also suffer from a range of issues, including poor repeatability, difficulty in scenario construction, and insufficient test samples. This is particularly true in research on artificial intelligence algorithms and autonomous control systems, where limited field data alone cannot meet the demands of high-frequency iterative training and large-scale testing.

[0003] Therefore, there is an urgent need to build a controllable, repeatable, low-cost virtual simulation platform, which will become a key technical path to replace some actual installation tests and promote the improvement of underwater submersible research and development efficiency.

[0004] While some virtual simulation platforms are currently being applied to underwater robotics, most remain limited to simple geometric models and static environment visualization, failing to fully model and simulate the real-world behavior of submersibles. This is particularly evident in areas such as dynamic modeling, control algorithm verification, perception system simulation, and environmental disturbance rendition. Relying solely on rendering engines, while achieving relatively realistic visual effects such as sea surface fluctuations, underwater lighting, and water particle effects, cannot support complete system-level closed-loop simulation.

[0005] To address this issue, the present invention proposes a method for constructing an underwater vehicle simulation platform based on the Unreal Engine. Through the design concept of multi-tool integration and module collaboration, it can not only provide a visually highly realistic underwater environment, but also fully model and simulate the interaction between the underwater vehicle body, control system, sensors and the external environment, and has high scalability and secondary development capabilities. It provides a high-fidelity, low-cost, repeatable comprehensive test platform for applications such as autonomous control research, intelligent algorithm verification and human-computer interaction training of underwater submersibles, significantly improving the R&D efficiency and verification reliability of underwater intelligent equipment. Compared with traditional solutions that rely entirely on the Unreal Engine, this method significantly lowers the threshold for building a simulation system, improves efficiency, flexibility and true consistency, and provides a unified, universal, and scalable high-fidelity test platform for underwater robot control verification, mission planning and artificial intelligence training. This platform construction method provides a high-efficiency, low-threshold, high-fidelity, and high-consistency simulation test solution for the research and development of underwater submersibles. It is particularly suitable for key scenarios such as complex control strategy verification, multi-sensor fusion testing, and AI algorithm training. It has broad scientific research and engineering application prospects and is of great significance to promoting the practical application and large-scale deployment of underwater intelligent systems. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the present invention aims to provide a method for constructing an underwater vehicle simulation platform based on Unreal Engine. This method creates a highly reproducible, interactive, and visually responsive simulation platform designed to support underwater vehicle research needs in areas such as design verification, control algorithm development, sensor fusion testing, and artificial intelligence perception algorithm training. This platform integrates vehicle geometry and environmental modeling into Unreal Engine, establishes kinematic and dynamic models in Simulink, and implements data closure and control interaction between the three through ROS. This effectively reduces system development complexity, improves simulation efficiency and practicality, and ultimately enables rapid algorithm migration from the simulation environment to the real vehicle system, meeting the technical requirements for efficient development and verification of underwater intelligent systems.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A method for constructing an underwater vehicle simulation platform based on Unreal Engine comprises the following steps:

[0009] Step 1: Construction of virtual ocean environment and 3D modeling of underwater submersible

[0010] Model the underwater vehicle and import it into Unreal Engine, and build the ocean environment in Unreal Engine;

[0011] Step 2: Simulink dynamics and kinematics modeling and control logic implementation

[0012] Perform dynamic modeling and kinematic analysis of underwater vehicles in MATLAB / Simulink, and design PID algorithms to control the speed and attitude of underwater vehicles;

[0013] Step 3: Data communication network establishment

[0014] Establish data communication between MATLAB / Simulink, Unreal Engine, and ROS;

[0015] Step 4: Virtual Sensor Simulation

[0016] Simulate the camera and IMU in Unreal Engine;

[0017] Step 5: System integration and task verification

[0018] Integrate the various subsystems and verify the performance and operability of the entire simulation platform in various mission scenarios through joint debugging.

[0019] Preferably, in step 1, the water plug-in in the Unreal Engine is used to construct the ocean environment, and the weather and lighting are set, and the color, flow rate, and wave size of the water are configured to achieve a simulation of the real ocean environment. SolidWorks software is used to build a three-dimensional model of the underwater submersible based on the actual underwater submersible, and the three-dimensional model file of the underwater submersible is imported into the Unreal Engine through the Datasmith plug-in of the Unreal Engine.

[0020] Preferably, the model includes structural components such as propellers, rudders, and control cabins.

[0021] Preferably, in step 2, dynamic modeling and kinematic attitude solution are performed on the underwater submersible in MATLAB / Simulink, and buoyancy, gravity, propulsion, water resistance and coupling interference factors are fully considered to establish a model, and a PID control algorithm is designed based on the model to achieve closed-loop control of key motion parameters of speed and attitude; at the same time, the response model of the actuator is integrated in Simulink to simulate the behavior of the real controller, realize the logical mapping between the control signal and the actuator action, and form a complete software and hardware control chain.

[0022] Preferably, the underwater submersible is mainly subjected to the hydrostatic force, i.e., its own gravity and the buoyancy of the water body, the hydrodynamic force, i.e., the lift and resistance generated by the movement of the underwater submersible relative to the water body, and the propulsion force generated by the propeller; wherein,

[0023] The forces in the X and Z directions are shown in Formula 1:

[0024]

[0025] Among them, PF X is the propulsion force generated by the tail thruster of the underwater submersible, D is the resistance encountered by the underwater submersible in the water when it moves in the water, which acts in the opposite direction of the movement of the submersible and slows down the movement of the submersible, and L is the buoyancy F B , the lift F generated by the water when the underwater submersible moves in the water L And the propulsion force PF generated by the underwater vehicle's Z-direction thruster Z W is the weight of the underwater vehicle;

[0026] The relationship between the thrust generated by the propeller and the propeller angular velocity is shown in Formula 2:

[0027]

[0028] in, is the coefficient, w is the angular velocity of the propeller;

[0029] The gravity acting on the underwater vehicle is shown in Formula 3:

[0030] W=mg (3)

[0031] Where m is the mass of the underwater vehicle and g is the acceleration due to gravity;

[0032] The resistance of the water body on the underwater submersible when it moves in the water body is shown in Formula 4:

[0033]

[0034] Where ρ is the water density, v is the speed of the underwater vehicle relative to the water, S is the area of ​​contact between the underwater vehicle and the water, C D is the drag coefficient;

[0035] The lift force exerted on an underwater vehicle when it moves in water is shown in Formula 5:

[0036]

[0037] in, is the lift coefficient;

[0038] The buoyancy of an underwater vehicle in water is shown in Formula 6:

[0039] F B =ρVg (6)

[0040] Wherein, V is the volume of the underwater vehicle immersed in the water;

[0041] The kinematic model of the underwater vehicle is implemented using the 6DOF module in Simulink. The resultant forces and moments from the previous dynamic model are used as input. The 6DOF module solves the motion of the underwater vehicle in six degrees of freedom (DOF) in three-dimensional space: three rotational degrees of freedom and three translational degrees of freedom.

[0042] Single-stage PID is used for the speed control of the underwater vehicle, and cascade PID is used for the PID control of the yaw angle of the underwater vehicle. PID control consists of three parts: proportional, integral, and differential. The formula is shown in Formula 7:

[0043]

[0044] Among them, e(t) is the deviation between the expected value and the actual value, K p is the proportional coefficient of the controller, T i is the integral time of the controller, also known as the integral coefficient, T d It is the differential time of the controller, also known as the differential coefficient.

[0045] Preferably, in step 3, by building a data communication network between Simulink, Unreal Engine and ROS, real-time data interaction and feedback closed loop between the systems are realized, the communication network is established based on ROS, and the data is sent to the ROS end in the form of ROS topic messages for processing; wherein,

[0046] Communication and interaction between MATLAB / Simulink and Unreal Engine: After building the kinematic model of the underwater vehicle in step 2, use the Simulation 3D Scene Configuration module in Simulink to connect to the Unreal Engine project in step 1. Then use the Simulation 3D Actor Transform Set module to transmit the real-time motion state information of the underwater vehicle in 3D space calculated by the 6DOF module to the corresponding underwater vehicle Actor Blueprint object instance in the Unreal Engine project. This allows the underwater vehicle Actor Blueprint object instance in the Unreal Engine to move according to the motion state information calculated by Simulink, realizing 3D visualization of the underwater vehicle's motion state.

[0047] Communication interaction between MATLAB / Simulink and ROS: In Simulink, the ROS Subscribe module is used to establish communication from the Windows system to the Linux in the WSL subsystem through a socket. This allows MATLAB / Simulink in Windows to subscribe to the topic of the ROS server in the Ubuntu 18.04 system to bring out the signal input interface of the control end. This module subscribes to the / velocity_control topic in the ROS server and receives speed and angle control commands sent by the ROS end.

[0048] Communication interaction between Unreal Engine and ROS: Based on the Unreal Engine open source plug-in ROS Integration, create a communication blueprint object in the Unreal Engine project in step 2 to inherit the ROSIntergrationGameInstance class provided by the plug-in, set the IP port to the IP port corresponding to the ROS end, and then create a communication C++ class to integrate the Topic class provided by the plug-in. In this class, C++ language is used in combination with ROS topic communication for development. This class serves as a bridge for two-way communication between the Unreal Engine project and the ROS end. Through this bridge, the Unreal Engine project in Windows can subscribe to the ROS end topic in Ubuntu18.04 to receive information sent by the ROS end, or publish topics to send information to the ROS end.

[0049] Preferably, in step 4, modeling and simulation of multiple typical underwater sensors are implemented in the Unreal Engine, including cameras and inertial measurement units (IMUs). The outputs of these virtual sensors are driven by the virtual state of the submersible. The simulation results have real data formats and output frequencies, and can be directly called by navigation, perception, and AI algorithms for algorithm verification and training.

[0050] Camera simulation: The camera simulation is based on the open source ROS IntegrationVision plug-in of Unreal Engine. In the Unreal Engine project, a C++ subclass is created based on the VisionActor C++ in ROS IntegrationVision. This class also inherits the IP port corresponding to the ROS end in ROSIntergrationGameInstance in step 3 to send the captured image information to the ROS server in the form of topic messages, realizing RGB images and depth images.

[0051] IMU simulation: In step 3, the communication subclass instance used for interaction between the Unreal Engine and the ROS side uses C++ to implement IMU simulation and sends IMU information to the ROS server at a frequency of 100 Hz. This communication class inherits the Actor class of the Unreal Engine and can obtain the Actor object, that is, the real-time coordinate position and attitude of the underwater submersible in the three-dimensional environment, that is, the Euler angle. Based on the real-time position and attitude and the data transmission rate, it calculates the data objects required by the IMU message type in ROS: attitude, linear acceleration, and angular velocity.

[0052] Preferably, the calculation formulas for the linear acceleration and angular velocity are shown in Formula 8 and Formula 9 respectively:

[0053] v now =(l now -l last ) / dt (8)

[0054] a now =(v now -v last ) / dt (9)

[0055] ω now =(θ now -θ last ) / dt (10)

[0056] Among them, l now 、v now ,θ now 、l last 、v last ,θ lastThey are the current position, speed and attitude and the position, speed and attitude when the last data was sent. now is the current linear acceleration, ω now is the current angular velocity.

[0057] Preferably, in step 5, by setting a typical underwater task, the dynamic response effect, path planning capability, perception accuracy of sensor data and responsiveness of the control system of the test platform are tested to ensure the system's collaborative ability and the effectiveness of task execution; the Unreal Engine simulation environment in step 1, the kinematic model in step 2, the data communication mechanism in step 3, and the virtual sensor in step 4 are system-integrated, and a cross-platform joint debugging test is performed to check whether the data transmission between the Unreal Engine, Simulink and ROS is timely and accurate, thereby ensuring the effectiveness of the real-time feedback loop.

[0058] Compared with the prior art, the present invention has achieved the following technical effects:

[0059] (1) The underwater vehicle simulation platform method proposed in this invention, which is based on the collaborative construction of Unreal Engine, Simulink and ROS, can achieve complete closed-loop support for vehicle structure modeling, hydrodynamic and kinematic simulation, complex underwater environment construction, sensor data simulation, and control and perception algorithm verification;

[0060] (2) The method of the present invention significantly reduces the difficulty of system development and integration, fully utilizes the existing modeling and control resources of Simulink, and avoids the technical barriers of repeatedly developing complex control logic in Unreal Engine. At the same time, ROS, as the core bridge between data interaction and control execution, ensures efficient communication and collaborative operation between modules and has good portability, allowing the control strategy developed in the simulation to be directly deployed to the real submarine system.

[0061] (3) Through high-fidelity graphics rendering and realistic sensor data output, the platform improves the immersion and credibility of the simulation system, significantly accelerates the R&D process of underwater submersibles from design to installation, reduces testing risks, and enhances the system's practicality and engineering application value in control algorithm verification, mission planning testing, and artificial intelligence training. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a flowchart of a method for constructing an underwater vehicle simulation platform based on Unreal Engine.

[0063] Figure 2 It is an ocean simulation environment.

[0064] Figure 3 This is a real picture of an underwater submersible.

[0065] Figure 4 It is a three-dimensional model of an underwater submersible created in SolidWorks.

[0066] Figure 5 It is the effect diagram of importing the three-dimensional model of the underwater submersible into the ocean simulation environment.

[0067] Figure 6 This is the force analysis diagram of the underwater submersible

[0068] Figure 7 It is a flowchart for dynamic modeling and kinematic solution in Simulink.

[0069] Figure 8 This is a block diagram of the PID control algorithm for the speed of the underwater vehicle.

[0070] Figure 9 This is a block diagram of the cascade PID control algorithm for the yaw angle of the underwater vehicle.

[0071] Figure 10 It is the communication network architecture diagram of the entire simulation platform.

[0072] Figure 11 It is the image information sent by the Unreal Engine end and received by the ROS end.

[0073] Figure 12 It is the IMU data information sent by the Unreal Engine end and received by the ROS end. DETAILED DESCRIPTION

[0074] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0075] The present invention discloses a method for constructing an underwater vehicle simulation platform based on Unreal Engine, the flow chart of which is as follows: Figure 1 shown.

[0076] Step 1: Construction of virtual ocean environment and 3D modeling of underwater submersible

[0077] Use the water plug-in in Unreal Engine 4 to build an ocean environment, set the weather and lighting, and configure the color, flow rate, wave size, etc. of the water to simulate the real ocean environment. Figure 2 . Using SolidWorks software based on the underwater submersible, such as Figure 3As shown in the figure, a three-dimensional model of the underwater submersible is established. The model includes structural components such as propellers, rudders, and control cabins. Figure 4 As shown in the figure, the underwater vehicle 3D model file is imported into the Unreal Engine through the Datasmith plug-in of the Unreal Engine. Figure 5 shown.

[0078] Step 2: Simulink dynamics and kinematics modeling and control logic implementation

[0079] Dynamic modeling and kinematic attitude calculations for underwater vehicles were performed in MATLAB / Simulink. Factors such as buoyancy, gravity, propulsion, water resistance, and coupled interference were comprehensively considered to establish a model. Based on this model, a PID control algorithm was designed to achieve closed-loop control of key motion parameters such as speed and attitude. Furthermore, response models of actuators (such as thrusters) were integrated into Simulink to simulate the behavior of real-world controllers (such as embedded devices like the STM32). This enabled a logical mapping between control signals and actuator actions, forming a complete hardware and software control chain.

[0080] The main forces acting on underwater submersibles include hydrostatic force (their own gravity and the buoyancy of the water body), hydrodynamic force (the lift and resistance generated by the movement of the underwater submersible relative to the water body), and the propulsion force generated by the propeller, such as Figure 6 As shown, it can be simply understood as the force in the X and Z directions (Formula 1):

[0081]

[0082] Among them, PF X is the propulsion force generated by the tail thruster of the underwater submersible, D is the resistance encountered by the underwater submersible in the water when it moves in the water, which acts in the opposite direction of the submersible's movement and slows down the movement of the submersible. L is the buoyancy F B , the lift F generated by the water when the underwater submersible moves in the water L And the propulsion force PF generated by the underwater vehicle's Z-direction thruster Z W is the gravity acting on the underwater vehicle.

[0083] The relationship between the thrust generated by the propeller and the propeller angular velocity is as follows (Formula 2):

[0084]

[0085] in, is the coefficient, and w is the angular velocity of the propeller.

[0086] The gravity acting on the underwater vehicle is as follows (Formula 3):

[0087] W=mg (3)

[0088] Where m is the mass of the underwater vehicle and g is the acceleration due to gravity.

[0089] The resistance of the water body on the underwater submersible when it moves in the water body is as follows (Formula 4):

[0090]

[0091] Where ρ is the water density, v is the speed of the underwater vehicle relative to the water, S is the area of ​​contact between the underwater vehicle and the water, C D is the drag coefficient.

[0092] The lift force exerted on an underwater vehicle when it moves in water is as follows (Formula 5):

[0093]

[0094] in, is the lift coefficient.

[0095] The buoyancy of an underwater vehicle in water is as follows (Formula 6):

[0096] F B =ρVg (6)

[0097] Where V is the volume of the underwater vehicle immersed in the water.

[0098] The kinematic model of the underwater vehicle is implemented based on the 6DOF module in Simulink. The resultant force and torque of the previous dynamic model are used as input, and the 6DOF module is used to solve the motion of the underwater vehicle in six degrees of freedom (three rotational degrees of freedom and three translational degrees of freedom) in three-dimensional space. Figure 7 shown.

[0099] At the same time, the PID control of the speed and yaw angle of the underwater vehicle is realized, as shown in the following example: Figure 8 and Figure 9 As shown. Single-stage PID is used for speed control, and cascade PID is used for yaw angle control. PID control consists of three parts: proportional, integral, and differential. The formula is as follows (Formula 7):

[0100]

[0101] Among them, e(t) is the deviation between the expected value and the actual value, K p is the proportional coefficient of the controller, T i is the integral time of the controller, also known as the integral coefficient, T d It is the differential time of the controller, also known as the differential coefficient.

[0102] Step 3: Establishment of data communication network. This step realizes real-time data interaction and feedback loop between various systems by building a data communication network between Simulink, Unreal Engine and ROS. The communication network is established based on ROS, and data is sent to the ROS end in the form of ROS topic messages for processing. The communication network architecture of the entire simulation platform is as follows: Figure 10 shown.

[0103] Communication and interaction between MATLAB / Simulink and Unreal Engine: After building the kinematic model of the underwater submersible in step 2, use the Simulation 3D Scene Configuration module in Simulink to connect to the Unreal Engine project in step 1. Then use the Simulation 3D Actor Transform Set module to transmit the real-time motion state information of the underwater submersible in three-dimensional space calculated by the 6DOF module to the corresponding underwater submersible Actor Blueprint object instance in the Unreal Engine project. This allows the underwater submersible Actor Blueprint object instance in the Unreal Engine to move according to the motion state information calculated by Simulink, realizing three-dimensional visualization of the underwater submersible's motion state.

[0104] Communication between MATLAB / Simulink and ROS: Using the ROS Subscribe module in Simulink, we establish socket communication from the Windows system to the Linux server in the WSL subsystem. This allows MATLAB / Simulink in Windows to subscribe to topics in the ROS server running on Ubuntu 18.04, thereby providing the control terminal's signal input interface. This module also subscribes to the / velocity_control topic in the ROS server, receiving speed and angle control commands from ROS.

[0105] Communication between the Unreal Engine and ROS: Based on the Unreal Engine open-source plugin ROS Integration, create a communication blueprint object in the Unreal Engine project from step 2 that inherits the ROSIntergrationGameInstance class provided by the plugin and sets the IP port to the IP port corresponding to the ROS client. Next, create a communication C++ class that integrates the Topic class provided by the plugin. This class is developed using C++ and ROS topic communication. This class serves as a bridge for two-way communication between the Unreal Engine project and the ROS client. Through this bridge, the Unreal Engine project in Windows can subscribe to ROS topics in Ubuntu 18.04 to receive information from ROS, or publish topics to send information to ROS.

[0106] Step 4: Virtual Sensor Simulation. Model and simulate various typical underwater sensors in Unreal Engine, including cameras and IMUs (inertial measurement units). The outputs of these virtual sensors are driven by the submersible's virtual state. The simulation results have realistic data formats and output frequencies, enabling them to be directly used by navigation, perception, and AI algorithms for verification and training.

[0107] Camera simulation: Camera simulation is based on the open source plug-in ROS IntegrationVision of Unreal Engine. In the Unreal Engine project, create a C++ subclass based on VisionActor C++ in ROS IntegrationVision. This class will also inherit the IP port corresponding to the ROS end in ROSIntergrationGameInstance in step 3 to send the captured image information to the ROS server in the form of topic messages, such as Figure 11 This class implements RGB images and depth images, with the topics unreal_ros / image_color and unreal_ros / image_depth respectively.

[0108] IMU Simulation: In Step 3, the communication subclass instance used for interaction between the Unreal Engine and ROS implements IMU simulation in C++ and sends IMU information to the ROS server at a 100 Hz frequency. This communication class inherits the Unreal Engine Actor class and obtains the real-time coordinate position and attitude (i.e., Euler angles) of the Actor object (underwater vehicle) in the 3D environment. Based on the real-time position and attitude, and the data transmission rate (100 Hz, meaning the interval between position and attitude status updates is dt = 0.01s), the data objects required for the ROS IMU message type are calculated: attitude (in quaternion form), linear acceleration, and angular velocity. The quaternion form of the attitude is converted from Euler angles to quaternions using the Quaternion() member function of the FRotator class. Since the interval between position and attitude status updates is dt = 0.01s, which is short and nearly instantaneous, the average acceleration during this period can be approximated as the real-time acceleration.

[0109] Therefore, the calculation formulas for linear acceleration and angular velocity can be shown as follows:

[0110] v now =(l now -l last ) / dt (8)

[0111] a now =(v now -v last ) / dt (9)

[0112] ω now =(θ now -θ last ) / dt (10)

[0113] Among them, l now 、v now ,θ now 、l last 、v last ,θ last They are the current position, speed and attitude and the position, speed and attitude when the last data was sent. now is the current linear acceleration, ω now is the current angular velocity.

[0114] The IMU topic received by the ROS side is in the form of Figure 12 shown.

[0115] Step 5: System integration and mission verification. In this step, the various subsystems are integrated, and the performance and operability of the entire simulation platform in various mission scenarios are verified through joint debugging. By setting up typical underwater tasks, the platform's dynamic response effect, path planning capability, sensor data perception accuracy, and control system responsiveness are tested to ensure the system's collaborative capabilities and the effectiveness of mission execution. The Unreal Engine simulation environment in step 1, the kinematic model in step 2, the data communication mechanism in step 3, and the virtual sensor in step 4 are integrated into the system. Ensure that data flows smoothly between modules and that the communication mechanism is stable. On this basis, a cross-platform joint debugging test is carried out to check whether the data transmission between the Unreal Engine, Simulink, and ROS is timely and accurate, ensuring the effectiveness of the real-time feedback loop.

[0116] According to the actual application scenarios of underwater submersibles, several typical underwater tasks are set and verified in the simulation environment. Common typical tasks include: (1) Track tracking task. Set a fixed path (such as a straight or curved trajectory) for the platform to verify the control accuracy and track tracking capability of the underwater submersible when performing the task. (2) Obstacle avoidance task. Add static or dynamic obstacles to the task scenario to verify the effectiveness of the obstacle recognition and avoidance strategy of the submersible. Use simulation sensors (cameras and IMUs) to collect environmental data in real time and test the response of the system in complex environments. (3) Depth-fixed directional control task. Test whether the underwater submersible can stably maintain the target depth and direction under given depth and attitude control to ensure the accuracy and robustness of the control system. (4) Task execution process monitoring and data recording. During each task execution, record key performance indicators such as sensor data, control instructions, path deviation, and system response time. Use the ROS publish and subscribe mechanism to transmit real-time data back to Simulink and Unreal Engine for easy analysis and adjustment. During the mission, the dynamic response of the underwater vehicle in the simulation environment is monitored in real time, including its position, attitude, velocity, acceleration, etc., to ensure the immediate response of the control system. (5) System collaboration capability test. During the execution of multiple tasks, the collaboration between the subsystems is tested, such as the effective combination of the Simulink control system and virtual sensor data, and the stability of ROS data transmission. Special attention is paid to the performance of the system under high load, including delays in task execution, data loss, etc., to ensure that the system can operate stably under complex task conditions.

[0117] The above description is merely a preferred embodiment of the present invention and does not limit the technical scope of the present invention. Therefore, any minor modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for constructing an underwater vehicle simulation platform based on Unreal Engine, comprising the following steps: Step 1: Construction of virtual ocean environment and 3D modeling of underwater submersible Model the underwater vehicle and import it into Unreal Engine, and build the ocean environment in Unreal Engine; Step 2: Simulink dynamics and kinematics modeling and control logic implementation Perform dynamic modeling and kinematic analysis of underwater vehicles in MATLAB / Simulink, and design PID algorithms to control the speed and attitude of underwater vehicles; Step 3: Data communication network establishment Establish data communication between MATLAB / Simulink, Unreal Engine, and ROS; Step 4: Virtual Sensor Simulation Simulate the camera and IMU in Unreal Engine; Step 5: System integration and task verification Integrate the various subsystems and verify the performance and operability of the entire simulation platform in various mission scenarios through joint debugging.

2. A method for constructing an underwater submersible simulation platform based on Unreal Engine according to claim 1, characterized in that in said step 1, a water plug-in in Unreal Engine is used to construct an ocean environment, and weather and lighting are set as well as the color, flow rate, and wave size of the water body are configured to achieve simulation of the real ocean environment, and SolidWorks software is used to build a three-dimensional model of the underwater submersible based on the actual underwater submersible, and the three-dimensional model file of the underwater submersible is imported into Unreal Engine through the Datasmith plug-in of Unreal Engine.

3. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 2, wherein the model includes structural components such as propellers, rudders, and control cabins.

4. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 1 is characterized in that in step 2, dynamic modeling and kinematic attitude solution are performed on the underwater vehicle in MATLAB / Simulink, buoyancy, gravity, propulsion, water resistance and coupled interference factors are fully considered to establish a model, and a PID control algorithm is designed based on the model to achieve closed-loop control of key motion parameters of speed and attitude; at the same time, the response model of the actuator is integrated in Simulink to simulate the behavior of the real controller, realize the logical mapping between the control signal and the actuator action, and form a complete software and hardware control chain.

5. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 1 is characterized in that the main forces acting on the underwater vehicle include hydrostatic force, i.e., its own gravity and the buoyancy of the water body, hydrodynamic force, i.e., the lift and resistance generated by the underwater vehicle's movement relative to the water body, and the propulsion force generated by the propeller; wherein, The forces in the X and Z directions are shown in Formula 1: Among them, PF X is the propulsion force generated by the tail thruster of the underwater submersible, D is the resistance encountered by the underwater submersible in the water when it moves in the water, which acts in the opposite direction of the movement of the submersible and slows down the movement of the submersible, and L is the buoyancy F B , the lift F generated by the water when the underwater submersible moves in the water L And the propulsion force PF generated by the underwater vehicle's Z-direction thruster Z W is the weight of the underwater vehicle; The relationship between the thrust generated by the propeller and the propeller angular velocity is shown in Formula 2: in, is the coefficient, w is the angular velocity of the propeller; The gravity acting on the underwater vehicle is shown in Formula 3: W=mg (3) Where m is the mass of the underwater vehicle and g is the acceleration due to gravity; The resistance of the water body on the underwater submersible when it moves in the water body is shown in Formula 4: Where ρ is the water density, v is the speed of the underwater vehicle relative to the water, S is the area of ​​contact between the underwater vehicle and the water, C D is the drag coefficient; The lift force exerted on an underwater vehicle when it moves in water is shown in Formula 5: in, is the lift coefficient; The buoyancy of an underwater vehicle in water is shown in Formula 6: F B =ρVg (6) Wherein, V is the volume of the underwater vehicle immersed in the water; The kinematic model of the underwater vehicle is implemented using the 6DOF module in Simulink. The resultant forces and moments from the previous dynamic model are used as input. The 6DOF module solves the motion of the underwater vehicle in six degrees of freedom (DOF) in three-dimensional space: three rotational degrees of freedom and three translational degrees of freedom. Single-stage PID is used for the speed control of the underwater vehicle, and cascade PID is used for the PID control of the yaw angle of the underwater vehicle. PID control consists of three parts: proportional, integral, and differential. The formula is shown in Formula 7: Among them, e(t) is the deviation between the expected value and the actual value, K p is the proportional coefficient of the controller, T i is the integral time of the controller, also known as the integral coefficient, T d It is the differential time of the controller, also known as the differential coefficient.

6. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 1, characterized in that in step 3, by constructing a data communication network between Simulink, Unreal Engine and ROS, real-time data interaction and feedback closed loop between the systems are realized, the communication network is established based on ROS, and data is sent to the ROS end in the form of ROS topic messages for processing; wherein, Communication and interaction between MATLAB / Simulink and Unreal Engine: After building the kinematic model of the underwater vehicle in step 2, use the Simulation 3D Scene Configuration module in Simulink to connect to the Unreal Engine project in step 1. Then use the Simulation 3D Actor Transform Set module to transmit the real-time motion state information of the underwater vehicle in 3D space calculated by the 6DOF module to the corresponding underwater vehicle Actor Blueprint object instance in the Unreal Engine project. This allows the underwater vehicle Actor Blueprint object instance in the Unreal Engine to move according to the motion state information calculated by Simulink, realizing 3D visualization of the underwater vehicle's motion state. Communication interaction between MATLAB / Simulink and ROS: In Simulink, the ROS Subscribe module is used to establish communication from the Windows system to the Linux in the WSL subsystem through a socket. This allows MATLAB / Simulink in Windows to subscribe to the topic of the ROS server in the Ubuntu 18.04 system to bring out the signal input interface of the control end. This module subscribes to the / velocity_control topic in the ROS server and receives speed and angle control commands sent by the ROS end. Communication interaction between Unreal Engine and ROS: Based on the Unreal Engine open source plug-in ROS Integration, create a communication blueprint object in the Unreal Engine project in step 2 to inherit the ROSIntergrationGameInstance class provided by the plug-in, set the IP port to the IP port corresponding to the ROS end, and then create a communication C++ class to integrate the Topic class provided by the plug-in. In this class, C++ language is used in combination with ROS topic communication for development. This class serves as a bridge for two-way communication between the Unreal Engine project and the ROS end. Through this bridge, the Unreal Engine project in Windows can subscribe to the ROS end topic in Ubuntu18.04 to receive information sent by the ROS end, or publish topics to send information to the ROS end.

7. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 1, characterized in that in step 4, the modeling and simulation of multiple typical underwater sensors, including cameras and inertial measurement units (IMUs), are implemented in Unreal Engine. The outputs of these virtual sensors are driven by the virtual state of the underwater vehicle. The simulation results have real data formats and output frequencies, and can be directly used by navigation, perception, and AI algorithms for algorithm verification and training. Camera simulation: The camera simulation is based on the open source plug-in ROS IntegrationVision of Unreal Engine. In the Unreal Engine project, a C++ subclass is created based on VisionActorC++ in ROS IntegrationVision. This class also inherits the IP port corresponding to the ROS end in ROSIntergrationGameInstance in step 3 to send the captured image information to the ROS server in the form of topic messages, realizing RGB images and depth images. IMU simulation: In step 3, the communication subclass instance used for interaction between the Unreal Engine and the ROS side uses C++ to implement IMU simulation and sends IMU information to the ROS server at a frequency of 100 Hz. This communication class inherits the Actor class of the Unreal Engine and can obtain the Actor object, that is, the real-time coordinate position and attitude of the underwater submersible in the three-dimensional environment, that is, the Euler angle. Based on the real-time position and attitude and the data transmission rate, it calculates the data objects required by the IMU message type in ROS: attitude, linear acceleration, and angular velocity.

8. The method for constructing an underwater vehicle simulation platform based on Unreal Engine according to claim 1, wherein the linear acceleration and angular velocity are calculated using formulas 8 and 9, respectively: v now =(l now -l last ) / dt(8) a now =(v now -v last ) / dt(9) ω now =(θ now -θ last ) / dt(10) Among them, l now 、v now ,θ now 、l last 、v last ,θ last They are the current position, speed and attitude and the position, speed and attitude when the last data was sent. now is the current linear acceleration, ω now is the current angular velocity.

9. The method for constructing an underwater vehicle simulation platform based on the Unreal Engine according to claim 1 is characterized in that, in step 5, by setting a typical underwater mission, the dynamic response effect, path planning capability, perception accuracy of sensor data and responsiveness of the control system of the platform are tested to ensure the system's collaborative ability and the effectiveness of task execution; the Unreal Engine simulation environment in step 1, the kinematic model in step 2, the data communication mechanism in step 3, and the virtual sensor in step 4 are system-integrated, and a cross-platform joint debugging test is performed to check whether the data transmission between the Unreal Engine, Simulink and ROS is timely and accurate, thereby ensuring the effectiveness of the real-time feedback loop.