Scene boundary line generation method, ground mobile robot, and storage medium
By using a linear fitting method of angle and triangle height on the ground mobile robot, sub-boundary lines are determined one by one, which solves the problem of time-consuming and low accuracy in building maps of the ground mobile robot, and achieves rapid and high-precision scene boundary generation.
Patent Information
- Application Number
- PCT/CN2024/126553
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-10-22
- Publication Date
- 2025-07-03
AI Technical Summary
Ground mobile robots take a long time to build maps and have low accuracy, which affects work efficiency and user experience.
A linear fitting method based on angle and triangle height is used to determine the sub-boundary line one by one, and the scene boundary line is generated by obtaining boundary points one by one and performing linear fitting.
Fast and high-precision scene boundary generation is achieved, reducing the number of fit points, and improving the generation speed and accuracy.
Smart Images

Figure CN2024126553_03072025_PF_FP_ABST
Abstract
Description
Scene boundary line generation method, ground mobile robot and storage medium Technical Field
[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a scene boundary line generation method, a ground mobile robot, and a storage medium. Background Art
[0002] Smart lawn mowers, smart sweepers, and other ground-based mobile robots are gaining popularity because they require no manual operation, freeing users' hands and improving work efficiency. Currently, to enable these ground-based mobile robots to more effectively plan their operations, their working range must be determined beforehand to prevent them from straying from the line during operation. This means that ground-based mobile robots must map their working range.
[0003] However, if the ground mobile robot takes a long time and has low accuracy when building maps, it will affect the work efficiency of the ground mobile robot and the user experience will be poor.
[0004] Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide a scene boundary line generation method, a ground mobile robot, and a storage medium, so that the ground mobile robot can obtain the scene boundary line more quickly and accurately. To solve the above technical problems, the embodiments of the present application provide a scene boundary line generation method applied to the ground mobile robot, wherein the boundary line includes multiple sub-boundary lines, and the method includes:
[0006] According to a preset strategy, sub-boundary lines are determined section by section, and the lengths of each sub-boundary line are the same or different;
[0007] Among them, the preset strategy includes: obtaining boundary points one by one in sequence, determining the starting point and end point of the sub-boundary line according to at least one of the angle and height of the figure composed of the boundary points; and performing linear fitting on the boundary points between the starting point and the end point to obtain the sub-boundary line.
[0008] When the number of boundary points on the sub-boundary line is less than a preset value, the height of the figure formed by the starting point and end point of the sub-boundary line and the boundary points on the next boundary line is greater than the preset height value.
[0009] The end point of the sub-boundary line is the starting point of the next sub-boundary line, and the boundary point on the next sub-boundary line is the next boundary point located after the starting point of the next sub-boundary line.
[0010] When the number of boundary points on the sub-boundary line is not less than a preset value,
[0011] The starting angle of the figure composed of the boundary points is less than or equal to a preset angle value, or the height of the figure composed of the boundary points between the starting point and end point of the sub-boundary line and the starting point and end point of the boundary line is not greater than a preset height value.
[0012] The height of the figure formed by the starting point and the end point of the sub-boundary line and the boundary point on the next boundary line is greater than the preset height value;
[0013] Or, in a graph formed by the starting point and the end point of the sub-boundary line and the boundary point on the next segment of the boundary line, the angle of the starting point is greater than a preset angle value;
[0014] Alternatively, the number of boundary points on the sub-boundary line is a preset maximum value.
[0015] The height is the value corresponding to the height of the line connecting the starting point and the end point of the boundary line as the base.
[0016] The figure is a triangle, or there is an inflection point between adjacent sub-boundary lines.
[0017] The acquiring of boundary points one by one in sequence comprises: sampling from a detection route of the ground mobile robot for the boundary of the target scene according to a preset interval, and acquiring a plurality of boundary points arranged in sequence.
[0018] The present invention also provides a ground mobile robot, comprising: at least one processor; and a memory in communication with the at least one processor; wherein,
[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a scene boundary line generation method;
[0020] The boundary line generation method comprises:
[0021] According to a preset strategy, sub-boundary lines are determined section by section, and the lengths of each sub-boundary line are the same or different;
[0022] Among them, the preset strategy includes: obtaining boundary points one by one in sequence, determining the starting point and end point of the sub-boundary line according to at least one of the angle and height of the figure composed of the boundary points; and performing linear fitting on the boundary points between the starting point and the end point to obtain the sub-boundary line.
[0023] When the number of boundary points on the sub-boundary line is less than a preset value, the height of the figure formed by the starting point and end point of the sub-boundary line and the boundary points on the next boundary line is greater than the preset height value.
[0024] When the number of boundary points on the sub-boundary line is not less than a preset value,
[0025] The starting angle of the figure composed of the boundary points is less than or equal to a preset angle value, or the height of the figure composed of the boundary points between the starting point and end point of the sub-boundary line and the starting point and end point of the boundary line is not greater than a preset height value.
[0026] The height of the figure formed by the starting point and the end point of the sub-boundary line and the boundary point on the next boundary line is greater than the preset height value;
[0027] Or, in a graph formed by the starting point and the end point of the sub-boundary line and the boundary point on the next segment of the boundary line, the angle of the starting point is greater than a preset angle value;
[0028] Alternatively, the number of boundary points on the sub-boundary line is a preset maximum value.
[0029] The height is the value corresponding to the height of the line connecting the starting point and the end point of the boundary line as the base.
[0030] The acquiring of boundary points one by one in sequence comprises: sampling from a detection route of the ground mobile robot for the boundary of the target scene according to a preset interval, and acquiring a plurality of boundary points arranged in sequence.
[0031] The present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, a method for generating a scene boundary line is implemented. The method comprises:
[0032] According to a preset strategy, sub-boundary lines are determined section by section, and the lengths of each sub-boundary line are the same or different;
[0033] Among them, the preset strategy includes: obtaining boundary points one by one in sequence, determining the starting point and end point of the sub-boundary line according to at least one of the angle and height of the figure composed of the boundary points; and performing linear fitting on the boundary points between the starting point and the end point to obtain the sub-boundary line.
[0034] When the number of boundary points on the sub-boundary line is less than a preset value, the height of the figure formed by the starting point and end point of the sub-boundary line and the boundary points on the next boundary line is greater than the preset height value.
[0035] When the number of boundary points on the sub-boundary line is not less than a preset value,
[0036] The starting angle of the figure composed of the boundary points is less than or equal to a preset angle value, or the height of the figure composed of the boundary points between the starting point and end point of the sub-boundary line and the starting point and end point of the boundary line is not greater than a preset height value.
[0037] The height of the figure formed by the starting point and the end point of the sub-boundary line and the boundary point on the next boundary line is greater than the preset height value;
[0038] Or, in a graph formed by the starting point and the end point of the sub-boundary line and the boundary point on the next segment of the boundary line, the angle of the starting point is greater than a preset angle value;
[0039] Alternatively, the number of boundary points on the sub-boundary line is a preset maximum value.
[0040] The height is the value corresponding to the height of the line connecting the starting point and the end point of the boundary line as the base.
[0041] The acquiring of boundary points one by one in sequence comprises: sampling from a detection route of the ground mobile robot for the boundary of the target scene according to a preset interval, and acquiring a plurality of boundary points arranged in sequence.
[0042] This solution combines the straight line fitting method of angle and triangle height. The angle straight line fitting method has a small amount of calculation, while the triangle height straight line fitting method ensures the accuracy of the fitting result, which can make the scene boundary generation method faster. At the same time, the generated scene boundary has higher accuracy and fewer fitting points. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] One or more embodiments are exemplarily described by the figures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments.
[0044] FIG1 is a flow chart of a first scene boundary line generation method provided by an embodiment of the present application;
[0045] FIG2 is a flow chart of a second scene boundary line generation method provided in an embodiment of the present application;
[0046] FIG3 is a flow chart of a third scene boundary line generation method provided in an embodiment of the present application;
[0047] FIG4 is a flowchart of a fourth scene boundary line generation method provided in an embodiment of the present application;
[0048] FIG5 is a schematic diagram of multiple boundary points provided in an embodiment of the present application;
[0049] FIG6 is a schematic diagram of a scene boundary line generating device provided in an embodiment of the present application;
[0050] FIG7 is a schematic structural diagram of a ground mobile robot provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in each embodiment of the present application, many technical details are proposed to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present application. The various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0052] Ground-based robots, such as lawn mowers and robot vacuums, need to determine the area corresponding to their work scene before they begin operations. This allows them to automatically operate within the boundaries of the work scene, ensuring they stay within those boundaries. However, if mapping is time-consuming and inaccurate, this can negatively impact the robot's efficiency and create a poor user experience.
[0053] In response to the above technical problems, an embodiment of the present application relates to a scene boundary line generation method, which is applied to a ground mobile robot. The method comprises: determining sub-boundary lines segment by segment according to a preset strategy, wherein the length of each sub-boundary line is the same or different;
[0054] The preset strategy includes: sequentially acquiring boundary points one by one, determining the starting and ending points of a sub-boundary line based on at least one of the angle and height of a figure formed by the boundary points; and performing a linear fit on the boundary points between the starting and ending points to obtain the sub-boundary line. As shown in Figure 1, the method specifically includes the following steps.
[0055] Step 101 : Acquire a plurality of boundary points arranged in sequence from a detection route of a ground mobile robot for a target scene boundary.
[0056] In embodiments of the present application, a target scene may be provided with a boundary line. The ground mobile robot uses its sensors to identify the boundary line, turning and moving forward, thereby forming a detection route for the ground mobile robot to the boundary of the target scene. For example, the ground mobile robot may start from a charging station, circle around, and then return to the charging station to stop. This process is called mapping.
[0057] After obtaining the detection route, multiple boundary points arranged in sequence are obtained from the detection route. This acquisition method can be based on the preset interval distance between two boundary points, or based on the preset interval time between two boundary points. Other acquisition methods are also possible and are not specifically limited in the embodiments of this application. The initial boundary point and the last boundary point can both be the locations corresponding to the charging piles.
[0058] Step 102 : Select a group of three boundary points, where three consecutive boundary points in the group are point i, point j, and point k, respectively, where j=i+1, and create a preset first set that is initially an empty set.
[0059] In an example implementation, the three consecutive boundary points can be the first three boundary points among multiple boundary points arranged in sequence, that is, let i=1, j=i+1=2, k=j+1=3. Of course, they can also be other three consecutive boundary points, such as i=3, j=4, k=5, and there is no specific limitation in the embodiment of this application.
[0060] Step 103: Obtain position information of each point in the group in the coordinate system of the target scene, and calculate the angle formed by each point in the group according to the position information of each point in the group.
[0061] In one example implementation, during the mapping process, the wheel encoder of the ground mobile robot records the number of rotations of the wheel. The wheel diameter of the machine is known. Therefore, the position information of the ground mobile robot in the coordinate system of the target scene can be calculated based on the differential drive motion model of the ground mobile robot. This position information can be expressed as P(x, y).
[0062] The target scene's coordinate system can be a world coordinate system. The ground mobile robot transforms the trajectory data collected by its wheel encoders into a world coordinate system via the machine coordinate system, creating a unified reference. These boundary points represent the ground mobile robot's position in the world coordinate system at each moment, and these trajectory points are serially numbered. Therefore, the position information of each point in the group in the world coordinate system is obtained, and the angle formed by each point in the group is calculated based on this position information.
[0063] In an exemplary implementation, the angle formed by the three points in the group in the world coordinate system can be calculated using a preset calculation formula, as shown in the following formula (1). θ = abs(atan((t1-t2) / (1+t1*t2))) Formula (1)
[0064] Where θ represents the angle formed by the three points in the group in the world coordinate system, t1 and t2 represent the slopes of the two angles a and b formed by the three points in the group in the world coordinate system, abs() is a function for finding the absolute value, and atan() is a function for finding the inverse tangent. In the embodiment of the present application, the absolute value is found by abs because the angle can be positive or negative, but regardless of whether it is positive or negative, it only needs to be less than the preset angle threshold. Therefore, the absolute value function is chosen in this application.
[0065] In step 104, if the included angle is less than the preset angle threshold, point k is added to the preset first set, with k set to k + 1, and the process continues until the included angle formed by points i, j, and k is greater than or equal to the preset angle threshold. The number of elements in the preset first set is then calculated. That is, when the number of boundary points on the sub-boundary line is not less than a preset value (i.e., a preset lower number threshold), the starting angle of the figure formed by the boundary points is less than or equal to the preset angle value.
[0066] The preset first set may be represented as set A. If the included angle is less than the preset angle threshold, point k is added to the preset first set. In the embodiment of the present application, the position information of point k may be added to the preset first set A.
[0067] After adding point k to the preset first set A, let k = k + 1, that is, let point k move back one position. For example, if k is currently the third point among multiple boundary points arranged in sequence, after moving back one position, the new point k is the fourth point among the multiple boundary points arranged in sequence. Continue to calculate the angle formed by point i, point j and the new point k. If the angle at this time is greater than or equal to the preset angle threshold, calculate the number of elements in A in the preset first set. On the contrary, if the angle at this time is still less than the preset angle threshold, continue to add the new point k to the preset first set A, let k = k + 1, that is, let the new point k continue to move back one position, and calculate the number of elements in the preset first set until the angle formed by point i, point j and the new point k is greater than or equal to the preset angle threshold, or until the number of elements in the preset first set is greater than or equal to the preset high number threshold.
[0068] Step 105 : Determine three target points based on the number of elements in the preset first set and the points in the set, and perform straight line fitting based on the height of the triangle formed by the three target points.
[0069] The three target points are determined based on the points in the set (point i, point j, and point k). The three target points determined vary depending on the number of elements in the preset first set. Furthermore, the height of the triangle formed by the three target points determines the method of line fitting.
[0070] In the embodiment of the present application, a preliminary judgment is made on the angles of continuous points, and then the heights of triangles constructed in different ways are determined according to the number in the preset first set A to determine whether the current angle result is overfitting or misfitting. Then, different correction strategies are adopted according to different schemes. If it is neither overfitting nor misfitting, then it is a correct straight line fit that meets the conditions, and the fitting result is saved.
[0071] Step 106: Update each point in the group and repeat the fitting step until the boundary line of the target scene is obtained.
[0072] According to the straight line fitting method, a corresponding point updating method is selected to update each point in the group to obtain updated points in the group, and then the fitting step is continued based on the updated points in the group.
[0073] In an example implementation, when the initial points i, j, and k are the first, second, and third points in a plurality of boundary points arranged in sequence, and if point k is the last boundary point in the plurality of boundary points, straight line fitting is completed to obtain the boundary line of the target scene, and the boundary line of the target scene is expressed as a polygon.
[0074] The solution proposed in this application is a straight line fitting method based on angle and height. By introducing the judgment of triangle height, it avoids centralized fitting with too few points and large errors caused by too long line segments, achieving faster and more accurate straight line fitting. By integrating the straight line fitting method with angle and triangle height, this application can achieve a faster scene boundary generation method. At the same time, the generated scene boundary has higher accuracy and fewer fitting points.
[0075] Based on the embodiment described in Figure 1 above, the embodiment of the present application also provides another method for generating scene boundary lines. As shown in Figures 2 and 3, the above step 105 determines three target points based on the number of elements in the preset first set and each point in the group, and performs straight line fitting based on the height of the triangle formed by the three target points, which specifically includes the following steps.
[0076] Step 301: If the number of elements in the preset first set is less than or equal to a preset lower number threshold, the three target points are determined to be point i, point j, and point k.
[0077] The preset low quantity threshold is a fixed value preset by the ground mobile robot.
[0078] Step 302: If the height of the triangle formed by point i, point j, and point k is greater than or equal to a preset height threshold, point i and point j are connected to complete a straight line fitting.
[0079] In the embodiment of the present application, the height of the triangle is the height of the longest side of the triangle. Of course, it can also be the height corresponding to other sides, and there is no specific limitation in the embodiment of the present application.
[0080] In a special case, if the number of elements in the preset first set is equal to 3, and the number of elements in the preset first set is less than or equal to the preset lower number threshold, and the angles between point i and point j, and point i and point k are greater than the preset angle threshold, then the triangle height is not judged, and point i and point j are directly connected to complete a straight line fitting.
[0081] The above step 106, updating each point in the group, includes:
[0082] Let i=j, j=j+1, k=j+1, that is, let point j be the new point i, the new point j be the next digit after the new point i, and the new point k be the next digit after the new point j.
[0083] In an exemplary implementation, when point i, point j, and point k are the fifth, sixth, and seventh points in a plurality of boundary points arranged in sequence, each point in the group after updating may be the sixth, seventh, and eighth point in the plurality of boundary points.
[0084] This updating method is only applicable to the case where the number of elements in the preset first set is less than or equal to the preset low number threshold, and the height of the triangle formed by point i, point j, and point k is greater than or equal to the preset height threshold.
[0085] In the solution of the present application, when the number of boundary points on the sub-boundary line is less than a preset value, the height of the figure formed by the starting point and end point of the sub-boundary line and the boundary points on the next segment of the boundary line is greater than the preset height value. The end point of the sub-boundary line is the starting point of the next segment of the sub-boundary line, and the boundary point on the next segment of the sub-boundary line is the next boundary point located after the starting point of the next segment of the sub-boundary line. That is, when the number of elements in the preset first set is less than or equal to the preset low number threshold, and the height of the triangle formed by point i, point j, and point k is greater than or equal to the preset height threshold, the fitting condition is met, and a straight line fitting is completed by connecting point i and point j, and then the points in the group are updated by the corresponding update method, and then the fitting step is continued to achieve straight line fitting under specific circumstances.
[0086] Based on the embodiment described in FIG3 above, the embodiment of the present application further provides another scene boundary line generation method, as shown in FIG2 , which specifically includes the following steps.
[0087] If the height of the triangle formed by point i, point j, and point k is less than the preset height threshold, the above step 106 updates each point in the group, including: setting k = k + 1, that is, moving point k one position back, and leaving point i and point j unchanged, that is, the height of the figure formed by the starting point and end point of the sub-boundary line and the boundary points between the starting point and end point of the boundary line is not greater than the preset height value.
[0088] In the embodiment of the present application, if the height of the triangle formed by point i, point j, and point k is less than the preset height threshold, it means that the angle fitting is unsuccessful, and the result is overfitting caused by too little data and too short line segments, so it needs to be discarded.
[0089] In one exemplary implementation, when point i, point j, and point k are the fifth, sixth, and ninth points in a sequentially arranged set of boundary points, each point in the updated set may be the fifth, sixth, and tenth point in the set of boundary points, wherein the positions of point i and point j remain unchanged.
[0090] This updating method is only applicable to the case where the number of elements in the preset first set is less than or equal to the preset low number threshold, and the height of the triangle formed by point i, point j, and point k is less than the preset height threshold.
[0091] In the solution of the present application, when the number of elements in the preset first set is less than or equal to the preset low number threshold, and the height of the triangle formed by point i, point j, and point k is less than the preset height threshold, the fitting condition is not met, and the points in the group are updated by the corresponding update method, and then the fitting step is continued, thereby realizing the straight line fitting judgment in specific circumstances.
[0092] Based on the embodiment described in Figure 1 above, the embodiment of the present application also provides another method for generating scene boundary lines. As shown in Figures 4 and 2, the above step 105 determines three target points based on the number of elements in the preset first set and each point in the group, and performs straight line fitting based on the height of the triangle formed by the three target points, which specifically includes the following steps.
[0093] Step 401: If the number of elements in the preset first set is greater than or equal to the preset high number threshold, that is, the number of boundary points on the sub-boundary line is greater than or equal to the preset maximum value, the three target points are determined to be point i, point k-1, and point k.
[0094] In an embodiment of the present application, the preset high quantity threshold is greater than the preset low quantity threshold, and the preset high quantity threshold is a fixed value preset by the ground mobile robot.
[0095] Wherein, point k-1 is the previous point of point k. For example, when point k is the fifth point among the plurality of boundary points arranged in sequence, point k-1 is the fourth point among the plurality of boundary points arranged in sequence.
[0096] Step 402: If the height of the triangle formed by point i, point k-1, and point k is less than a preset height threshold, point i and point k are connected to complete a straight line fitting.
[0097] If the height of the triangle formed by point i, point k-1, and point k is less than the preset height threshold, it indicates that the fitting condition is met. At this time, point i and point k can be connected to complete a straight line fitting.
[0098] The above step 106, updating each point in the group, includes:
[0099] Clear the preset first set, let i=k, j=i+1, k=j+1, that is, let point k be the new point i, the new point j be the next digit after the new point i, and the new point k be the next digit after the new point j.
[0100] If a straight line fitting is completed, the points in the preset first set are added to the preset second set, and then the points in the preset first set are cleared. After clearing, the points in the set are continuously updated.
[0101] In an exemplary implementation, when point i, point j, and point k are the fifth, sixth, and ninth points in a plurality of boundary points arranged in sequence, each point in the group after updating may be the ninth, tenth, and eleventh point in the plurality of boundary points.
[0102] This updating method is only applicable to the case where the number of elements in the preset first set is greater than or equal to the preset high number threshold and the height of the triangle formed by point i, point k-1, and point k is less than the preset height threshold.
[0103] In the solution of the present application, when the number of elements in the preset first set is greater than or equal to the preset high number threshold, and the height of the triangle formed by point i, point k-1, and point k is less than the preset height threshold, the fitting condition is met, and a straight line fitting is completed by connecting point i and point k, and then the points in the group are updated by the corresponding update method, and then the fitting step is continued to achieve straight line fitting in specific circumstances.
[0104] Based on the embodiment described in FIG3 above, the embodiment of the present application further provides another scene boundary line generation method, as shown in FIG2 , which specifically includes the following steps.
[0105] If the height of the triangle formed by point i, point k-1, and point k is greater than or equal to the preset height threshold, keep point i unchanged and update points k-1 and point k until the height of the triangle formed by point i, point k-1, and point k is less than the preset height threshold, connect point i and point k, complete a straight line fitting, and then update each point in the group, including: clearing the preset first collection, setting i=k, j=i+1, k=j+1.
[0106] In the embodiment of the present application, if the height of the triangle formed by point i, point k-1, and point k is greater than or equal to the preset height threshold, it means that the angle fitting is unsuccessful and the points need to be updated before performing straight line fitting.
[0107] The principle of updating the point here is: let k = k-1, that is, let point k-1 be the new point k, and the new point k-1 is the previous one of the new point k.
[0108] In one exemplary implementation, when point i, point k-1, and point k are the third, sixth, and seventh points in a sequentially arranged set of boundary points, the updated point may be the third, fifth, and sixth points in the set of boundary points, wherein the position of point i remains unchanged.
[0109] If the height of the triangle formed by the updated points i, k-1, and k is less than the preset height threshold, connect points i and k, complete a straight line fit, and then continue to determine the angle. Otherwise, if the height of the triangle formed by the updated points i, k-1, and k is greater than or equal to the preset height threshold, continue updating until the height of the triangle formed by the updated points i, k-1, and k is less than the preset height threshold, connect points i and k, complete a straight line fit, update each point in the group, and then continue to determine the angle.
[0110] This updating method is only applicable when the number of elements in the preset first set is greater than or equal to the preset high number threshold, and the height of the triangle formed by point i, point k-1, and point k is greater than or equal to the preset height threshold.
[0111] In the solution of the present application, when the number of elements in the preset first set is greater than or equal to the preset high number threshold, and the height of the triangle formed by point i, point k-1, and point k is greater than or equal to the preset height threshold, the fitting condition is not met. By updating the points in the group, point i, point k-1, and point k meet the fitting condition, and point i and point k are connected to complete a straight line fitting, and then the update step is continued to be executed, thereby realizing straight line fitting in specific circumstances.
[0112] Based on the embodiment described in Figure 1 above, the embodiment of the present application also provides another method for generating scene boundary lines, as shown in Figure 2. In the above step 105, three target points are determined based on the number of elements in the preset first set and each point in the group, and a straight line fitting is performed based on the height of the triangle formed by the three target points, which specifically includes the following steps.
[0113] If the number of elements in the preset first set is greater than the preset lower number threshold and less than the upper number threshold, determine the point k-1 before point k, connect point i and point k-1, and complete a straight line fitting.
[0114] In an embodiment of the present application, if the number of elements in the preset first set is between the preset lower number threshold and the preset upper number threshold, then point i and point k-1 are connected to complete a straight line fitting, and no judgment is made based on the triangle height, thereby reducing unnecessary calculations and improving judgment efficiency.
[0115] The above step 106 updates each point in the group, including: clearing the preset first set, setting i=k-1, j=i+1, k=j+1, that is, setting point k-1 to be the new point i, the new point j to be the next digit after the new point i, and the new point k to be the next digit after the new point j.
[0116] In the solution of the present application, when the number of elements in the preset first set is greater than the preset lower number threshold and less than the upper number threshold, it means that the fitting conditions are met through angle judgment, point i and point k-1 are fitted, and each point in the group is updated, which reduces the calculation time of triangle height judgment and improves fitting efficiency.
[0117] On the basis of the above embodiments, the embodiment of the present application specifically explains the solution of the present application through a specific example, as shown in FIG5 .
[0118] After the initial points i, j, and k are judged by the included angle and the preset angle threshold, the included angle formed by points i, j, and k shown in Figure 5 is greater than or equal to the preset angle threshold. At this time, the number of elements in the preset first set is 5, and 5 is greater than or equal to the preset high number threshold. The three target points are determined to be points i, k-1, and k. The height h of the triangle formed by points i, k-1, and k is calculated. If h is less than the preset height threshold, point i and point k are connected to complete a straight line fitting. The preset first set is cleared, and i=k, j=i+1, k=j+1 is set, that is, point k is the new point i, the new point j is the next digit after the new point i, and the new point k is the next digit after the new point j. The fitting step is continued.
[0119] The steps of the various methods above are divided only for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0120] An embodiment of the present application relates to a scene boundary line generating device. The details of the scene boundary line generating device of this embodiment are specifically described below. The following content is only the implementation details provided for easy understanding and is not necessary for implementing this example. Figure 6 is a schematic diagram of the scene boundary line generating device provided in an embodiment of the present application, including: an acquisition module 601, a selection module 602 and a fitting module 603, and an acquisition module 604.
[0121] The acquisition module 601 is configured to acquire a plurality of boundary points arranged in sequence from a detection route of a ground mobile robot for a target scene boundary.
[0122] The selection module 602 is configured to obtain a plurality of boundary points arranged in sequence from a detection route of the ground mobile robot for the boundary of the target scene.
[0123] The first calculation module 603 is used to obtain the position information of each point in the group in the coordinate system of the target scene, and calculate the angle formed by each point in the group according to the position information of each point in the group.
[0124] The second calculation module 604 is used to add point k to the preset first set if the angle is less than the preset angle threshold, set k=k+1, and calculate the number of elements in the preset first set until the angle formed by points i, j, and k is greater than or equal to the preset angle threshold, or until the number of elements in the preset first set is greater than or equal to the preset high number threshold.
[0125] Obtain module 605, which is used to determine three target points based on the number of elements in the preset first set and each point in the group, and perform straight line fitting based on the height of the triangle formed by the three target points; update each point in the group, and repeat the fitting steps until the boundary line of the target scene is obtained.
[0126] Optionally, module 605 is obtained, which is specifically used to determine that the three target points are point i, point j, and point k if the number of elements in the preset first set is less than or equal to a preset low number threshold; if the height of the triangle formed by point i, point j, and point k is greater than or equal to the preset height threshold, connect point i and point j to complete a straight line fitting; update each point in the group, including: let i=j, j=i+1, k=k+1, that is, let point j be the new point i, the new point j be the next digit after the new point i, and the new point k be the next digit after the new point k.
[0127] Optionally, module 605 is obtained, which is also used to not perform straight line fitting if the height of the triangle formed by point i, point j, and point k is less than a preset height threshold; update each point in the group, including: setting k=k+1, that is, moving point k back one position, and point i and point j remain unchanged.
[0128] Optionally, module 605 is obtained, which is specifically used to determine the three target points as point i, point k-1, and point k if the number of elements in the preset first set is greater than or equal to the preset high number threshold; if the height of the triangle formed by point i, point k-1, and point k is less than the preset height threshold, connect point i and point k to complete a straight line fitting; the updated points in the group include: clearing the preset first set, setting i=k, j=i+1, k=j+1, that is, setting point k to be the new point i, the new point j to be the next digit after the new point i, and the new point k to be the next digit after the new point j.
[0129] Optionally, a module 505 is obtained, which is specifically used to keep point i unchanged and update point k-1 and point k if the height of the triangle formed by point i, point k-1, and point k is greater than or equal to a preset height threshold, until the height of the triangle formed by the updated point i, point k-1, and point k is less than the preset height threshold, connect point i and point k, and complete a straight line fit. Updating each point in the group includes: clearing the preset first collection, setting i=k, j=i+1, k=j+1. Updating point k-1 and point k includes: setting k=k-1, that is, setting point k-1 to be the new point k, and the new point k-1 to be the previous digit of the new point k.
[0130] Optionally, module 605 is obtained, which is specifically used to determine the point k-1 before point k if the number of elements in the preset first set is greater than the preset low number threshold and less than the preset high number threshold, connect point i and point k-1, and complete a straight line fitting; update each point in the group, including: clearing the preset first set, setting i=k-1, j=i+1, k=j+1, that is, setting point k-1 as the new point i, the new point j as the next digit of the new point i, and the new point k as the next digit of the new point j.
[0131] Optionally, the acquisition module 601 is specifically configured to sample from a detection route of the ground mobile robot for the boundary of the target scene according to a preset interval distance, and acquire a plurality of boundary points arranged in sequence.
[0132] It is not difficult to find that this embodiment is an apparatus embodiment corresponding to the above-mentioned method embodiment, and this embodiment can be implemented in conjunction with the above-mentioned method embodiment. The relevant technical details and technical effects mentioned in the above-mentioned embodiment are still valid in this embodiment, and to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above-mentioned embodiment.
[0133] An embodiment of the present application relates to a ground mobile robot, as shown in Figure 7, comprising: at least one processor 701; and a memory 702 communicatively connected to the at least one processor 701; wherein the memory 702 stores instructions that can be executed by the at least one processor 701, and the instructions are executed by the at least one processor 701 so that the at least one processor 701 can execute the scene boundary line generation method in the above-mentioned embodiments.
[0134] The memory 702 and processor 701 are connected using a bus. The bus may include any number of interconnected buses and bridges, connecting various circuits of one or more processors and memories. The bus may also connect various other circuits, such as peripheral devices, which are well known in the art and are not further described herein.
[0135] The embodiments of the present application relate to a computer-readable storage medium storing a computer program, which implements the above-mentioned method embodiments when executed by a processor.
[0136] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0137] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.
Claims
1. A method for generating a scene boundary line, characterized in that, The boundary line includes a plurality of sub-boundary lines, and the method includes: Determining the sub-boundary lines segment by segment according to a preset strategy, where the lengths of each sub-boundary lines are the same or different; Wherein, the preset strategy includes: sequentially obtaining boundary points one by one, and determining the starting point and the ending point of the sub-boundary line according to at least one of the angle and the height of the figure formed by the boundary points; performing linear fitting on the boundary points between the starting point and the ending point to obtain the sub-boundary line.
2. The method according to claim 1, characterized in that, When the number of boundary points on the sub-boundary line is less than a preset value, the height of the figure formed by the starting point and the ending point of the sub-boundary line and the boundary points on the next segment of the boundary line is greater than a preset height value.
3. The method according to claim 2, wherein The ending point of the sub-boundary line is the starting point of the next sub-boundary line, and the boundary points on the next sub-boundary line are the next boundary point located after the starting point of the next sub-boundary line.
4. The method according to claim 1, wherein When the number of boundary points on the sub-boundary line is not less than a preset value, The starting angle of the figure formed by the boundary points is less than or equal to a preset angle value, or the height of the figure formed by the starting point and the ending point of the sub-boundary line and the boundary points between the starting point and the ending point of the boundary line is not greater than a preset height value.
5. The method according to claim 4, wherein The height of the figure formed by the starting point and the ending point of the sub-boundary line and the boundary points on the next segment of the boundary line is greater than a preset height value; Or, in the figure formed by the starting point and the ending point of the sub-boundary line and the boundary points on the next segment of the boundary line, the angle of the starting point is greater than a preset angle value; Or, the number of boundary points on the sub-boundary line is greater than or equal to a preset maximum value.
6. The method according to claim 4 or 5, characterized in that, The height is the value of the height corresponding to the line connecting the starting point and the ending point of the boundary line as the base.
7. The method according to claim 1, characterized in that The figure is a triangle, or there is an inflection point between adjacent sub-boundary lines.
8. The method according to claim 7, wherein The sequentially obtaining boundary points one by one includes: sampling at a preset interval distance from the detection route of the ground mobile robot for the target scene boundary, and obtaining a plurality of boundary points arranged in sequence.
9. A ground mobile robot, characterized in that It includes: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the scene boundary line generation method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that When the computer program is executed by a processor, it implements the scene boundary line generation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Point cloud boundary fitting system and method
CN105719348A
Robot control method, robot, electronic device and readable storage medium
CN111531536A
Mobile robot, edge moving method thereof and computer storage medium
CN114265405A
Scene boundary line generation method, ground mobile robot and storage medium
CN118012046A
System and Method for Fitting Edge of Point Cloud Data
TW201643820A