Underwater robot virtual simulation platform design method based on unreal engine 5
By adopting a layered decoupling design and modular architecture based on Unreal Engine 5, combined with ROS2 and TCP communication, the problems of high cost, high risk, low simulation fidelity and low iteration efficiency in traditional underwater robot development are solved, and efficient control algorithm testing and high-fidelity simulation platform are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-31
AI Technical Summary
In the traditional development of underwater robots, real sea trials are costly and risky, simulation platforms have low fidelity, high control-simulation coupling, low iteration efficiency, insufficient sensor simulation accuracy, and high real-time communication latency, making it difficult to balance the needs of high-frequency data transmission and low-latency control.
It adopts a layered decoupled design based on Unreal Engine 5 to build a high-fidelity underwater virtual environment and robot model. Combined with ROS2 and TCP communication channels, it realizes modular architecture and low-latency communication, supporting independent development and testing of each functional module.
It improves the efficiency of developing and testing underwater robot control algorithms, reduces R&D costs, enhances the reliability and control accuracy of simulation results, reduces iteration cycles, and lowers the risks of real sea trials.
Smart Images

Figure CN121766201A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of underwater robot simulation and testing technology, and in particular to a design method for an underwater robot virtual simulation platform based on Unreal Engine 5. Background Technology
[0002] As core equipment in underwater exploration, resource development, and marine engineering, the reliability and adaptability of underwater robots' control algorithms directly determine the success or failure of missions. In traditional underwater robot development, control algorithm testing relies on real sea trials or simplified simulation platforms. Real sea trials are costly and risky. Traditional simplified simulation platforms often integrate underwater robot dynamics calculations, control algorithms, and visualization rendering into a single module. Modifying the control logic or optimizing the dynamic model requires recompiling the entire system, making independent development and testing of individual functional modules impossible and inefficient. Furthermore, if the control algorithm is deployed on an external system (such as the robot operating system ROS), communication between the simulation platform and the external system often uses a single TCP / UDP protocol, making it difficult to balance the requirements of "high-frequency data transmission" and "low-latency control." When the control command frequency exceeds 20Hz, command backlog or trajectory tracking lag can easily occur, affecting control requirements. Summary of the Invention
[0003] The purpose of this application is to provide a design method for an underwater robot virtual simulation platform based on Unreal Engine 5, which can improve the development / testing efficiency of underwater robot control algorithms.
[0004] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a design method for an underwater robot virtual simulation platform based on Unreal Engine 5, including: In Unreal Engine 5, an underwater robot virtual simulation model and a high-fidelity underwater virtual environment are constructed; the underwater robot virtual simulation model is used to adjust its own motion state in the high-fidelity underwater virtual environment according to the received control commands. In the first external system, a model calculation module is deployed; the model calculation module is used to acquire motion state data of the underwater robot virtual simulation model, and preprocess the motion state data according to the underwater robot dynamics model; In the second external system, a control algorithm module is deployed; the control algorithm module is used to acquire preprocessed motion state data and underwater virtual environment information, and generate control commands for the underwater robot virtual simulation model based on the preprocessed motion state data and / or underwater virtual environment information; the control algorithm in the control algorithm module is a verified algorithm; the underwater virtual environment information includes underwater virtual environment images; A dual-channel communication mechanism is constructed to connect Unreal Engine 5, the model calculation module, and the control algorithm module; the dual-channel communication mechanism includes a communication channel based on ROS2 and a communication channel based on TCP.
[0005] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a design method for an underwater robot virtual simulation platform based on Unreal Engine 5. Through a layered decoupling design, the underwater robot virtual simulation platform is divided into parts deployed by different independent systems / processes, namely, an underwater robot virtual simulation model based on Unreal Engine 5 and a high-fidelity underwater virtual environment, a model calculation module and a control algorithm module deployed on an external system independent of the Unreal Engine 5 environment. This enables independent development and testing of each functional module, improving efficiency. Furthermore, a dual-path communication mechanism is established for the three, namely a communication channel based on ROS2 and a communication channel based on TCP, thereby ensuring the testing requirements of "high-frequency data transmission" and "low-latency control". Attached Figure Description
[0006] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0007] Figure 1 A flowchart illustrating a design method for an underwater robot virtual simulation platform based on Unreal Engine 5, provided as an embodiment of this application; Figure 2 A schematic diagram of the architecture of an underwater robot virtual simulation platform provided in an embodiment of this application; Figure 3 A schematic diagram of the architecture of another underwater robot virtual simulation platform provided in an embodiment of this application; Figure 4 A schematic diagram of the functional modules of each layer of the underwater robot virtual simulation platform provided in an embodiment of this application; Figure 5 This is a schematic diagram of an underwater robot model provided in an embodiment of this application. Detailed Implementation
[0008] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0009] Currently, in the research and development of underwater robots, there are still some issues with the traditional testing platform for control algorithms that need improvement, which will be discussed in detail below.
[0010] 1) Real sea trials are costly and risky: Sea trials require a lot of resources such as manufacturing equipment, equipment maintenance, and personnel scheduling. In addition, underwater robots are prone to collision damage in complex underwater environments (such as turbulent and obstacle areas), which leads to a longer research and development cycle.
[0011] 2) Low fidelity of traditional simulation platforms: Existing simulation tools (such as MATLAB / Simulink, V-REP) mostly use simplified underwater environment models (such as single water color, ignoring light scattering effects) and low-precision underwater robot geometric models, which cannot reproduce the optical characteristics and hydrodynamic effects (such as buoyancy, resistance, turbulence) of real underwater environments. This results in large deviations between simulation results and actual scenarios, and low credibility of control algorithm verification.
[0012] 3) High coupling between control and simulation, low iteration efficiency: Most platforms integrate underwater robot dynamics calculation, control algorithm, and visualization rendering into a single module. If the control logic needs to be modified or the dynamic model needs to be optimized, the entire system needs to be recompiled, which cannot support the independent development and testing of each functional module.
[0013] 4) Insufficient sensor simulation accuracy: Underwater robots rely on sensors such as cameras, inertial measurement units (IMUs), and ultra-short baseline positioning systems (USBLs) to achieve environmental perception and positioning. However, traditional platforms often output "ideal sensor data" (no noise, no delay) without considering the measurement errors of real sensors (such as IMU drift, USBL ranging deviation, and underwater camera color distortion), resulting in incomplete verification of the perception-control algorithm chain.
[0014] 5) High real-time communication latency: If the control algorithm is deployed on an external system (such as the robot operating system ROS), the traditional simulation platform and the external system often use a single TCP / UDP protocol for communication, which makes it difficult to balance the requirements of "high-frequency data transmission" and "low-latency control". When the control command frequency exceeds 20Hz, command accumulation or trajectory tracking lag is likely to occur, affecting control accuracy.
[0015] To address the aforementioned issues, an underwater robot virtual simulation platform is needed that features a high-fidelity environment, modular architecture, accurate sensor simulation, and low-latency communication, thereby reducing R&D costs and improving the efficiency and reliability of control algorithm verification. Therefore, this application provides a design method for an underwater robot virtual simulation platform based on Unreal Engine 5.
[0016] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] In one exemplary embodiment, such as Figure 1 As shown, a design method for an underwater robot virtual simulation platform based on Unreal Engine 5 is provided, including the following steps.
[0018] S101: In Unreal Engine 5 (also known as UE5), construct an underwater robot virtual simulation model and a high-fidelity underwater virtual environment; the underwater robot virtual simulation model is used to adjust its own motion state in the high-fidelity underwater virtual environment according to the received control commands.
[0019] S102: In the first external system, a model calculation module is deployed; the model calculation module is used to acquire motion state data (such as position, attitude, velocity and acceleration) of the underwater robot virtual simulation model, and preprocess the motion state data according to the underwater robot dynamics model.
[0020] S103: In the second external system, a control algorithm module is deployed; the control algorithm module is used to acquire preprocessed motion state data and underwater virtual environment information, and generate control commands for the underwater robot virtual simulation model based on the preprocessed motion state data and / or underwater virtual environment information; the control algorithm in the control algorithm module is a verified algorithm; the underwater virtual environment information includes underwater virtual environment images.
[0021] S104: Construct a dual-path communication mechanism connecting Unreal Engine 5, the model calculation module, and the control algorithm module; the dual-path communication mechanism includes a ROS2-based communication channel and a TCP-based communication channel (also known as a dedicated TCP control link).
[0022] The above solution adopts a layered and modular architecture to decouple the functions of "visual rendering, control algorithm, and model calculation," supporting independent development and iteration of each module and improving development / testing efficiency. By designing a dual-path real-time communication mechanism, it balances "general data interaction" and "low-latency control command execution," ensuring real-time closed-loop control between the external control algorithm and the virtual underwater robot.
[0023] Both the first and second external systems are external systems independent of the Unreal Engine 5 environment.
[0024] In some embodiments, UE5 is deployed on a server with high computing power, and the external system refers to another PC host or a real underwater robot device. The external system obtains environmental information from the UE5 virtual simulation platform via a TCP connection. After processing, the control algorithm layer acts as a node of ROS2, issuing control commands to the UE5 virtual simulation platform through ROS2. (See [reference needed]). Figure 2 and Figure 3 .
[0025] As an optional implementation, the underwater robot virtual simulation model further includes an underwater robot physical motion model, corresponding control components, and a sensor simulation module; the construction process of the underwater robot virtual simulation model includes: S201: Create the underwater robot geometry model and import it into Unreal Engine 5.
[0026] S202: In Unreal Engine 5, convert the underwater robot's geometric model into an underwater robot's physical motion model.
[0027] S203: In Unreal Engine 5, construct a control body component for the underwater robot's physical motion model; the control body component is used to: collect the original motion state data of the underwater robot's physical motion model, receive control commands, and adjust the motion state of the underwater robot's physical motion model based on the control commands.
[0028] S204: In Unreal Engine 5, a sensor simulation module for constructing the physical motion model of an underwater robot is provided. The sensor simulation module includes an underwater vision sensor simulation submodule and an inertial measurement unit simulation submodule. The underwater vision sensor simulation submodule is used to acquire images of the underwater virtual environment. The inertial measurement unit simulation submodule includes a basic data extraction unit and a noise superposition unit. The basic data extraction unit is used to extract the original motion state data of the underwater robot's physical motion model from the control body components. The noise superposition unit is used to superimpose noise onto the extracted original motion state data of the underwater robot's physical motion model to simulate measurement errors.
[0029] By establishing a precise sensor simulation model, the measurement characteristics of a real sensor (including noise, delay, and error) are simulated to output sensing data that closely resembles actual conditions (i.e., motion state data). Specifically, the model calculation module acquires motion state data after adding noise.
[0030] As an optional implementation, in adjusting the motion state of the underwater robot's physical motion model based on the control commands, the operations performed by the control body component include: 1-1) Parse the control command to obtain motion control parameters; the motion control parameters include position parameters and attitude parameters.
[0031] 1-2) Based on the motion control parameters, invoke the virtual model posture adjustment mechanism of Unreal Engine 5 to update the world coordinates and motion state of the underwater robot's physical motion model in the high-fidelity underwater virtual environment.
[0032] As an optional implementation method, the underwater robot's geometric model is converted into an underwater robot's physical motion model, specifically including: S301: Use the skeleton mesh of Unreal Engine 5 to bind the movable joints in the geometric model of the underwater robot, and use the Control Rig system to construct the motion logic of the movable joints to obtain the initial physical motion model of the underwater robot.
[0033] S302: Set the basic physical properties of the initial underwater robot physical motion model to obtain the underwater robot physical motion model; the basic physical properties include mass, volume and friction coefficient.
[0034] As an optional implementation, the construction process of the underwater vision sensor simulation submodule includes: S401: In Unreal Engine 5, add a virtual camera component to the underwater robot's physical motion model and set the basic parameters of the virtual camera component; the basic parameters include resolution, frame rate and field of view.
[0035] S402: Using Unreal Engine 5 Blueprints, set the perception characteristic simulation logic of the virtual camera component; the perception characteristic simulation logic includes light attenuation simulation logic, color distortion simulation logic, and scattering effect simulation logic.
[0036] As an optional implementation, the light attenuation simulation logic includes: adjusting the image brightness according to the distance between the virtual camera and the target, based on a calculation rule that multiplies the distance by an attenuation coefficient.
[0037] The color distortion simulation logic includes: adjusting the signal strength of the red and green channels of the image according to the depth of the water; wherein, the deeper the water, the weaker the signal strength of the red and green channels of the image.
[0038] The scattering effect simulation logic includes adjusting the image fogging degree according to the turbidity level of the water body.
[0039] As an optional implementation, the high-fidelity underwater virtual environment includes underwater scene elements, integrated fluid dynamics effects, and simulated optical properties of water; the construction process of the high-fidelity underwater virtual environment includes: S501: Create underwater scene elements using the Unreal Engine 5 environment system; the underwater scene elements include underwater terrain, static obstacles, and dynamic obstacles.
[0040] S502: Utilizes the Unreal Engine 5 material system to configure water materials to simulate the optical properties of water; specifically including: using volumetric fog to simulate the light scattering effect; and using color attenuation curves to simulate light absorption at different water depths.
[0041] S503: Utilizes the Chaos physics engine built into Unreal Engine 5 to simulate fluid resistance and dynamic water flow. For example, based on the motion direction and velocity of an underwater robot virtual simulation model, calculates the resistance in the opposite direction of motion; sets up stable ocean currents and / or local turbulence.
[0042] By constructing a high-fidelity underwater virtual environment, the optical properties (light scattering, absorption, attenuation), fluid dynamic effects (buoyancy, resistance, turbulence), and complex scene elements (terrain, vegetation, dynamic obstacles) of real water bodies are reproduced.
[0043] In some embodiments, the design method for an underwater robot virtual simulation platform based on Unreal Engine 5 further includes: in Unreal Engine 5, using high-fidelity visual rendering technology to visualize the underwater robot virtual simulation model and the high-fidelity underwater virtual environment; the high-fidelity visual rendering technology includes Lumen global illumination technology and Nanite virtual geometry technology.
[0044] Among them, Lumen global illumination technology is used to simulate the reflection and refraction of light in an underwater virtual environment; Nanite virtual geometry technology is used to render underwater scene elements of underwater robot virtual simulation models and high-fidelity underwater virtual environments.
[0045] As an optional implementation, the control algorithm module is deployed in a Docker container.
[0046] As an optional implementation, the TCP-based communication channel is used to transmit motion state data and underwater virtual environment information of the underwater robot virtual simulation model; the ROS2-based communication channel is used to transmit preprocessed motion state data and control commands for the underwater robot virtual simulation model. Other implementations can also be used, such as swapping the transmitted data between the two.
[0047] To aid those skilled in the art in understanding, the technical concept of this application is further explained below.
[0048] See Figure 4 This application divides the simulation process into three layers: a visualization motion execution layer, a control algorithm layer, and a model calculation layer. Data synchronization is achieved through dual communication channels of ROS2 and TCP. This adopts a "layered decoupling, modular integration" design approach, with each layer functioning independently and communicating through standardized interfaces.
[0049] Visualized Motion Execution Layer: Deployed in the UE5 environment, it is responsible for the construction of the underwater virtual environment, the rendering and motion driving of the underwater robot virtual simulation model (also known as the underwater robot model), and the output of sensor data. This layer receives control commands from the control algorithm layer, drives the underwater robot model to update its pose, and feeds back the sensor simulation data to the model calculation layer.
[0050] Model calculation layer: Deployed in an external system (can be integrated into the control algorithm layer or an independent process), it performs dynamic model calculations for the underwater robot and receives sensor data (i.e. motion state data) output from the visualization motion execution layer. After filtering and solving the sensor data, it provides the control algorithm layer with real-time state information of the underwater robot model (such as velocity, acceleration, and attitude angle).
[0051] Control algorithm layer: Deployed on an external system (such as a ROS2 node), it runs the underwater robot's advanced control logic (such as path planning and attitude stabilization control), generates pose control commands and joint drive commands, and sends them to the visual motion execution layer through a communication channel.
[0052] The working process of the above architecture will be described step by step through another exemplary embodiment.
[0053] Step 1: In the visualization motion execution layer, construct the underwater virtual environment, including: underwater robot geometry and kinematic modeling, and the construction process of underwater scene and scene physics simulation.
[0054] Using the UE5 simulation environment as the core of the system, a high-fidelity underwater world (including terrain, obstacles, water effects and fluid dynamics effects) is constructed, and high-precision modeling and physical attribute assignment of the underwater robot are completed. This provides a visualization platform for the verification of control algorithms, provides motion state data for the model calculation layer, and generates simulation perception data for the sensor module.
[0055] Using UE5 as the core platform, a high-fidelity underwater virtual environment is constructed. The specific process is as follows: 1.1) Geometric and kinematic modeling of underwater robots.
[0056] High-precision geometric models of underwater robots are built using professional modeling tools (Blender or Solidworks), covering external structures (shell, thrusters, sensor mounting positions), key internal components (such as control compartment and battery compartment), and movable joints (such as thruster steering mechanisms).
[0057] Import the model into UE5, bind the movable joints of the underwater robot through the UE5 Skeletal Mesh, and use the Control Rig system to define the joint motion logic (such as the mapping relationship between thruster speed and steering angle).
[0058] In UE5, basic physical properties are assigned to the underwater robot model, such as: setting the mass (configured according to the actual underwater robot parameters, such as 50kg), volume (required for calculating buoyancy), friction coefficient (friction characteristics with water), and initially integrating underwater physical effects.
[0059] 1.2) Construction of underwater scene and physical simulation.
[0060] Underwater scene elements are created based on the UE5 environment system, including seabed topography (generating seabed landforms with variable slope and depth using UE5 terrain tools), static obstacles (rocks, corals, shipwrecks), and dynamic elements (underwater vegetation swaying with the water flow, dynamic obstacles such as floating seaweed).
[0061] Simulate the optical properties of water bodies, including: configuring water body materials using the UE5 material system, simulating the light scattering effect through "volume fog", simulating light absorption at different water depths through "color attenuation curves" (e.g., shallow water appears blue, deep water appears dark black), and simulating the optical distortion of underwater cameras through "post-processing effects" (e.g., edge blurring, fisheye effect).
[0062] Integrated fluid dynamics effects: Employs the built-in Chaos physics engine in UE5 (or combines it with third-party fluid simulation plugins) to simulate fluid resistance and dynamic water flow.
[0063] a. Fluid resistance simulation: Calculate the resistance in the opposite direction of motion based on the underwater robot's direction and speed (the resistance coefficient is configurable, such as 0.8).
[0064] b. Dynamic water flow simulation: Supports setting "stable ocean current" (e.g., 0.5 m / s along the X-axis) and "local turbulence" (e.g., water flow velocity fluctuates randomly in a certain area by ±0.3 m / s).
[0065] Simulate changes in environmental parameters, such as configuring temperature gradients (e.g., surface water temperature 25℃, temperature decreases by 1℃ for every 10m depth) to simulate the impact of different depths on the performance of underwater robots (e.g., battery efficiency, sensor accuracy).
[0066] Step 2: In the visualization motion execution layer, the underwater robot's pose is updated according to the control instructions. Based on the obtained pose information, the underwater robot's motion simulation is visualized using UE5 high-fidelity rendering technology (Lumen+Nanite) to obtain a high-fidelity underwater robot motion simulation image and traceable motion data records.
[0067] The core control mechanism of the underwater robot serves as the execution center of control commands. It receives and executes control algorithm commands through a custom Actor class in UE5, driving the underwater robot model to move precisely. At the same time, it utilizes Lumen and Nanite technologies to optimize the visual presentation and provides real-time feedback of motion data to the model calculation layer, achieving efficient linkage between the control algorithm and the virtual environment.
[0068] 2.1) Abstraction of underwater robot control volume and attitude update.
[0069] The core control mechanism of the underwater robot based on the UE5 underwater robot virtual simulation platform includes the underwater robot control volume abstraction and attitude update sub-module. This sub-module is deployed in the UE5 environment and serves as the core interaction interface between the external system (control algorithm layer, model calculation layer) and the underwater robot model in UE5. It undertakes the functions of receiving control commands, updating the underwater robot's attitude in real time, and providing motion state feedback, providing key support for the system to build a real-time closed-loop control of "command-execution-feedback".
[0070] 2.1.1 Abstraction of the underwater robot control body: In the UE5 environment, a custom control body component (e.g., defined as "AUV_Controller_Actor") is built, which serves as a unified interface for external systems to control the underwater robot model; the control body component has two types of core data and one type of interaction function built in.
[0071] Real-time pose parameters: These include the three-dimensional spatial position parameters (X / Y / Z axis coordinates) and attitude parameters (roll angle, pitch angle, yaw angle) of the underwater robot model in the virtual underwater scene, which are used to accurately describe the spatial state of the model.
[0072] Real-time motion state parameters: These include the model's instantaneous velocity and instantaneous acceleration data, used to reflect the model's dynamic motion characteristics.
[0073] Control command receiving function: It has the ability to receive various control commands sent by external systems through communication channels, forming an interactive link between external commands and the underwater robot control body.
[0074] 2.1.2 Control Command Reception and Attitude Update Logic: External systems (such as ROS2 nodes in the control algorithm layer) send structured control commands to the underwater robot control body components through a preset communication channel (ROS2 communication channel or TCP dedicated control link). For example, the pose control command format is "SetPose: X=specific value, Y=specific value, Z=specific value; Roll=specific value, Pitch=specific value, Yaw=specific value".
[0075] After receiving the control command, the control component automatically parses the position and attitude parameters in the command, calls UE5's virtual model attitude adjustment mechanism, and updates the world coordinates and attitude angle of the underwater robot model in the UE5 scene in real time to ensure that the underwater robot's motion state is consistent with the requirements of the control command.
[0076] 2.1.3 Real-time Motion State Feedback and Closed-Loop Control Formation: While the underwater robot model's posture is updated, the control body component uses UE5's motion data acquisition capabilities to extract the underwater robot model's current velocity, acceleration, and other dynamic motion state data in real time. The extracted motion state data is fed back to the model calculation layer in a preset format. After data filtering and calculation, the model calculation layer generates the underwater robot model's real-time state information and sends it back to the control algorithm layer. This ultimately forms a real-time closed-loop control process of "control algorithm layer issues commands → underwater robot control body executes → motion state feedback to model calculation layer → model calculation layer sends state back to control algorithm layer".
[0077] 2.2) High-fidelity visual rendering.
[0078] Using UE5's Lumen global illumination technology, the reflection (such as the reflection of skylight on the water surface and the reflection of water light spots on the underwater robot shell) and refraction (such as the deflection of light as it passes through the water-air interface) of light in the underwater environment are simulated to enhance the realism of the scene.
[0079] By leveraging UE5's Nanite virtual geometry technology, the rendering efficiency of underwater robot models and underwater scene elements is optimized. For high-precision details of underwater robot models (such as sensor probes and screw textures), Nanite can dynamically adjust the number of polygons based on the rendering distance, ensuring image quality while maintaining a stable UE5 frame rate of 30-60fps.
[0080] Visualization assistance features: The UE5 scene integrates "Underwater robot model motion trajectory line" (records the historical position of the underwater robot model and draws line segments through UE5 blueprints) and "Real-time control parameter display panel" (displays the current control command, underwater robot model attitude angle, and sensor data), making it easier for developers to intuitively evaluate the control effect.
[0081] Step 3: Based on the real-time pose and motion parameters of the underwater robot model obtained in Step 2 (including three-dimensional position, roll / pitch / yaw attitude angles, X / Y / Z axis velocities and accelerations), virtual sensor modeling and simulation are carried out in two major modules: underwater vision sensor and inertial measurement unit (IMU) through the method of "UE5 component construction + parametric characteristic simulation + multi-type noise superposition". Finally, noisy simulation data that closely resembles the actual measurement characteristics is obtained.
[0082] The sensor modeling and simulation module provides the system with virtual sensing capabilities. By simulating the imaging and data acquisition behavior of underwater visual sensors and IMUs, it outputs noisy simulation data (including realistic underwater visual sensing simulation data and inertial sensing simulation data with errors).
[0083] like Figure 5 As shown, the green part of the glass cover in front of the underwater robot model is the camera, and the purple part is the IMU.
[0084] This module relies on the UE5 environment to generate perception data, provides sensor data input for the model calculation layer, and provides key perception basis for the decision-making of the control algorithm layer.
[0085] The sensor modeling and simulation module of the underwater robot virtual simulation platform based on Unreal Engine 5 includes: an underwater vision sensor simulation submodule and an inertial measurement unit (IMU) simulation submodule; wherein, both the underwater vision sensor simulation submodule and the inertial measurement unit (IMU) simulation submodule rely on the UE5 environment to generate perception data, and both are respectively connected to the model calculation layer and the control algorithm layer.
[0086] The sensor modeling and simulation module as a whole is used to simulate the imaging and data acquisition behavior of commonly used sensors in underwater robots, outputting high-fidelity simulated perception data with noise, providing sensor data input for the model calculation layer, and providing key perception basis for the decision-making of the control algorithm layer.
[0087] 3.1) Underwater vision sensor simulation submodule, including camera parameter configuration unit and underwater imaging characteristic simulation unit; used to build underwater camera simulation model based on UE5's "virtual camera component", simulate the imaging characteristics of the camera in real underwater environment, and output underwater vision perception data that is close to reality.
[0088] 3.1.1 Camera parameter configuration unit, used to set parameters for virtual camera components in the UE5 environment, such as configuration parameters: resolution 1920×1080, frame rate 30fps, field of view 90°, to build a basic simulation model that matches the parameters of a real underwater camera.
[0089] 3.1.2 Underwater Imaging Characteristics Simulation Unit, used to simulate the physical characteristics of real underwater imaging through UE5 material post-processing technology, specifically includes: a. Light Attenuation Simulation: Based on the actual distance between the virtual camera and the target object, the image brightness is reduced according to the calculation rule of "distance × attenuation coefficient (e.g., 0.1 / m)" to reproduce the characteristic of underwater light attenuation with propagation distance.
[0090] b. Color distortion simulation: As the water depth in the virtual underwater scene increases, the red and green channel signals of the image are gradually weakened, while only the blue channel signal is retained, matching the selective absorption characteristics of the spectrum in the real underwater environment.
[0091] c. Scattering effect simulation: The effect of water turbidity on imaging is simulated through UE5's "volume fog intensity adjustment" function. The turbidity level can be adjusted in the range of 0-10 through an external configuration file (corresponding to clear water to turbid water scenarios). The higher the turbidity, the stronger the scattering effect and the more significant the image fogging.
[0092] 3.2) Inertial Measurement Unit (IMU) Simulation Submodule, including basic data extraction unit, noise model superposition unit, and noise parameter configuration unit; used to extract basic motion data from the underwater robot control body components of UE5, superimpose parameterized noise model, simulate the measurement error characteristics of real IMU, and output inertial sensing data with error.
[0093] 3.2.1 Basic data extraction unit is used to read the underwater robot motion state data stored in the custom Actor class (AUV_Controller_Actor) in UE5 in real time, including the underwater robot's attitude angles (roll angle, pitch angle, yaw angle), linear acceleration in the X / Y / Z axis direction, and angular velocity in the X / Y / Z axis direction. The above data is used as the "ideal output data" of the IMU.
[0094] 3.2.2 Noise Model Stacking Unit: This unit is used to superimpose multiple types of noise onto the "ideal output data" to simulate the measurement error of a real IMU. Specific noise types include: a. Gaussian white noise: The mean is set to 0, and the standard deviation is configurable (e.g., angular velocity noise standard deviation 0.1° / s, acceleration noise standard deviation 0.01m / s). 2 This simulates random disturbances in IMU measurements.
[0095] b. Random walk noise: Based on the Brownian motion model, the noise accumulation increases linearly with time. The configuration parameters include the angular velocity random walk coefficient (e.g., 0.01° / √h) to reproduce the drift characteristics in long-term IMU measurements.
[0096] c. Fixed Deviation Noise: Set a configurable constant error value (e.g., acceleration deviation of 0.02 m / s²). 2 This is to simulate the inherent errors of the IMU hardware itself.
[0097] 3.2.3 Noise parameter configuration unit, used to store and adjust the above-mentioned noise parameters through JSON format configuration file, supports adaptation to IMUs of different accuracy levels (such as industrial grade, navigation grade) according to requirements, and realizes flexible adaptation of noise model.
[0098] Step 4: Based on the noisy simulation data obtained in Step 3, the sensor data is sent to the independently deployed model calculation layer via a dual-path communication method, primarily using ROS2 communication and secondarily using a dedicated TCP control link. This model calculation layer processes the data using a filtering algorithm and an underwater robot dynamics solution algorithm to obtain high-precision real-time status information of the underwater robot (including denoised position, attitude angle, velocity, and acceleration). Then (e.g., via a dedicated TCP control link), the optimized control commands are sent to the underwater robot control body components in the visualization motion execution layer for position adjustment.
[0099] The real-time communication architecture is the data hub of the system, employing a dual-path mechanism of "ROS2+TCP" to handle data exchange between all modules. It ensures that control commands are delivered to the UE5 terminal to drive the underwater robot model's movement, and transmits the obtained sensor data back to the model computation layer in real time. Finally, it feeds back the processed state information to the control algorithm layer, serving as the integrated link connecting and coordinating the work of each module.
[0100] The entire process is as follows: Noisy data enters the model calculation layer via dual-channel communication. Model calculation layer processing: The core is to use algorithms to eliminate noise, correct deviations by combining underwater robot physical parameters, and finally output high-precision real-time underwater robot status (position, attitude angle, velocity, acceleration) that can be directly used for control. Noise removal typically uses Kalman filtering or second-order low-pass filtering. Control algorithm layer computation: This process translates the high-precision status into actual control commands.
[0101] For (to be verified) control algorithms, such as the commonly used PID control algorithm, the attitude of the underwater robot can be controlled to ensure that it reaches the preset value.
[0102] That is: Noisy sensor data → ROS2 / TCP transmitted to the model calculation layer → (filtering + dynamics calculation) → high-precision underwater robot status → ROS2 transmitted to the control algorithm layer → control commands → ROS2 / TCP transmitted to UE5 → underwater robot adjustment → new data feedback.
[0103] The following is a further explanation of the model's computational layer: The input to the model calculation layer is the noisy, uncorrected "raw" motion state data (e.g., data containing sensor errors or environmental interference) output by the visualization motion execution layer. First, based on its previous motion state (data), combined with environmental factors such as water resistance and external disturbances, as well as physical parameters like the robot's mass and volume, the model calculation layer calculates the predicted motion state for the current moment according to the underwater robot's dynamics model. Then, based on the predicted motion state, the received "raw" motion state data for the current moment is corrected and fused, ultimately outputting high-precision (real-time) motion state data that can be directly used for control algorithm decisions. Although the input and output data of the model calculation layer are of the same data type, the former is "raw" data containing errors, while the latter is accurate data after prediction, correction, and denoising, ensuring that control commands conform to the robot's actual motion patterns. The aforementioned correction and fusion process itself already includes filtering.
[0104] This embodiment has the following beneficial effects: 1) High-fidelity simulation, close to real-world scenarios: Based on UE5's Lumen, Nanite, and Chaos technologies, it reproduces the optical characteristics (light scattering, attenuation), hydrodynamic effects (buoyancy, drag, turbulence), and complex scene elements in real underwater environments, significantly improving the credibility of control algorithm verification.
[0105] 2) Modular architecture with high iteration efficiency: The three layers of "visualization-control-model" are decoupled, and each module can be optimized independently (e.g., modifying the control algorithm does not require recompiling the UE5 scene, and updating the dynamic model does not require adjusting the visualization rendering), shortening the development cycle by more than 30%.
[0106] 3) Accurate sensor simulation and complete verification: Parametric noise models are established for sensors such as cameras and IMUs. The output data is consistent with the error characteristics of real sensors, which can completely verify the "perception-control" algorithm chain of underwater robots and avoid the risk of algorithm deployment due to sensor simulation distortion.
[0107] 4) Dual-channel communication, balancing real-time performance and versatility: The ROS2 channel meets the general data interaction needs of multiple modules, while the dedicated TCP link ensures low-latency execution of control commands.
[0108] 5) Cross-platform deployment and strong compatibility: Supports Windows development and Ubuntu operation. The control algorithm can be packaged into a Docker container, seamlessly integrated with the ROS2 ecosystem, and can be adapted to different hardware configurations and underwater robot models (only the underwater robot model and dynamic parameters need to be modified), with a wide range of applications.
[0109] 6) Low cost and low risk: The initial verification and optimization of the control algorithm can be completed without actual sea trials. The cost of a single simulation is only 1 / 100 of that of a sea trial, and there is no risk of damage to the underwater robot, which significantly reduces the R&D cost of underwater robots.
[0110] The following is a specific implementation example.
[0111] I. Development Environment Setup.
[0112] This step aims to build a cross-platform (development and deployment) technical support environment to provide basic operating conditions for subsequent underwater robot modeling, scene construction, and algorithm deployment. Specifically, it includes the configuration of a Windows 11 development machine and an Ubuntu 20.04 deployment machine.
[0113] 1.1) Configure and install UE5.3 on the Windows 11 development machine, and check "C++ Development Tools", "ROS2 for UE5 Plugin" and "Chaos Physics Engine Plugin"; among them, the C++ Development Tools are used for custom functional module development, the ROS2 Plugin realizes data interaction between UE5 and external systems, and the Chaos engine supports underwater physics effect simulation.
[0114] Install SolidWorks software for high-precision geometric modeling of underwater robots.
[0115] Install Visual Studio 2022 and configure the UE5 C++ compilation environment to ensure that custom component code in UE5 can be compiled normally.
[0116] Install Python 3.9 and configure the Windows version of ROS2. Also install dependency packages such as "rclpy", "sensor_msgs", and "geometry_msgs" to generate sensor noise parameter files and assist in development.
[0117] 1.2) Configure and install UE5.3 on the Ubuntu 20.04 deployment machine. The graphics card needs to meet the rendering requirements of UE5 and ensure stable simulation frame rate.
[0118] Install the ROS2 Humble version and configure environment variables to ensure that ROS2 commands are globally effective, providing support for the deployment of ROS2 nodes that control algorithms.
[0119] Install Docker Engine, pull the Ubuntu 20.04 base image, integrate ROS2 Humble and Python 3.9 into the image, and build an independent running container for the control algorithm to avoid conflicts with the deployment machine system environment.
[0120] II. Underwater robot model and underwater scene construction.
[0121] This step is a core implementation of the visual motion execution layer (UE5 environment). It reproduces the geometric and physical characteristics of the real underwater environment through high-precision modeling of underwater robots and configuration of the physical characteristics of underwater scenes.
[0122] 2.1) Underwater Robot Modeling and Import. A model of a specific underwater robot (e.g., 124 caliber) was built using SolidWorks, encompassing the hull, thrusters, sensor mounting positions, and other structural elements, and exported as a "datasmith" file. UE5 was launched, and the model was imported via the Datasmith plugin. The thruster joints were bound using the "Skeleton Mesh Editor," and the "rotation speed → thrust" mapping was defined using Control Rig. Physical properties such as mass, volume, and friction coefficient were configured for the underwater robot model in UE5 to ensure its motion conforms to realistic mechanical laws.
[0123] 2.2) Underwater Scene Construction. The underwater terrain was created using UE5's terrain tools: a maximum depth of 20m was set, two 30° slopes were constructed, and ten rock obstacles with diameters of 0.5-1m were added to simulate a complex underwater environment. Water materials were configured: the UE5 "Volume Water" template was used, and the "Scattering Intensity" was adjusted to 0.8 to simulate light scattering. The "Absorption Curve" was set to "Blue Preservation, Red and Green Attenuation" to match the real underwater spectral characteristics. The Chaos physics engine was enabled, a stable ocean current of 0.3m / s along the X-axis was set, and localized turbulence with velocity fluctuations of ±0.2m / s was added at coordinates (10,5,-10) to reproduce a realistic underwater flow field.
[0124] III. Sensor Simulation Module Configuration.
[0125] This step simulates the real sensing characteristics of underwater cameras and inertial measurement units (IMUs) to output high-fidelity sensing data with errors, supporting the verification of the "sensing-control" link.
[0126] 3.1) Underwater Camera Configuration. Add a "Virtual Camera" component to the underwater robot model in UE5, setting the basic parameters to 1920×1080 resolution, 30fps frame rate, and 90° field of view. Add perception characteristic simulation logic to the UE5 blueprint, such as: implementing "light attenuation" (image brightness decreases by 10% for every 1m increase in distance between the camera and the target) and "color distortion" (red channel intensity decreases by 50% for depths exceeding 5m, and the red channel is turned off for depths exceeding 10m); configure the turbidity parameter to "Level 3" (medium turbidity), and adjust the "volume fog intensity" through the blueprint to simulate the impact of water turbidity on imaging.
[0127] 3.2) IMU Configuration. Add an "IMU Data Extraction" blueprint to the underwater robot controller component (AUV_Controller_Actor) in UE5 to acquire the underwater robot's attitude angles (roll / pitch / yaw), linear acceleration, and angular velocity in real time as "ideal output data." Write a Python script to generate a noise parameter file (e.g., noise_config.json), setting error parameters such as Gaussian white noise, random walk, and fixed bias. Read this noise parameter file in UE5, superimpose the noise onto the ideal data, and output the IMU data with errors in the "sensor_msgs / Imu" format.
[0128] IV. Implementation of dual-path communication mechanism.
[0129] This step establishes a dual-path mechanism of "ROS2 standard communication + TCP dedicated control link" to achieve efficient data interaction between modules, balancing versatility and low latency.
[0130] 4.1) ROS2 Communication Configuration. Enable the "ROS2 for UE5" plugin in UE5 and create a ROS2 node "auv_simulation_node" as the data interaction entry point. Configure the data publisher: Set up topics for the camera, IMU, and Ultra-Short Baseline Positioning System (USBL), specifying the message type and publishing frequency to enable the transmission of sensor data to external systems. Configure the command subscriber: Set up topics for underwater robot pose control and joint control, specifying the message type and subscription frequency to enable the reception of external control commands.
[0131] 4.2) TCP Communication Configuration. Develop a TCP server module in UE5, set the listening port, and write connection management logic (including port listening, client connection reception, and automatic reconnection). Define the TCP command protocol format (such as pose control commands), write command parsing logic, and implement command parameter extraction and direct driving of the underwater robot's posture.
[0132] Write a TCP client script in a Docker container on an Ubuntu deployment machine, set the command sending frequency and connection method, and achieve low-latency transmission of high-priority control commands.
[0133] V. Deployment and simulation of control algorithms.
[0134] This step completes the deployment of the control algorithm and system integration testing, verifying the platform's support capability for the control algorithm.
[0135] 5.1) Control Algorithm Development: Develop control algorithms based on ROS2 Humble in Docker containers.
[0136] For example: 1) Develop a PID attitude controller, based on the attitude angle fed back by the IMU, to generate pose control commands to ensure that the underwater robot model maintains a horizontal attitude. 2) Develop a path tracking algorithm, preset the motion path, obtain the position of the underwater robot model through USBL and calculate the deviation, and generate pose control commands to drive the underwater robot model to move along the preset path.
[0137] 5.2) Simulation Run: Start UE5 on the Ubuntu deployment machine, load the underwater robot model scene, and UE5 automatically starts the ROS2 node and TCP server; start the Docker container, execute the control algorithm script, and at the same time start the TCP client script to establish a connection with UE5, completing the closed-loop simulation run of the entire system.
[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for designing an underwater robot virtual simulation platform based on Unreal Engine 5, characterized in that, The application relates to a method for constructing a virtual simulation model of an underwater robot and a high-fidelity underwater virtual environment in Unreal Engine 5. The virtual simulation model of the underwater robot is used to adjust the motion state of the virtual simulation model in the high-fidelity underwater virtual environment according to received control instructions. In a first external system, a model calculation module is deployed; the model calculation module is used to obtain motion state data of the virtual simulation model of the underwater robot, and pre-process the motion state data according to an underwater robot dynamics model. In a second external system, a control algorithm module is deployed; the control algorithm module is used to obtain pre-processed motion state data and underwater virtual environment information, and generate control instructions of the virtual simulation model of the underwater robot according to the pre-processed motion state data and / or the underwater virtual environment information; the control algorithm in the control algorithm module is a verified algorithm; the underwater virtual environment information comprises underwater virtual environment images. A two-way communication mechanism connecting Unreal Engine 5, the model calculation module and the control algorithm module is constructed; the two-way communication mechanism comprises a ROS2-based communication channel and a TCP-based communication channel. The virtual simulation model of the underwater robot comprises an underwater robot physical motion model and a corresponding control body component and a sensor simulation module.
2. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 1, characterized in that, The construction process of the virtual simulation model of the underwater robot comprises: A underwater robot geometric model is created, and the underwater robot geometric model is imported into Unreal Engine 5. In Unreal Engine 5, the underwater robot geometric model is converted into the underwater robot physical motion model. In Unreal Engine 5, a control body component of the underwater robot physical motion model is constructed; the control body component is used to collect original motion state data of the underwater robot physical motion model, receive control instructions and adjust the motion state of the underwater robot physical motion model based on the control instructions. In Unreal Engine 5, a sensor simulation module of the underwater robot physical motion model is constructed; the sensor simulation module comprises an underwater visual sensor simulation submodule and an inertial measurement unit simulation submodule; the underwater visual sensor simulation submodule is used to collect underwater virtual environment images; the inertial measurement unit simulation submodule comprises a basic data extraction unit and a noise superposition unit; the basic data extraction unit is used to extract original motion state data of the underwater robot physical motion model from the control body component; and the noise superposition unit is used to superimpose noise on the extracted original motion state data of the underwater robot physical motion model to simulate measurement errors. In the aspect of adjusting the motion state of the underwater robot physical motion model based on the control instructions, the control body component performs operations comprising:
3. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 2, characterized in that, The control instructions are analyzed to obtain motion control parameters; the motion control parameters comprise position parameters and attitude parameters; According to the motion control parameters, a virtual model attitude adjustment mechanism of Unreal Engine 5 is called to update the world coordinates and motion state of the underwater robot physical motion model in the high-fidelity underwater virtual environment. Converting the underwater robot geometric model into the underwater robot physical motion model specifically comprises:
4. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 2, characterized in that, The movable joints in the underwater robot geometry model are bound by using a skeletal mesh of Unreal Engine 5, and the motion logic of the movable joints is constructed by using a ControlRig system to obtain an initial underwater robot physical motion model; The underwater robot physical motion model is obtained by setting basic physical properties of the initial underwater robot physical motion model; the basic physical properties include mass, volume and friction coefficient.
5. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 2, characterized in that, The construction process of the underwater visual sensor simulation submodule includes: In Unreal Engine 5, a virtual camera component is added to the underwater robot physical motion model, and basic parameters of the virtual camera component are set; the basic parameters include resolution, frame rate and field of view angle; The perception characteristic simulation logic of the virtual camera component is set by using a blueprint of Unreal Engine 5; the perception characteristic simulation logic includes light attenuation simulation logic, color distortion simulation logic and scattering effect simulation logic.
6. The Unreal Engine 5-based underwater robot virtual simulation platform design method according to claim 5, characterized in that, The light attenuation simulation logic includes: according to the distance between the virtual camera and the target, adjusting the image brightness according to the calculation rule of distance multiplied by the attenuation coefficient; The color distortion simulation logic includes: adjusting the red and green channel signal intensity of the image according to the depth of the water; wherein the deeper the water, the weaker the red and green channel signal intensity of the image; The scattering effect simulation logic includes: adjusting the image fogging degree according to the turbidity level of the water body.
7. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 1, characterized in that, The high-fidelity underwater virtual environment is an underwater virtual environment including underwater scene elements, integrated fluid dynamics effects and simulated water optical properties; The construction process of the high-fidelity underwater virtual environment includes: Underwater scene elements are created by using an environment system of Unreal Engine 5; the underwater scene elements include underwater terrain, static obstacles and dynamic obstacles; Water body materials are configured by using a material system of Unreal Engine 5 to simulate water optical properties; specifically including: simulating the scattering effect of light by using a volume fog function; simulating light absorption at different water depths by using a color attenuation curve function; Fluid resistance and dynamic water flow are simulated by using a Chaos physical engine built-in Unreal Engine 5.
8. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 1, characterized in that, Further comprising: In Unreal Engine 5, the underwater robot virtual simulation model and the high-fidelity underwater virtual environment are visualized by using high-fidelity visual rendering technology; the high-fidelity visual rendering technology includes Lumen global lighting technology and Nanite virtual geometry technology.
9. The virtual simulation platform design method for the underwater robot based on Unreal Engine 5 according to claim 1, characterized in that, The control algorithm module is deployed in a Docker container.
10. The Unreal Engine 5-based underwater robot virtual simulation platform design method according to claim 1, characterized in that, The TCP-based communication channel is used to transmit motion state data of the underwater robot virtual simulation model and underwater virtual environment information; The ROS2-based communication channel is used to transmit preprocessed motion state data and control instructions of the underwater robot virtual simulation model.