Line patrol method, line patrol device, terminal equipment and computer readable storage medium

By using ray detection technology and texture map coordinates to identify the line patrol status of the object model in a virtual scene, the problem of inability to implement line patrol control in a virtual scene is solved, and the precise identification and control of the line patrol path status of the virtual object model is achieved.

CN114359518BActive Publication Date: 2025-05-16UBTECH ROBOTICS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111494684.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-05-16
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

In a virtual scene, line patrol control of the object model cannot be achieved because sensors cannot be installed on the virtual object model to detect line patrol status.

Method used

By setting preset emission points in the virtual scene, using ray detection technology to detect collision objects on the patrol path, obtaining their texture map coordinates and attribute information, and then identifying the patrol status of the object model.

Benefits of technology

The line patrol control of the object model in the virtual scene is realized, and the accuracy of identifying the line patrol path status in the virtual environment is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359518B_ABST
    Figure CN114359518B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of computer technology, and provides a line patrol method, a line patrol device, a terminal device, and a computer-readable storage medium, including: in a target environment, ray detection is performed through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene; when the ray emitted by the preset emission point on the line patrol carrier detects a collision object, the texture map coordinates of the collision object in the target environment are obtained, wherein the collision object is a triangular face on the line patrol path in the target environment; attribute information of the collision object in the target environment is obtained according to the texture map coordinates; and the line patrol state of the line patrol carrier on the line patrol path is identified according to the attribute information. Through the above method, line patrol control of object models in virtual scenes can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a line patrol method, a line patrol device, a terminal device, and a computer-readable storage medium. Background Art

[0002] The line patrol function of the robot refers to the function of the robot moving along a pre-planned path. The implementation method is to mark the pre-planned path, install sensors on the robot, and use the sensors to detect whether the robot passes the marked position on the road surface, so as to determine the line patrol status of the robot.

[0003] However, in a virtual scene, it is impossible to install sensors on the virtual object model, and thus it is impossible to know the line patrol status of the object model. Therefore, it is impossible to implement line patrol control of the object model in the virtual scene. Summary of the invention

[0004] The embodiments of the present application provide a line patrol method, a line patrol device, a terminal device and a computer-readable storage medium, which can realize line patrol control of an object model in a virtual scene.

[0005] In a first aspect, an embodiment of the present application provides a line patrol method, including:

[0006] In a target environment, ray detection is performed through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene;

[0007] When the ray emitted by the preset emission point on the line patrol carrier detects a collision object, the texture map coordinates of the collision object in the target environment are obtained, wherein the collision object is a triangular surface on the line patrol path in the target environment;

[0008] Acquire attribute information of the collision object in the target environment according to the texture map coordinates;

[0009] The line patrol status of the line patrol carrier on the line patrol path is identified according to the attribute information.

[0010] In the embodiment of the present application, a preset emission point is set on the object model in the virtual scene, and the collision object on the line patrol path detected by the preset emission point is detected by the ray detection technology in the virtual scene, and the line patrol state of the object model in the virtual scene is identified according to the attribute information of the collision object. Through the above method, the line patrol control of the object model in the virtual scene is realized.

[0011] In a possible implementation manner of the first aspect, the line patrol path includes a first area and a second area, the first area and the second area each include a plurality of triangular faces, and the triangular faces in the first area have different attributes from the triangular faces in the second area;

[0012] Before performing ray detection at a preset emission point on the line patrol carrier, the method further includes:

[0013] Generate a first physical object from a first area on the line patrol path by using a physical engine;

[0014] The second area on the line patrol path is generated into a second physical object by the physical engine, wherein the physical object is used for ray detection.

[0015] In a possible implementation manner of the first aspect, generating a second physical object from a second area on the line patrol path by the physical engine includes:

[0016] Moving the spatial position of the second area by a preset distance in the up-down direction so that the first area and the second area are located in different planes, wherein the up-down direction is a direction perpendicular to the plane where the line patrol path is located;

[0017] The second physical object is generated by the physical engine using the moved second area.

[0018] In a possible implementation manner of the first aspect, the identifying, according to the attribute information, a line patrol state of the line patrol carrier on the line patrol path includes:

[0019] Determine a target area to which the collision object belongs according to the attribute information, wherein the target area is the first area or the second area;

[0020] The line patrol state of the line patrol carrier is identified according to the target area to which the collision object belongs.

[0021] In a possible implementation manner of the first aspect, the attribute information includes color information; and determining the target area to which the collision object belongs according to the attribute information includes:

[0022] Converting the color information into grayscale values;

[0023] If the gray value is greater than or equal to a preset threshold, the collision object belongs to the first area;

[0024] If the gray value is less than a preset threshold, the collision object belongs to the second area.

[0025] In a possible implementation manner of the first aspect, after identifying the line patrol state of the line patrol carrier on the line patrol path according to the attribute information, the method further includes:

[0026] The movement of the line patrol carrier at the next moment is controlled according to the line patrol state of the line patrol carrier.

[0027] In a second aspect, an embodiment of the present application provides a line patrol device, including:

[0028] A ray detection unit, used for performing ray detection in a target environment through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene;

[0029] A coordinate acquisition unit, configured to acquire the texture map coordinates of the collision object in the target environment when the ray emitted by the preset emission point on the line patrol carrier detects a collision object, wherein the collision object is a triangular surface on the target path in the target environment;

[0030] An attribute acquisition unit, used for acquiring attribute information of the collision object in the target environment according to the texture map coordinates;

[0031] A line patrol identification unit is used to identify the line patrol status of the line patrol carrier on the target path according to the attribute information.

[0032] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a line patrol method as described in any one of the first aspects above when executing the computer program.

[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the line patrol method as described in any one of the above-mentioned first aspects is implemented.

[0034] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device executes the line patrol method described in any one of the first aspects above.

[0035] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] Figure 1 is a schematic diagram of a line patrol path provided in an embodiment of the present application;

[0038] Figure 2 It is a flowchart of the line patrol method provided in an embodiment of the present application;

[0039] Figure 3 is a schematic diagram of the line patrol state provided in an embodiment of the present application;

[0040] Figure 4 is a schematic diagram of a texture map provided in an embodiment of the present application;

[0041] Figure 5 is a structural block diagram of a line patrol device provided in an embodiment of the present application;

[0042] Figure 6 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0044] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0045] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0047] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0048] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0049] The line patrol method provided in the embodiment of the present application requires pre-construction of a line patrol path. The following first introduces the method for constructing the line patrol path.

[0050] A virtual scene refers to a digital scene drawn by a computer through digital communication technology, such as a game scene, a virtual reality (VR) scene, etc. In a virtual scene, the model of a three-dimensional object is composed of multiple two-dimensional triangular faces at different angles. Therefore, in a virtual scene, the area corresponding to the patrol path includes multiple triangular faces. In order to distinguish the patrol path from other areas outside the patrol path, in an embodiment of the present application, when constructing the patrol path, the attributes of the triangular faces on the patrol path are different from the attributes of the triangular faces on other areas outside the patrol path.

[0051] In the embodiment of the present application, the attributes of the triangular face may include color, position, material, etc. For example, the triangular face on the patrol path is set to black, and the triangular face in other areas outside the patrol path is set to white. For another example, the triangular face on the patrol path is set to a smooth surface, and the triangular face in other areas outside the patrol path is set to a rough surface. For another example, the triangular face at certain positions can be defined as the patrol path, and the triangular faces at other positions are areas outside the patrol path.

[0052] In order to more accurately identify the line-following state of the object model, in one embodiment, the line-following path may be divided into multiple areas, and the triangles in different areas are set to different attributes.

[0053] Optionally, the line patrol path includes a first area and a second area, wherein the first area and the second area each include a plurality of triangular faces, and the triangular faces in the first area have different properties from the triangular faces in the second area.

[0054] For example, see Figure 1 , is a schematic diagram of a line patrol path provided in an embodiment of the present application. Figure 1 As shown in the figure, it is a patrol path, the middle of the path is black area, and the edge of the black path is white area. Of course, if the patrol path is divided into multiple areas, multiple colors can be used to distinguish different areas.

[0055] In one embodiment, the step of constructing a dashed path may include:

[0056] A first physical object is generated from a first area on the line patrol path through a physical engine; a second physical object is generated from a second area on the line patrol path through a physical engine, wherein the physical object is used for ray detection.

[0057] The physics engine calculates motion, rotation and collision response by giving rigid objects real physical properties. Through the physics engine, object models in the virtual scene can simulate rigid body behaviors such as collision, acceleration, friction, and resistance in the real scene.

[0058] Ray detection is a detection technology in virtual scenes. It detects the triangles hit by a virtual ray emitted from a certain point.

[0059] Generating physical objects from the area on the patrol path is essentially inserting the triangles in a certain area on the patrol path into the physics engine for subsequent ray detection.

[0060] In order to improve the accuracy of ray detection, optionally, a second area on the line inspection path is generated into a second physical object through a physical engine, including:

[0061] The spatial position of the second area is moved by a preset distance in the up-down direction so that the first area and the second area are in different planes, wherein the up-down direction is a direction perpendicular to the plane where the line patrol path is located; and a second physical object is generated by the physical engine for the moved second area.

[0062] Continue with Figure 1Taking the scene shown as an example, the black area on the patrol path can be moved vertically upward by a preset distance to make the black area and the white area offset in space. If the black area and the white area are in the same plane, the color information of the collision object obtained may be confused, such as distinguishing white as black. If the two areas are offset in space, the above situation will be avoided, which is conducive to improving the accuracy of ray detection.

[0063] In another embodiment, a virtual path can also be constructed by using a bounding volume hierarchy (BVH) technology. The principle is: the object is surrounded by a simple bounding box (such as a rectangular bounding box or a spherical bounding box), and before the ray intersects with the object in the scene, it will first intersect with the bounding box. If the ray does not hit the bounding box, it means that the ray will definitely not intersect with the object in the bounding box; if the ray hits the bounding box, then calculate whether the ray intersects with the object in the bounding box. When constructing a virtual path, the triangles corresponding to the line patrol path can be inserted into the BVH tree for ray detection.

[0064] See also Figure 2 , is a flow chart of a line patrol method provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps:

[0065] S201, in the target environment, performing ray detection through a preset emission point on the line patrol carrier.

[0066] The target environment is a virtual scene, and the patrol carrier is an object model that performs patrol tasks in the virtual scene. For example, if a car model in a game scene needs to travel along a certain route, then the game scene is the target environment, the car model is the patrol carrier, and the certain route is the patrol path.

[0067] In order to improve the recognition accuracy, it is optional to set multiple preset emission points on the line patrol carrier. Take the car model as an example, see Figure 3 , is a schematic diagram of the line patrol state provided in the embodiment of the present application. Figure 3 As shown in (a) in FIG. 5 , five preset emission points are set on the chassis of the car model.

[0068] S202: When the ray emitted by the preset emission point on the line patrol carrier detects the collision object, the texture map coordinates of the collision object in the target environment are obtained.

[0069] The collision object is the triangular surface on the patrol path in the target environment.

[0070] The essence of the preset emission point detecting the collision object is the triangular face hit by the ray direction emitted by the preset emission point. Since the triangular faces on the patrol path are generated into physical objects in advance by the physics engine, the physical effect of the virtual ray hitting the triangular face can be detected in the virtual scene.

[0071] Texture map coordinates define the position of each point on the image. These points are related to the 3D model to determine the position of the texture map on the surface of the 3D model. Figure 4 , is a schematic diagram of a texture map provided in an embodiment of the present application. Figure 4 As shown in the figure, the left side is a 3D model and the right side is a 2D image. The 2D image on the right side is pasted on the surface of the 3D model. Texture mapping coordinates are used to accurately correspond each point on the image to the surface of the object model. The 3D model is three-dimensional, while the image to be pasted is flat. Using texture mapping coordinates, each point on the 2D image can be matched one-to-one with each point on the 3D model.

[0072] S203: Acquire attribute information of the collision object in the target environment according to the texture map coordinates.

[0073] In the embodiment of the present application, the attribute information of the collision object may include color, position, material, etc.

[0074] When the attribute information is a position, the texture map coordinates obtained can be used as the attribute information of the collision object. The texture map coordinates can also be converted into the three-dimensional coordinates of the collision object in the target environment.

[0075] When the attribute information is color or material, the corresponding color information or material information under the current texture map coordinates can be obtained through the interface function.

[0076] S204: Identify the line patrol status of the line patrol carrier on the line patrol path according to the attribute information.

[0077] Since the attributes of the triangular faces in each area on the line patrol path are determined, the target area to which the collision object belongs can be determined based on the attribute information of the triangular faces detected by the ray. In one embodiment, step S204 may include:

[0078] The target area to which the collision object belongs is determined according to the attribute information, wherein the target area is the first area or the second area; and the line patrol state of the line patrol carrier is identified according to the target area to which the collision object belongs.

[0079] For example, when the attribute information is color information, Figure 1The line patrol path shown includes a black area and a white area. If the color of the collision object detected by the preset emission point is white, it means that the preset emission point is directly above the white area; if the color of the collision object detected by the preset emission point is black, it means that the preset emission point is directly above the black area. According to the position of different preset emission points, the position of the line patrol carrier can be determined, and then the line patrol status of the line patrol carrier can be determined.

[0080] Another example, when the attribute information is material, it is assumed that the material of the triangular surface on the patrol path is smooth, and the triangular surface outside the patrol path is rough. If the material of the collision object detected by the preset emission point is smooth, it means that the preset emission point is above the patrol path; if the material of the collision object detected by the preset emission point is rough, it means that the preset emission point is above the patrol path. According to the position of different preset emission points, the position of the patrol carrier can be determined, and then the patrol status of the patrol carrier can be determined.

[0081] Optionally, an implementation method of determining the target area to which the collision object belongs according to the color includes:

[0082] The color information is converted into a grayscale value; if the grayscale value is greater than or equal to a preset threshold, the collision object belongs to the first area; if the grayscale value is less than the preset threshold, the collision object belongs to the second area.

[0083] When the line patrol path includes multiple areas and different areas are distinguished by different colors, multiple preset thresholds can be set to divide the grayscale value into multiple grayscale intervals, and different colors belong to different grayscale intervals. In this way, the areas to which different colors belong can be determined.

[0084] The line patrol status of the line patrol carrier on the line patrol path can be identified according to the layout of the preset transmitting points and the attribute information of the collision object detected by each preset transmitting point.

[0085] by Figure 3 Take the preset transmitting point shown in (a) as an example. Figure 3 As shown in (b) in the figure, when the preset emission points 1 and 5 are directly above the black area, the preset emission points 2 and 3 are directly above the white area, and the preset emission points 4 and 6 do not detect the collision object (i.e., the area outside the patrol path), it means that the car model moves along the center line of the patrol path. When the preset emission point 3 is directly above the black area, and the emission points 1, 5, and 6 are directly above the white area, it means that the car model is offset to the left of the patrol path.

[0086] like Figure 3As shown in (c) in the figure, when the preset emission points 1, 2, 3 and 5 are all directly above the black area, the preset emission points 4 and 6 do not detect the collision object (i.e., the area outside the patrol path), it means that the car model is passing through a T-junction or a crossroads.

[0087] The method in the embodiments S201-S204 of the present application sets a preset emission point on the object model in the virtual scene, detects the collision object on the line patrol path detected by the preset emission point through the ray detection technology in the virtual scene, and identifies the line patrol state of the object model in the virtual scene according to the attribute information of the collision object. Through the above method, the line patrol control of the object model in the virtual scene is realized.

[0088] In one embodiment, after S204, the method further includes: controlling the movement of the line patrol carrier at the next moment according to the line patrol state of the line patrol carrier.

[0089] As described in the above example, when the preset transmitting point No. 3 is directly above the black area, and the transmitting points No. 1, No. 5, and No. 6 are directly above the white area, it means that the car model is offset to the left of the patrol path. Then at the next moment, the car model is controlled to offset to the right so that the car model moves along the center line of the patrol path again.

[0090] It should be understood that the size of the serial numbers of the steps in the above embodiments does not 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 application.

[0091] Corresponding to the line patrol method described in the above embodiment, Figure 5 : is a structural block diagram of a line patrol device provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0092] Reference Figure 5 , the device comprises:

[0093] The ray detection unit 51 is used to perform ray detection in a target environment through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene.

[0094] The coordinate acquisition unit 52 is used to acquire the texture mapping coordinates of the collision object in the target environment when the ray emitted by the preset emission point on the line patrol carrier detects the collision object, wherein the collision object is a triangular surface on the target path in the target environment.

[0095] The attribute acquisition unit 53 is used to acquire the attribute information of the collision object in the target environment according to the texture map coordinates.

[0096] The line patrol identification unit 54 is used to identify the line patrol status of the line patrol carrier on the target path according to the attribute information.

[0097] Optionally, the line patrol path includes a first area and a second area, the first area and the second area each include a plurality of triangular faces, and the triangular faces in the first area have different properties from the triangular faces in the second area.

[0098] Optionally, the device 5 further comprises:

[0099] The first generating unit 55 is used to generate a first physical object from a first area on the line patrol path through a physical engine before performing ray detection through a preset emission point on the line patrol carrier.

[0100] The second generating unit 56 is used to generate a second physical object from the second area on the line patrol path through the physical engine, wherein the physical object is used for ray detection.

[0101] Optionally, the second generating unit 56 is further configured to:

[0102] The spatial position of the second area is moved by a preset distance in the up-down direction so that the first area and the second area are in different planes, wherein the up-down direction is a direction perpendicular to the plane where the line patrol path is located; and the second physical object is generated by the physical engine for the moved second area.

[0103] Optionally, the line patrol identification unit 54 is further used for:

[0104] A target area to which the collision object belongs is determined according to the attribute information, wherein the target area is the first area or the second area; and the line patrol state of the line patrol carrier is identified according to the target area to which the collision object belongs.

[0105] Optionally, the attribute information includes color information.

[0106] Accordingly, the line patrol identification unit 54 is also used for:

[0107] The color information is converted into a grayscale value; if the grayscale value is greater than or equal to a preset threshold, the collision object belongs to the first area; if the grayscale value is less than the preset threshold, the collision object belongs to the second area.

[0108] Optionally, the device 5 further comprises:

[0109] The line patrol control unit 57 is used to control the movement of the line patrol carrier at a next moment according to the line patrol status of the line patrol carrier after identifying the line patrol status of the line patrol carrier on the line patrol path according to the attribute information.

[0110] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0111] in addition, Figure 5 The line patrol device shown may be a software unit, a hardware unit, or a combination of software and hardware, which is built into an existing terminal device, or may be integrated into the terminal device as an independent pendant, or may exist as an independent terminal device.

[0112] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0113] Figure 6 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 6 As shown, the terminal device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, and when the processor 60 executes the computer program 62, the steps in any of the above-mentioned line patrol method embodiments are implemented.

[0114] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 6It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0115] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0116] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0117] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0118] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0119] 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-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0122] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0123] 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, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0124] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A line inspection method, characterized in that: include: In a target environment, ray detection is performed through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene; When the ray emitted by the preset emission point on the line patrol carrier detects a collision object, the texture map coordinates of the collision object in the target environment are obtained, wherein the collision object is a triangular surface on the line patrol path in the target environment; Acquire attribute information of the collision object in the target environment according to the texture mapping coordinates; wherein the attribute information includes at least one of the following: color, position, and material; when the attribute information is position, determine the position of the collision object in the target environment according to the texture mapping coordinates; when the attribute information is color or material, determine the color of the collision object in the target environment according to the color information corresponding to the texture mapping coordinates, and determine the material of the collision object in the target environment according to the material information corresponding to the texture mapping coordinates; The line patrol status of the line patrol carrier on the line patrol path is identified according to the attribute information; wherein the attribute information of different areas on the line patrol path is different.

2. The line inspection method according to claim 1, characterized in that: The line patrol path includes a first area and a second area, each of the first area and the second area includes a plurality of triangular faces, and the triangular faces in the first area have different properties from the triangular faces in the second area; Before performing ray detection at a preset emission point on the line patrol carrier, the method further includes: Generate a first physical object from a first area on the line patrol path by using a physical engine; The second area on the line patrol path is generated into a second physical object by the physical engine, wherein the physical object is used for ray detection.

3. The line inspection method according to claim 2, characterized in that: Generating a second physical object from a second area on the line patrol path by the physical engine includes: Moving the spatial position of the second area by a preset distance in the up-down direction so that the first area and the second area are located in different planes, wherein the up-down direction is a direction perpendicular to the plane where the line patrol path is located; The second physical object is generated by the physical engine using the moved second area.

4. The line inspection method according to claim 2, characterized in that: The identifying the line patrol status of the line patrol carrier on the line patrol path according to the attribute information includes: Determine a target area to which the collision object belongs according to the attribute information, wherein the target area is the first area or the second area; The line patrol state of the line patrol carrier is identified according to the target area to which the collision object belongs.

5. The line patrol method according to claim 4, characterized in that: The attribute information includes color information; and determining the target area to which the collision object belongs according to the attribute information includes: Converting the color information into grayscale values; If the gray value is greater than or equal to a preset threshold, the collision object belongs to the first area; If the gray value is less than a preset threshold, the collision object belongs to the second area.

6. The line patrol method according to claim 1, characterized in that: After identifying the line patrol state of the line patrol carrier on the line patrol path according to the attribute information, the method further includes: The movement of the line patrol carrier at a next moment is controlled according to the line patrol state of the line patrol carrier.

7. A line patrol device, characterized in that: include: A ray detection unit, used for performing ray detection in a target environment through a preset emission point on a line patrol carrier, wherein the target environment is a virtual scene, and the line patrol carrier is an object model that performs a line patrol task in the virtual scene; A coordinate acquisition unit, configured to acquire the texture map coordinates of the collision object in the target environment when the ray emitted by the preset emission point on the line patrol carrier detects a collision object, wherein the collision object is a triangular surface on the line patrol path in the target environment; an attribute acquisition unit, configured to acquire attribute information of the collision object in the target environment according to the texture mapping coordinates; wherein the attribute information includes at least one of the following: color, position, and material; when the attribute information is position, the position of the collision object in the target environment is determined according to the texture mapping coordinates; when the attribute information is color or material, the color of the collision object in the target environment is determined according to the color information corresponding to the texture mapping coordinates, and the material of the collision object in the target environment is determined according to the material information corresponding to the texture mapping coordinates; The line patrol identification unit is used to identify the line patrol status of the line patrol carrier on the line patrol path according to the attribute information; wherein the attribute information of different areas on the line patrol path is different.

8. The line patrol device according to claim 7, characterized in that: The line patrol path includes a first area and a second area, each of the first area and the second area includes a plurality of triangular faces, and the triangular faces in the first area have different properties from the triangular faces in the second area; The device also includes: A first generating unit is used to generate a first physical object from a first area on the line patrol path through a physical engine before performing ray detection through a preset emission point on the line patrol carrier; The second generating unit is used to generate a second physical object from a second area on the line patrol path through the physical engine, wherein the physical object is used for ray detection.

9. A terminal 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 method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Virtual scene data processing method and device, equipment and readable storage medium

    CN111921202A

  • Rewritable compression of triangulated data

    US20080012854A1