A method and system for clamping objects in a three-dimensional scene

By setting the touch detection area in a three-dimensional scene and using the game engine's event system to monitor collision events, the problem of unstable clamping of programming robots is solved, and more stable and accurate object clamping operations are achieved, improving user experience.

CN118952229BActive Publication Date: 2024-12-13GUANGZHOU JOINMAX DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411441355.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2024-12-13
Estimated Expiration
2044-10-16

AI Technical Summary

Technical Problem

During the construction of a programming robot, when the physical engine is directly called to achieve virtual clamping of objects, the clamping hand opening and closing is unstable, which can easily lead to the object being squeezed or slipped, and the static friction force is unstable, resulting in unstable clamping.

Method used

By setting a touch detection area in a three-dimensional scene, the game engine's event system is used to monitor collision events. If the setting requirements are met, the associated robot components will move in concert with the object to ensure the stability and accuracy of clamping.

Benefits of technology

It improves the accuracy and reliability of clamping operations, avoids clamping failures caused by misjudgment or misjudgment, ensures real-time and efficient collision detection, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118952229B_ABST
    Figure CN118952229B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to the technical field of programming robots, and discloses a method for clamping an object in a three-dimensional scene, including: obtaining the clamping state information of the corresponding object to be clamped in the virtual three-dimensional scene, and a touch detection area is set at the object to be clamped; monitoring the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine; if the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component. The method for clamping an object in a three-dimensional scene in the embodiment of the present invention can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation and avoids clamping failures caused by misjudgment or missed judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of programmable robots, and in particular to a method and system for clamping an object in a three-dimensional scene. Background Art

[0002] At present, in the process of programming robots, if the physical engine is directly called to realize the virtual clamping of objects, a mechanical gripper structure is built on the robosim robot, and then a motor is built to realize the opening and closing of the mechanical gripper. In this way, when a block is clamped, the opening and closing of the gripper will not stop just right, but will cause the block to be squeezed out; or it will slip during the clamping process due to the problem of unstable static friction. Therefore, designing a solution that can achieve more stable clamping of objects has become a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention

[0003] In response to the above-mentioned defects, an embodiment of the present invention discloses a method for clamping an object in a three-dimensional scene, which can achieve accurate detection of clamping, avoid unstable clamping, and improve user experience.

[0004] A first aspect of an embodiment of the present invention discloses a method for clamping an object in a three-dimensional scene, comprising:

[0005] Acquiring clamping state information of a corresponding object to be clamped in a virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area;

[0006] The collision events between the robot parts and the touch detection area of ​​the object to be gripped are monitored through the game engine's event system;

[0007] If the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination;

[0008] If the collision event does not meet the set requirements, the collision event between the robot component and the touch detection area of ​​the object to be clamped continues to be monitored through the event system of the game engine.

[0009] As an optional implementation, in the first aspect of the embodiment of the present invention, the object to be clamped is an object model constructed based on 3D modeling software, and the object model is imported into the game engine, the object to be clamped includes a first clamping surface and a second clamping surface, and the first clamping surface and the second clamping surface are arranged opposite to each other, a first touch detection area with a first trigger is arranged at the first clamping surface, and a second touch detection area with a second trigger is arranged at the second clamping surface;

[0010] The collision event includes a first collision event and a second collision event, wherein the first collision event is an event detected by a first touch detection area having a first trigger, and the second collision event is an event detected by a second touch detection area having a second trigger; the first trigger and the second trigger are both configured as triggers that do not produce physical effects.

[0011] As an optional implementation manner, in the first aspect of the embodiment of the present invention, if the collision event meets the set requirements, it includes:

[0012] If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements, or,

[0013] If the coordinates at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

[0014] As an optional implementation, in the first aspect of the embodiment of the present invention, monitoring the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine includes:

[0015] Monitoring a first collision event between a first robot component and a touch detection area of ​​an object to be clamped through an event system of a game engine; wherein the first robot component is a manipulator component of the first robot;

[0016] Monitoring a second collision event between a second robot component and a touch detection area of ​​the object to be clamped through an event system of the game engine; wherein the second robot component is a manipulator component of the second robot;

[0017] If the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination, including:

[0018] If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements;

[0019] Acquire the first robot component that last triggers the first touch detection area through the first collision event, and acquire the second robot component that last triggers the second touch detection area through the second collision event;

[0020] Setting one of the first robot component and the second robot component as a master component, and setting the other of the first robot component and the second robot component as a slave component;

[0021] The parent object of the object to be clamped is set as the main component, and the slave component is positionally associated with the main component so that the object to be clamped, the main component and the slave component can achieve coordinated movement.

[0022] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the position association of the slave component with the master component includes:

[0023] Shared path data is created for the slave component and the master component, and it is determined according to a path following script that both the slave component and the master component reference the shared path data.

[0024] As an optional implementation manner, in the first aspect of the embodiment of the present invention, both the first touch detection area and the second touch detection area are provided with a label layer, and the label layer includes a label data set;

[0025] If the collision event meets the set requirements, it includes:

[0026] Matching the label information of the robot parts obtained in the first collision event and the second collision event with the label data set at the corresponding touch detection area, and if the match is consistent, executing the next step;

[0027] If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

[0028] As an optional implementation manner, in the first aspect of the embodiments of the present invention, the method for clamping an object in a three-dimensional scene further includes:

[0029] Parameter information of a touch detection area set by a user is received, and parameters of the touch detection area are updated based on the parameter information, wherein the parameter information includes one or more of detection position information, detection area size, and detection area shape.

[0030] A second aspect of an embodiment of the present invention discloses a system for clamping an object in a three-dimensional scene, comprising:

[0031] An acquisition module is used to acquire the clamping state information of the corresponding object to be clamped in the virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area;

[0032] Monitoring module: used to monitor the collision events between the robot parts and the touch detection area of ​​the object to be clamped through the event system of the game engine;

[0033] The first judgment module is used for obtaining the robot component that last triggered the collision through the collision event if the collision event meets the set requirements, and associating the object to be clamped with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination;

[0034] The second judgment module is used for continuing to monitor the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine if the collision event does not meet the set requirements.

[0035] A third aspect of an embodiment of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the method for clamping objects in a three-dimensional scene disclosed in the first aspect of the embodiment of the present invention.

[0036] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for clamping an object in a three-dimensional scene disclosed in the first aspect of an embodiment of the present invention.

[0037] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0038] The method for clamping an object in a three-dimensional scene in an embodiment of the present invention can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation and avoids clamping failures caused by misjudgment or missed judgment; and uses the powerful event system of the game engine to monitor collision events, ensuring the real-time and high efficiency of collision detection. Game engines usually have optimized collision detection algorithms that can quickly and accurately identify collision events in complex three-dimensional scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 is a flow chart of a method for clamping an object in a three-dimensional scene disclosed in an embodiment of the present invention;

[0041] Figure 2 is a schematic diagram of the process of the coordinated movement disclosed in the embodiment of the present invention;

[0042] Figure 3 is a schematic diagram of a flow chart of collision event judgment disclosed in an embodiment of the present invention;

[0043] Figure 4 is a schematic structural diagram of a system for clamping an object in a three-dimensional scene provided by an embodiment of the present invention;

[0044] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0046] It should be noted that the terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present invention and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] At present, in the process of building a programming robot, if the physical engine is directly called to realize the virtual clamping of the object, a mechanical gripper structure is built on the robosim robot, and then a motor is built to realize the opening and closing of the mechanical gripper. In this way, when a block is clamped, the opening and closing of the gripper will not stop just right, but will cause the block to be squeezed out; or it will slip during the clamping process due to the problem of unstable static friction. Based on this, the embodiment of the present invention discloses a method, system, electronic device and storage medium for clamping objects in a three-dimensional scene, which can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation, avoids the clamping failure caused by misjudgment or missed judgment; and uses the powerful event system of the game engine to monitor collision events, ensuring the real-time and high efficiency of collision detection. The game engine usually has an optimized collision detection algorithm that can quickly and accurately identify collision events in complex three-dimensional scenes. Embodiment 1

[0048] See also Figure 1 , Figure 1 It is a flowchart of a method for clamping an object in a three-dimensional scene disclosed in an embodiment of the present invention. Among them, the execution subject of the method described in the embodiment of the present invention is an execution subject composed of software and / or hardware, and the execution subject can receive relevant information by wired or / and wireless means, and can send certain instructions. Of course, it can also have certain processing functions and storage functions. The execution subject can control multiple devices, such as a remote physical server or cloud server and related software, or it can be a local host or server and related software that performs related operations on a device placed somewhere. In some scenarios, multiple storage devices can also be controlled, and the storage devices can be placed in the same place or different places as the devices. For example Figure 1 As shown, the method for clamping an object in a three-dimensional scene includes the following steps:

[0049] S101: Obtaining clamping state information of a corresponding object to be clamped in a virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area;

[0050] S102: monitoring collision events between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine;

[0051] S103: If the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination;

[0052] S104: If the collision event does not meet the set requirements, continue to monitor the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine.

[0053] The solution of the embodiment of the present invention can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation and avoids clamping failure caused by misjudgment or missed judgment.

[0054] The method of the embodiment of the present invention includes a judgment logic of whether the collision event meets the set requirements. If the collision event meets the set requirements (such as the collision force, angle, speed, etc. are within a certain range), the clamping operation is performed; if not, the collision event continues to be monitored. This design makes the clamping operation more flexible and can adapt to different clamping scenarios and needs. When the collision event meets the set requirements, the object to be clamped is connected to the corresponding robot component through component association to achieve coordinated movement of the two. This coordinated movement mechanism ensures the stability and reliability of the clamping process and avoids the falling off or damage of the object during the clamping process. Through the real-time rendering and feedback mechanism of the game engine, the user can intuitively see the occurrence of the collision event and the result of the clamping operation. This instant feedback mechanism improves the user's operating experience and satisfaction.

[0055] More preferably, the object to be clamped is an object model constructed based on 3D modeling software, and the object model is imported into the game engine, the object to be clamped includes a first clamping surface and a second clamping surface, and the first clamping surface and the second clamping surface are arranged opposite to each other, a first touch detection area with a first trigger is arranged at the first clamping surface, and a second touch detection area with a second trigger is arranged at the second clamping surface;

[0056] The collision event includes a first collision event and a second collision event, wherein the first collision event is an event detected by a first touch detection area having a first trigger, and the second collision event is an event detected by a second touch detection area having a second trigger; the first trigger and the second trigger are both configured as triggers that do not produce physical effects.

[0057] The solution of the embodiment of the present invention realizes the possibility of clamping detection from two relative directions by setting a first clamping surface and a second clamping surface for the object to be clamped, and respectively configuring a touch detection area and a trigger. This design makes the clamping operation more delicate and flexible, and can adapt to objects of different shapes and sizes. The first trigger and the second trigger are configured as triggers that do not produce physical effects, which means that they do not change the physical state of the object (such as position, speed, etc.) when triggered, and are only used to detect collision events. This design avoids additional physical interference caused by the action of the trigger, and ensures the stability and accuracy of the clamping process. The clamping surfaces here are generally arranged relatively to each other. For a square object, they are two opposite surfaces, and for a triangular object, they are two adjacent surfaces.

[0058] Due to the coexistence of the first touch detection area and the second touch detection area, the detection sensitivity of the robot component approaching the object to be clamped is improved. When the robot component approaches from any direction, it can be quickly captured by the corresponding touch detection area, thereby accelerating the clamping response speed. Through the double-sided clamping design and the configuration of non-physical effect triggers, the misjudgment and missed judgment that may be caused by a single detection surface or physical effect trigger are reduced. This design improves the accuracy and reliability of the clamping operation. Users can clearly see the interaction process between the robot component and the object to be clamped through the real-time rendering and feedback mechanism of the game engine. When the clamping operation is successful, the user can intuitively see that the object is firmly clamped; when the clamping operation fails, the user can also get feedback in time and adjust the operation strategy.

[0059] More preferably, if the collision event meets the set requirements, it includes:

[0060] If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements, or,

[0061] If the coordinates at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

[0062] In the embodiment of the present invention, the time at which the first collision event and the second collision event occur is required to match, which means that the robot component contacts the clamping surface of the object to be clamped from two opposite directions almost at the same time. This temporal synchronization ensures the accuracy of the clamping operation and avoids unstable clamping or clamping failure caused by time difference. The coordinates at which the first collision event and the second collision event occur are required to match, that is, the two collision events occur at corresponding positions on the object model. This spatial correspondence further improves the accuracy of clamping and ensures that the robot component can accurately clamp the expected position of the object to be clamped.

[0063] During the specific implementation, double verification can be performed. Only when both conditions are met at the same time, it is determined that the collision event meets the set requirements, and the clamping operation is performed. This double verification mechanism enhances the reliability of the clamping operation and reduces the risk of clamping failure caused by a single condition judgment error.

[0064] The specific implementation process of the present invention is as follows: 1. The touch detection area is fixed on the left and right sides of the block; it is attached to the surface of the block; and only collision events caused by robot components are detected. 2. Two scripts are set in the touch detection area, namely InCollisionEvent and OutCollisionEvent. InCollisionEvent will screen all objects entering the touch detection area. If it is a robot component that enters, it will output a feedback. OutCollisionEvent will output a feedback after all robot components leave the touch detection area and reset InCollisionEvent. 3. According to the method of setting the robot component as the parent object of the block, the block will accurately follow the movement of the robot component, and there will be no problem of slipping due to insufficient friction. When the touch detection areas on both sides are not satisfied at the same time, it means that the clamp is released, the parent object of the block is set to empty, and the block will fall off naturally.

[0065] More preferably, the monitoring of the collision event between the robot component and the touch detection area of ​​the object to be clamped by the event system of the game engine includes:

[0066] Monitoring a first collision event between a first robot component and a touch detection area of ​​an object to be clamped through an event system of a game engine; wherein the first robot component is a manipulator component of the first robot;

[0067] Monitoring a second collision event between a second robot component and a touch detection area of ​​the object to be clamped through an event system of the game engine; wherein the second robot component is a manipulator component of the second robot;

[0068] like Figure 2 As shown, if the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination, including:

[0069] S1031: If the time at which the first collision event and the second collision event occur match, determining that the corresponding collision event meets the set requirements;

[0070] S1032: acquiring the first robot component that last triggers the first touch detection area through the first collision event, and acquiring the second robot component that last triggers the second touch detection area through the second collision event;

[0071] S1033: setting one of the first robot component and the second robot component as a master component, and setting the other of the first robot component and the second robot component as a slave component;

[0072] S1034: Setting the parent object of the object to be clamped as the main component, and associating the position of the slave component with the main component so that the object to be clamped, the main component, and the slave component can achieve coordinated movement.

[0073] The richness of programming learning is improved by providing a dual-robot clamping method, and a more complex interactive method is provided. The solution of the embodiment of the present invention realizes the function of dual-robot collaborative clamping by simultaneously monitoring the collision events between the two robot components (the first robot component and the second robot component) and the touch detection area of ​​the object to be clamped through the event system of the game engine. This mechanism ensures the synchronization and efficiency of the clamping operation and improves the stability and accuracy of the clamping. The time when the first collision event and the second collision event occur must match. This condition ensures that the dual robots contact the object to be clamped at almost the same time point, thereby avoiding unstable or failed clamping due to time difference. This time synchronization is crucial to achieving accurate and reliable clamping.

[0074] After the collision event meets the set requirements, the solution of the embodiment of the present invention obtains the robot component that last triggered the collision through the collision event, and associates the object to be clamped with the corresponding robot component. This association mechanism enables the object to be clamped to be tightly connected with one or more robot components to achieve coordinated motion. One of the two robot components is set as the master component, and the other is set as the slave component. The master component is responsible for leading the process of clamping and coordinated motion, while the slave component follows the master component to move. This master-slave setting simplifies the control logic of coordinated motion and improves the stability and response speed of the system. The slave component is positionally associated with the master component to ensure that the object to be clamped maintains the correct position and posture during the coordinated motion. This position association mechanism is the key to achieving precise clamping and coordinated motion.

[0075] In Unity, it is indeed possible to bind the trajectory of one robot's manipulator to that of another robot's manipulator to achieve coordinated movement between them. This binding usually involves some form of path tracking or position synchronization mechanism. Here are some ways to achieve this binding: First, use the path following system to create a path: First, define one or more paths (you can use BezierCurve, Spline, or a simple linear interpolation point array, etc.) that describe the trajectory that the manipulator should follow. Path following script: Write a path following script for each manipulator, which is responsible for calculating the current position of the manipulator based on the points on the path and moving it to that position smoothly. Synchronize the path: Make sure that the path following scripts of both manipulators reference the same path data so that they move along the same trajectory. Second, use position synchronization to share position data: Create a shared data structure or variable to store the current position that should be synchronized to. Position update: When the position of one manipulator changes (perhaps through user input or path following), update this shared position data in real time. Position synchronization: The other manipulator periodically reads this shared position data and sets its own position to the position indicated by the data. You can use Vector3.Lerp, Vector3.MoveTowards, or more complex interpolation algorithms to smoothly move the robot. Third, write custom synchronization logic and write other custom synchronization logic.

[0076] More preferably, the position association of the slave component with the master component comprises:

[0077] Shared path data is created for the slave component and the master component, and it is determined according to a path following script that both the slave component and the master component reference the shared path data.

[0078] By creating shared path data for the slave and master components, it is ensured that both follow the same path trajectory during collaborative motion. This sharing mechanism eliminates motion inconsistencies caused by path differences and improves the accuracy of collaborative motion. The use of path following scripts further ensures that the slave components can closely follow the motion trajectory of the master component. By referencing the same shared path data, the slave components can adjust their positions and postures in real time to maintain synchronization and coordination with the master component. During collaborative motion, if each component calculates the path independently or relies on different data sources, it may lead to the accumulation and amplification of errors. The design of shared path data reduces the possibility of such error accumulation and improves the stability and reliability of the system. By sharing path data and path following scripts, the control logic between the slave and master components is simplified. The system only needs to focus on the generation and update of the path without dealing with complex collaborative control issues, thereby reducing the complexity and error rate of the system.

[0079] More preferably, both the first touch detection area and the second touch detection area are provided with a label layer, and the label layer includes a label data set;

[0080] like Figure 3 As shown, if the collision event meets the set requirements, it includes:

[0081] S103a: matching the label information of the robot components obtained in the first collision event and the second collision event with the label data set at the corresponding touch detection area, and if the match is consistent, executing the next step;

[0082] S103b: If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

[0083] The tag information here can be the robot arm information. If the robot head touches the corresponding area and is determined not to meet the set requirements, the system can automatically identify and filter out collision events that do not meet the conditions through the tag matching mechanism, thereby reducing clamping failures or system abnormalities caused by misoperation. This automated processing method improves the smoothness and satisfaction of the user experience.

[0084] The solution of the embodiment of the present invention can ensure that only collision events that meet specific conditions (i.e., consistent labels) are considered valid by matching the label information obtained by the robot component in the collision event with the label data set at the corresponding touch detection area. This mechanism greatly improves the accuracy of collision event identification and reduces the possibility of misjudgment. In addition to time matching, a verification step for label matching is also added. This double verification mechanism further enhances the system's ability to judge whether the collision event meets the set requirements, allowing the system to more accurately identify valid collision events.

[0085] More preferably, the method for clamping an object in a three-dimensional scene further comprises:

[0086] Parameter information of a touch detection area set by a user is received, and parameters of the touch detection area are updated based on the parameter information, wherein the parameter information includes one or more of detection position information, detection area size, and detection area shape.

[0087] Users can set the parameter information of the touch detection area according to their needs and scene characteristics, including the detection position, detection area size, and detection area shape. This customization capability enhances the interactivity between users and the system, allowing users to control the clamping operation process more flexibly. By receiving the parameter information set by the user and updating the touch detection area, the system can adapt to different clamping scenarios and needs. Whether it is a static environment or a dynamic environment, users can adjust the parameters of the touch detection area according to actual conditions to ensure the accuracy and reliability of the clamping operation. During the clamping process, if the scene changes (such as the position of the object to be clamped moves, the shape changes, etc.), users can quickly adapt to these changes by updating the parameters of the touch detection area. This dynamic adjustment capability improves the flexibility and response speed of the system.

[0088] The method for clamping an object in a three-dimensional scene in an embodiment of the present invention can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation and avoids clamping failures caused by misjudgment or missed judgment; and uses the powerful event system of the game engine to monitor collision events, ensuring the real-time and high efficiency of collision detection. Game engines usually have optimized collision detection algorithms that can quickly and accurately identify collision events in complex three-dimensional scenes. Embodiment 2

[0089] See also Figure 4 , Figure 4 Schematic diagram of the structure of the system for clamping objects in a three-dimensional scene disclosed in an embodiment of the present invention. Figure 4 As shown, the system for clamping an object in the three-dimensional scene may include:

[0090] The acquisition module 21 is used to acquire the clamping state information of the corresponding object to be clamped in the virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area;

[0091] Monitoring module 22: used for monitoring collision events between robot components and the touch detection area of ​​the object to be clamped through the event system of the game engine;

[0092] The first judgment module 23 is used for obtaining the robot component that last triggered the collision through the collision event if the collision event meets the set requirements, and associating the object to be clamped with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination;

[0093] The second judgment module 24 is used for continuing to monitor the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine if the collision event does not meet the set requirements.

[0094] The method for clamping an object in a three-dimensional scene in an embodiment of the present invention can accurately detect whether a collision event occurs in the area by setting a touch detection area on the object to be clamped. This design improves the accuracy and reliability of the clamping operation and avoids clamping failures caused by misjudgment or missed judgment; and uses the powerful event system of the game engine to monitor collision events, ensuring the real-time and high efficiency of collision detection. Game engines usually have optimized collision detection algorithms that can quickly and accurately identify collision events in complex three-dimensional scenes. Embodiment 3

[0095] See also Figure 5 , Figure 5 Schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may be a computer, a server, etc. Of course, in certain circumstances, it may also be a smart device such as a mobile phone, a tablet computer, a monitoring terminal, and an image acquisition device with processing functions. Figure 5 As shown, the electronic device may include:

[0096] A memory 510 storing executable program codes;

[0097] a processor 520 coupled to the memory 510;

[0098] The processor 520 calls the executable program code stored in the memory 510 to execute part or all of the steps in the method for clamping an object in a three-dimensional scene in the first embodiment.

[0099] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute part or all of the steps in the method for clamping an object in a three-dimensional scene in the first embodiment.

[0100] The embodiment of the present invention further discloses a computer program product, wherein when the computer program product is run on a computer, the computer is enabled to execute part or all of the steps in the method for clamping an object in a three-dimensional scene in the first embodiment.

[0101] An embodiment of the present invention further discloses an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps in the method for clamping an object in a three-dimensional scene in embodiment one.

[0102] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a memory and includes several requests to enable a computer device (which can be a personal computer, server or network device, etc., specifically a processor in a computer device) to perform some or all steps of the method described in each embodiment of the present invention.

[0106] In the embodiments provided by the present invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0107] A person of ordinary skill in the art may understand that part or all of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0108] The above is a detailed introduction to the method, system, electronic device and storage medium for clamping objects in a three-dimensional scene disclosed in the embodiments of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for clamping an object in a three-dimensional scene, characterized in that: include: Acquiring clamping state information of a corresponding object to be clamped in a virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area; The game engine's event system monitors collision events between robot components and the touch detection area of ​​the object to be gripped; If the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination; If the collision event does not meet the set requirements, the collision event between the robot component and the touch detection area of ​​the object to be clamped continues to be monitored through the event system of the game engine.

2. The method for clamping an object in a three-dimensional scene as claimed in claim 1, characterized in that: The object to be clamped is an object model constructed based on 3D modeling software, and the object model is imported into the game engine, the object to be clamped includes a first clamping surface and a second clamping surface, and the first clamping surface and the second clamping surface are arranged opposite to each other, a first touch detection area with a first trigger is arranged at the first clamping surface, and a second touch detection area with a second trigger is arranged at the second clamping surface; The collision event includes a first collision event and a second collision event, wherein the first collision event is an event detected by a first touch detection area having a first trigger, and the second collision event is an event detected by a second touch detection area having a second trigger; The first trigger and the second trigger are both configured as triggers that do not produce physical effects.

3. The method for clamping an object in a three-dimensional scene as claimed in claim 2, characterized in that: If the collision event meets the set requirements, it includes: If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements, or, If the coordinates at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

4. The method for clamping an object in a three-dimensional scene as claimed in claim 2, characterized in that: The event system of the game engine monitors the collision event between the robot component and the touch detection area of ​​the object to be clamped, including: Monitoring a first collision event between a first robot component and a touch detection area of ​​an object to be clamped through an event system of a game engine; wherein the first robot component is a manipulator component of the first robot; Monitoring a second collision event between a second robot component and a touch detection area of ​​the object to be clamped through an event system of the game engine; wherein the second robot component is a manipulator component of the second robot; If the collision event meets the set requirements, the robot component that last triggered the collision is obtained through the collision event, and the object to be clamped is associated with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination, including: If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements; Acquire the first robot component that last triggers the first touch detection area through the first collision event, and acquire the second robot component that last triggers the second touch detection area through the second collision event; Setting one of the first robot component and the second robot component as a master component, and setting the other of the first robot component and the second robot component as a slave component; The determined main component is set as the parent object of the object to be clamped, and the slave component is positionally associated with the main component so that the object to be clamped, the main component and the slave component can achieve coordinated movement.

5. The method for clamping an object in a three-dimensional scene as claimed in claim 4, characterized in that: The step of associating the slave component with the master component comprises: Shared path data is created for the slave component and the master component, and it is determined according to a path following script that both the slave component and the master component reference the shared path data.

6. The method for clamping an object in a three-dimensional scene as claimed in claim 2, characterized in that: The first touch detection area and the second touch detection area are both provided with a label layer, and the label layer includes a label data set; If the collision event meets the set requirements, it includes: Matching the label information of the robot parts obtained in the first collision event and the second collision event with the label data set at the corresponding touch detection area, and if the match is consistent, executing the next step; If the time at which the first collision event and the second collision event occur match, it is determined that the corresponding collision event meets the set requirements.

7. The method for clamping an object in a three-dimensional scene as claimed in claim 1, characterized in that: The method for clamping an object in a three-dimensional scene also includes: Parameter information of a touch detection area set by a user is received, and parameters of the touch detection area are updated based on the parameter information, wherein the parameter information includes one or more of detection position information, detection area size, and detection area shape.

8. A system for clamping an object in a three-dimensional scene, characterized in that: include: An acquisition module is used to acquire the clamping state information of the corresponding object to be clamped in the virtual three-dimensional scene, wherein a touch detection area is provided at the object to be clamped, wherein the touch detection area is used to detect whether a collision event occurs in the corresponding area; Monitoring module: used to monitor the collision events between the robot parts and the touch detection area of ​​the object to be clamped through the event system of the game engine; The first judgment module is used for obtaining the robot component that last triggered the collision through the collision event if the collision event meets the set requirements, and associating the object to be clamped with the corresponding robot component so that the object to be clamped and the corresponding robot component move in coordination; The second judgment module is used for continuing to monitor the collision event between the robot component and the touch detection area of ​​the object to be clamped through the event system of the game engine if the collision event does not meet the set requirements.

9. An electronic device, characterized in that: include: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for clamping an object in a three-dimensional scene as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the method for clamping an object in a three-dimensional scene according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Property model grabbing control method and device in game, equipment and storage medium

    CN107694093A

  • A device and method for interacting with a mobile phone AR virtual object by hand

    CN109358748A