A method and device for calculating apartment movement lines
By marking areas on the raster map and using the A-star algorithm, combined with penalty values and reward values, the planning of movement lines is optimized, which solves the problems of rationality and aesthetics of movement lines in the existing technology, and achieves reasonable and beautiful house type movement lines. calculate.
Patent Information
- Application Number
- CN202111225058.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-10-21
AI Technical Summary
The existing automated moving line solution ignores the rationality and aesthetics of the moving line, resulting in the calculated path not meeting the shortest path requirements, and failing to effectively avoid the existing moving line, affecting the rationality and aesthetics of the moving line.
Using the preset path planning algorithm, by marking obstacle areas, free areas and correction areas on the grid map, and assigning different traffic cost values, the A-star algorithm is used to search for the path with the smallest total traffic cost, combining the penalty value and Reward value to optimize route planning.
We have achieved a reasonable and beautiful layout planning for the moving lines, ensuring that the paths are as smooth as possible, avoiding collisions between moving lines, and complying with ergonomic requirements.
Smart Images

Figure CN113970321B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of route planning algorithms, and in particular to a method and device for calculating a moving line of an apartment. Background Art
[0002] The traffic flow of an apartment is a very important attribute of a residential unit. It usually depicts the living convenience and privacy of a living space, etc.
[0003] However, the automated traffic flow solutions currently available on the market often ignore the rationality of the traffic flow: first, the most basic requirement for traffic flow planning is to be able to visit multiple points of interest with a sufficiently short path. For example, the visitor traffic flow needs to visit public spaces such as the entrance door, dining table, public bathroom, and living room. The traffic flows currently available on the market often start from a set center and calculate the traffic flows of two pairs of points of interest. When the total distance is finally calculated, the calculated traffic flow distances are summed up, which obviously does not meet the rationality requirement of the shortest final path, because most aisle paths can be shared; secondly, the walking route needs to conform to human habits. For example, from an ergonomic point of view, it is generally difficult for people to pass through aisles that are less than a certain width, and people will not walk close to the wall in a wide passage.
[0004] In addition, the existing automated traffic flow solutions also ignore the aesthetics of the traffic flow: first, an aesthetically pleasing traffic flow requires that the path be smooth enough, horizontal and vertical, without unnecessary corners or uneven burrs if possible; secondly, it is also necessary to consider the avoidance of existing traffic flow situations. For example, if there is an existing visitor traffic flow, then when calculating the housework and living traffic flows, it is necessary to avoid the existing traffic flow as much as possible, so that the final traffic flow collision detection will be more reasonable.
[0005] Therefore, a method and device for calculating the moving lines of an apartment type that can overcome the above-mentioned problems are needed, so as to obtain a reasonable and beautiful moving line of an apartment type.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore it may contain information that does not constitute the prior art known to those skilled in the art. Summary of the invention
[0007] In order to solve the problems existing in the prior art, the present invention provides a method and device for calculating apartment movement lines, which obtain a reasonable and beautiful apartment movement line by integrating penalty values and / or reward values when adopting a preset path planning algorithm, thereby overcoming the problems existing in the prior art.
[0008] The present invention provides a method for calculating a moving line of an apartment, comprising the following steps: mapping an apartment diagram into a grid map; marking an obstacle area, a free area and a correction area on the grid map, wherein the correction area includes a penalty area and / or a reward area; assigning different travel cost values to the obstacle area, the free area and the correction area; determining a starting node and a target node of a target moving line; and searching for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area, and using the path as the target moving line.
[0009] According to an embodiment of the present invention, marking the penalty area on the grid map includes: expanding the wall line in the floor plan by a first width; mapping the expanded wall line to the grid map; and marking the grid where the expanded wall line mapped to the grid map is located as the penalty area.
[0010] According to one embodiment of the present invention, marking a reward area on the grid map includes: calculating a skeleton line of the floor plan; expanding the skeleton line by a second width; mapping the expanded skeleton line to the grid map; and marking a grid where the expanded skeleton line mapped to the grid map is located as a reward area.
[0011] According to an embodiment of the present invention, the preset path planning algorithm is the A-star algorithm, which calculates the grid travel cost of each node by the following formula:
[0012] f(n)=g(n)+h(n)
[0013] Among them, f(n) represents the evaluation function of n nodes, g(n) represents the actual cost from the starting node to the n nodes, h(n) represents the estimated cost from the n nodes to the target node, and the search for the path with the minimum total travel cost based on the preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area includes: if the n node is located in the penalty area or the reward area, then adding the first penalty value or the first reward value to the evaluation function f(n).
[0014] According to one embodiment of the present invention, the method of searching for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area also includes: if the n node is an inflection point, a second penalty value is added to the evaluation function f(n).
[0015] According to one embodiment of the present invention, the search for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area also includes: if the n node is located on an existing movement line, then determining whether the target movement line and the existing movement line are of the same type: if yes, merging the target movement line with the existing movement line; if not, adding a third penalty value to the evaluation function f(n).
[0016] According to another aspect of the present invention, there is also provided a device for calculating apartment movement lines, comprising: a gridding module, configured to map an apartment plan into a grid map; a marking module, configured to mark obstacle areas, free areas and correction areas on the grid map, wherein the correction areas include penalty areas and / or reward areas; an assignment module, configured to assign different travel cost values to the obstacle areas, free areas and correction areas; a determination module, configured to determine the starting node and the target node of the target movement line; and a search module, configured to search for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle areas, free areas and correction areas, and use it as the target movement line.
[0017] According to one embodiment of the present invention, the marking module includes: a penalty area submodule, which is configured to: expand the wall line in the floor plan by a first width; map the expanded wall line to the grid map; and mark the grid where the expanded wall line mapped to the grid map is located as a penalty area; and / or a reward area submodule, which is configured to: calculate the skeleton line of the floor plan; expand the skeleton line by a second width; map the expanded skeleton line to the grid map; and mark the grid where the expanded skeleton line mapped to the grid map is located as a reward area.
[0018] According to another aspect of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for calculating the unit movement line as described above are implemented.
[0019] According to another aspect of the present invention, there is further provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for calculating the unit movement line as described above.
[0020] According to another aspect of the present invention, there is also provided a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method for calculating the unit movement line as described above.
[0021] The calculation method and device of the apartment moving line provided by the present invention adopt a heuristic multi-objective path-finding algorithm to solve the problems of overall merging, collision and ergonomics of the moving line, and keep the moving line as flat and beautiful as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other features of the present invention will be described in detail below with reference to specific exemplary embodiments shown in the accompanying drawings, which are given below only by way of illustration and therefore do not limit the present invention, in which:
[0023] Figure 1 A flow chart showing a method for calculating apartment movement lines according to an embodiment of the present invention is shown.
[0024] Figure 2 The present invention is shown in FIG. Figure 1 Flow chart of the process of step S1200.
[0025] Figure 3 The present invention is shown in FIG. Figure 1 Flow chart of the process of step S1200.
[0026] Figure 4 A schematic diagram showing wall expansion in a floor plan according to an embodiment of the present invention is shown.
[0027] Figure 5 A schematic diagram showing a skeleton line in a floor plan according to an embodiment of the present invention is shown.
[0028] Figure 6 The present invention is shown in FIG. Figure 1 Flow chart of the process of step S1500.
[0029] Figure 7 A schematic diagram showing the structure of a device for calculating apartment movement lines according to an embodiment of the present invention is shown.
[0030] Figure 8 The present invention is shown in FIG. Figure 7 A schematic diagram of the structure of the marking module 2200. DETAILED DESCRIPTION
[0031] The present invention is described in detail below through specific embodiments so that those skilled in the art can easily implement the present invention according to the contents disclosed in this specification. The embodiments described below are only some embodiments of the present invention, not all. Based on the embodiments described in this specification, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present invention. It should be noted that the embodiments in this specification and the features in the embodiments can be combined with each other without conflict.
[0032] like Figure 1 As shown, the present invention provides a method 1000 for calculating a unit movement line. Specifically, the method 1000 includes mapping the unit plan to a grid map at S1100; marking an obstacle area, a free area, and a correction area on the grid map at S1200; assigning different travel cost values to the obstacle area, the free area, and the correction area at S1300; determining the starting node and the target node of the target movement line at S1400; and searching for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area, and the correction area at S1500, and using it as the target movement line.
[0033] Specifically, in Figure 1 In one or more embodiments of the present invention of step S1100 shown in , an image vectorization method known to those skilled in the art can be used to convert the floor plan into a vectorized floor plan. The vectorized floor plan can be any data structure as long as the wall point, line and surface relationship of the floor plan can be obtained. Then, a scaled floor plan vector coordinate system is established, and the vectorized floor plan is rasterized - the floor plan is scaled to a point map with a grid number of M*N, that is, the wall and accessories of the original real-world length of the floor plan are scaled to a canvas (matrix) with a specified grid number of M*N to form a grid map. In other words, all the floor plan point, line and surface information are drawn on the canvas, and all the walls and partitions of the floor plan are drawn in the new coordinate system. Among them, M and N can be set according to actual needs and commonly used values in the field, and the present invention does not limit this. In a preferred embodiment, the grid number can also be set to N*N, where the value of N can be 200, for example.
[0034] Subsequently, the method 1000 marks an obstacle area, a free area, and a correction area on the grid map at step S1200. Specifically, the obstacle area may represent an area that is impassable such as a wall or a pillar; the free area may represent an area that can be freely passed; the correction area may include a penalty area and / or a reward area, wherein the penalty area may represent an area that is passable but not encouraged to pass there; the reward area may represent an area that is passable and encouraged to pass there. In one or more embodiments of the present invention, different areas may be divided or marked by setting different pixel values for different areas. More specifically, the initial pixel value of the grid map is first set to B, such as -1, and then the pixel value of the obstacle area is set to W, such as 255, the pixel value of the free area is set to R, such as 0, the pixel value of the penalty area is set to E, such as 10, the pixel value of the reward area is set to S, such as 20, and the pixel value of the passable area such as the door and pass on the wall is also set to R. In the above embodiment, each pixel value can be set according to actual conditions and requirements, and the present invention does not specifically limit this.
[0035] Further references Figure 2 , which shows a processing flow chart for marking a penalty area on a grid map according to an embodiment of the present invention, including: in step S1211, the wall line in the floor plan is expanded by a first width; in step S1212, the expanded wall line is mapped to the grid map; and in step S1213, the grid where the expanded wall line mapped to the grid map is located is marked as a penalty area. Specifically, the walking route needs to conform to people's habits. For example, from the perspective of ergonomics, it is generally difficult to pass through a corridor less than 45 cm, and people will not walk close to the wall in a wide passage. Therefore, the present invention sets a certain range around the wall as a penalty area, that is, when calculating the moving line, try not to pass through the area. In one or more embodiments of the present invention, the wall line in the floor plan is first expanded by a first width; then, according to the scaling factor from the floor plan to the grid map, the grid map is expanded to make the original floor plan wall line thicker; then, the pixel value of the expanded area is set to the pixel value E of the penalty area. The first width of the linear expansion of the wall may preferably be set to 45 cm, that is, 45 cm is expanded on each side of the wall. Of course, the first width may also be set to other values according to actual needs, and the present invention does not limit this.
[0036] Figure 4 The diagram vividly shows the wall expansion in the floor plan, wherein the circled portion schematically shows the wall expansion: the straight line within the circle represents the original wall, and the rectangular frame surrounded by the dotted line represents the expanded wall.
[0037] Further references Figure 3, which shows a processing flow chart for marking a reward area on a grid map according to an embodiment of the present invention, including: calculating the skeleton line of the floor plan at step S1221; expanding the skeleton line to a second width at step S1222; mapping the expanded skeleton line to the grid map at step S1223; and marking the grid where the expanded skeleton line mapped to the grid map is located as a reward area at step S1224. Specifically, the purpose of setting a reward area is to encourage the path to get as close to the center of an area as possible, and this purpose can be achieved by calculating the skeleton line of the floor plan. It can be intuitively understood here that an independent area is a limb of the floor plan, and the skeleton is the innermost part of this area, which can be obtained using the traditional skeleton line algorithm in the image field.
[0038] Figure 5 The schematic diagram of the skeleton line in the floor plan is vividly shown. It can be seen in the figure that a skeleton line is obtained inside an independent area. Based on these internal lines, we use the image expansion algorithm again to increase the width of the skeleton line by a second width, and then expand the grid map according to the scaling factor from the floor plan to the grid map to make the original skeleton line thicker; then the pixel value of the expanded area is set to the pixel value S of the reward area. The second width of the skeleton line expansion can be the same as or different from the first width, and the specific value can also be set according to actual needs, which is not limited by the present invention.
[0039] In this way, by adding penalty areas and reward areas when looking for points of interest on the grid map, the ergonomic problem of the movement line can be well solved, so that the movement line does not run along the wall, but tries to stay in the middle of the feasible area, thereby guiding the final path to become more reasonable and beautiful.
[0040] Back to Figure 1Then, at step S1300, method 1000 assigns different pass cost values to the obstacle area, free area and correction area, that is, assigns each grid in the above areas a respective grid pass cost value. Specifically, the travel cost value can represent the size of the cost paid by the path passing through this node or grid. For example, when encountering an obstacle area, since the obstacle area is impassable, the travel cost value of the area can be set to a large value, such as 1000, so that when calculating the path, the nodes or grids in the area will be discarded as the necessary parts of the path; for example, when encountering a penalty area, since the penalty area is passable, but it may be a wall part or a very narrow aisle where walking is not encouraged, the travel cost value of the area can be set to a large value, such as 0.95, so as to avoid selecting the nodes or grids in the area as the necessary parts of the path; for the reward area, since you want to make the path pass through the area as much as possible, the travel cost value of the area can be set to a small value, such as -10; for the free area, it includes neither the obstacle area nor the penalty or reward area, so there is no penalty or reward when passing through this area, so the travel cost value of the area can be set to a value that has no effect or a small effect on the path calculation, such as 0. It should be noted that the travel cost value of each area can be set according to actual conditions and needs, and is not limited to the specific numerical examples listed above.
[0041] Subsequently, method 1000 determines the starting node and the target node of the target movement line at step S1400, that is, determines on the grid map which point of interest to which point of interest of the floor plan the movement line is to be obtained, and marks the grids where the corresponding starting node and the target node are located on the grid map.
[0042] Subsequently, at step S1500 , method 1000 searches for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area, and the correction area, and uses it as the target moving line.
[0043] In a preferred embodiment of the present invention, the preset path planning algorithm is the A-star algorithm, which calculates the grid travel cost of each node by the following formula (1):
[0044] f(n)=g(n)+h(n) (1)
[0045] Among them, f(n) represents the evaluation function of n nodes, that is, the estimated cost from the starting node to the target node via n nodes. When selecting the next node to traverse, we always choose the node with the highest comprehensive priority (the smallest f(n)). g(n) represents the actual cost from the starting node to n nodes, and h(n) represents the estimated cost from n nodes to the target node, that is, the heuristic function of the A-star algorithm.
[0046] As known to those skilled in the art, the A-star algorithm is a commonly used path finding and graph traversal algorithm, and is the most effective method for solving the shortest path in a static road network. During the operation, the node with the smallest f(n) (highest priority) is selected from the priority queue each time as the next node to be traversed. In addition, the A-star algorithm usually uses two sets to represent the nodes to be traversed and the nodes that have been traversed, which are usually called open_set and close_set.
[0047] Reference below Figure 6 To specifically illustrate an example process S1500 for searching for a path with the minimum total travel cost based on the A-star algorithm and the travel cost values of each area, the process starts at step S1510; at step S1520, it expands from the starting node to its adjacent node - the n node; at step S1521, it is determined whether the n node is located in the penalty area or the reward area: if so, at step S1522, a first penalty value or a first reward value is added to the evaluation function f(n); if not, it proceeds to step S1523 and determines whether the n node is an inflection point: if so, at step S1524, a second penalty value is added to the evaluation function f(n); if not, it proceeds to step S1525, And determine whether the n node is located on the existing movement line: if so, determine whether the target movement line and the existing movement line are the same type of movement line at step S1526: if so, merge the target movement line with the existing movement line at step S1527; if not, add a third penalty value to the evaluation function f(n) at step S1528; then expand to the next adjacent node based on f(n) at step S1530; then determine whether the next adjacent node is the target node at step S1540: if yes, end the process at step S1560; if not, update the next adjacent node to the n node in the next loop at step S1550, and then start the next loop at step S1521.
[0048] It should be noted that Figure 6The process S1500 shown does not show the judgment and action of node n in the obstacle area and free area, but this does not mean that this link is not included in the process of searching for a path. Those skilled in the art can adopt appropriate methods to implement the judgment and subsequent actions of the obstacle area and free area (for example, using the above-mentioned method of assigning each grid passage cost value to the grids in each area for judgment). At the same time, the node n in the above embodiment can represent any neighboring node of the current node within the range of the grid map, for example, Figure 6 At step S1520, the current node is the starting node, and node n is the adjacent node of the starting node. For easy understanding, node n here can be regarded as the first node, and in all steps of this loop, node n is the first node; and in the next loop, the current node is updated to the first node (since there can be multiple first nodes, the first node here can also be one or more), and node n is updated to the next adjacent node, that is, the adjacent node of the first node. For easy understanding, node n here can be regarded as the second node, and in all steps of this loop, node n is the second node; and so on.
[0049] Furthermore, the turning point mentioned above may refer to a node that has changed direction relative to the previous path. In one or more embodiments of the present invention, we constrain the n-node to be in only four directions, namely, up, down, left, and right, relative to the previous node. This ensures that the final path is horizontal and vertical. For example, the second penalty value added to the evaluation function f(n) in step S1524 may be set to a larger value, such as 90, so as to avoid turning the moving line as much as possible through this turning penalty. In other embodiments of the present invention, the above-mentioned constraints on the direction may not be imposed, that is, the n-node may be located in up, down, left, right, and diagonal directions relative to the previous node. In this case, the penalty value corresponding to the turning point may be further subdivided into up, down, left, right, and right penalty values and diagonal penalty values. The diagonal penalty value will be set to a value greater than the up, down, left, and right penalty values, thereby encouraging people to avoid taking diagonal lines as much as possible.
[0050] In addition, when searching for moving lines, we need to consider not only the shortest path to a target node, but also rationality and aesthetics. Figure 6Steps S1525 to S1528 shown in the figure can realize the search of similar moving lines without repeated calculation, and different moving lines are complementary and interfered with each other as much as possible. Specifically, the moving line of the apartment is a very important attribute of the residential suite, which usually depicts the convenience and privacy of a living space, etc. Common moving lines include: residential moving lines, which mainly involve areas such as living rooms, dining rooms, study rooms, cloakrooms, bathrooms and bedrooms, which are all relatively private areas: household moving lines, such as kitchens and places for washing and drying clothes, which are all places used for daily housework; visitor moving lines, such as living rooms, dining rooms and public toilets. In order to prevent areas with different functions from interfering with each other through the planning of moving lines, the three common moving lines listed above should try not to intersect or have the same route. For example, visitor moving lines should not intersect with residential moving lines and household moving lines to avoid affecting family rest and work.
[0051] In one or more embodiments of the present invention, since multiple moving lines need to be calculated for a house, the calculated moving lines can be marked in the grid map, and the coordinates of all grids through which the moving lines pass can be recorded so as to make a judgment in step S1525 when calculating subsequent moving lines. If the n-node of the target moving line being calculated is located on an existing moving line, it is divided into the following two cases: the target moving line and the existing moving line are of the same type, and the target moving line and the existing moving line are of different types. For the first case, the same type of moving lines generally do not involve interference issues, so once it is detected that the calculated moving line already exists at the n-node, it means that this road has been traveled when searching for other points of interest of the current class, so the current search is terminated directly and the path is merged into the existing moving line. This can not only avoid repeated calculations, but also avoid searching for multiple redundant moving lines of the same type. For the second case, since there are intersections or overlaps of different types of moving lines, the third penalty value added to the evaluation function f(n) in step S1528 can be set to a larger value, such as 15, so as to avoid intersections or overlaps between different types of moving lines by adding the collision penalty, thereby achieving the rationality and aesthetics of the moving lines.
[0052] It should be noted that the specific values of the turning penalty and collision penalty mentioned above can be set according to actual conditions, and the values listed in the present invention are only examples.
[0053] In another embodiment of the present invention, the preset path planning algorithm may also adopt other algorithms known to those skilled in the art, such as the Breadth First algorithm, the Dijkstra algorithm, the Best First algorithm, etc. It is worth noting that when using the above-mentioned other path planning algorithms, the specific steps described in the above embodiments will also be adaptively adjusted, and the specific steps will not be repeated here.
[0054] It should be further explained that the above combination Figure 6 The description of the search route is only for the purpose of convenience of description. In the specific implementation process, without departing from the concept of the present invention and without affecting the technical effect of the present invention, the order of steps S1521~1522, steps S1523~1524 and steps S1525~1528 can be changed arbitrarily, or only some of the steps can be implemented.
[0055] Based on the same inventive concept, Figure 7 The schematic diagram of the structure of the calculation device 2000 of the apartment type moving line of an embodiment of the present invention is shown, and the device 2000 includes: a rasterization module 2100, which is configured to map the apartment type map into a raster map. In the embodiment of the present invention, the rasterization module 2100 can be configured to execute Figure 1 S1100 shown in FIG. 1 and in this specification Figure 1 The corresponding step of S1100 in FIG. 2; a marking module 2200, which is configured to mark the obstacle area, the free area and the correction area on the grid map. In an embodiment of the present invention, the marking module 2200 may be configured to perform Figure 1 S1200, Figure 2 and Figure 2 As shown and in this manual Figure 1 S1200, Figure 2 and Figure 2 Corresponding steps; an assignment module 2300, which is configured to assign different travel cost values to the obstacle area, the free area and the correction area. In an embodiment of the present invention, the assignment module 2300 can be configured to execute Figure 1 S1300 shown in FIG. 1 and in this specification Figure 1 The step corresponding to S1300 in FIG. 24; a determination module 2400 configured to determine the starting node and the target node of the target moving line. In an embodiment of the present invention, the determination module 2400 may be configured to execute Figure 1 S1400 shown in FIG. 1 and in this specification Figure 1 The step corresponding to S1400 in the above description; a search module 2500, which is configured to search for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area, and use it as the target moving line. The search module 2500 can be configured to execute Figure 1 S1500, Figure 6 As shown and in this manual Figure 1 S1500, Figure 6 The corresponding steps.
[0056] Based on the same inventive concept, Figure 8The present invention shows an embodiment of Figure 7 The structural diagram of the marking module 2200 of the present invention is a schematic diagram of the marking module 2200, wherein the marking module 2200 includes: a penalty area submodule 2210, which is configured to expand the wall line in the floor plan by a first width; map the expanded wall line to the grid map; and mark the grid where the expanded wall line mapped to the grid map is located as a penalty area. In an embodiment of the present invention, the penalty area submodule 2210 can be configured to perform Figure 2 As shown and in this manual Figure 2 Corresponding steps; reward area submodule 2220, which is configured to calculate the skeleton line of the floor plan; expand the skeleton line by a second width; map the expanded skeleton line to the grid map; and mark the grid where the expanded skeleton line mapped to the grid map is located as a reward area. In an embodiment of the present invention, the reward area submodule 2220 can be configured to perform Figure 3 As shown and in this manual Figure 3 The corresponding steps.
[0057] Understandably, Figures 7-8 The structure shown is for illustration only, and the device may also include Figures 7-8 More or fewer modules or components shown in, or with Figures 7-8 Different configurations are shown.
[0058] In addition, the present application also provides a computer device. According to one embodiment of the present invention, the computer device may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for calculating the unit movement lines described in this specification may be implemented.
[0059] In addition, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device can execute the steps of the method for calculating the unit movement line described in this specification.
[0060] In addition, the present application also provides a computer program product, including computer instructions, which, when executed by a processor, can implement the steps of the method for calculating the unit movement line described in this specification.
[0061] In particular, the embodiment process described above with reference to the flowcharts in the accompanying drawings can be implemented as a computer software program. For example, the embodiment disclosed in the specification of this application includes a computer program product, which includes a computer program carried on a computer-readable medium, the computer program includes program codes for executing the methods shown in the flowcharts in the accompanying drawings, and the computer program is executed by a processor to execute the method of the present application.
[0062] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: a computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0063] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0064] Computer program code for performing the operations of the present application may be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0065] The flow chart and block diagram in the accompanying drawings exemplarily illustrate the possible architecture, function and operation of the system, method and computer program product according to each embodiment of the present application. Each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should be noted that in some alternative embodiments, the functions marked in the box can also occur in a different order from that shown in the accompanying drawings. For example, two boxes represented in sequence can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0066] The units or modules involved in the embodiments of the present application may be implemented by software or hardware. The above units or modules may also be set in a processor, for example, it may be described as: a processor including a rasterization module, a marking module, an assignment module, a determination module, a search module, etc. The names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0067] All documents mentioned in this specification are cited in this application as references, just as if each document was fully cited in this specification as references.
[0068] In addition, it should be understood that after reading the above description of the present invention, those skilled in the art may make various changes or modifications to the present invention, and these equivalent forms also fall within the protection scope of the present invention.
Claims
1. A method for calculating the moving line of an apartment, characterized in that: The following steps are involved: Map the floor plan to a raster map; Marking an obstacle area, a free area and a correction area on the grid map, wherein the correction area includes a penalty area and / or a reward area; Assigning different travel cost values to the obstacle area, free area and correction area; Determine the starting node and target node of the target moving line; as well as Based on the preset path planning algorithm and the travel cost values of the obstacle area, free area and correction area, a path with the minimum total travel cost is searched and used as the target moving line. Marking penalty areas on the grid map includes: Expanding the wall line in the floor plan by a first width; mapping the dilated wall lines to the grid map; and Marking the grid where the expanded wall line mapped to the grid map is located as a penalty area, Marking reward areas on the grid map includes: Calculating the skeleton line of the floor plan; expanding the bone line by a second width; Mapping the dilated skeleton lines to the grid map; and The grid where the dilated skeleton line mapped to the grid map is located is marked as a reward area.
2. The method according to claim 1, characterized in that: The preset path planning algorithm is the A-star algorithm, which calculates the grid travel cost of each node by the following formula: f(n)=g(n)+h(n) Among them, f(n) represents the evaluation function of n nodes, g(n) represents the actual cost from the starting node to the n nodes, and h(n) represents the estimated cost from the n nodes to the target node. The searching for a path with the minimum total travel cost based on the preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area includes: If the n node is located in the penalty region or the reward region, a first penalty value or a first reward value is added to the evaluation function f(n).
3. The method according to claim 2, characterized in that The searching for a path with the minimum total travel cost based on the preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area also includes: If node n is an inflection point, a second penalty value is added to the evaluation function f(n).
4. The method according to claim 2, characterized in that: The searching for a path with the minimum total travel cost based on the preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area also includes: If node n is located on an existing moving line, determine whether the target moving line and the existing moving line are of the same type: if yes, merge the target moving line with the existing moving line; if not, add a third penalty value to the evaluation function f(n).
5. A device for calculating the movement lines of an apartment, characterized in that: include: A rasterization module, which is configured to: map the floor plan into a raster map; A marking module, configured to: mark an obstacle area, a free area and a correction area on the grid map, wherein the correction area includes a penalty area and / or a reward area; An assignment module, which is configured to: assign different travel cost values to the obstacle area, the free area and the correction area; A determination module is configured to: determine a starting node and a target node of a target moving line; as well as The search module is configured to: search for a path with the minimum total travel cost based on a preset path planning algorithm and the travel cost values of the obstacle area, the free area and the correction area, and use it as the target moving line, Marking penalty areas on the grid map includes: Expanding the wall line in the floor plan by a first width; mapping the dilated wall lines to the grid map; and Marking the grid where the expanded wall line mapped to the grid map is located as a penalty area, Marking reward areas on the grid map includes: Calculating the skeleton line of the floor plan; expanding the bone line by a second width; Mapping the dilated skeleton lines to the grid map; and The grid where the dilated skeleton line mapped to the grid map is located is marked as a reward area.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
8. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Accompanying robot path planning method and system based on obstacle virtual expansion
CN108775902A
Method and device for calculating moving line of house type
CN111291440A
Method for planning motion path of bridge crane
CN111422741A
