Depth camera assembly simulation system and method for robot joint simulation

By encapsulating the depth camera sensor in Unreal Engine and using Fastdds communication middleware to jointly simulate with the ROS2 platform, the challenges of existing depth camera simulation systems in real-time and data accuracy are solved, and efficient depth image acquisition and transmission are achieved, meeting the needs of high-precision and low-latency simulation.

CN119653253APending Publication Date: 2025-03-18江淮前沿技术协同创新中心
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411762785.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Existing depth camera simulation systems have challenges in real-time and data accuracy, and are difficult to meet the needs of high-precision and low-latency simulation, especially in robot simulation.

Method used

The depth camera sensor is packaged in the Unreal Engine engine and jointly simulated with the ROS2 platform through the Fastdds communication middleware to achieve efficient acquisition and transmission of depth images. The system includes an interaction layer, a communication layer, a data layer, and a texture capture layer, supporting parameter configuration and image Gaussian noise processing.

Benefits of technology

It improves the efficiency of depth image acquisition and network transmission efficiency, meets the needs of high-precision and low-latency simulation, and enhances the operability of depth cameras in self-developed simulation systems and the compatibility of ROS2 algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653253A_ABST
    Figure CN119653253A_ABST
Patent Text Reader

Abstract

The invention discloses a depth camera assembly simulation system and method for robot joint simulation, a depth camera sensor is packaged into a sensor assembly in a UE engine to be used in an ROS2 platform, and the sensor assembly comprises an interaction layer, a communication layer, a data layer and a texture capture layer; the texture capture layer obtains and stores a scene depth map; a depth data acquisition module in the data layer acquires a depth value of each pixel in the scene depth map and converts the depth value into a general image format in opencv, and the converted image is packaged through a data format packaging module; a Fastdds communication module is integrated in the communication layer so as to acquire and publish the packaged image; a picture transmission parameter configuration module and a camera parameter configuration module are arranged in the interaction layer to configure camera parameters and picture transmission parameters, and a configuration file is stored; according to the depth camera assembly simulation system and method, the depth image acquisition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sensor simulation technology, and in particular to a depth camera component simulation system and method for robot joint simulation. Background Art

[0002] Sensor simulation refers to the use of computer technology to simulate the behavior and performance of actual sensors in a specific environment. Through sensor simulation, the perception ability and data output of different types of sensors to the external environment can be simulated as accurately as possible. The accuracy and reliability of the simulated data are important indicators of sensor simulation.

[0003] In the field of robot simulation, sensor simulation plays a vital role. Sensor simulation allows engineers to test the robot's perception and other systems in a virtual environment to verify its reliability and effectiveness in a variety of complex scenarios. Through sensor simulation, researchers can evaluate the impact of different sensor configurations on the robot's performance of specific tasks, thereby optimizing the robot's design and function. Sensor simulation technology provides a key tool for robot simulation, which can effectively promote the development and application of robot technology and provide support for related research and development work in various aspects.

[0004] Depth camera simulation is a commonly used technology in sensor simulation. It can be used to test the performance of depth cameras, verify the effectiveness of depth image processing algorithms, and support the development of virtual reality and augmented reality applications. Currently, excellent simulation systems such as AirSim and Carla provide powerful depth camera simulation functions, but with the development of diversified robot functions, the demand for self-developed simulation systems is increasing. In these self-developed simulation systems, depth camera simulation has become an important component.

[0005] At present, a common simulation method is to build a simulation environment with the help of a three-dimensional game engine and deploy a depth camera model. Chinese invention patent CN201910576884.8 discloses a parameter-configurable depth camera simulation method: in the Unity three-dimensional engine, infrared rays are emitted in the scene, and the angle between the infrared rays and the surface normal of the object is calculated to simulate the depth camera. The advantage is that while using high-precision maps, the depth camera sensor can be flexibly integrated into various self-developed simulation systems based on Unity. However, the disadvantage of this solution is that a large number of infrared rays need to be emitted to obtain a high-precision depth map, which seriously affects the operation of the simulation system and the transmission efficiency of the depth map, and the depth data obtained by this method is not accurate. If the simulation system algorithm has high requirements for image real-time and accuracy, this method is difficult to meet the simulation requirements.

[0006] In the current self-developed simulation platform, the simulation technology of depth cameras faces some challenges, especially in terms of real-time and data accuracy. Due to the efficiency limitations of depth camera simulation, the transmission of image data often cannot meet the real-time requirements, which is a significant problem in scenarios that require fast response environmental monitoring and decision-making, such as obstacle detection, posture estimation, and dynamic scene analysis. This delay may cause the algorithm to be unable to analyze and solve based on the image data in a timely manner, thus affecting the performance of the entire system.

[0007] The inaccurate depth value in the depth camera simulation process may cause the simulation task to fail in application scenarios with high precision requirements, such as robotic arm grasping tasks. Accurate depth information is crucial for the positioning and operation of the robotic arm, and inaccurate depth data will directly affect the motion planning and execution of the robotic arm.

[0008] When depth map data is used in the ROS2 platform, data format incompatibility issues may occur. The default image format of the simulation platform is inconsistent with the image encoding format used in various ROS2 algorithms and the ROS custom image format, which requires cumbersome format conversion before data processing. This conversion not only increases the processing steps, but may also introduce data processing delays, further affecting real-time performance. Summary of the invention

[0009] Based on the technical problems existing in the background technology, the present invention proposes a depth camera component simulation system and method for robot joint simulation, which encapsulates the depth camera in the UE engine, and the communication is based on the Fastdds communication middleware, which is used to perform robot simulation in conjunction with the ROS2 platform, thereby improving the efficiency of depth image acquisition.

[0010] The present invention proposes a depth camera component simulation system for robot joint simulation, wherein the depth camera sensor is encapsulated as a sensor component in the UE engine for use in the ROS2 platform, and the sensor component includes an interaction layer, a communication layer, a data layer, and a texture capture layer;

[0011] The texture capture layer obtains the scene depth map and stores it;

[0012] The depth data acquisition module in the data layer obtains the depth value of each pixel in the scene depth map and converts it into a common image format in OpenCV. The converted image is encapsulated by the data format encapsulation module.

[0013] The Fastdds communication module is integrated in the communication layer to obtain the encapsulated images and publish them;

[0014] The interactive layer is provided with a picture transmission parameter configuration module and a camera parameter configuration module to configure the camera parameters and picture transmission parameters and save the configuration files.

[0015] Furthermore, an image Gaussian noise processing module is also provided in the data layer for adding noise to the converted image.

[0016] Furthermore, in the Fastdds communication module, the buffer of the listening socket is set to be larger than the size of the depth map data, and the sending mode is set to reliable transmission.

[0017] Furthermore, a depth camera internal and external parameter calculation output module is also provided in the interaction layer, which is used to calculate the internal and external parameters of the camera according to the camera configuration and the placement of the camera components.

[0018] A method for simulating a depth camera component for robot joint simulation comprises the following steps:

[0019] S1. Encapsulate the depth camera sensor as a sensor component in the UE engine for use in the ROS2 platform, and fill in or load the configuration on the UMG interface;

[0020] S2. Setting the FOV parameter of the image capture component according to the field of view;

[0021] S3, select a texture rendering component according to the image encoding, and set the texture rendering component properties according to the pixels;

[0022] S4, capture the scene depth map through the image capture component and convert it into an image format that can be used by OpenCV;

[0023] S5, determining whether to add noise, if yes, adding noise to the converted image through the image Gaussian noise processing module, and proceeding to step S6, if no, directly proceeding to step S6;

[0024] S6. Encapsulate depth map data according to image parameters;

[0025] S7. Use the Fastdds communication module to publish the encapsulated depth map data;

[0026] S8. Determine whether the simulation is stopped. If not, perform thread sleep according to the sending frequency. After the timing time is up, enter step S4 again. If it is stopped, end the simulation.

[0027] Furthermore, in step S3, specifically:

[0028] Determine whether the picture encoding is 8UC1;

[0029] If yes, the texture rendering component selects the format as RTFRGBA8;

[0030] If not, continue to determine whether the picture encoding is 16UC1;

[0031] If yes, the texture rendering component selects the format as RTFRGBA16f;

[0032] If not, the rendering component selects the format as RTFRGBA32f.

[0033] Sets the properties of the selected texture's render component on a per-pixel basis.

[0034] Furthermore, step S6 is specifically as follows:

[0035] Create a UE format structure: set a 64-bit integer to store the timestamp, set a string to store the frame identifier of the image, set a 32-bit integer to represent the height of the image, set a 32-bit integer to represent the width of the image, set a string to represent the encoding format of the image data, set an 8-bit unsigned integer to identify whether the image data is big endian or little endian, set a 32-bit integer to represent the number of bytes of each row of pixel data in the image, and set a dynamic array to store the raw pixel data of the scene depth map;

[0036] The scene depth map in the dynamic array is encapsulated using the data format encapsulation module.

[0037] Furthermore, the scene depth map in the dynamic array is encapsulated using a data format encapsulation module, and the encapsulation process is as follows:

[0038] Get any pixel of the scene depth map and convert each pixel value in the utPic array to meters;

[0039] Declare two 8-bit unsigned integers to store the high byte and low byte of the depth value;

[0040] Check whether the scene depth map data is in big endian order. If so, the high byte is the high 8 bits of the depth value and the low byte is the low 8 bits of the depth value. If not, the high byte is the low 8 bits of the depth value and the low byte is the high 8 bits of the depth value.

[0041] Calculate the high byte and low byte of the depth value and store them in the mageData.data array, so as to assign the scene depth map data directly to the sensor_msgs / Image format protocol defined in the Fastdds communication module;

[0042] The above operation is repeated until all pixels of the scene depth map are completed.

[0043] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned depth camera component simulation method when executing the computer program.

[0044] A computer-readable storage medium stores a plurality of classification programs, wherein the plurality of classification programs are used to be called by a processor and execute the depth camera component simulation method as described above.

[0045] The advantages of the depth camera component simulation system and method for robot joint simulation provided by the present invention are: simulating a depth camera in the Unreal Engine engine (UE engine), and adding a configuration function for the depth camera parameters, thereby solving the problem of depth image acquisition efficiency. By encapsulating the image capture control that comes with the UE engine, the functions of configurable parameters and output of internal and external parameters of the camera are realized. The upper limit of ordinary TCP / UDP data transmission is 65535 bytes, while the size of scene depth map data usually far exceeds this upper limit, resulting in the need to send and merge data in batches, reducing transmission efficiency. This embodiment uses Fastdds communication middleware for depth map data transmission, so that there is no transmission upper limit at the user application layer, which improves network transmission efficiency and further improves depth image acquisition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a schematic diagram of the simulation framework of the present invention;

[0047] Figure 2 This is a diagram of the UE-side UMG interface parameter setting interface;

[0048] Figure 3 It is a simulation flow chart of the present invention;

[0049] Figure 4 Schematic diagram of the process of adding noise to the depth map;

[0050] Figure 5 This is the depth image instance image received and displayed by the ROS end. DETAILED DESCRIPTION

[0051] Below, the technical solution of the present invention is described in detail through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific implementation disclosed below.

[0052] like Figures 1 to 5As shown, the present invention proposes a depth camera component simulation system for robot joint simulation, and the depth camera sensor is encapsulated as a sensor component in the UE engine to be used in the ROS2 platform.

[0053] This embodiment simulates a depth camera in the Unreal Engine engine (UE engine), and adds a configuration function for the depth camera parameters, solving the problem of depth image acquisition efficiency. By encapsulating the image capture control that comes with the UE engine, the functions of configurable parameters and output of internal and external parameters of the camera are realized. The upper limit of ordinary TCP / UDP data transmission is 65535 bytes, and the size of scene depth map data usually far exceeds this upper limit, resulting in the need to send and merge data in batches, reducing transmission efficiency. This embodiment uses Fastdds communication middleware for depth map data transmission, so that there is no transmission upper limit at the user application layer, which improves network transmission efficiency and further improves depth image acquisition efficiency.

[0054] In this embodiment, the sensor components encapsulated in the UE engine include an interaction layer, a communication layer, a data layer, and a texture capture layer;

[0055] (a1) The texture capture layer uses the UE engine's SceneCapture2D image capture component to obtain scene depth map data and stores it in the TextureRenderTarget texture rendering component.

[0056] (a2) Data layer: The depth data acquisition module is responsible for obtaining the depth value of each pixel of the scene depth map from the texture rendering component and converting it into a common image format in OpenCV. At the same time, the image Gaussian noise processing module can also be called to add noise to the image according to the parameters. Finally, the depth information is encapsulated into the sensor_msgs / Image format in ROS through the data format encapsulation module.

[0057] (a3) The Fastdds communication module is integrated into the UE engine in the communication layer, the buffer of the listening socket is set to be larger than the size of the depth map data, and the sending mode is set to reliable transmission. The encapsulated scene depth map is obtained from the data layer and published.

[0058] (a4) Interaction layer: In the UMG interface, you can configure the camera parameters and image transmission parameters, and save the configuration file. After that, you can use "Load configuration file" to directly load the previously saved configuration. If you need to obtain the internal and external parameters of the camera, you can click "Get internal and external parameters" in the interface to calculate the internal and external parameters of the camera through the camera configuration and the placement of the camera components. The UMG interface diagram is as follows Figure 2 shown.

[0059] In most simulation platforms on the market, users can configure resolution, field of view, image noise parameters and transmission frequency to meet different needs. However, image encoding and transmission end sequence are usually not configurable. Since different algorithms have different requirements for the accuracy and range of depth maps, there are many ways to encode images. In addition, most depth camera simulations are difficult to meet the compatibility requirements of various ROS2-end image algorithms, and the API must be modified or the image data must be processed. Therefore, this embodiment provides the function of configuring image encoding and transmission end sequence to increase its flexibility and compatibility.

[0060] The flowchart of capturing, packaging and sending depth data in the simulation scene is as follows Figure 3 As shown, a method for simulating a depth camera component for robot joint simulation includes the following steps:

[0061] S1. Encapsulate the depth camera sensor as a sensor component in the UE engine for use in the ROS2 platform, and fill in or load the configuration on the UMG interface;

[0062] S2. Setting the FOV parameter of the image capture component according to the field of view;

[0063] S3, select a texture rendering component according to the image encoding, and set the texture rendering component properties according to the pixels;

[0064] Specifically: determine whether the image encoding is 8UC1; if so, the texture rendering component selects the format as RTFRGBA8; if not, continue to determine whether the image encoding is 16UC1; if so, the texture rendering component selects the format as RTFRGBA16f; if not, the texture rendering component selects the format as RTFRGBA32f. Set the properties of the selected texture rendering component according to the pixel

[0065] S4, capture the scene depth map through the image capture component and convert it into an image format that can be used by OpenCV;

[0066] S5, determining whether to add noise, if yes, adding noise to the converted image through the image Gaussian noise processing module, and proceeding to step S6, if no, directly proceeding to step S6;

[0067] S6. Encapsulate depth map data according to image parameters;

[0068] S7. Use the Fastdds communication module to publish the encapsulated depth map data;

[0069] S8. Determine whether the simulation is stopped. If not, perform thread sleep according to the sending frequency. After the timing time is up, enter step S4 again. If it is stopped, end the simulation.

[0070] As an embodiment

[0071] by Figure 2 Take the properties set in as an example, set the field of view property of the image capture component to 90.0, select the texture rendering component with the target format (Render Target Format) property as RTF RGBA16f, and set the width (SizeX) and height (SizeY) values ​​to 640 and 480 respectively.

[0072] This embodiment uses Gaussian noise by default. The implementation method is as follows: use the plug-in provided by opencv in the UE engine to convert the data stream into the cv::Mat format. The 16UC1 format image in this example needs to be converted to the 32FU1 format first, and then the noise parameter mean and variance are input into the randn (noise, mean, standard deviation) function. The image data and the noise data are added, and the obtained image is converted back to the 16UC1 format, as shown in the figure. Figure 4 shown.

[0073] This embodiment encapsulates depth map data according to picture parameters, specifically (b1) to (b2):

[0074] (b1) Create a UE format structure: set a 64-bit integer to store the timestamp, set a string to store the frame identifier of the image, set a 32-bit integer to represent the height of the image, set a 32-bit integer to represent the width of the image, set a string to represent the encoding format of the image data, such as "16UC1", "8UC1", etc. (this is the image data encoding format of OpenCV), set an 8-bit unsigned integer to identify whether the image data is big endian or little endian. Big endian and little endian are two different ways for computers to store multi-byte data. Set a 32-bit integer to represent the number of bytes of pixel data in each row of the image, including possible padding bytes. Set a dynamic array to store the raw pixel data of the scene depth map.

[0075] The created UE format structure is as follows:

[0076] struct FImageFormat

[0077] {

[0078] int64 stamp;

[0079] FString frame_id;

[0080] int32 height;

[0081] int32 width;

[0082] FString encoding;

[0083] uint8 is_bigendian;

[0084] int32 step;

[0085] TArray <uint8>data;

[0086] };

[0087] stamp is the current time stamp, frame_id is a string identifier to distinguish the camera, height and width are the height and width of the image resolution, encoding is the image encoding, is_bigendian is the big endian / little endian identifier, step is the image step length, in this example, step = image.width*sizeof(uint16). data is the scene depth map, which needs to be encapsulated using the data format encapsulation module.

[0088] (b2) This embodiment is a package that can support multiple image formats. The pseudo code of the package is illustrated by whether the image encoding is in 16UC1 format: obtain any pixel of the scene depth map, divide each pixel value in the utPic array (assuming that it is a depth value in centimeters) by 100 to convert it into meters; declare two 8-bit unsigned integers for storing the high byte and low byte of the depth value; check whether the scene depth map data is in big endian order. If so, the high byte is the high 8 bits of the depth value and the low byte is the low 8 bits of the depth value. If not, the high byte is the low 8 bits of the depth value and the low byte is the high 8 bits of the depth value; calculate the high byte and low byte of the depth value and store them in the mageData.data array, so as to directly assign the scene depth map data to the sensor_msgs / Image format protocol defined in the Fastdds communication module, and repeat the above operation until all pixels of the scene depth map are completed.

[0089] The pseudo code encapsulated in 16UC1 format is as follows:

[0090] for(int num=0;num <height*width,num++)

[0091] {

[0092] uint16 depth = outPic[num] / 100; / / convert centimeters to meters

[0093] uint8 highByte, lowByte;

[0094] if(is_bigendian)

[0095] {

[0096] highByte=(depth>>8)&0xFF;

[0097] lowByte=depth&0xFF;

[0098] }

[0099] else

[0100] {

[0101] lowByte=(depth>>8)&0xFF;

[0102] highByte=depth&0xFF;

[0103] }

[0104] imageData.data[2*num]=lowByte;

[0105] imageData.data[2*num+1]=highByte;

[0106] }

[0107] The depth camera of this embodiment can output the following internal and external parameters:

[0108] External parameters: rotation matrix (R), translation vector (T);

[0109] Internal parameters: focal length (fx, fy), optical center coordinates (cx, cy);

[0110] The method to obtain the external parameters of the depth camera is: directly obtain the six-axis relative position of the image capture component under the parent component (the default unit of UE is centimeters, and the relative position needs to be converted into meters), assign the position information to the translation vector, and assign the rotation angle to the rotation matrix.

[0111] The method to obtain the depth camera internal parameters is as follows: In the virtual simulation camera, the camera internal parameters cx and cy are at the center point by default, that is, cx = width / 2, cy = height / 2. The depth camera's fx and fy cannot be directly obtained through calibration, but can be reversed through the derivation formula of the field of view FOV:

[0112] Width field of view FOVX = 2*atan(cx,fx);

[0113] Altitude field of view FOVY = 2*atan(cy,fy);

[0114] The transformation can be obtained as follows:

[0115] fx = cx / tan(FOVX / 2);

[0116] fy = cy / tan (FOVY / 2);

[0117] Since cx and cy are the midpoints of the image by default in the component simulation of the UE engine, let width and height be the width and height of the resolution respectively, and finally derive the formulas for fx and fy as follows:

[0118] fx = width / (2*tan(FOVX / 2));

[0119] fy=height / (2*tan(FOVY / 2));

[0120] In the simulated camera, FOVX = FOVY = FOV, so the final calculation formula is:

[0121] fx = width / (2*tan(FOV / 2));

[0122] fy=height / (2*tan(FOV / 2)).

[0123] This embodiment uses a combination of the UE's built-in image capture component and Fastdds, which greatly improves the efficiency of image acquisition and transmission while ensuring the accuracy of depth data. An operable UMG interface is added to set the parameters of the camera and picture, which improves the operability of the depth camera in the self-developed simulation system. End sequence parameters and picture encoding parameters that cannot be directly modified in most depth camera simulation technologies are added, and the depth image data is packaged in the format commonly used by ROS2 in combination with Fastdds, which improves the compatibility of the depth camera simulation with the ROS2 algorithm. In summary, the advantage of this new use is that in the joint simulation scenario of the self-developed simulation system and the ROS2 algorithm, users can add various models of depth cameras to adapt to the diverse depth image algorithms on the ROS2 side by simply modifying parameters and directly dragging camera components, and ensure the accuracy of the depth map data and the efficiency of transmission.

[0124] This embodiment aims to solve the problem that the depth camera simulation technology in the prior art is difficult to use in high-precision, low-latency simulation systems, and cannot guarantee the accuracy of image data and the transmission efficiency. The technical characteristics of this embodiment are: based on the image capture component, according to the commonly used data format of the ROS2 deep image algorithm and the parameter requirements for cameras and pictures, the image and camera parameter adjustment, camera internal and external parameter acquisition and camera configuration storage and loading functions are added, and secondary packaging is performed to solve the high-precision requirements of the self-developed simulation system. Using Fastdds as the communication middleware further guarantees the efficiency of image data transmission and compatibility with ROS2.

[0125] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A depth camera component simulation system for robot joint simulation, characterized in that: The depth camera sensor is encapsulated as a sensor component in the UE engine for use in the ROS2 platform. The sensor component includes an interaction layer, a communication layer, a data layer, and a texture capture layer; The texture capture layer obtains the scene depth map and stores it; The depth data acquisition module in the data layer obtains the depth value of each pixel in the scene depth map and converts it into a common image format in OpenCV. The converted image is encapsulated by the data format encapsulation module. The Fastdds communication module is integrated in the communication layer to obtain the encapsulated images and publish them; The interactive layer is provided with a picture transmission parameter configuration module and a camera parameter configuration module to configure the camera parameters and picture transmission parameters and save the configuration files.

2. The depth camera component simulation system for robot joint simulation according to claim 1, characterized in that: An image Gaussian noise processing module is also provided in the data layer to add noise to the converted image.

3. The depth camera component simulation system for robot joint simulation according to claim 1, characterized in that: In the Fastdds communication module, set the buffer of the listening socket to be larger than the size of the depth map data, and set the sending mode to reliable transmission.

4. The depth camera component simulation system for robot joint simulation according to claim 1, characterized in that: The interaction layer is also provided with a depth camera internal and external parameter calculation output module, which is used to calculate the internal and external parameters of the camera according to the camera configuration and the placement of the camera components.

5. A method for simulating a depth camera component for robot joint simulation, characterized in that: The steps include: S1. Encapsulate the depth camera sensor as a sensor component in the UE engine for use in the ROS2 platform, and fill in or load the configuration on the UMG interface; S2. Setting the FOV parameter of the image capture component according to the field of view; S3, select a texture rendering component according to the image encoding, and set the texture rendering component properties according to the pixels; S4, capture the scene depth map through the image capture component and convert it into an image format that can be used by OpenCV; S5, determining whether to add noise, if yes, adding noise to the converted image through the image Gaussian noise processing module, and proceeding to step S6, if no, directly proceeding to step S6; S6. Encapsulate depth map data according to image parameters; S7. Use the Fastdds communication module to publish the encapsulated depth map data; S8. Determine whether the simulation is stopped. If not, perform thread sleep according to the sending frequency. After the timing time is up, enter step S4 again. If it is stopped, end the simulation.

6. The method for simulating a depth camera component for robot joint simulation according to claim 5, characterized in that: In step S3, specifically: Determine whether the picture encoding is 8UC1; If yes, the texture rendering component selects the format as RTFRGBA8; If not, continue to determine whether the picture encoding is 16UC1; If yes, the texture rendering component selects the format as RTFRGBA16f; If not, the rendering component selects the format as RTFRGBA32f. Sets the properties of the selected texture's render component on a per-pixel basis.

7. The method for simulating a depth camera component for robot joint simulation according to claim 5, characterized in that: Step S6 is specifically as follows: Create a UE format structure: set a 64-bit integer to store the timestamp, set a string to store the frame identifier of the image, set a 32-bit integer to represent the height of the image, set a 32-bit integer to represent the width of the image, set a string to represent the encoding format of the image data, set an 8-bit unsigned integer to identify whether the image data is big endian or little endian, set a 32-bit integer to represent the number of bytes of each row of pixel data in the image, and set a dynamic array to store the raw pixel data of the scene depth map; The scene depth map in the dynamic array is encapsulated using the data format encapsulation module.

8. The method for simulating a depth camera component for robot joint simulation according to claim 7, characterized in that: The scene depth map in the dynamic array is encapsulated using a data format encapsulation module, and the encapsulation process is as follows: Get any pixel of the scene depth map and convert each pixel value in the utPic array to meters; Declare two 8-bit unsigned integers to store the high byte and low byte of the depth value; Check whether the scene depth map data is in big endian order. If so, the high byte is the high 8 bits of the depth value and the low byte is the low 8 bits of the depth value. If not, the high byte is the low 8 bits of the depth value and the low byte is the high 8 bits of the depth value. Calculate the high byte and low byte of the depth value and store them in the mageData.data array, so as to assign the scene depth map data directly to the sensor_msgs / Image format protocol defined in the Fastdds communication module; The above operation is repeated until all pixels of the scene depth map are completed.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the depth camera component simulation method according to any one of claims 5 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of classification programs, and the plurality of classification programs are used to be called by a processor and execute the depth camera component simulation method as described in any one of claims 5-8.

Citation Information

Patent Citations

  • A parameter-configurable depth camera simulation method

    CN110276791B