Obstacle position marking method and obstacle position representing method based on laser radar
Through lidar rotation scanning and laser point cloud analysis, the location of obstacles is accurately judged and marked, and the problem of misjudgment of obstacle positions in the prior art is solved, and the accuracy of robot obstacle avoidance is improved.
Patent Information
- Application Number
- CN202310688445.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, when a robot walks along the wall or the edge of furniture, low obstacle detection can easily lead to misjudgment of obstacle positions, and it is impossible to accurately distinguish between isolated obstacles, resulting in inaccurate obstacle avoidance operations.
The laser point cloud is obtained through the rotational scanning of the lidar. The points of the same obstacle are judged based on the positional relationship between adjacent laser points, and the location of the obstacle is marked by the distance between the laser point and the center of the robot body, accurately divide the positions of each obstacle to reduce the number of points and the locations of the obstacles. Misjudgment.
It improves the accuracy of judging obstacle positions, at least to a single laser point, enhances the accuracy of the robot's obstacle avoidance, and reduces misjudgment of obstacle positions.
Smart Images

Figure CN119126146A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of laser radar detection, and in particular to an obstacle position marking method based on laser radar and an obstacle position representation method based on laser radar. Background Art
[0002] When the robot walks along the wall or the edge of the furniture leg, it can detect obstacles in front through a variety of sensors. Generally, for low obstacles, the robot detects them through collision sensors, and can judge the situation of the obstacle based on the number and direction of the collision signal fed back when the robot collides. The robot will also judge the situation of the obstacle through the point cloud projected by the laser radar on the obstacle. Generally, laser sensors are used to scan at a large angle range, and a large amount of point cloud data will be obtained. Then, a large amount of point cloud data will be linearly fitted, which can easily fit the contours of multiple isolated obstacles into a straight line representing the position of an obstacle. The position of the obstacle will be misjudged, which is not suitable for the robot to perform obstacle avoidance operations in a timely manner. Summary of the invention
[0003] The present application discloses a laser radar-based obstacle position marking method and a laser radar-based obstacle position representation method. The specific technical solutions are as follows:
[0004] The obstacle position marking method based on laser radar comprises: step A, the robot uses laser radar to rotate and scan to obtain a valid laser point cloud; step B, according to the position relationship between two adjacent laser points in the valid laser point cloud, the laser points on the same obstacle are judged; step C, among the laser points on the same obstacle judged in step B, the laser points used to represent the same obstacle position are marked based on the distance between the laser point and the body center of the robot, so that the laser points used to represent the positions of various obstacles are divided by repeatedly executing steps B and C.
[0005] This technical solution first determines the laser points on the same obstacle from the effective laser point cloud based on the positional relationship between two adjacent laser points, and then determines the laser points used to represent the same obstacle position based on the distance between the laser point and the center of the robot body. On this basis, the laser points representing the positions of various obstacles can be saved, and the positions of various obstacles are located at different positions of the robot. Therefore, before the robot starts to move, the effective laser point cloud scanned by the laser radar is used to divide the laser points representing the positions of a single or multiple obstacles, so that the robot can distinguish obstacles in different positions. Without adding collision sensors or contact obstacles to the body, the positions of obstacles at multiple angles around the body are located by the screened laser points. Therefore, compared with the prior art method of fitting the contour of at least one isolated obstacle into a straight line representing the position of an obstacle, the position of the obstacle is judged with higher accuracy, at least accurate enough to be represented by a single laser point, thereby improving the accuracy of the robot triggering obstacle avoidance.
[0006] Furthermore, in step B, the method for determining the laser points located on the same obstacle based on the positional relationship between two adjacent laser points in the effective laser point cloud includes: in the effective laser point cloud obtained in step A, calculating the plane projection distance between two adjacent laser points, and then determining whether the plane projection distance between the two adjacent laser points is less than a preset projection distance; the plane projection distance between the two adjacent laser points is the distance formed by the two adjacent laser points in the walking plane of the robot; when it is determined that the plane projection distance between the two adjacent laser points is less than the preset projection distance, it is determined that the two adjacent laser points are located on the same obstacle. This technical solution utilizes the positional relationship between two adjacent laser points to determine the laser points located on the same obstacle, realizes orderly processing of a batch of discretely distributed laser points according to the continuity of position distribution, and improves the efficiency of positioning the effective laser point cloud.
[0007] Furthermore, the step B specifically includes: step B1, controlling the laser radar to emit a laser line, rotating and scanning a laser point cloud, and then screening out laser points in a target circular area with the center of the body as the center in the laser point cloud to form a valid laser point cloud; then traversing each laser point in the valid laser point cloud in turn; the radius of the target circular area is greater than the radius of the body and less than the maximum scanning radius of the laser radar; step B2, in the valid laser point cloud, each time a laser point is traversed, the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is calculated; step B3, judging the distance between the currently traversed laser point and its adjacent Whether the plane projection distance between a laser point that has not been traversed is less than the preset projection distance, if so, it is determined that the currently traversed laser and an adjacent laser point that has not been traversed are located in the same obstacle, otherwise it is determined that the currently traversed laser and an adjacent laser point that has not been traversed are located in different obstacles respectively; step B4, updating an adjacent laser point that has not been traversed to the currently traversed laser point as the currently traversed laser point, and then repeating step B2 and step B3 until all laser points in the valid laser point cloud are calculated and judged, and it is determined that the laser points located in different obstacles are divided from the valid laser point cloud. Therefore, compared with the prior art method of fitting a large amount of point cloud data into a straight line representing the position of an obstacle, the present technical solution can divide the laser points that fall into different obstacles from the effective laser point cloud, that is, obtain the point cloud information of obstacles distributed in various directions within the target circle, at least accurately enough to be represented by a single laser point, thereby realizing the distinction of the obstacle occupied areas at different directions of the robot in the effective laser point cloud scanned by the laser radar according to the positional relationship between two adjacent laser points, thereby reducing the misjudgment of the obstacle position.
[0008] Furthermore, in step C, among the laser points on the same obstacle, a laser point closest to the center of the body is selected and marked as the laser point used to indicate the position of the same obstacle, and the two-dimensional plane coordinates of the laser point used to indicate the position of the same obstacle are set as the position coordinates of the obstacle where it is located; wherein, the laser point closest to the center of the body refers to a laser point whose projection position is closest to the center of the body in the walking plane of the robot; the center of the body is the origin of the robot coordinate system. In the process of repeatedly executing steps B2 to B3, the laser points used to indicate the positions of different obstacles and the position coordinates of different obstacles in the target circular area are obtained in turn. Representing the positions of various obstacles around the robot can also reduce the blind spots on the sides of the obstacles when the robot moves close to the obstacles.
[0009] Furthermore, in step B2 and step B3, the currently traversed laser point and an adjacent laser point that has not been traversed are two laser points with adjacent distribution positions in the laser point cloud, wherein the traversal sequence number of the laser point that has not been traversed is greater than the traversal sequence number of the laser point that has been traversed, so that the traversal order of each laser point or each laser point pair in the effective laser point cloud is controllable, thereby improving the calculation efficiency of step B2 and the judgment efficiency of step B3.
[0010] The obstacle position representation method based on laser radar comprises: the robot uses laser radar to collect laser points in the target circular area, and then determines the laser points on the same obstacle according to the positional relationship between any two laser points collected, and then marks the laser points used to represent the same obstacle position according to the distance between the laser points on the same obstacle and the robot's body center. The technical scheme first determines the laser points on the same obstacle from the effective laser point cloud according to the positional relationship between any two laser points, and then determines the laser points used to represent the same obstacle position based on the distance between the laser points and the robot's body center. On this basis, the laser points representing the positions of each obstacle can be saved, and each obstacle position is located at a different orientation of the robot. Therefore, before the robot starts to move, the effective laser point cloud scanned by the laser radar is used to divide the laser points representing the positions of a single or multiple obstacles, and the robot can be controlled to distinguish different obstacles in all directions according to any traversal order of the laser points. Without adding collision sensors or contact obstacles to the body, the obstacle position at each angle of the target circular area can be traversed and determined by laser points one by one.
[0011] Compared with the defect of the prior art that the contours of multiple isolated obstacles are easily fitted into a straight line representing the position of an obstacle during the linear fitting process of a large amount of point cloud data, the present technical solution has a higher accuracy in judging the position of the obstacle, at least accurate enough to be represented by a single laser point, thereby improving the accuracy of the robot triggering obstacle avoidance.
[0012] Furthermore, the obstacle position representation method specifically includes: step 11, controlling the laser radar to rotate and scan out a laser point cloud, and then in the laser point cloud, screening out the laser points in the target circle with the center of the body as the center of the circle to form a valid laser point cloud; then in the valid laser point cloud, traversing each laser point in the target circle in turn; step 12, in the valid laser point cloud, each time a laser point is traversed, the currently traversed laser point is marked as the currently traversed target laser point, and any other laser point is marked as a candidate laser point; then traversing the marked candidate laser points, and calculating the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point; step 13, each time a candidate laser point is traversed, judging whether the currently traversed Whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance, if so, it is determined that the currently traversed target laser point and the currently traversed candidate laser point are located at the same obstacle, and the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair located at the same obstacle, otherwise, the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair that has been determined; step 14, repeatedly executing steps 12 and 13 until the plane projection distance between any two laser points in the valid laser point cloud is calculated and all laser point pairs located at the same obstacle are determined, so as to realize dividing the valid laser point cloud into laser point pairs located in different obstacles in sequence.
[0013] Furthermore, in the laser point pairs in each obstacle divided in step 14, the laser points included in each laser point pair in the same obstacle are used to form a laser point cloud for representing the position of the same obstacle; then, in the laser point cloud for representing the position of the same obstacle, a laser point closest to the center of the body is selected as the laser point for representing the position of the same obstacle, and the two-dimensional plane coordinates of the laser point for representing the position of the same obstacle are set as the position coordinates of the obstacle. Thus, in the process of repeatedly executing steps 12 to 13, the laser points for representing the positions of different obstacles and the position coordinates of different obstacles in the target circular area are obtained in sequence.
[0014] Furthermore, in the currently executed step 13, after determining whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance, a laser point pair located at the same obstacle or a laser point pair that has been determined is marked; then the candidate laser point of the next traversal is updated to the currently traversed candidate laser point, and step 13 is executed again until the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is determined; while the currently traversed target laser point remains unchanged, after traversing all the candidate laser points marked in step 12 and calculating the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12, the laser point of the next traversal is updated to the currently traversed target laser point, and step 12 is executed again to update all candidate laser points. The technical solution traverses all the laser points in the valid laser point cloud in sequence by cyclically executing step 12 and step 13, and calculates the plane projection distance between any two laser points in the valid laser point cloud in sequence and determines all laser point pairs located in the same obstacle, thereby realizing the division of the valid laser point cloud into laser point pairs located in different obstacles in sequence.
[0015] Furthermore, when the currently traversed target laser point remains unchanged, if it is determined in the repeated execution of step 13 that the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is greater than or equal to the preset projection distance, it is determined that the currently traversed target laser point and the candidate laser point marked in step 12 are respectively in different obstacles. Compared with the technical defect of the prior art that the contours of multiple isolated obstacles are easily fitted into a straight line representing the position of an obstacle during the linear fitting of a large amount of point cloud data, the present technical solution has a higher accuracy in determining the position of the obstacle, at least accurate enough to compare laser points one by one, and improves the accuracy of marking the obstacle position by calculating the plane projection distance between any two laser points.
[0016] Furthermore, whenever it is determined that the plane projection distance between a target laser point in a laser point pair located on the same obstacle and a candidate laser point marked in the same executed step 12 is less than the preset projection distance, the target laser point currently involved in the judgment and the candidate laser point marked in the same executed step 12 are marked as a laser point pair located on the same obstacle, and then the pre-determined laser point pair located on the same obstacle and the currently marked laser point pair located on the same obstacle where the target laser point is located are set as two laser point pairs located on the same obstacle, and the pre-determined laser point pair located on the same obstacle and the candidate laser point marked in the same executed step 12 constitute a part of the laser points on the same obstacle. Thus, by repeatedly executing steps 12 and 13, a laser point pair located on the same obstacle and a laser point pair located on the same obstacle are used to form a complete laser point cloud located on the same obstacle, so that each laser point pair in the effective laser point cloud is processed in a certain traversal order, and any two laser points are divided into a corresponding obstacle in a more comprehensive and orderly manner. Compared with the defect of the prior art that the outlines of multiple isolated obstacles are easily fitted into a straight line representing the position of an obstacle during the linear fitting process of a large amount of point cloud data, this embodiment has a higher accuracy in judging the position of obstacles, at least accurate enough to mark the positions of multiple obstacles with paired laser points, thereby improving the robot's accuracy in locating obstacles in multiple directions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 An embodiment of the present application discloses a schematic diagram of a robot scanning a laser point cloud of various obstacles within a target circular area.
[0018] Figure 2 Another embodiment of the present application discloses a flow chart of an obstacle position marking method based on laser radar.
[0019] Figure 3 It is a flowchart of another embodiment of the present application that discloses a method for representing the position of an obstacle based on a laser radar. DETAILED DESCRIPTION
[0020] In order to more clearly illustrate the present invention, specific embodiments are given below for further explanation. In the following description, for illustration rather than for limitation, specific details such as specific system structure, technology and the like are proposed, so as to thoroughly understand the present application embodiments. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, the detailed description of well-known systems, devices, circuits and methods is omitted to prevent unnecessary details from hindering the description of the present application.
[0021] As an embodiment, a method for marking obstacle positions based on laser radar is disclosed, see Figure 2 It can be seen that the obstacle position marking method includes:
[0022] Step A: The robot uses a laser radar to rotate and scan to obtain a valid laser point cloud. Specifically, the laser radar rotates and scans laser points in a 360-degree direction at a position, and then selects the point cloud in the target circular area with the center of the body as the center as the valid laser point cloud, reducing the accuracy error of the data collected by the laser radar. Among them, the coverage range of the target circular area is larger than the body coverage range of the robot, and smaller than the maximum scanning coverage range of the laser radar; so that the target circular area can cover the partial outline or the entire outline of the obstacle at at least one angle around the robot, or the collision-free area.
[0023] Step B: Determine the laser points on the same obstacle according to the positional relationship between two adjacent laser points in the effective laser point cloud, and then filter out all laser points on an obstacle in one direction from the effective laser point cloud; thereby determining the laser points on the same obstacle according to the positional relationship between the laser points in the effective laser point cloud, which can also be regarded as all the laser points required for fitting an obstacle.
[0024] Preferably, the same obstacle mentioned in step B can specifically be an irregularly shaped obstacle other than a straight wall, a box, or a door sill, such as a toy ball, a cylindrical table or chair leg, or pet excrement, and the positions they occupy can be represented by laser points, that is, by a two-dimensional coordinate position; when the robot approaches this type of obstacle, the laser radar can mark its partial curved contour or discretely distributed point cloud on the grid map.
[0025] Step C, among the laser points on the same obstacle determined in step B, based on the distance between the laser point and the body center of the robot, marking the laser point used to represent the same obstacle position, that is, determining the laser point used to represent an obstacle position, which is a laser point including the three-dimensional coordinates of the laser point, generally the laser point closest to the body center; by repeatedly executing step B and step C, the laser points on different obstacles are orderly divided, and the laser points used to represent the same obstacle position are marked among all the laser points on a single obstacle, so as to realize sequential division of the laser points representing the positions of the various obstacles, and in the case of an obstacle position in one orientation or an obstacle position representing one obstacle, the laser points representing the obstacle positions in different orientations are sequentially divided.
[0026] In summary, this embodiment will first determine the laser points on the same obstacle from the effective laser point cloud based on the positional relationship between two adjacent laser points, and then determine the laser points used to represent the same obstacle position based on the distance between the laser point and the center of the robot body. On this basis, the laser points representing the positions of each obstacle can be saved, and each obstacle position is located at a different position of the robot. Therefore, before the robot starts to move, the effective laser point cloud scanned by the laser radar is used to divide the laser points representing the positions of a single or multiple obstacles, so that the robot can distinguish obstacles in different positions. Without adding collision sensors or contacting obstacles to the body, the obstacle positions at multiple angles around the body are located by the screened laser points. Therefore, compared with the prior art method of fitting the contour of at least one isolated obstacle to a straight line representing the position of an obstacle, the position of the obstacle is judged with higher accuracy, at least accurate enough to be represented by a single laser point, thereby improving the accuracy of the robot triggering obstacle avoidance.
[0027] As an embodiment, in the step B, the method for determining the laser points located on the same obstacle based on the positional relationship between two adjacent laser points in the effective laser point cloud includes: in the effective laser point cloud obtained in the step A, calculating the plane projection distance between two adjacent laser points, which can be understood as the plane projection distance between two laser points with adjacent positions, wherein the plane projection distance between two laser points at different positions is the distance formed by the two laser points in the walking plane of the robot; when the plane projection distance between the two laser points is less than the preset projection distance, it is determined that the two laser points are located on the same obstacle. This embodiment utilizes the positional relationship between two adjacent laser points to determine the laser points located on the same obstacle, realizes orderly processing of a batch of discretely distributed laser points according to the continuity of position distribution, and improves the efficiency of the effective laser point cloud positioning.
[0028] Schematically, among two adjacent laser points, assuming that the three-dimensional coordinates of the first laser point are (x1, y1, z1), and the three-dimensional coordinates of the second laser point are (x2, y2, z2), the result of (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1) is set as the plane projection distance between the two adjacent laser points, and then, when (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)<20mm (the preferred value of the preset projection distance), it is considered that the first laser point and the second laser point are on the same obstacle, wherein the first laser point and the second laser point are regarded as two adjacent laser points in the valid laser point cloud.
[0029] In the effective laser point cloud obtained in step A, the two laser points at different positions to be calculated are preferably two laser points at adjacent positions, which are schematically represented as Figure 1 Any two adjacent laser points along the edge of obstacle #1, Figure 1 Any two adjacent laser points along the edge of obstacle #2, and Figure 1 Any two adjacent laser points along the edge of obstacle #3 are located within the target circle and are scanned by the laser radar. They are located within the walking plane of the non-circular sweeping robot shown in the figure. The walking plane of the non-circular sweeping robot is regarded as Figure 1 The plane in which the YOX coordinate system is shown.
[0030] Generally, when a D-type sweeping robot encounters an irregular obstacle, it will turn immediately. At this time, there is a speed difference on both sides of the body. The side protrusions of the D-type sweeping robot (such as the protrusion structure at the junction of the front edge and the right edge of the body) are too close to the obstacle and are prone to collide with the obstacle, especially Figure 1 In the environment of isolated obstacles discretely distributed in multiple directions as shown, there is insufficient adjustment space on the front and rear sides or the left and right sides of the D-type sweeping robot, which causes the D-type sweeping robot to directly collide with obstacles during movement. Therefore, the robot disclosed in the present application can be represented by a non-circular sweeping robot, which is displayed as a D-type sweeping robot from a top view. It is necessary to mark laser points used to represent the position of the same obstacle before the robot moves by executing steps A to C included in the obstacle position marking method, thereby dividing the laser points used to represent the position of each obstacle by repeatedly executing steps B and C, so that the robot can plan the approximate range of the collision-free area.
[0031] As an embodiment, the step B specifically includes:
[0032] Step B1, control the laser radar to emit laser line, rotate and scan the laser point cloud, and then select the laser points in the target circle with the center of the body as the center of the circle from the laser point cloud to form a valid laser point cloud; specifically, it is equivalent to scanning the target circle with the center of the body as the center of the circle, obtaining laser points in 360-degree angle directions to form a valid laser point cloud; because the point cloud data collected by the laser radar has accuracy errors, and the farther the laser point is from the center of the body, the greater the error, so when using the laser radar to mark obstacles, only the laser point cloud within a certain radius of the center of the body is used as Figure 1 The effective data of obstacles marked in the target circular area shown, i.e., the effective laser point cloud, the maximum distance between the edge point of the robot and the center of the body (expressed by the body radius) is less than the certain radius, the certain radius is less than the maximum scanning radius of the laser radar, and can also meet the point cloud data accuracy allowed by the laser radar or the grid resolution requirement for building a laser grid map; then traverse each laser point in the effective laser point cloud in turn. Then execute step B2.
[0033] Correspondingly, Figure 1 The laser points collected by the non-circular sweeping robot at position O are discrete points on the contour lines of obstacles #1, #2 and #3 projected by the laser line. Each discrete point can be transformed into the robot coordinate system. If the origin of the robot coordinate system is the center of the body, the straight-line distance between the corresponding discrete point and the center O of the body is calculated using the transformed coordinates of each discrete point in the robot coordinate system.
[0034] Step B2: In the effective laser point cloud, each time a laser point is traversed, the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is calculated, and then step B3 is executed. The effective laser point cloud can be regarded as a point cloud in which multiple collected laser points in the target circular area are distributed according to predetermined positions. Then, the currently traversed laser point and an adjacent laser point that has not been traversed can be extracted according to the positional proximity relationship, and the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is calculated.
[0035] Step B3, determine whether the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is less than the preset projection distance, if yes, determine that the currently traversed laser and an adjacent laser point that has not been traversed are located in the same obstacle, otherwise determine that the currently traversed laser and an adjacent laser point that has not been traversed are located in different obstacles, which can also be regarded as obstacles in different directions. Then execute step B4, that is, determine that the currently traversed laser and an adjacent laser point that has not been traversed are located in the same obstacle, or determine that the currently traversed laser and an adjacent laser point that has not been traversed are located in different obstacles, and then execute step B4.
[0036] Step B4, updating a laser point adjacent to the currently traversed laser point that has not been traversed as the currently traversed laser point, and then repeating step B2 and step B3 until all laser points in the valid laser point cloud are calculated and judged, and it is determined that the laser points located in different obstacles are divided from the valid laser point cloud, that is, the laser points located in obstacles at different directions, and the number of laser points in obstacles at each direction is not limited to 1.
[0037] Specifically, after determining that the currently traversed laser point and an adjacent laser point that has not been traversed are both located at the same obstacle, or are located at different obstacles respectively, an adjacent laser point that has not been traversed to the currently traversed laser point is updated to the currently traversed laser point, and then step B2 and step B3 are repeated until all laser points in the valid laser point cloud in step B1 are calculated and judged. In this embodiment, the two laser points involved in calculating the plane projection distance will be marked as two laser points that have been traversed after the judgment of step B3, so as to prevent repeated traversal in the subsequent repeated execution of steps B2 to B4; then, an adjacent laser point that has not been traversed can be extracted to continue to calculate the new plane projection distance according to the positional relationship and accept the judgment of step B3. On this basis, by repeatedly executing steps B2 to B4 until all laser points in the effective laser point cloud are calculated and judged, it is determined that all laser points in the effective laser point cloud have been traversed. Therefore, compared with the prior art method of fitting a large amount of point cloud data into a straight line representing the position of an obstacle, the present embodiment can divide the laser points falling into different obstacles from the effective laser point cloud, that is, obtain the point cloud information of obstacles distributed in various directions within the target circular area, at least accurately represented by a single laser point, so as to realize the distinction of the obstacle occupation area at different directions of the robot in the effective laser point cloud scanned by the laser radar according to the positional relationship between the two adjacent laser points, thereby reducing the misjudgment of the obstacle position.
[0038] Based on steps B1 to B4 of the above embodiment, after the robot divides all the laser points located at different obstacles by executing step B4, among the laser points located at the same obstacle divided in step B4, a laser point closest to the center of the body is selected as the laser point used to represent the position of the same obstacle; the laser point closest to the center of the body here is for the same obstacle, and is the closest laser point in the plane projection distance; and the two-dimensional plane coordinates of the laser point used to represent the position of the same obstacle are set to the position coordinates of the obstacle where it is located, and in the process of repeatedly executing steps B2 to B3, the laser points used to represent the positions of different obstacles and the position coordinates of different obstacles in the target circular area are obtained in sequence. Then, the position coordinates of each obstacle set are filled into the storage queue in sequence to record the positions of all obstacles in the target circular area, representing the positions of each obstacle around the robot, and can also reduce the blind spots existing on the side of the obstacle when the robot moves close to the obstacle.
[0039] It should be noted that the aforementioned laser point closest to the body center refers to a laser point whose projection position is closest to the body center within the robot's walking plane; the body center is the origin of the robot coordinate system, which can be expressed as the current position of the robot; the XOY coordinate plane of the robot coordinate system is parallel to the robot's walking plane, and the positive direction of the horizontal axis (X-axis) of the robot coordinate system represents the current moving direction of the robot, and is set to be parallel to the robot's body centerline.
[0040] In some embodiments, in step B2 and step B3, the currently traversed laser point and an adjacent laser point that has not been traversed are two laser points with adjacent distribution positions in the effective laser point cloud, and are configured to have a sequential traversal order, wherein the traversal sequence number of the laser point that has not been traversed is greater than the traversal sequence number of the laser point that has been traversed. This makes the traversal order of each laser point or each laser point pair in the effective laser point cloud controllable, thereby improving the calculation efficiency of step B2 and the judgment efficiency of step B3.
[0041] In step B3 that is executed multiple times in succession, it is determined that the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is less than the preset projection distance, and then all laser points located in the same obstacle can be obtained and marked as traversed laser points in the valid laser point cloud in sequence. When it is determined that the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is greater than the preset projection distance, the adjacent laser point that has not been traversed is divided into a laser point located in a new obstacle, that is, it is determined that the currently traversed laser point and an adjacent laser point that has not been traversed are located in different obstacles. Then in step B4, an untraversed laser point adjacent to the currently traversed laser point is updated as the currently traversed laser point, and step B2 and step B3 are repeated to sequentially determine all laser points located at a new obstacle until all laser points in the valid laser point cloud are traversed, and the plane projection distance between each two adjacent laser points is calculated and determined, thereby achieving the division of the laser points of the valid laser point cloud into laser points located in different obstacles.
[0042] This application also discloses a method for representing obstacle positions based on laser radar, see Figure 3It can be seen that the obstacle position representation method includes: the robot uses a laser radar to collect laser points within a target circular area, wherein the target circular area is preferably a partial outline or a full outline of an obstacle or a collision-free area that can cover at least one angle around the robot. Then, the laser points on the same obstacle are determined based on the positional relationship between any two collected laser points; each time, the positional relationship between two different laser points that have not been traversed is determined to achieve the screening of all laser points on obstacles in various directions from the effective laser point cloud. Then, according to the distance between the laser points on the same obstacle and the body center of the robot, the laser points used to represent the position of the same obstacle are marked, that is, the laser point used to represent the position of an obstacle is determined to be a laser point, including the three-dimensional coordinates of the laser point, which is generally the laser point closest to the body center. Thus, the laser points on different obstacles are divided from the effective laser point cloud, and the laser points used to represent the position of the same obstacle are marked among all the laser points on a single obstacle. This embodiment will first determine the laser points on the same obstacle from the effective laser point cloud based on the positional relationship between any two laser points, and then determine the laser points used to represent the same obstacle position based on the distance between the laser point and the center of the robot body. On this basis, the laser points representing the positions of each obstacle can be saved, and the positions of each obstacle are located at different positions of the robot. Therefore, before the robot starts to move, the effective laser point cloud scanned by the laser radar is used to divide the laser points representing the positions of a single or multiple obstacles. The robot can be controlled to distinguish different obstacles in all directions according to any traversal order of the laser points. Without adding collision sensors or contact obstacles to the body, the laser points are traversed one by one and the obstacle positions at each angle of the target circle are determined. Compared with the defect of the prior art that the contours of multiple isolated obstacles are easily fitted into a straight line representing the position of an obstacle in the process of linear fitting of a large amount of point cloud data, this embodiment has a higher judgment accuracy for the position of the obstacle, at least accurate enough to be represented by a single laser point, thereby improving the accuracy of the robot triggering obstacle avoidance.
[0043] As an embodiment, the obstacle position representation method specifically includes:
[0044] Step 11: Control the laser radar to rotate and scan the laser point cloud, and then select the laser points in the target circular area with the center of the body as the center in the laser point cloud to form a valid laser point cloud; then, in the valid laser point cloud, traverse each laser point in the target circular area in turn. Then execute step 12.
[0045] It should be noted that due to the accuracy error of the point cloud data collected by the laser radar, and the farther the laser point is from the center of the body, the greater the error, so when using the laser radar to mark obstacles, only the laser point cloud within a certain radius of the center of the body is used as Figure 1 The effective data of obstacles marked in the target circle shown, that is, the effective laser point cloud, the maximum distance between the edge point of the robot and the center of the body (expressed by the body radius) is less than the certain radius, and the certain radius is less than the maximum scanning radius of the laser radar. It can also meet the point cloud data accuracy allowed by the laser radar or the grid resolution requirement for constructing a laser grid map.
[0046] Step 12, in the valid laser point cloud, each time a laser point is traversed, the currently traversed laser point is marked as the currently traversed target laser point, and any other laser point is marked as a candidate laser point. When step 12 is executed for the first time, the candidate laser points are all laser points that have not been traversed; the marked candidate laser points are traversed again, and the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is calculated; then step 13 is executed. The plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point includes two laser points that are adjacent in position and two laser points that are not adjacent in position. Among the two laser points, one is a traversed laser point and the other is a laser point that has not been traversed. Preferably, the two laser points are not allowed to be both traversed laser points.
[0047] Step 13: Each time a candidate laser point is traversed, it is determined whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance. If so, it is determined that the currently traversed target laser point and the currently traversed candidate laser point are located in the same obstacle, and the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair located in the same obstacle; otherwise, the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair that has been determined, but it has not yet been determined that they are located in the same obstacle, and it is still necessary to continue to traverse other laser points and make judgments to improve the accuracy of obstacle position judgment. Then execute step 14.
[0048] Step 14, repeating steps 12 and 13 until the plane projection distance between any two laser points in the valid laser point cloud is calculated and all laser point pairs located in the same obstacle are determined. In step 14, specifically, any candidate laser point that has not been traversed is first updated to the candidate laser point currently traversed, and then step 13 is repeated until all candidate laser points marked in step 12 are traversed, and then any laser point that has not been traversed is updated to the target laser point currently traversed, and then steps 12 and 13 are repeated until all laser points in the valid laser point cloud are traversed in sequence, and on this basis, the plane projection distance between any two laser points in the valid laser point cloud is also calculated and all laser point pairs located in the same obstacle are determined, so as to realize the division of the valid laser point cloud into laser point pairs located in different obstacles in sequence.
[0049] Based on the above embodiment, in the laser point pairs in each obstacle divided in step 14, the laser points included in each laser point pair in the same obstacle are used to form a laser point cloud for representing the position of the same obstacle; then in the laser point cloud for representing the position of the same obstacle, a laser point closest to the center of the body is selected as the laser point for representing the position of the same obstacle, wherein the laser point closest to the center of the body here is for the same obstacle, and is the closest laser point in the plane projection distance; and the two-dimensional plane coordinates of the laser point for representing the position of the same obstacle are set as the position coordinates of the obstacle; in the process of repeatedly executing steps 12 to 13, the laser points for representing the positions of different obstacles and the position coordinates of different obstacles in the target circular area are obtained in sequence. Then the position coordinates of each obstacle set are filled into the storage queue in sequence to record the positions of all obstacles in the target circular area, representing the positions of each obstacle around the robot, and can also reduce the blind spots existing on the side of the obstacle when the robot approaches the obstacle, and avoid the robot directly hitting the obstacle in the corresponding direction during the turning process.
[0050] Optionally, the position coordinates of each obstacle set are sequentially filled into a storage queue to record the positions of all obstacles within the target circular area.
[0051] It should be noted that the aforementioned laser point closest to the body center refers to a laser point whose projection position is closest to the body center within the robot's walking plane; the body center is the origin of the robot coordinate system, which can be expressed as the current position of the robot; the XOY coordinate plane of the robot coordinate system is parallel to the robot's walking plane, and the positive direction of the horizontal axis (X-axis) of the robot coordinate system represents the current moving direction of the robot, and is set to be parallel to the robot's body centerline.
[0052] In some embodiments, in the currently executed step 13, after determining whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance, a laser point pair located at the same obstacle or a laser point pair that has been determined is marked; then the candidate laser point of the next traversal is updated to the candidate laser point of the current traversal; then step 13 is repeated once until the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is determined; thereby, when the currently traversed target laser point remains unchanged, the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is determined in sequence by repeating step 13. Specifically, when the currently traversed target laser point remains unchanged, after traversing all the candidate laser points marked in step 12 and calculating the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12, the laser point of the next traversal is updated to the currently traversed target laser point, step 12 is executed again to update all candidate laser points, and a new round of steps 12 and 13 is repeated. By looping through step 12 and step 13, all laser points in the valid laser point cloud are traversed in sequence, and the plane projection distance between any two laser points in the valid laser point cloud is calculated in sequence, and all laser point pairs located in the same obstacle are determined, so that the valid laser point cloud is divided into laser point pairs located in different obstacles in sequence.
[0053] In some embodiments, when the target laser point currently traversed disclosed in step 12 remains unchanged, if it is determined in the repeated execution of step 13 that the plane projection distance between the target laser point currently traversed and each candidate laser point marked in step 12 is greater than or equal to the preset projection distance, it is determined that the target laser point currently traversed and the candidate laser point marked in step 12 are respectively in different obstacles, and the preset projection distance is preferably 20 mm, that is, the obstacle into which the target laser point currently traversed falls is different from the obstacle into which the candidate laser points marked in step 12 fall, and are respectively located in different directions relative to the body center of the robot. Compared with the technical defect of the prior art that the contours of multiple obstacles isolated from each other are easily fitted into a straight line representing the position of an obstacle in the process of linear fitting of a large amount of point cloud data, the present embodiment has a higher accuracy in judging the position of the obstacle, at least accurate enough to compare laser points one by one, and improves the accuracy of marking the position of the obstacle by calculating the plane projection distance between any two laser points.
[0054] In the above embodiment, whenever it is determined that the plane projection distance between a target laser point in a laser point pair located on the same obstacle and a candidate laser point marked in step 12 executed at the same time is less than the preset projection distance, a target laser point currently involved in the judgment and a candidate laser point marked in step 12 executed at the same time are marked as a laser point pair located on the same obstacle, and then a laser point pair located on the same obstacle and a laser point pair currently marked are set as two laser point pairs located on the same obstacle, and a laser point pair located on the same obstacle and a candidate laser point marked in step 12 executed at the same time constitute a part of the laser points on the same obstacle, and some repeated laser points may not be included therein; at this time, it is determined that a laser point pair located on the same obstacle and a laser point pair located on the same obstacle and a laser point pair currently marked are both located in the same obstacle. Thus, by repeatedly executing step 12 and step 13, a laser point pair located at the same obstacle that is pre-determined and a laser point pair located at the same obstacle that is currently marked are used to form a complete laser point cloud located at the same obstacle, so that each laser point pair in the effective laser point cloud is processed in a certain order of traversal, and any two laser points are divided into corresponding obstacles in a more comprehensive and orderly manner. Compared with the defect of the prior art that the contours of multiple isolated obstacles are easily fitted into a straight line representing the position of an obstacle during the linear fitting of a large amount of point cloud data, the present embodiment has a higher accuracy in determining the position of the obstacle, at least accurate enough to mark the positions of multiple obstacles with paired laser points, thereby improving the accuracy of the robot in locating obstacles in multiple directions.
[0055] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several embodiments of the present invention, and their descriptions are relatively specific and detailed, but they cannot be understood as limitations on the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of this application, several modifications and improvements can be made, which all belong to the scope of protection of this application.
Claims
1. Obstacle location marking method based on LiDAR, It is characterized in that The obstacle position marking method comprises: Step A: The robot uses the laser radar to rotate and scan to obtain a valid laser point cloud; Step B: according to the positional relationship between two adjacent laser points in the effective laser point cloud, determine the laser points on the same obstacle; Step C, among the laser points on the same obstacle determined in step B, the laser points used to represent the same obstacle position are marked based on the distance between the laser points and the body center of the robot, thereby dividing the laser points used to represent the positions of various obstacles by repeatedly executing steps B and C.
2. The obstacle position marking method according to claim 1, It is characterized in that In the step B, the method for determining the laser points on the same obstacle according to the positional relationship between two adjacent laser points in the effective laser point cloud includes: In the effective laser point cloud obtained in step A, the plane projection distance between two adjacent laser points is calculated, and then it is determined whether the plane projection distance between the two adjacent laser points is less than the preset projection distance; the plane projection distance between the two adjacent laser points is the distance formed by the two adjacent laser points in the walking plane of the robot; When it is determined that the plane projection distance between the two adjacent laser points is less than the preset projection distance, it is determined that the two adjacent laser points are located at the same obstacle.
3. The obstacle position marking method according to claim 2, It is characterized in that The step B specifically comprises: Step B1, control the laser radar to emit laser lines, rotate and scan to generate a laser point cloud, and then select the laser points in the target circle with the center of the body as the center from the laser point cloud to form a valid laser point cloud; then traverse each laser point in the valid laser point cloud in turn; the radius of the target circle is greater than the radius of the body and less than the maximum scanning radius of the laser radar; Step B2, in the valid laser point cloud, each time a laser point is traversed, the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is calculated; Step B3, determining whether the plane projection distance between the currently traversed laser point and an adjacent laser point that has not been traversed is less than a preset projection distance, if so, determining that the currently traversed laser and an adjacent laser point that has not been traversed are located in the same obstacle, otherwise determining that the currently traversed laser and an adjacent laser point that has not been traversed are located in different obstacles respectively; Step B4, updating a laser point adjacent to the currently traversed laser point that has not been traversed as the currently traversed laser point, and then repeating step B2 and step B3 until all laser points in the valid laser point cloud are calculated and judged, and the laser points located in different obstacles are determined to be divided from the valid laser point cloud.
4. The obstacle position marking method according to claim 3, It is characterized in that In step C, among the laser points on the same obstacle, a laser point closest to the center of the aircraft is selected and marked as the laser point used to indicate the position of the same obstacle, and the two-dimensional plane coordinates of the laser point used to indicate the position of the same obstacle are set as the position coordinates of the obstacle where it is located; The laser point closest to the center of the robot body refers to a laser point whose projection position is closest to the center of the robot body in the walking plane of the robot; the center of the robot body is the origin of the robot coordinate system.
5. The obstacle position marking method according to claim 4, It is characterized in that In step B2 and step B3, the currently traversed laser point and an adjacent laser point that has not been traversed are two laser points with adjacent distribution positions in the laser point cloud, wherein the traversal sequence number of the laser point that has not been traversed is greater than the traversal sequence number of the laser point that has been traversed.
6. Obstacle position representation method based on LiDAR, It is characterized in that The obstacle position representation method comprises: The robot uses a laser radar to collect laser points within the target circle, and then determines the laser points on the same obstacle based on the positional relationship between any two collected laser points. Then, the laser points used to indicate the position of the same obstacle are marked based on the distance between the laser points on the same obstacle and the center of the robot's body.
7. The obstacle position representation method according to claim 6, It is characterized in that The obstacle position representation method specifically includes: Step 11, control the laser radar to rotate and scan the laser point cloud, and then select the laser points in the target circular area with the center of the body as the center in the laser point cloud to form a valid laser point cloud; then, in the valid laser point cloud, traverse each laser point in the target circular area in turn; Step 12: In the valid laser point cloud, each time a laser point is traversed, the currently traversed laser point is marked as the currently traversed target laser point, and any other laser point is marked as a candidate laser point; then the marked candidate laser points are traversed, and the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is calculated; Step 13: Each time a candidate laser point is traversed, it is determined whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance. If yes, it is determined that the currently traversed target laser point and the currently traversed candidate laser point are located at the same obstacle, and the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair located at the same obstacle. Otherwise, the currently traversed target laser point and the currently traversed candidate laser point are marked as a laser point pair that has been determined. Step 14, repeating steps 12 and 13 until the plane projection distance between any two laser points in the valid laser point cloud is calculated and all laser point pairs located in the same obstacle are determined, so as to divide the valid laser point cloud into laser point pairs located in different obstacles in turn.
8. The obstacle position representation method according to claim 7, It is characterized in that In the laser point pairs in each obstacle divided in step 14, the laser points included in each laser point pair in the same obstacle are combined to form a laser point cloud for representing the position of the same obstacle; then, in the laser point cloud for representing the position of the same obstacle, a laser point closest to the center of the body is selected as the laser point for representing the position of the same obstacle, and the two-dimensional plane coordinates of the laser point for representing the position of the same obstacle are set as the position coordinates of the obstacle.
9. The method for representing the position of an obstacle according to claim 8, It is characterized in that In the currently executed step 13, after determining whether the plane projection distance between the currently traversed target laser point and the currently traversed candidate laser point is less than the preset projection distance, a laser point pair located at the same obstacle or a laser point pair that has been determined is marked; then the candidate laser point of the next traversal is updated to the candidate laser point of the current traversal, and step 13 is executed again until the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is determined; While the currently traversed target laser point remains unchanged, after traversing all candidate laser points marked in step 12 and calculating the planar projection distance between the currently traversed target laser point and each candidate laser point marked in step 12, the laser point of the next traversal is updated to the currently traversed target laser point, and step 12 is executed again to update all candidate laser points.
10. The obstacle position representation method according to claim 9, It is characterized in that When the currently traversed target laser point remains unchanged, if it is determined in the repeated execution of step 13 that the plane projection distance between the currently traversed target laser point and each candidate laser point marked in step 12 is greater than or equal to the preset projection distance, it is determined that the currently traversed target laser point and the candidate laser point marked in step 12 are respectively in different obstacles.
11. The obstacle position representation method according to claim 9, It is characterized in that Whenever it is determined that the plane projection distance between a target laser point in a laser point pair located on the same obstacle and a candidate laser point marked in step 12 executed at the same time is less than the preset projection distance, a target laser point currently involved in the judgment and a candidate laser point marked in step 12 executed at the same time are marked as a laser point pair located on the same obstacle, and then a laser point pair located on the same obstacle that is pre-determined and where the target laser point is located and a laser point pair located on the same obstacle that is currently marked are set as two laser point pairs located on the same obstacle, and a laser point pair located on the same obstacle that is pre-determined and a candidate laser point marked in step 12 executed at the same time constitute a part of the laser points on the same obstacle.
