Two-dimensional laser point cloud-based mapping method, electronic device, and readable storage medium
By obtaining the pitch and roll angles of the two-dimensional laser point cloud, determining the tilt angle and direction, and filtering out erroneous point clouds, the problem of inaccurate positioning of two-dimensional laser point clouds in slope areas is solved, accurate positioning is achieved, overlapping images are reduced, and the user experience is improved.
Patent Information
- Application Number
- PCT/CN2024/143556
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-22
- Filing Date
- 2024-12-28
- Publication Date
- 2025-09-25
AI Technical Summary
The existing two-dimensional laser point cloud leads to inaccurate positioning when the robot tilts, and the constructed map has problems such as overlapping images.
By obtaining the pitch and roll angles of the electronic device, the tilt angle and direction are determined, the laser point cloud hitting the ground is filtered out, and the valid point cloud is retained for map construction.
It improves the positioning accuracy of electronic devices in sloped areas, reduces image overlap problems, and enhances user experience.
Smart Images

Figure CN2024143556_25092025_PF_FP_ABST
Abstract
Description
Mapping method, electronic device and readable storage medium based on two-dimensional laser point cloud
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 22, 2024, with application number 202410345105.4 and invention name “Mapping method, electronic device and readable storage medium based on two-dimensional laser point cloud”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application belongs to the field of terminal technology, and in particular relates to a mapping method, device, electronic device and computer-readable storage medium based on two-dimensional laser point cloud. Background Art
[0003] Two-dimensional (2D) lasers are commonly used for mapping and positioning in mobile robots, such as small commercial cleaning robots or household sweeping robots. When the robot tilts, some of the 2D laser point cloud will hit the ground, forming erroneous feature points. Using these erroneous feature points for mapping and positioning can lead to inaccurate positioning and even overlapping images in the constructed map. Technical issues
[0004] The embodiments of the present application provide a mapping method, device, electronic device, and computer-readable storage medium based on two-dimensional laser point clouds, which can reduce problems such as overlapping in the constructed maps, enable electronic devices to be accurately positioned even in sloped areas, improve the accuracy of electronic device positioning, and enhance user experience. Technical Solutions
[0005] In a first aspect, an embodiment of the present application provides a mapping method based on a two-dimensional laser point cloud, comprising:
[0006] Obtaining a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud;
[0007] determining a first tilt angle and a first tilt direction of the electronic device according to the first pitch angle and the first roll angle;
[0008] When it is determined that the electronic device is located in a slope area based on the first tilt angle and the first posture, the first two-dimensional laser point cloud is filtered according to the first tilt angle and the tilt direction, and a map is constructed based on the filtered first two-dimensional laser point cloud.
[0009] In the above-mentioned two-dimensional laser point cloud mapping method, the electronic device can obtain the first pitch angle, the first roll angle, and the first pose when the electronic device collects the first two-dimensional laser point cloud, and can determine the first tilt angle and tilt direction of the electronic device based on the first pitch angle and the first roll angle. Subsequently, the electronic device can determine whether the electronic device is located in a slope area based on the first tilt angle and the first pose. When it is determined that the electronic device is located in a slope area, the electronic device can filter the first two-dimensional laser point cloud based on the first tilt angle and the tilt direction, and construct a map based on the filtered first two-dimensional laser point cloud, so that when it is determined that the electronic device is located in a slope area, the two-dimensional laser point cloud that is hit on the ground can be accurately filtered out based on the first tilt angle and the tilt direction, and other correct and valid two-dimensional laser point clouds can be retained, so that the map can be constructed based on the other correct and valid two-dimensional laser point clouds, which can reduce the problem of overlapping images in the constructed map, so that the electronic device can be accurately located even when it is in a slope area, thereby improving the accuracy of the electronic device positioning and enhancing the user experience.
[0010] In a possible implementation, the method may further include:
[0011] Acquiring a second pitch angle, a second roll angle, and a second posture when the electronic device collects a second two-dimensional laser point cloud, where the second two-dimensional laser point cloud is a two-dimensional laser point cloud collected before the first two-dimensional laser point cloud;
[0012] determining a second tilt angle of the electronic device according to the second pitch angle and the second roll angle;
[0013] When both the first tilt angle and the second tilt angle are greater than a first threshold, determining an angle variance according to the first tilt angle and the second tilt angle;
[0014] Acquiring a speed of the electronic device from the time when the second two-dimensional laser point cloud is acquired to the time when the first two-dimensional laser point cloud is acquired;
[0015] Determining a predicted posture corresponding to the electronic device based on the second posture and the speed, and determining a posture difference between the first posture and the predicted posture;
[0016] When the angle variance is less than or equal to a second threshold, and the posture difference is less than or equal to a third threshold, it is determined that the electronic device is located in the slope area.
[0017] In one example, determining the first tilt angle and tilt direction of the electronic device according to the first pitch angle and the first roll angle may include:
[0018] The first tilt angle is determined according to the following formula: tilt=arccos(cos(pitch)×cos(roll));
[0019] Among them, tilt is the first tilt angle, pitch is the first pitch angle, and roll is the first roll angle.
[0020] In another example, determining the first tilt angle and tilt direction of the electronic device according to the first pitch angle and the first roll angle may include:
[0021] The tilt direction is determined according to the following formula:
[0022] Wherein, angle_tilt is the tilt direction, pitch is the first pitch angle, and roll is the first roll angle.
[0023] In a possible implementation, filtering the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction may include:
[0024] Determining an angle filtering interval according to the first tilt angle and the tilt direction, where the angle filtering interval is an angle interval corresponding to the two-dimensional laser point cloud to be filtered out;
[0025] The first two-dimensional laser point cloud is filtered according to the angle filtering interval.
[0026] Exemplarily, filtering the first two-dimensional laser point cloud according to the angle filtering interval may include:
[0027] Determining a tilt angle threshold corresponding to the electronic device;
[0028] When the first tilt angle is greater than the tilt angle threshold, determining a first angle according to the first tilt angle, the tilt direction, and the tilt angle threshold;
[0029] The angle filtering interval is determined according to the first angle and the tilt direction.
[0030] In a possible implementation, after constructing the map based on the filtered first two-dimensional laser point cloud, the method further includes:
[0031] The first posture is updated according to the Gauss-Newton method and the constructed map to obtain a target posture corresponding to the electronic device.
[0032] In a second aspect, an embodiment of the present application provides a mapping device based on a two-dimensional laser point cloud, comprising:
[0033] A first pose acquisition module is used to obtain a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud;
[0034] a tilt direction determining module, configured to determine a first tilt angle and a tilt direction of the electronic device according to the first pitch angle and the first roll angle;
[0035] A map construction module is used to filter the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction when it is determined that the electronic device is located in a slope area based on the first tilt angle and the first posture, and to construct a map based on the filtered first two-dimensional laser point cloud.
[0036] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the two-dimensional laser point cloud-based mapping method described in any one of the first aspects above.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a computer, the computer implements the two-dimensional laser point cloud-based mapping method described in any one of the first aspects above.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the two-dimensional laser point cloud-based mapping method described in any one of the first aspects above.
[0039] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] FIG1 is an exemplary diagram of an electronic device located in a sloped area;
[0042] FIG2 is a schematic flow chart of a mapping method based on a two-dimensional laser point cloud provided in an embodiment of the present application;
[0043] FIG3 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0044] FIG4 is a schematic flowchart of a method for determining whether an electronic device is located in a slope area according to an embodiment of the present application;
[0045] FIG5 is a schematic structural diagram of a mapping device based on a two-dimensional laser point cloud according to an embodiment of the present application;
[0046] FIG6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Modes for Carrying Out the Invention
[0047] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0049] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0050] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0052] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0053] Two-dimensional (2D) lasers are generally used for mapping and positioning of mobile robots, such as small commercial cleaning robots or household sweeping robots. When the robot tilts, as shown in Figure 1, when it is located on a slope, some of the 2D laser point cloud will be reflected on the ground, forming erroneous feature points. Using these erroneous feature points for mapping and positioning can result in inaccurate positioning and lead to overlapping images in the constructed map.
[0054] To avoid overlapping maps, the robot's state is typically determined using an inertial measurement unit (IMU). If the robot is detected to be tilted, mapping is not performed until the robot returns to a horizontal position, at which point mapping is resumed. While this approach can somewhat avoid overlapping maps, it can lead to inaccurate positioning when the robot is tilted, impacting the user experience.
[0055] To address the aforementioned issues, embodiments of the present application provide a mapping method, apparatus, electronic device, and computer-readable storage medium based on a two-dimensional laser point cloud. In this method, an electronic device can obtain a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud, and determine a first tilt angle and tilt direction of the electronic device based on the first pitch angle and the first roll angle. Subsequently, the electronic device can determine whether the electronic device is located in a sloped area based on the first tilt angle and the first pose. When the electronic device is determined to be located in a sloped area, the electronic device can filter the first two-dimensional laser point cloud based on the first tilt angle and the tilt direction, and construct a map based on the filtered first two-dimensional laser point cloud. When the electronic device is determined to be located in a sloped area, the electronic device can accurately filter out the two-dimensional laser point cloud that is impacted on the ground based on the first tilt angle and the tilt direction, retaining other valid two-dimensional laser point clouds. Map construction can then be performed based on the other valid two-dimensional laser point clouds, reducing issues such as overlapping images in the constructed map. This allows accurate positioning of the electronic device even in a sloped area, improving positioning accuracy and enhancing user experience, resulting in enhanced usability and practicality.
[0056] The two-dimensional laser point cloud-based mapping method provided in the embodiments of the present application can be applied to electronic devices that can perform map construction, such as robots, robotic arms, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, and the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0057] The following will describe in detail the two-dimensional laser point cloud-based mapping method provided in the embodiments of the present application in combination with the accompanying drawings and specific application scenarios.
[0058] Please refer to Figure 2, which shows a schematic flow chart of a two-dimensional laser point cloud-based mapping method provided in an embodiment of the present application. The method can be applied to electronic devices, such as robots. As shown in Figure 2, the method may include:
[0059] S201: Obtain a first pitch angle, a first roll angle, and a first posture when the electronic device collects a first two-dimensional laser point cloud.
[0060] For example, the electronic device may be provided with a laser device, such as a laser radar, and may collect a two-dimensional laser point cloud through the laser device.
[0061] For example, an IMU may be provided in the electronic device, and the electronic device may obtain the pitch angle and roll angle of the electronic device when collecting a two-dimensional laser point cloud through the IMU.
[0062] In an embodiment of the present application, to facilitate subsequent analysis and processing, after obtaining the pitch angle and roll angle when the electronic device collects a two-dimensional laser point cloud, the pitch angle and roll angle can be converted to the body coordinate system (base_link) of the electronic device. Similarly, after obtaining the two-dimensional laser point cloud collected by the electronic device, the two-dimensional laser point cloud can be converted to the body coordinate system of the electronic device. For example, when the electronic device is a robot, the pitch angle, roll angle and two-dimensional laser point cloud can be converted to the robot body coordinate system.
[0063] It should be noted that the body coordinate system of the electronic device (such as the robot body coordinate system) can be specifically determined according to the actual scene, and the embodiments of the present application do not impose any restrictions on this. For example, the robot body coordinate system can be a coordinate system established with the center point of the robot as the origin, the forward direction of the robot as the x-axis, the vertical direction as the y-axis, and the right side of the robot as the z-axis. Similarly, the specific method of converting the pitch angle, roll angle and two-dimensional laser point cloud to the robot body coordinate system can be determined according to the actual scene, and the embodiments of the present application do not impose any restrictions on this.
[0064] For example, the electronic device may be provided with an odometry, through which the electronic device may obtain the position and posture of the electronic device when collecting the two-dimensional laser point cloud.
[0065] In the embodiment of the present application, the first two-dimensional laser point cloud may be a two-dimensional laser point cloud collected by an electronic device at time T1. In other words, the first pitch angle may be the pitch angle acquired by the IMU at time T1. The first roll angle may be the roll angle acquired by the IMU at time T1. The first pose may be the pose acquired by the odometer at time T1. It should be understood that time T1 may be any time and is not specifically limited in the embodiment of the present application.
[0066] S202: Determine a first tilt angle and a tilt direction of the electronic device according to the first pitch angle and the first roll angle.
[0067] In the embodiment of the present application, the first tilt angle of the electronic device may refer to the maximum tilt angle when the electronic device collects the first two-dimensional laser point cloud. The tilt direction of the electronic device may refer to the maximum tilt direction when the electronic device collects the first two-dimensional laser point cloud.
[0068] In one example, when the angle order of the laser point cloud is [-π, π], the electronic device can determine the tilt direction of the electronic device according to the following formula 1.
[0069] Wherein, angle_tilt is the tilt direction of the electronic device, pitch is the first pitch angle, and roll is the first roll angle.
[0070] Please refer to Figure 3, which shows a schematic diagram of an application scenario provided by an embodiment of the present application. This application scenario is exemplified by an example in which the electronic device is a robot and the angle order of the laser point cloud is [-π, π]. In this application scenario, the robot body coordinate system can be a coordinate system established with the center point of the robot as the origin, the robot's forward direction as the x-axis, the vertical direction as the y-axis, and the right side of the robot as the z-axis.
[0071] For example, when the first pitch angle and the first roll angle are both π / 4 when the robot collects the first two-dimensional laser point cloud, the tilt direction of the robot can be determined to be π / 4 according to the above formula (1). That is, as shown in Figure 3, the robot is tilted 45° in its forward direction, and the angle indicated by the arrow in Figure 3 is 45°.
[0072] In another example, when the angle order of the laser point cloud is [π, -π], the electronic device can determine the tilt direction of the electronic device according to the following formula 2.
[0073] For example, the electronic device may determine the first tilt angle tilt of the electronic device according to the following formula 3: tilt = arccos (cos (pitch) × cos (roll)). (Formula 3)
[0074] S203: Determine whether the electronic device is located in a slope area according to the first tilt angle and the first posture.
[0075] For example, the electronic device may obtain a second pitch angle, a second roll angle, and a second posture when the electronic device collects the second two-dimensional laser point cloud. Subsequently, the electronic device may determine the second tilt angle of the electronic device based on the second pitch angle and the second roll angle. When the first tilt angle and the second tilt angle are both greater than the first threshold, the electronic device may determine the angle variance based on the first tilt angle and the second tilt angle. In addition, the electronic device may also obtain the speed of the electronic device from the time when the second two-dimensional laser point cloud was collected to the time when the first two-dimensional laser point cloud was collected. Subsequently, the electronic device may determine the corresponding predicted posture of the electronic device based on the second posture and speed, and determine the posture difference between the first posture and the predicted posture, so as to determine whether the electronic device is located in a slope area based on the angle variance and the posture difference. When the angle variance is less than or equal to the second threshold, and the posture difference is less than or equal to the third threshold, the electronic device may determine that the electronic device is located in a slope area.
[0076] It should be understood that the first threshold, the second threshold and the third threshold can be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any limitations on this.
[0077] The second two-dimensional laser point cloud may be a two-dimensional laser point cloud collected by the electronic device before the first two-dimensional laser point cloud is collected. For example, the second two-dimensional laser point cloud may be a two-dimensional laser point cloud collected by the electronic device at time T2. Time T2 may be before time T1. That is, the second pitch angle may be the pitch angle acquired by the IMU at time T2. The second roll angle may be the roll angle acquired by the IMU at time T2. The second posture may be the posture acquired by the odometer at time T2.
[0078] In an embodiment of the present application, when the first tilt angle and the second tilt angle are both greater than the first threshold value, the electronic device may deem that the electronic device is in a tilted state when collecting the first two-dimensional laser point cloud and the second two-dimensional laser point cloud. At this time, the electronic device may determine the angle variance (i.e., the variance of the tilt angle) based on the first tilt angle and the second tilt angle, and determine whether the angle variance is less than or equal to the second threshold value, thereby determining whether the electronic device is currently in a stable tilt state. When the angle variance is less than or equal to the second threshold value, the electronic device may determine that the electronic device is currently in a stable tilt state.
[0079] When the electronic device is in a stable tilted state, it may be located on a slope, or may be tilted and stuck on an object, or may be in a slipping state. Therefore, in order to accurately determine whether the electronic device is located on a slope, the electronic device may also obtain the speed V(t) of the electronic device from the time when the second two-dimensional laser point cloud is collected (e.g., time T2) to the time when the first two-dimensional laser point cloud is collected (e.g., time T1).
[0080] It should be understood that during the movement of the electronic device from time T2 to time T1, the IMU of the electronic device can obtain the speed of the electronic device from time T2 to time T1 in real time. Therefore, the electronic device can obtain the speed from time T2 to time T1 from the IMU.
[0081] After obtaining the speed V(t) of the electronic device from time T2 to time T1, the electronic device can integrate the speed to obtain the displacement x, that is, Subsequently, the electronic device can determine the predicted posture corresponding to the electronic device based on the second posture and displacement x. After determining the predicted posture, the electronic device can determine the error between the first posture and the predicted posture, that is, it can determine the posture difference between the first posture and the predicted posture, and determine whether the posture difference is greater than a third threshold, so as to determine whether the electronic device is stuck on an object or in a slipping state. When the posture difference is less than or equal to the third threshold, the electronic device can determine that the electronic device is not stuck on an object and is not in a slipping state. At this time, the electronic device can determine that the electronic device is located in a slope area.
[0082] That is, when the angular variance corresponding to the first tilt angle and the second tilt angle is less than or equal to the second threshold, and the error between the predicted position determined based on the speed and the second position and the first position is less than or equal to the third threshold, the electronic device can determine that the electronic device is currently located in a slope area. When the angular variance corresponding to the first tilt angle and the second tilt angle is greater than the second threshold, or the error between the predicted position and the first position is greater than the third threshold, the electronic device can determine that the electronic device is not currently located in a slope area.
[0083] It should be noted that the posture may include position and attitude. Among them, the position in the predicted posture = the position in the second posture + x. The specific calculation method can be based on any existing calculation method, and the embodiments of the present application are not limited to this. For example, the displacement x can be decomposed into the displacement in the x-axis direction and the displacement in the y-axis direction, and the displacement of the displacement x in the x-axis direction can be added to the value of the position in the second posture in the x-axis direction, and the displacement of the displacement x in the y-axis direction can be added to the value of the position in the second posture in the y-axis direction to obtain the position in the predicted posture. The attitude in the predicted posture can be calculated based on the position in the predicted posture.
[0084] In one possible implementation, to accurately determine whether an electronic device is in a stable tilt state and whether it is located in a sloped area, the electronic device can determine whether the electronic device is in a stable tilt state based on the pitch angle and roll angle corresponding to multiple frames of two-dimensional laser point clouds, thereby accurately determining whether the electronic device is in a sloped area. The pitch angle corresponding to the two-dimensional laser point cloud refers to the pitch angle when the electronic device collects the two-dimensional laser point cloud, and the roll angle corresponding to the two-dimensional laser point cloud refers to the roll angle when the electronic device collects the two-dimensional laser point cloud.
[0085] It should be understood that the frequency of two-dimensional laser point cloud acquisition by the electronic device can be determined according to the actual scenario, and the embodiments of the present application do not impose specific restrictions on this.
[0086] Please refer to FIG. 4 , which shows a schematic flowchart of a method for determining whether an electronic device is located in a slope area according to an embodiment of the present application.
[0087] As shown in FIG4 , when the electronic device collects each frame of a two-dimensional laser point cloud, the electronic device can obtain the pitch angle and roll angle of each frame collected by the electronic device through the IMU, and can determine the tilt angle of the electronic device when collecting the two-dimensional laser point cloud based on the pitch angle and roll angle. Subsequently, the electronic device can determine whether the tilt angle is greater than a first threshold.
[0088] When the tilt angle of the electronic device when collecting the two-dimensional laser point cloud is greater than a first threshold, the electronic device may determine that the electronic device was in a tilted state when collecting the two-dimensional laser point cloud. In this case, the electronic device may store the tilt angle of the electronic device when collecting the two-dimensional laser point cloud. For example, the tilt angle of the electronic device when collecting the two-dimensional laser point cloud may be stored as a vector.
[0089] When the tilt angle when the electronic device collects the two-dimensional laser point cloud is less than or equal to the first threshold, the electronic device can determine that the electronic device is not in a tilted state when collecting the two-dimensional laser point cloud. At this time, the electronic device can delete all tilt angles saved in the vector, that is, the vector can be cleared.
[0090] The electronic device may determine whether the number of consecutive frames of the two-dimensional laser point cloud with tilt angles greater than a first threshold is greater than a preset number of frames, that is, whether the number of vectors stored has reached the preset number of frames.
[0091] When the tilt angles when the electronic device collects a continuous preset number of frames of two-dimensional laser point clouds are all greater than a first threshold, that is, when the number of vectors saved reaches the preset number of frames, the electronic device can determine that the electronic device may currently be in a stable tilt state. At this time, the electronic device can determine the angle variance based on the tilt angles when the electronic device collects these two-dimensional laser point clouds, and determine whether the angle variance is less than or equal to the second threshold.
[0092] When the angle variance is less than or equal to the second threshold, the electronic device can determine that the electronic device is currently in a stable tilted state. In this case, the electronic device can determine that the electronic device may be located in a sloped area, may be tilted and stuck on an object, or may be slipping. When the angle variance is greater than the second threshold, the electronic device can determine that the electronic device is not currently located in a sloped area.
[0093] In addition, the electronic device can obtain the pose when the electronic device collects the latest frame of two-dimensional laser point cloud (for example, the first two-dimensional laser point cloud mentioned above, for ease of understanding, the moment of obtaining the latest frame of two-dimensional laser point cloud can be determined as time T1) and the pose when the previous frame of two-dimensional laser point cloud before the first two-dimensional laser point cloud (for example, the second two-dimensional laser point cloud mentioned above, for ease of understanding, the moment of obtaining the previous frame of two-dimensional laser point cloud can be determined as time T2), and the speed from time T2 to time T1 can be obtained by the IMU to obtain the displacement from time T2 to time T1 based on the speed integral. Subsequently, the electronic device can determine the predicted pose based on the pose at time T2 and the displacement obtained based on the speed integral. After determining the predicted pose, the electronic device can determine the pose difference between the pose at time T1 and the predicted pose, and determine whether the pose difference between the pose at time T1 and the predicted pose is less than or equal to a third threshold. When it is determined that the pose difference between the pose at time T1 and the predicted pose is less than or equal to the third threshold, and the angular variance is less than or equal to the second threshold, the electronic device can determine that the electronic device is currently located in a slope area. When it is determined that the posture difference between the posture at time T1 and the predicted posture is greater than the third threshold, the electronic device may determine that the electronic device is not currently located in a slope area.
[0094] It should be understood that when the number of vectors saved is greater than the preset number of frames, the electronic device can delete the earliest saved tilt angle according to the saving time and retain the latest tilt angle to determine whether the electronic device is in a stable tilt state based on the latest tilt angle, thereby accurately determining whether the electronic device is in a slope area.
[0095] It should be noted that the preset number of frames can be determined according to the actual scene, and the embodiment of the present application does not impose any restrictions on this. For example, the preset number of frames can be determined according to the actual scene to be 10 frames, or the preset number of frames can be determined according to the actual scene to be 8 frames, and so on.
[0096] S204: When it is determined that the electronic device is located in a slope area according to the first tilt angle and the first posture, the first two-dimensional laser point cloud is filtered according to the first tilt angle and the tilt direction, and a map is constructed according to the filtered first two-dimensional laser point cloud.
[0097] In an embodiment of the present application, when it is determined that the electronic device is located in a slope area, the electronic device can filter the first two-dimensional laser point cloud according to the first tilt angle and tilt direction, that is, filter out erroneous or deformed two-dimensional laser point clouds (for example, two-dimensional laser point clouds projected on the ground), and retain correct and valid two-dimensional laser point clouds, so as to build a map based on the correct and valid two-dimensional laser point clouds to avoid problems such as overlapping images.
[0098] In one possible implementation, the electronic device may determine in advance a tilt angle threshold corresponding to the electronic device, and determine the tilt degree of the electronic device based on the tilt angle threshold and the first tilt angle, thereby determining whether filtering of the two-dimensional laser point cloud is required.
[0099] For example, when the first tilt angle is greater than the tilt angle threshold, the electronic device may determine that the tilt of the electronic device is large, and in this case, the electronic device may determine that filtering of the two-dimensional laser point cloud is required. When the first tilt angle is less than or equal to the tilt angle threshold, the electronic device may determine that the tilt of the electronic device is small, and in this case, the electronic device may determine that filtering of the two-dimensional laser point cloud is not required.
[0100] That is, after determining the first tilt angle, the electronic device can determine whether filtering of the two-dimensional laser point cloud is required based on the first tilt angle and the tilt angle threshold. When it is determined that filtering of the two-dimensional laser point cloud is required, the electronic device can determine an angle filtering interval based on the first tilt angle and the tilt direction, and perform filtering of the two-dimensional laser point cloud based on the angle filtering interval. When it is determined that filtering of the two-dimensional laser point cloud is not required, the electronic device does not need to determine an angle filtering interval.
[0101] In an example, the laser device in the electronic device may be a horizontally mounted laser device, and the electronic device may determine the tilt angle threshold according to an installation height and a maximum distance corresponding to the laser device.
[0102] It should be understood that the installation height may refer to the distance between the laser device and the lowest point of the electronic device. For example, when the electronic device is located on the ground, the lowest point of the electronic device may coincide with the ground. In this case, the corresponding installation height of the laser device may refer to the distance between the laser device and the ground. The corresponding maximum distance of the laser device may refer to the maximum range of the laser device, that is, the farthest distance the laser can reach.
[0103] Optionally, the electronic device may determine the tilt angle threshold according to the following formula 4.
[0104] Wherein, h_laser is the installation height corresponding to the laser device, which can be expressed in meters (m), and range_max is the maximum distance corresponding to the laser device.
[0105] For example, the electronic device may determine the first angle according to the first tilt angle, the tilt direction, and the tilt angle threshold, and then determine the angle filtering interval according to the first angle and the tilt direction.
[0106] Exemplarily, the electronic device may determine the angle filtering interval as (tilt direction - first angle, tilt direction + first angle).
[0107] Exemplarily, the electronic device may determine the first angle according to the following formula 5:
[0108] Wherein, θ is the first angle, tilt is the first tilt angle, tilt_min is the tilt angle threshold, and angle_tilt is the tilt direction.
[0109] In an embodiment of the present application, after determining the angle filtering interval, the electronic device can determine the angle corresponding to each first two-dimensional laser point cloud, so as to determine the first two-dimensional laser point cloud located within the angle filtering interval based on the angle corresponding to each first two-dimensional laser point cloud, and can filter out the first two-dimensional laser point cloud located within the angle filtering interval. For example, the range of the first two-dimensional laser point cloud located within the angle filtering interval can be set to 0 to obtain a two-dimensional laser point cloud that is filtered out due to inclination and reaches the ground.
[0110] For example, in the scenario shown in Figure 3, when the tilt direction is determined to be π / 4, assuming that the electronic device determines the first angle θ to be 20° based on the first tilt angle, tilt direction and tilt angle threshold, the electronic device can determine the angle filtering interval to be (45°-20°, 45°+20°), that is, the angle filtering interval can be (25°, 65°). The electronic device can find all first two-dimensional laser point clouds with angles at (25°, 65°), and can filter these first two-dimensional laser point clouds to obtain the first two-dimensional laser point clouds that are filtered out due to the tilt of the electronic device and hit the ground. Then, the electronic device can construct a map based on the first two-dimensional laser point cloud that has been filtered out due to the tilt of the electronic device and hit the ground.
[0111] S205: When it is determined that the electronic device is not located in a slope area according to the first tilt angle and the first posture, construct a map according to the first two-dimensional laser point cloud.
[0112] That is to say, after determining the first tilt angle, the electronic device can determine whether the electronic device is located in a slope area based on the first tilt angle and the first posture. When it is determined that the electronic device is located in a slope area, the electronic device can filter the first two-dimensional laser point cloud based on the first tilt angle and the tilt direction, that is, filter out erroneous or deformed two-dimensional laser point clouds (such as two-dimensional laser point clouds projected on the ground), retain the correct and valid two-dimensional laser point clouds for mapping or map updates, and avoid problems such as overlapping maps. When it is determined that the electronic device is not located in a slope area, the electronic device can map or update the map based on the first two-dimensional laser point cloud.
[0113] In one possible implementation, after constructing a map based on the filtered first two-dimensional laser point cloud, the electronic device can update the current first posture of the electronic device according to the Gauss-Newton method and the constructed map to obtain the target posture of the electronic device, so that when the electronic device is in a slope area, the electronic device can be accurately positioned according to the map constructed from the two-dimensional laser point cloud after filtering out erroneous or deformed two-dimensional laser point clouds, thereby improving the accuracy of the electronic device positioning and enhancing the user experience.
[0114] It should be noted that the embodiment of the present application does not impose any specific restrictions on the content of obtaining the target posture by updating the current first posture of the electronic device according to the Gauss-Newton method and the constructed map. For details, please refer to the relevant content of positioning by the Gauss-Newton method in the prior art.
[0115] In an embodiment of the present application, the electronic device can obtain the first pitch angle, the first roll angle and the first posture when the electronic device collects the first two-dimensional laser point cloud, and can determine the first tilt angle and tilt direction of the electronic device based on the first pitch angle and the first roll angle. Subsequently, the electronic device can determine whether the electronic device is located in a slope area based on the first tilt angle and the first posture. When it is determined that the electronic device is located in a slope area, the electronic device can filter the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction, and construct a map based on the filtered first two-dimensional laser point cloud, so that when it is determined that the electronic device is located in a slope area, the two-dimensional laser point cloud that is hit on the ground can be accurately filtered out according to the first tilt angle and the tilt direction, and other correct and valid two-dimensional laser point clouds can be retained, so that a map can be constructed based on other correct and valid two-dimensional laser point clouds, which can reduce the problem of overlapping images in the constructed map, so that the electronic device can also be accurately positioned when it is in a slope area, thereby improving the accuracy of the electronic device positioning and enhancing the user experience.
[0116] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0117] Corresponding to the two-dimensional laser point cloud-based mapping method described in the above embodiment, Figure 5 shows a structural block diagram of the two-dimensional laser point cloud-based mapping device provided in the embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0118] Referring to FIG5 , the device comprises:
[0119] A first pose acquisition module 501 is used to acquire a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud;
[0120] a tilt direction determining module 502, configured to determine a first tilt angle and a first tilt direction of the electronic device according to the first pitch angle and the first roll angle;
[0121] The map construction module 503 is used to filter the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction when it is determined that the electronic device is located in a slope area based on the first tilt angle and the first posture, and to construct a map based on the filtered first two-dimensional laser point cloud.
[0122] In a possible implementation, the apparatus may further include:
[0123] a second posture acquisition module, configured to acquire a second pitch angle, a second roll angle, and a second posture when the electronic device collects a second two-dimensional laser point cloud, where the second two-dimensional laser point cloud is a two-dimensional laser point cloud collected before the first two-dimensional laser point cloud;
[0124] a second tilt angle determining module, configured to determine a second tilt angle of the electronic device according to the second pitch angle and the second roll angle;
[0125] an angle variance determining module, configured to determine an angle variance according to the first tilt angle and the second tilt angle when both the first tilt angle and the second tilt angle are greater than a first threshold;
[0126] A speed acquisition module, configured to acquire a speed of the electronic device from the time when the second two-dimensional laser point cloud is acquired to the time when the first two-dimensional laser point cloud is acquired;
[0127] a posture difference determining module, configured to determine a predicted posture corresponding to the electronic device based on the second posture and the speed, and determine a posture difference between the first posture and the predicted posture;
[0128] The slope area determination module is used to determine that the electronic device is located in the slope area when the angle variance is less than or equal to a second threshold and the posture difference is less than or equal to a third threshold.
[0129] In one example, the tilt direction determining module 502 is specifically configured to determine the first tilt angle according to the following formula: tilt=arccos(cos(pitch)×cos(roll));
[0130] Among them, tilt is the first tilt angle, pitch is the first pitch angle, and roll is the first roll angle.
[0131] In another example, the tilt direction determining module 502 is further configured to determine the tilt direction according to the following formula:
[0132] Wherein, angle_tilt is the tilt direction, pitch is the first pitch angle, and roll is the first roll angle.
[0133] In one possible implementation, the map construction module 503 is further used to determine an angle filtering interval based on the first tilt angle and the tilt direction, where the angle filtering interval is the angle interval corresponding to the two-dimensional laser point cloud to be filtered; and filter the first two-dimensional laser point cloud according to the angle filtering interval.
[0134] Exemplarily, the map construction module 503 is also used to determine the tilt angle threshold corresponding to the electronic device; when the first tilt angle is greater than the tilt angle threshold, the first angle is determined according to the first tilt angle, the tilt direction and the tilt angle threshold; and the angle filtering interval is determined according to the first angle and the tilt direction.
[0135] In a possible implementation, the apparatus further includes:
[0136] The posture updating module is used to update the first posture according to the Gauss-Newton method and the constructed map to obtain a target posture corresponding to the electronic device.
[0137] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0138] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0139] FIG6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in FIG6 , the electronic device 6 of this embodiment includes: at least one processor 60 (only one is shown in FIG6 ), a memory 61, a computer program 62 stored in the memory 61 and executable on the at least one processor 60, at least one laser device 63 (only one is shown in FIG6 ), at least one IMU 64 (only one is shown in FIG6 ), and at least one odometer 65 (only one is shown in FIG6 ). The laser device 63 can collect a two-dimensional laser point cloud corresponding to the environment in which the electronic device is located. The IMU 64 can obtain the pitch angle, roll angle, and speed of the electronic device, etc. The odometer 65 can obtain the position and posture of the electronic device. When the processor 60 executes the computer program 62, the steps in any of the above-mentioned two-dimensional laser point cloud mapping method embodiments are implemented.
[0140] The electronic device 6 can be a robot, a robotic arm, a mobile phone, a tablet computer, a wearable device, an in-vehicle device, or an AR / VR device, etc., capable of performing map construction and computing. The electronic device 6 can include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that FIG6 is merely an example of the electronic device 6 and does not limit the electronic device 6. The electronic device 6 can include more or fewer components than shown, or a combination of certain components, or different components. For example, it can also include input and output devices, network access devices, etc.
[0141] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0142] In some embodiments, the memory 61 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. In other embodiments, the memory 61 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Furthermore, the memory 61 may include both an internal storage unit of the electronic device 6 and an external storage device. The memory 61 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is about to be output.
[0143] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.
[0144] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps of the above-mentioned method embodiments when executing the computer program product.
[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may at least include: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable storage medium cannot be an electric carrier signal or a telecommunication signal.
[0146] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0147] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0148] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0150] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A mapping method based on two-dimensional laser point cloud, characterized in that: include: Obtaining a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud; determining a first tilt angle and a first tilt direction of the electronic device according to the first pitch angle and the first roll angle; When it is determined that the electronic device is located in a slope area based on the first tilt angle and the first posture, the first two-dimensional laser point cloud is filtered according to the first tilt angle and the tilt direction, and a map is constructed based on the filtered first two-dimensional laser point cloud.
2. The method according to claim 1, characterized in that The method further comprises: Acquiring a second pitch angle, a second roll angle, and a second posture when the electronic device collects a second two-dimensional laser point cloud, where the second two-dimensional laser point cloud is a two-dimensional laser point cloud collected before the first two-dimensional laser point cloud; determining a second tilt angle of the electronic device according to the second pitch angle and the second roll angle; When both the first tilt angle and the second tilt angle are greater than a first threshold, determining an angle variance according to the first tilt angle and the second tilt angle; Acquiring a speed of the electronic device from the time when the second two-dimensional laser point cloud is acquired to the time when the first two-dimensional laser point cloud is acquired; Determining a predicted posture corresponding to the electronic device based on the second posture and the speed, and determining a posture difference between the first posture and the predicted posture; When the angle variance is less than or equal to a second threshold, and the posture difference is less than or equal to a third threshold, it is determined that the electronic device is located in the slope area.
3. The method according to claim 1, characterized in that Determining a first tilt angle and a first tilt direction of the electronic device according to the first pitch angle and the first roll angle includes: The first tilt angle is determined according to the following formula: tilt=arccos(cos(pitch)×cos(roll)); Among them, tilt is the first tilt angle, pitch is the first pitch angle, and roll is the first roll angle.
4. The method according to claim 1, wherein Determining a first tilt angle and a first tilt direction of the electronic device according to the first pitch angle and the first roll angle includes: The tilt direction is determined according to the following formula: Wherein, angle_tilt is the tilt direction, pitch is the first pitch angle, and roll is the first roll angle.
5. The method according to claim 1, wherein The filtering of the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction includes: Determining an angle filtering interval according to the first tilt angle and the tilt direction, where the angle filtering interval is an angle interval corresponding to the two-dimensional laser point cloud to be filtered out; The first two-dimensional laser point cloud is filtered according to the angle filtering interval.
6. The method according to claim 5, characterized in that The filtering of the first two-dimensional laser point cloud according to the angle filtering interval includes: Determining a tilt angle threshold corresponding to the electronic device; When the first tilt angle is greater than the tilt angle threshold, determining a first angle according to the first tilt angle, the tilt direction, and the tilt angle threshold; The angle filtering interval is determined according to the first angle and the tilt direction.
7. The method according to any one of claims 1 to 6, characterized in that After constructing the map based on the filtered first two-dimensional laser point cloud, the method further includes: The first posture is updated according to the Gauss-Newton method and the constructed map to obtain a target posture corresponding to the electronic device.
8. A mapping device based on two-dimensional laser point cloud, characterized in that: include: A first pose acquisition module is used to obtain a first pitch angle, a first roll angle, and a first pose when the electronic device collects a first two-dimensional laser point cloud; a tilt direction determining module, configured to determine a first tilt angle and a tilt direction of the electronic device according to the first pitch angle and the first roll angle; A map construction module is used to filter the first two-dimensional laser point cloud according to the first tilt angle and the tilt direction when it is determined that the electronic device is located in a slope area based on the first tilt angle and the first posture, and to construct a map based on the filtered first two-dimensional laser point cloud.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device implements the two-dimensional laser point cloud-based mapping method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the computer is enabled to implement the two-dimensional laser point cloud-based mapping method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Laser positioning and mapping method and system based on gradient factor
CN115345934A
Ground filtering and obstacle detection method and device, electronic equipment and storage medium
CN115953374A
Laser SLAM (Simultaneous Localization and Mapping) method for inhibiting height drift of odometer
CN116878542A
Self-adaptive obstacle detection method and system
CN117518198A
Filtering method and device of two-dimensional laser point cloud, electronic equipment and storage medium
CN117890878A