Map creation method, device, electronic device and readable storage medium
By extracting the centroid information set from point cloud data and determining the environmental boundaries, the problems of large computational complexity and slow speed of existing map creation methods are solved, and fast and low-cost map creation is achieved.
Patent Information
- Application Number
- CN202211073910.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-09-02
AI Technical Summary
Existing map creation methods are computationally intensive and slow, and are particularly inefficient in mobile robot navigation and global path planning.
By extracting the centroid information set from the point cloud data and determining the boundary information of the environment based on the centroid information set, an environment map can be quickly created.
It achieves map creation with low computational complexity and high speed, reduces equipment costs, and has no requirements for ambient illumination and light-dark contrast.
Smart Images

Figure CN115585802B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics technology, and in particular to a map creation method, device, electronic device, and readable storage medium. Background Art
[0002] Map creation is a fundamental and crucial issue in mobile robotics, with widespread applications in areas such as navigation and positioning, and global path planning. Typically, point cloud data is collected first, and then a map is constructed based on this data. However, existing map creation methods are computationally intensive and slow. Summary of the Invention
[0003] The embodiments of the present application provide a map creation method, device, electronic device and readable storage medium, which have the characteristics of small calculation amount and high speed.
[0004] The embodiments of the present application can be implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a map creation method, the method comprising:
[0006] Obtaining initial point cloud data of the target environment, wherein the initial point cloud data includes coordinates of each measurement point in the target global coordinate system;
[0007] Obtaining a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data;
[0008] Obtaining boundary information of the target environment according to the centroid information set, wherein the boundary information includes a boundary line or a boundary plane;
[0009] An environment map of the target environment is obtained according to the boundary information.
[0010] In a second aspect, an embodiment of the present application provides a map creation device, the device comprising:
[0011] A point cloud data acquisition module is used to obtain initial point cloud data of the target environment, wherein the initial point cloud data includes the coordinates of each measurement point in the target global coordinate system;
[0012] a centroid calculation module, configured to obtain a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data;
[0013] a boundary calculation module, configured to obtain boundary information of the target environment according to the centroid information set, wherein the boundary information includes a boundary line or a boundary plane;
[0014] A processing module is used to obtain an environment map of the target environment according to the boundary information.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the map creation method described in the aforementioned embodiment.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the map creation method as described in the aforementioned embodiment.
[0017] The map creation method, device, electronic device and readable storage medium provided in the embodiments of the present application first determine the center of mass from the point cloud, and then determine the boundary line or boundary plane of the environment based on the center of mass, and then obtain the environment map. In this way, the environment map can be created in a computationally small and fast manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 One of the block diagrams of an electronic device provided in an embodiment of the present application;
[0020] Figure 2 The second block diagram of the electronic device provided in the embodiment of the present application;
[0021] Figure 3 The third block diagram of the electronic device provided in the embodiment of the present application;
[0022] Figure 4 One of the working diagrams of the electronic device performing 2D environment perception according to the embodiment of the present application;
[0023] Figure 5 The second working diagram of the electronic device performing 2D environment perception according to the embodiment of the present application;
[0024] Figure 6A schematic diagram illustrating the operation of an electronic device for 3D environment perception according to an embodiment of the present application;
[0025] Figure 7 A flowchart of a map creation method provided in an embodiment of the present application;
[0026] Figure 8 for Figure 7 One of the flowcharts of the sub-steps included in step S200;
[0027] Figure 9 for Figure 7 Flowchart 2 of the sub-steps included in step S200;
[0028] Figure 10 for Figure 7 One of the flow charts of the sub-steps included in step S300;
[0029] Figure 11 for Figure 10 A schematic flow chart of the sub-steps included in sub-step S330;
[0030] Figure 12 for Figure 7 Flowchart 3 of the sub-steps included in step S200;
[0031] Figure 13 for Figure 7 Flowchart 2 of the sub-steps included in step S300;
[0032] Figure 14 for Figure 13 A schematic flow chart of the sub-steps included in sub-step S380;
[0033] Figure 15 A block diagram of a map creation device provided in an embodiment of the present application.
[0034] Icons: 100-electronic device; 110-memory; 120-processor; 130-communication unit; 140-mobile unit; 150-single-point ranging unit; 161-pitch rotation subunit; 162-yaw rotation subunit; 200-map creation device; 210-point cloud data acquisition module; 220-center of mass calculation module; 230-boundary calculation module; 240-processing module. DETAILED DESCRIPTION
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0036] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present application.
[0037] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0038] Please refer to Figure 1 , Figure 1 This is one of the block diagrams of an electronic device provided in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a computer, a server, a robot, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0039] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0040] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a map creation device 200, which includes at least one software function module stored in the memory 110 in the form of software or firmware. By running the software programs and modules stored in the memory 110, such as the map creation device 200 in the embodiment of the present application, the processor 120 executes various functional applications and data processing, thereby implementing the map creation method in the embodiment of the present application.
[0041] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.
[0042] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0043] Optionally, the electronic device 100 may be a device such as a robot that can move autonomously and complete mapping.
[0044] Currently, the following two methods are generally used to build maps.
[0045] Method 1: Autonomous mobile robots use onboard single- or multi-line laser radar to perform 360-degree scanning of the environment, acquiring 2D / 3D information about structured or unstructured environments. However, current single- or multi-line laser ranging sensor technology is complex to implement and requires high-performance computing units, which is costly.
[0046] Method 2: An autonomous mobile robot uses an RGB binocular camera to acquire three-dimensional information of structured or unstructured environments based on the parallax of the captured images (extracting feature points in the image and calculating the positional deviation between corresponding points). However, this method has certain requirements for light intensity. The ambient illumination cannot exceed the maximum / minimum values of the camera, and there are certain requirements for the contrast between light and dark in the environment. In addition, a specific algorithm is required to identify feature points in the image (or environment) and calculate the positional deviation between corresponding points in the image. This method is ineffective in textureless or weakly textured environments. This method is computationally intensive and requires a high-performance computing unit, which is costly.
[0047] In this embodiment, the electronic device 100 can obtain point cloud data as described in Method 1, and then quickly create a map through the map creation method provided in the embodiment of the present application.
[0048] In this embodiment, the electronic device 100 can also obtain point cloud data through single-point ranging, and then quickly create a map using the map creation method provided in this embodiment. In this way, the map can be created while reducing the equipment cost of the electronic device 100, and there are no requirements for ambient illumination and light-dark contrast.
[0049] Please refer to Figure 2 , Figure 2 This is a second block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 is an autonomous mobile mechanism and may further include a mobile unit 140, a single-point ranging unit 150, a rotation unit, and a position acquisition unit. The mobile unit 140 may be an autonomous mobile mechanism configured to carry the single-point ranging unit 150, the rotation unit, the position acquisition unit, the memory 110, the processor 120, and the communication unit 130, thereby driving the movement of the electronic device 100.
[0050] The single-point ranging unit 150 is used to measure the distance between it and a single measurement point. This means that the single-point ranging unit 150 can only determine one measurement point at a time. The single-point ranging unit 150 modulates the transmission and reception of light or sound waves of a specific wavelength and calculates the distance between it and the obstacle based on the time difference. The unit ranging unit 150 can be fixed to the rotating unit and rotated by the rotating unit to measure in different directions.
[0051] The rotating unit is used to drive the single point ranging unit 150 to rotate. The rotating unit can be located between the single point ranging unit 150 and the moving unit 140. The rotating unit can include a pitch rotating subunit 161 and / or a yaw rotating subunit 162. When the rotating unit includes the pitch rotating subunit 161 and the yaw rotating subunit 162, the single point ranging unit 150 can be as follows: Figure 2 As shown, the pitch rotating subunit 161 is fixed to the pitch rotating subunit 161, the pitch rotating subunit 161 is fixed to the yaw rotating subunit 162, and the yaw rotating subunit 162 is fixed to the mobile unit 140; alternatively, the single-point ranging unit 150 can be fixed to the yaw rotating subunit 162, the yaw rotating subunit 162 is fixed to the pitch rotating subunit 161, and the pitch rotating subunit 161 is fixed to the mobile unit 140. The specific setting method can be set according to actual needs.
[0052] like Figure 2 As shown, the pitch rotator subunit 161 is electrically controlled to achieve vertical pitch. Because the single-point ranging unit 150 is fixed to it, its operation causes the single-point ranging unit 150 to form a pitch angle. The yaw rotator subunit 162 is electrically controlled to achieve horizontal rotation. Because the pitch rotator subunit 161 is fixed to it, its horizontal rotation causes the pitch rotator subunit 161 to rotate in the same direction / angle as it.
[0053] The posture acquisition unit is used to obtain posture description information of the electronic device 100. The posture description information may include the position coordinates and posture of the electronic device 100 in the target global coordinate system during the environmental perception process; it may also include mileage information and posture information of the electronic device 100 during the environmental perception process. The mileage information and posture information can be used to calculate the coordinates of the electronic device 100 in the target global coordinate system. The target global coordinate system can be a coordinate system established with the starting point of environmental perception as its origin.
[0054] Optionally, the posture acquisition unit may include an odometer and an attitude measurement subunit. The odometer is used to obtain mileage information, and the attitude measurement subunit is used to obtain attitude information. Optionally, the attitude measurement subunit may include a geomagnetic sensor and an inertial measurement unit, the geomagnetic sensor is used to obtain geomagnetic sensor information, and the inertial measurement unit is used to obtain attitude information; correspondingly, the posture description information includes: geomagnetic sensor information, attitude information, and mileage information, and the geomagnetic sensor information, attitude information, and mileage information can be used to determine the coordinates of the electronic device 100 in the target global coordinate system.
[0055] The processor 120 is electrically connected to the mobile unit 140, the single-point ranging unit 150, the rotation unit and the posture acquisition unit, and is used to achieve movement by controlling the mobile unit 140 to perform environmental detection, and obtain initial point cloud data based on the received ranging information, the rotation angle information of the rotation unit and the posture description information, and then complete the map creation of the structured environment based on the initial point cloud data.
[0056] Please refer to Figure 3 , Figure 3 This is a third block diagram of an electronic device 100 provided in an embodiment of the present application. In this embodiment, the electronic device 100 may further include an obstacle avoidance sensor. The electronic device 100 can move autonomously through its own motion mechanism and sense environmental obstacles through the obstacle avoidance sensor to complete exploration of a structured environment.
[0057] Optionally, in this embodiment, the electronic device 100 may further include a camera or a detection unit for collecting information to determine whether the end point of the environmental detection has been reached, and to terminate environmental perception when the end point has been reached. For example, a sign may be set at the exit of the environment to be detected. When the sign is detected in the image obtained by the camera, and the pixel size and shape of the sign in the image meet the corresponding preset requirements, it can be determined that the end point has been reached. For another example, an NFC (Near Field Communication) tag may be set at the exit of the environment to be detected. When the detection unit detects the NFC tag, it can be determined that the end point has been reached.
[0058] like Figure 4 and Figure 5 As shown, when performing 2D environmental perception, the electronic device 100 can first perform environmental perception at entrance X, then travel a certain distance and perform another measurement to obtain environmental information; and so on until it reaches exit Y. When the electronic device 100 remains at one location for environmental perception, the single-point ranging unit 150, driven by the yaw rotation subunit 162, can rotate within the horizontal plane, for example, at intervals of Δθ, to obtain measurement point data from different directions. It will be understood that during 2D environmental perception, the height H at which the single-point ranging unit 150 is located does not change.
[0059] like Figure 6As shown, when the electronic device 100 performs 3D environmental perception, such as 2D environmental perception, it can perform environmental perception at entrance X, then travel a certain distance and perform another measurement to obtain environmental information; and so on until it reaches exit Y. When the electronic device 100 stays at one location to perform environmental perception, the single-point ranging unit 150 can rotate in the horizontal plane driven by the yaw rotation subunit 162, and can also rotate in the vertical plane driven by the pitch rotation subunit 161, for example, rotating at intervals Δθ in the horizontal direction and Δβ in the vertical direction to obtain measurement point data obtained in different directions. It is understood that when performing 2D environmental perception, the height H at which the single-point ranging unit 150 is located does not change.
[0060] Optionally, the electronic device 100 may stay at the location to perform environmental detection after traveling a certain distance (eg, 30 cm).
[0061] Please refer to Figure 7 , Figure 7 This is a flowchart of a map creation method provided in an embodiment of the present application. The method can be applied to the electronic device 100 described above. The specific process of the map creation method is described in detail below. In this embodiment, the method may include steps S100 to S400.
[0062] Step S100: obtaining initial point cloud data of the target environment.
[0063] In this embodiment, the target environment is the environment for map construction to be completed, which can be determined in combination with actual needs. The electronic device 100 can obtain the initial point cloud data from other devices; it can also obtain original point cloud data from other devices, and then process the original point cloud data to obtain initial point cloud data; it can also perform environmental perception on its own to obtain the initial point cloud data. The method for obtaining the initial point cloud data can be determined in combination with actual needs and is not specifically limited here. Among them, the initial point cloud data includes the coordinates of each measurement point in the target global coordinate system. The origin of the target global coordinate system (that is, the target origin) can be determined in combination with actual conditions. For example, it can be the position at the time when the detection of the target environment begins, that is, it can be Figure 4 The reference point X in is used as the target origin of the target global coordinate system.
[0064] Step S200: obtaining a centroid information set from the initial point cloud data.
[0065] When the initial point cloud data is obtained, the initial point cloud data can be processed to obtain a centroid information set, wherein the centroid information set includes coordinates of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data.
[0066] Step S300: Obtain boundary information of the target environment according to the centroid information set.
[0067] Wherein, the boundary information includes a boundary line or a boundary plane. It is understood that when a 2D map needs to be created, the boundary line is obtained based on the centroid information set; when a 3D map needs to be created, the boundary plane is obtained based on the centroid information set.
[0068] Step S400: Obtain an environment map of the target environment according to the boundary information.
[0069] In the embodiment of the present application, the centroid is first determined from the point cloud, and then the boundary line or boundary plane of the environment is determined based on the centroid, thereby obtaining an environment map. In this way, the environment map can be created in a computationally small and fast manner.
[0070] As a possible implementation, the initial point cloud data may be obtained by rotating a single-point distance measuring unit, wherein the single-point distance measuring unit is configured to obtain information of a measurement point through a single measurement.
[0071] In this embodiment, the entrance to the structured terrain (i.e., the target environment) to be mapped can be manually confirmed. With the entrance as the reference point, the electronic device 100 is placed at the reference point to begin work. The end point of the electronic device 100's exploration can be manually confirmed, using a visual tag as an identifier. When the electronic device 100 recognizes a visual tag within a certain range, the visual tag is used as the end point, completing the point cloud data collection of the structured environment.
[0072] After the electronic device 100 completes the collection of environmental point cloud data at the current collection point, it confirms the next collection point based on the acquired obstacle information (for example, the distance between the device and the obstacle) and direction, as well as its own posture information, and stops at that point to start collecting environmental point cloud data for that collection point.
[0073] Environmental point cloud data can be divided into 2D point cloud data and 3D point cloud data. When you need to create a 2D map, you can obtain 2D point cloud data; when you need to create a 3D map, you can obtain 3D point cloud data.
[0074] 2D point cloud data can be obtained as follows. Using the local coordinate system of the electronic device 100 as a reference, the processor controls the yaw rotation subunit to cause the single-point ranging unit to perform a 360° rotation traversal starting from the front, with a step interval of Δθ. The local coordinate system is the electronic device coordinate system, and the origin of the coordinate system can be a point on the electronic device 100.
[0075] Within the set effective measurement range of the single-point ranging unit, the distance and yaw angle data [D(n), n*Δθ] of the measurement point are recorded and converted into coordinate data in the local coordinate system of the electronic device 100 .
[0076] 3D point cloud data can be obtained as follows. Using the local coordinate system of the electronic device 100 as a reference, the processor controls the yaw rotation subunit to perform a 360° rotation in the horizontal plane with a step interval of Δθ. The processor also controls the pitch rotation subunit to perform a rotation within the controllable pitch angle range with a step interval of Δβ. The measurement point distance, yaw angle, and pitch angle [L(n), n*Δθ, m*Δβ] are recorded. The recorded data is used as the basis for calculations and converted into coordinate data within the local coordinates of the electronic device 100.
[0077] Optionally, to ensure the accuracy of the recorded distance of the measurement points, when the measured distance exceeds the measurement range, a special mark may be placed on the distance.
[0078] Assume the maximum measurement distance of the single-point ranging unit is Lmax, and the measurement error is ±Δs%. The measurement error at Lmax is Lmax*±Δs%. To reduce the measurement error, the effective measurement range of the single-point ranging unit can be set to Lef (Lef < Lmax). When the distance measured by the single-point ranging unit is greater than or equal to Lef, the data can be set as invalid data. In other words, the data is specially marked as invalid data. Invalid data can be omitted.
[0079] After completing the conversion of the coordinate data in the local coordinate system of this collection point, the transformation equation between the coordinate system of the current collection point and the coordinate system of the reference point X (i.e., the target global coordinate system) can be confirmed through the information recorded by relevant sensors such as the odometer, I inertial measurement unit, and geomagnetic sensor. The coordinate data of the current collection point is transformed into the coordinate data of the coordinate system of the reference point X, thereby obtaining the coordinate data in the target global coordinate system.
[0080] Similarly, when detection stops, the initial point cloud data in a 2D environment or the initial point cloud data in a 3D environment can be obtained. Then, based on the point cloud data set with the reference point X as the coordinate system, data processing can be performed to reconstruct and obtain a 2D or 3D map.
[0081] The following will first explain how to obtain a 2D environment map when the initial point cloud data in the 2D environment is obtained.
[0082] Please refer to Figure 8 , Figure 8 for Figure 7 The centroid information set may include the coordinates and weights of each centroid. In this embodiment, step S200 may include sub-steps S230 and S240.
[0083] In sub-step S230 , the measurement points corresponding to the initial point cloud data are grid-divided with the target origin of the target global coordinate system as the origin and the first preset length as the side length.
[0084] Sub-step S240 , for each grid, obtaining the coordinates of the centroid of the grid according to the coordinates of each measurement point in the grid, and obtaining the weight corresponding to the centroid of the grid according to the number of measurement points in the grid.
[0085] In this embodiment, the target global coordinate system can be divided into multiple two-dimensional grids with the target origin as the origin and the first preset length as the side length, and the point cloud included in each grid is determined. Then, for each grid, the two-dimensional coordinates of the center of mass of the grid are obtained with the point cloud data in the grid as a subset; and the weight corresponding to the center of mass of the grid is determined according to the number of measurement points in the grid. After processing each grid, a center of mass parameter set can be obtained. The center of mass parameter set is a 2D weight point cloud (xn, yn, wn), and the center of mass parameter set can be used as the first center of mass information set corresponding to the 2D environment. Among them, (xn, yn) is the coordinate of the first center of mass in the target global coordinate system, wn is the weight corresponding to the first center of mass, and the first center of mass is the center of mass of the two-dimensional grid. The first preset length can be set according to actual needs.
[0086] Optionally, as a possible implementation, the first preset length is Lef*Δs%, where Lef is the measurement range set when measuring distance, and Δs% is the measurement error of the sensor used when measuring distance, for example, the measurement error of a single-point measurement sensor. When the grid is divided based on the first preset length and the measurement points in each grid are determined, for each grid, the average x-value of the coordinates of the measurement points in the grid can be used as the x-value of the center of mass coordinate, the average y-value of the coordinates of the measurement points in the grid can be used as the y-value of the center of mass coordinate, and the number of measurement points in the grid can be used as the weight corresponding to the center of mass of the grid.
[0087] In order to reduce interference, the discrete points in the point cloud data can be removed before determining the centroid to obtain the target point cloud data, and then the target point cloud data can be Figure 8The data grid is filtered to obtain the centroid information set. Figure 9 , Figure 9 for Figure 7 2 is a flow chart of the sub-steps included in step S200. In this embodiment, before sub-step S230, sub-step S230 may further include sub-step S211 and sub-step S221.
[0088] In sub-step S211 , for each measurement point in the initial point cloud data, the number of measurement points within a circle having the measurement point as the center and a second preset length as the radius is obtained.
[0089] Sub-step S212 : determining whether to remove the measurement point based on the number of measurement points within the circle corresponding to the measurement point, so as to obtain first target point cloud data.
[0090] In this embodiment, once initial 2D point cloud data is obtained, for each measurement point in the initial point cloud data, the number of measurement points within a circle centered at the measurement point and having a second preset length as a radius can be determined. The second preset length can be set based on actual needs. For example, it can be the same as the first preset length, set to Lef*Δs%.
[0091] Then, the number of measurement points can be compared with the preset number. If it is less than the preset number, the measurement point can be deleted. If it is less than, the measurement point can be retained. The preset number can be set in combination with actual needs, and the preset number is at least greater than 1. In this way, the measurement point can be used as the center of the circle and the second preset length as the radius to perform radius filtering and remove outliers to obtain the first 2D target point cloud data. Afterwards, the data grid filtering shown in sub-steps S230 to S240 can be performed on the first target point cloud data, that is, in a 2D environment, the object of grid division is the measurement point corresponding to the first target point cloud data, thereby obtaining the first centroid information set corresponding to the 2D environment.
[0092] Please refer to Figure 10 , Figure 10 for Figure 7 One of the flow charts of the sub-steps included in step S300. In this embodiment, when the environment map is a 2D map, step S300 may include sub-steps S310 to S340.
[0093] Sub-step S310, taking the first centroid closest to the target origin of the target global coordinate system in the first centroid information set as the starting point, determine the next first centroid closest to the starting point, take the starting point and the next first centroid as a first centroid pair, and update the next first centroid as the starting point to repeat the step of determining the first centroid pair until the first centroid pair corresponding to the last first centroid is determined.
[0094] Sub-step S320 , for each first centroid pair, obtaining the first equilibrium point of the first centroid pair according to the coordinates and weights of each first centroid in the first centroid pair.
[0095] As a possible implementation method, the first equilibrium point can be obtained by the following first preset formula:
[0096]
[0097]
[0098] Among them, (Hx, Hy) represents the coordinates of the first equilibrium point, (Qx s ,Qy s ) represents the coordinates of the first centroid of the first centroid as the starting point, Qw s represents the weight of the first centroid as the starting point; (Qx e ,Qy e ) represents the coordinates of the first center of mass of the first center of mass pair as the next first center of mass, Qw e represents the weight of the first centroid as the next first centroid.
[0099] In the above process, the first center of mass Q(0) closest to the target origin can be used as the starting point, and the next first center of mass Q(1) closest to Q(0) can be found. The first equilibrium point H(x0, y0) can be obtained using the relevant parameters of Q(0) and Q(1).
[0100] Hx0=Qx0+(Qx1-Qx0)*[Qw1 / (Qw0+Qw1)];
[0101] Hy0=Qy0+(Qy1-Qy0)*[Qw1 / (Qw0+Qw1)];
[0102] The coordinates of the first centroid Q(0) are (Qx0, Qy0) and the corresponding weight is Qw0. The coordinates of the next first centroid Q(1) are (Qx1, Qy1) and the corresponding weight is Qw1.
[0103] Similarly, the first centroid information set is traversed to obtain a first equilibrium point set H1, which includes the two-dimensional coordinates of the first equilibrium point of each second centroid pair.
[0104] For example, assuming there are 5 first centroids, first find Q(0), then find Q(1) that is closest to Q(0) from the first centroid that has not been divided into the first centroid pair, and calculate the first equilibrium point H1(0) based on the information of Q(0) and Q(1); and so on, until the first equilibrium point H1(4) is calculated based on the information of Q(4) and Q(5).
[0105] Sub-step S330: dividing the first equilibrium point set into a plurality of first equilibrium point subsets based on the normal turning points corresponding to the first equilibrium point set.
[0106] In this embodiment, the first balancing point set can be analyzed to obtain turning points of the lines connecting the first balancing points, which are used as normal turning points. The first balancing point set can then be divided into multiple first balancing point subsets based on the normal turning points. The normal turning points are the first balancing points in the first balancing point set.
[0107] Please refer to Figure 11 , Figure 11 for Figure 10 Flowchart of sub-steps included in sub-step S330. In this embodiment, the first equilibrium points in the first equilibrium point set H1 are sorted according to the order in which the corresponding first centroid pairs are obtained, and step S330 may include sub-steps S331 to S333.
[0108] Sub-step S331 : sequentially connecting adjacent first equilibrium points in the first equilibrium point set to obtain a first normal line set.
[0109] In this embodiment, the first equilibrium points in the first equilibrium point set H1 are sorted in the order in which their corresponding first centroid pairs were obtained. Two adjacent points in the first equilibrium point set H1 can be connected by a straight line to form a 2D weighted key cloud normal set N1 (0, 1, 2, ..., n), which is then used as the first normal set. It should be noted that, to simplify calculations, the first normal in the first normal set is actually an approximate normal.
[0110] The first normal is a line formed by connecting two adjacent equilibrium points. That is, the first normals in the first normal set are straight lines connecting adjacent first equilibrium points. The first normals in the first normal set are sorted according to the order in which the first equilibrium points are connected. For example, if there are first equilibrium points H1(0) to H1(4), four lines can be obtained by connecting two adjacent points with straight lines.
[0111] Sub-step S332, traverses the first normal set. When, among the four adjacent first normals, the angle between the first first normal and the fourth first normal is less than or equal to a first preset value, and the angle between the second first normal and the third first normal is less than or equal to a second preset value, the first equilibrium point between the second first normal and the third first normal is taken as a normal turning point.
[0112] The first normal set is traversed, and when the following second preset formula is satisfied, a normal turning point can be determined. The second preset formula is:
[0113] ∠A≥K[N1(n+1),N1(n+2)];
[0114] ∠B≥K[N1(n), N1(n+3)];
[0115] Wherein, K represents the angle between two straight lines, ∠B represents the first preset value, and ∠A represents the second preset value.
[0116] When the above second preset formula is satisfied, the first equilibrium point H1(n+2) between the normal segment N1(n+1) and the normal segment N1(n+2) can be determined as the normal turning point.
[0117] Sub-step S333: dividing the first equilibrium point set into a plurality of first equilibrium point subsets based on the obtained normal turning points.
[0118] Based on the determined normal turning point, the first equilibrium point set can be divided into multiple subsets to obtain multiple first equilibrium point subsets H1[m]. The first first equilibrium point in a subsequent first equilibrium point subset is the last first equilibrium point in the previous first equilibrium point subset, and this first equilibrium point is a normal turning point.
[0119] Sub-step S340: for each first equilibrium point subset, determine a boundary line corresponding to the first equilibrium point subset.
[0120] When the first equilibrium point subset is obtained, a boundary line may be calculated for each first equilibrium point subset based on each point in the first equilibrium point subset, wherein the sum of the squares of the vertical distances from all points in the first equilibrium point subset to the boundary line is minimized.
[0121] That is, from the first equilibrium point subset H1[0], find a boundary line L[0] such that the sum of the squares of the vertical distances from all first equilibrium points in the first equilibrium point subset H1[0] to the line L[0] is minimized. Similarly, find L[1], L[2]…L[m] in sequence.
[0122] It is worth noting that the above boundary line expressions L[1], L[2]…L[m] are not line segments, but straight lines. The above boundary lines can determine the corresponding line segments, and the map boundary position is confirmed by the starting and ending coordinates of the first equilibrium point set H1 (that is, the first equilibrium point corresponding to the starting reference point X and the first equilibrium point corresponding to the ending reference point Y during environmental perception), thereby obtaining a 2D map. Among them, the intersection of the boundary lines corresponding to adjacent first equilibrium point subsets can determine the line segment. For example, according to the above description, the boundary lines L[0], L[1], L[2], etc. are obtained. The boundary line L[0] intersects with the boundary line L[1], and the boundary line L[1] intersects with the boundary line L[2]. Based on the two intersection points, a line segment can be determined from the boundary line L[1], and the others can be deduced in the same way. The line segment intercepted from the first boundary line L[0] has its end point at the intersection of boundary line L[0] and boundary line L[1], and its starting point is perpendicularly intercepted from the starting point of the first equilibrium point subset H1[0] corresponding to the boundary line L[0]. Similarly, the line segment intercepted from the last boundary line L[m] has its starting point at the intersection of boundary line L[m-1] and boundary line L[m], and its end point is perpendicularly intercepted from the ending point of the first equilibrium point subset H1[m] corresponding to the boundary line L[m]. In this way, based on the line segments intercepted from each boundary line, a 2D map can be obtained.
[0123] In this embodiment, when creating a 2D map, the initial point cloud data is first subjected to discrete point removal, followed by grid data filtering to obtain a first balanced point set. A first normal set is then derived based on the first balanced point set. A first balanced point, serving as a turning point for the first normal, is then determined. This first balanced point, identified as a turning point, is then used to partition the data into a first balanced subset. Finally, a 2D map boundary reference line is drawn based on the first balanced subset, thereby obtaining the 2D map. This reduces the computational effort involved in creating the 2D map and improves speed.
[0124] The following will explain how to obtain a 3D environment map when the initial point cloud data in the 3D environment is obtained.
[0125] First, it is necessary to obtain the second centroid information set based on the initial 3D point cloud data.
[0126] Please refer to Figure 12 , Figure 12 for Figure 7 The third flowchart of the sub-steps included in step S200 is as follows: The method of obtaining the second centroid information set is similar to the method of obtaining the first centroid information set. In this embodiment, step S200 may include sub-steps S230 and S240.
[0127] In sub-step S230 , the measurement points corresponding to the initial point cloud data are grid-divided with the target origin of the target global coordinate system as the origin and the first preset length as the side length.
[0128] Sub-step S240 , for each grid, obtaining the coordinates of the centroid of the grid according to the coordinates of each measurement point in the grid, and obtaining the weight corresponding to the centroid of the grid according to the number of measurement points in the grid.
[0129] In this embodiment, the target global coordinate system can be divided into multiple three-dimensional grids with the target origin as the origin and a first preset length as the side length, and the point cloud included in each grid is determined. Then, for each grid, the three-dimensional coordinates of the grid's centroid are obtained using the point cloud data in that grid as a subset. The weight corresponding to the grid's centroid is determined based on the number of measurement points in the grid. In this way, a second centroid information set is obtained. The centroid of each three-dimensional grid is the second centroid, and the second centroid information set includes the second centroid's three-dimensional coordinates and weight.
[0130] Optionally, the 3D space of the dataset can be divided into grid cube space with the target origin as the origin and Lef*△s% as the side length. The point cloud data in each grid cube is used as a subset to obtain the centroid, and the centroid weight is assigned according to the number of measurement points in the grid cube. After processing each grid cube, a set of centroid parameters is obtained. This set of centroid parameters is a 3D weighted point cloud Q(xn,yn,zn,wn), which can be used as the first centroid information set corresponding to the 3D environment. Among them, (xn,yn,zn) is the coordinate of the second centroid in the target global coordinate system, and wn is the weight corresponding to the second centroid.
[0131] In order to reduce interference, before determining the second centroid, discrete points in the point cloud data can be removed to obtain the second target point cloud data, and then the data grid filtering described in sub-steps S230 and S240 is performed on the second target point cloud data to obtain the second centroid information set. Figure 12 In this embodiment, before sub-step S230, sub-step S230 may further include sub-step S213 and sub-step S223.
[0132] In sub-step S213 , for each measurement point in the initial point cloud data, the number of measurement points within a sphere having the measurement point as the center and a second preset length as the radius is obtained.
[0133] Sub-step S223 : determining whether to remove the measurement point according to the number of measurement points in the sphere corresponding to the measurement point, so as to obtain second target point cloud data.
[0134] In this embodiment, when initial 3D point cloud data is obtained, for each measurement point in the initial point cloud data, the number of measurement points within a sphere with the measurement point as the center and a second preset length as the radius can be obtained. The second preset length can be set to Lef*Δs%.
[0135] If the number of measurement points within the sphere is less than a preset number, the measurement point can be deleted. Otherwise, the measurement point can be saved. The preset number can be set in combination with actual needs, and the preset number is at least greater than 1. In this way, the measurement point can be used as the center of the sphere and the second preset length as the radius, and radius filtering can be performed to remove outliers to obtain the second target point cloud data in 3D. Afterwards, the data grid filtering shown in sub-steps S230 to S240 can be performed on the second target point cloud data, that is, in a 3D environment, the object of grid division is the measurement point corresponding to the second target point cloud data, thereby obtaining a second centroid information set corresponding to the 3D environment.
[0136] Please refer to Figure 13 , Figure 13 for Figure 7 FIG2 is a flow chart of the sub-steps included in step S300. In this embodiment, when the environment map is a 3D map, step S300 may include sub-steps S350 to S390.
[0137] Sub-step S350, taking the second center of mass closest to the target origin of the target global coordinate system in the second center of mass information set as the starting point, determine the next second center of mass closest to the starting point, take the starting point and the next second center of mass as a second center of mass pair, and update the next second center of mass as the starting point to repeat the step of determining the second execution pair until the second center of mass pair corresponding to the last second center of mass is determined.
[0138] Sub-step S360 , for each second centroid pair, obtaining the second equilibrium point of the second centroid pair according to the coordinates and weights of each second centroid in the second centroid pair.
[0139] For detailed descriptions of sub-steps S350 to S360 , reference may be made to the above descriptions of sub-steps S310 to S320 .
[0140] The process of finding the second equilibrium point can be as follows. The second center of mass Q(0) closest to the target origin can be used as the starting point, and the next second center of mass Q(1) closest to Q(0) can be found. The second equilibrium point H(x0, y0, z0) can be found using the relevant parameters of Q(0) and Q(1).
[0141] Hx0=Qx0+(Qx1-Qx0)*[Qw1 / (Qw0+Qw1)];
[0142] Hy0=Qy0+(Qy1-Qy0)*[Qw1 / (Qw0+Qw1)];
[0143] Hz0=Qz0+(Qz1-Qz0)*[Qw1 / (Qw0+Qw1)];
[0144] Among them, the coordinates of the second center of mass Q(0) are (Qx0, Qy0, Qz0), and the corresponding weight is Qw0, and the coordinates of the next second center of mass Q(1) are (Qx1, Qy1, Qz1), and the corresponding weight is Qw1.
[0145] Similarly, the second centroid information set is traversed to obtain a second equilibrium point set H2, which includes the three-dimensional coordinates of the second equilibrium points of each second centroid pair.
[0146] Sub-step S370 , based on the manner in which any three adjacent points closest to each other in the second equilibrium point set form a plane, obtain multiple reference planes according to the second equilibrium point set.
[0147] Using any three adjacent points in the second equilibrium point set H2 that are closest to each other, a plane is formed, and the second equilibrium point set H2 is traversed to obtain a reference plane set P consisting of multiple reference planes. Each reference plane is a plane determined by three second equilibrium points in the above manner.
[0148] Sub-step S380 : dividing the reference plane set into a plurality of reference plane subsets based on the angles between the reference planes.
[0149] In this embodiment, based on the angles between the reference planes, planes with smaller angles may be grouped together, thereby obtaining multiple reference plane subsets based on the reference plane set.
[0150] Please refer to Figure 14 , Figure 14 for Figure 13 Flowchart of sub-steps included in sub-step S380. In this embodiment, sub-step S380 may include sub-steps S381 to S389.
[0151] Sub-step S381 , calculating the second normal of each reference plane to obtain a second normal set.
[0152] For each reference plane in the reference plane set, a second normal of each reference plane can be calculated, thereby obtaining a second normal set. The second normal set includes the second normal of each reference plane in the reference plane set.
[0153] Sub-step S382 , selecting a second normal from the second normals that have not been assigned to the second normal subset as an element in the current second normal subset.
[0154] When a new reference plane subset is needed, an empty subset is first created. Then, a second normal is selected from the second normals not assigned to the second normal subset and added to the empty subset to obtain the current second normal subset. It should be understood that when the reference plane is first partitioned, all second normals are those not assigned to the second normal subset.
[0155] Sub-step S383, calculating the average normal vector angle according to the elements in the current second normal subset, and determining the current reference plane subset corresponding to the current second normal subset.
[0156] Then, based on all second normals included in the current second normal subset, the average of all second normal vector angles can be calculated as the average normal vector angle. At the same time, since the current second normal subset has been determined, a current reference plane subset corresponding to the current second normal subset can be determined. The current reference plane subset includes reference planes corresponding to each second normal in the current second normal subset.
[0157] Sub-step S384: Find an adjacent plane from the reference planes that are not assigned a reference plane subset according to the second equilibrium point included in the elements in the current reference plane subset.
[0158] When the current reference plane subset has been determined, the second equilibrium point included in the elements in the current reference plane subset can be determined, and then a reference plane including the second equilibrium point in the current reference plane subset can be selected from the reference planes that have not been assigned to the reference plane subset as an adjacent plane.
[0159] Sub-step S385 , calculating the vector angle of the second normal of the adjacent plane, and calculating the absolute angle between the average normal vector angle and the vector angle corresponding to the adjacent plane.
[0160] When an adjacent plane is found, the vector angle of the second normal of the adjacent plane can be calculated based on the adjacent plane. Then, the absolute angle between the average normal vector angle and the vector angle corresponding to the adjacent plane is calculated.
[0161] Sub-step S386, determining whether the absolute angle is greater than or equal to a third preset value.
[0162] The third preset value can be set according to actual needs.
[0163] If it is less than, then sub-steps S387 to S388 may be executed. If it is greater than or equal to, then sub-step S3810 may be executed.
[0164] Sub-step S387, adding the adjacent plane to the current reference plane subset, and adding the second normal of the adjacent plane to the current second normal subset.
[0165] Sub-step S388, determining whether the critical plane search is complete.
[0166] In this way, the current reference plane subset and the current second normal subset can be updated based on the found neighboring planes. After completing an update, it can be determined whether the search for neighboring planes of the current reference plane subset has been completed. If the search is complete, that is, there are no neighboring planes of the current reference plane subset among the unassigned reference planes, the current reference plane subset can be treated as a completed reference plane subset, indicating that the classification of the current reference plane subset has been completed. In this way, a reference plane subset is obtained.
[0167] If the search is not completed, jump to step S383 to obtain a new average normal vector angle to continue adding elements to the current reference plane subset.
[0168] Among them, if there is no reference plane that has not been assigned a reference plane subset, it can be considered that all reference planes have been searched. At this time, there is no adjacent plane, and the reference plane subsets obtained at this time and before can be regarded as the result of completing the division of the reference plane set.
[0169] Sub-step S3810: Do not add the adjacent plane to the current reference plane subset.
[0170] When the absolute angle is greater than or equal to the third preset value, the adjacent plane is not added to the current reference plane subset, and the second normal of the adjacent plane is not added to the current second normal subset. Then, sub-step S388 is executed.
[0171] If there are still reference planes that have not been assigned a reference plane subset, the process can be repeated starting from sub-step S382 to obtain multiple reference plane subsets by repeating the steps of obtaining the reference plane subsets, and multiple second normal subsets can be obtained at the same time.
[0172] Sub-step S390 : for each reference plane subset, determining a boundary plane corresponding to the reference plane subset.
[0173] As a possible implementation, a second normal subset corresponding to each reference plane subset can be obtained. The second normal subset includes the second normal of each reference plane in the corresponding reference plane subset. For each second normal subset, a target normal can be obtained based on the second normal subset as a representative of the second normal subset. Based on the target normal, a boundary plane corresponding to the reference plane subset corresponding to the second normal subset is obtained. The sum of the squares of all second equilibrium points in the reference plane subset to the boundary plane is minimized.
[0174] Optionally, for a second normal subset M(m), the target normal Mav(m) can be obtained by taking the average of all elements of the second normal subset. Then, based on the target normal Mav(m), a plane O(m) can be determined so that the sum of the squares of the second equilibrium point included in the reference plane corresponding to the second normal subset M(m) to the plane O(m) is minimized. In this way, the coordinate information of the O(m) plane can be obtained. O(m) is a boundary plane of the 3D map, and the coordinate information of the O(m) plane can be a three-variable linear equation of the O(m) plane.
[0175] The 3D map boundary O(m) is determined based on all second normal subsets M(m) in sequence. The intersection of the boundary planes is then determined, and the open area of the 3D map is determined using the starting and ending boundary points (the second equilibrium point corresponding to the starting reference point X and the second equilibrium point corresponding to the ending reference point Y during environmental perception) to obtain the 3D map.
[0176] Among them, there are multiple second normal subsets, and multiple planes can be obtained based on the multiple second normal subsets. For example, plane O(1) can be determined based on the second normal subset M(1), and plane O(2) can be determined based on the second normal subset M(2). Since the angle represented by the target normal exceeds the third preset value, there is an intersection between the nearest planes. The expression equation X(m) of the intersection line of the adjacent planes can be determined through the plane equation of plane O(m). The intersection line contains the turning boundary information in the 3D map. Subsequently, X(m) is intercepted according to the plane closed area O(m)s. The intercepted line segments are the turning connections of the various planes in the 3D map.
[0177] After obtaining the O(m) plane, the boundary points of the second equilibrium point subset H2(m) are projected onto the O(m) plane to obtain a projection point set, which is connected to form a plane closed area O(m)s, which is an effective expression for 3D map measurement. The second equilibrium points used in the process of obtaining the O(m) plane constitute the second equilibrium point subset H2(m) corresponding to the O(m) plane. For example, the O(1) plane is determined based on all the second equilibrium points in the second equilibrium point subset H2(1). The boundary points of the second equilibrium point subset H2(m) are some of the second equilibrium points in the second equilibrium point subset H2(m). For example, the boundary points of the second equilibrium point subset H2(1) can include the intersection with the second equilibrium point subset H2(2), as well as the second equilibrium points that do not represent turning points but represent boundaries. The second equilibrium point subset H2(2) is a set of second equilibrium points used to determine the O(2) plane.
[0178] In this embodiment, when creating a 3D map, discrete points are first removed from the initial point cloud data, followed by raster data filtering to obtain a second balanced point set. Based on this second balanced point set, a reference plane set is determined and classified. Based on the classification results, the boundary reference planes of the 3D map are drawn, resulting in the 3D map. This reduces the computational effort involved in creating the 3D map and improves speed.
[0179] The map creation method provided in the embodiments of the present application can be applied to science literacy education for primary and secondary school students, smart toys, and the like. For example, when applied to science literacy education for primary and secondary school students, a structured environment model can be constructed using simple materials (e.g., foam board, cardboard, wood board, etc.). Through such a miniature actual environment, teachers can let students practice the construction of digital maps through the above method, and gain a deep understanding of the relevant scientific knowledge involved in automatic navigation. When applied to smart toys, the above method can be used to perceive the environment and complete the construction of the digital map when the smart toy is first operated; when the user operates it again, the smart toy can present to the user an "intelligent" performance that "I have memorized the surrounding environment information."
[0180] In order to execute the corresponding steps in the above embodiments and various possible methods, an implementation method of a map creation device 200 is given below. Optionally, the map creation device 200 can adopt the above Figure 1 The device structure of the electronic device 100 is shown in FIG. Figure 15 , Figure 15This is a block diagram of a map creation device 200 provided in an embodiment of the present application. It should be noted that the basic principles and technical effects of the map creation device 200 provided in this embodiment are the same as those in the aforementioned embodiments. For the sake of brevity, any details not mentioned in this embodiment are referred to the corresponding content in the aforementioned embodiments. In this embodiment, the map creation device 200 may include: a point cloud data acquisition module 210, a centroid calculation module 220, a boundary calculation module 230, and a processing module 240.
[0181] The point cloud data acquisition module 210 is used to obtain initial point cloud data of the target environment, wherein the initial point cloud data includes the coordinates of each measurement point in the target global coordinate system.
[0182] The centroid calculation module 220 is configured to obtain a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data.
[0183] The boundary calculation module 230 is configured to obtain boundary information of the target environment based on the centroid information set, wherein the boundary information includes a boundary line or a boundary plane.
[0184] The processing module 240 is configured to obtain an environment map of the target environment according to the boundary information.
[0185] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in FIG. 110 or the operating system (OS) of the electronic device 100 may be fixed and may be used by Figure 1 Meanwhile, the data, program codes, etc. required to execute the above modules may be stored in the memory 110.
[0186] An embodiment of the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the map creation method is implemented.
[0187] In summary, the embodiments of the present application provide a map creation method, device, electronic device and readable storage medium, which first determine the center of mass from the point cloud, and then determine the boundary line or boundary plane of the environment based on the center of mass, and then obtain the environment map. In this way, the environment map can be created in a computationally small and fast manner.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0189] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0190] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0191] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A map creation method, characterized in that: The method comprises: Obtaining initial point cloud data of the target environment, wherein the initial point cloud data includes coordinates of each measurement point in the target global coordinate system; Obtaining a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates and weights of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data; Obtaining boundary information of the target environment according to the centroid information set; According to the boundary information, an environmental map of the target environment is obtained, wherein when the environmental map is a 2D map, the centroid information set includes a first centroid information set corresponding to the 2D environment, and the boundary information includes a boundary line, and the boundary line is obtained based on a first equilibrium point subset obtained from the first equilibrium point, and the first equilibrium point subset is obtained by dividing the first equilibrium point obtained based on the normal turning point corresponding to the obtained first equilibrium point; wherein, the first centroid closest to the target origin of the target global coordinate system in the first centroid information set is used as the starting point, and the next first centroid closest to the starting point is determined, and the starting point and the next first centroid are used as a first centroid pair, and the next first centroid is updated as the starting point to repeat the step of determining the first centroid pair until the first centroid pair corresponding to the last first centroid is determined, and then for each first centroid pair, the first equilibrium point of the first centroid pair is obtained according to the coordinates and weights of each first centroid in the first centroid pair.
2. The method according to claim 1, characterized in that The origin of the target global coordinates is the starting point of the environment detection, and the centroid information set is obtained from the initial point cloud data, including: Performing grid division on the measurement points corresponding to the initial point cloud data with the target origin of the target global coordinate system as the origin and the first preset length as the side length; For each grid, the coordinates of the centroid of the grid are obtained according to the coordinates of each measurement point in the grid, and the weight corresponding to the centroid of the grid is obtained according to the number of measurement points in the grid.
3. The method according to claim 2, characterized in that In the case where the environment map is a 2D map, before performing grid division, obtaining a centroid information set from the initial point cloud data further includes: For each measurement point in the initial point cloud data, obtaining the number of measurement points within a circle having the measurement point as the center and a second preset length as the radius; According to the number of measurement points within the circle corresponding to the measurement point, it is determined whether to remove the measurement point to obtain first target point cloud data, wherein the grid division targets the measurement point corresponding to the first target point cloud data.
4. The method according to claim 1, wherein The first equilibrium point is obtained by the following first preset formula: in, represents the coordinates of the first equilibrium point, represents the coordinates of the first centroid of the first centroid pair as the starting point, represents the weight of the first centroid as the starting point; represents the coordinates of the first centroid of the first centroid pair as the next first centroid, represents the weight of the first centroid as the next first centroid.
5. The method according to claim 1, wherein The first equilibrium point set includes the first equilibrium points of each first centroid pair, and the first equilibrium points in the first equilibrium point set are sorted according to the order in which the corresponding first centroid pairs are obtained. Based on the normal turning points corresponding to the first equilibrium point set, the first equilibrium point set is divided into a plurality of first equilibrium point subsets, including: sequentially connecting adjacent first equilibrium points in the first equilibrium point set to obtain a first normal line set, wherein the first normal lines in the first normal line set are straight lines connecting the adjacent first equilibrium points, and the first normal lines in the first normal line set are sorted according to the order in which the first equilibrium points are connected; Traversing the first normal set, when, among four consecutive first normals, the angle between the first first normal and the fourth first normal is less than or equal to a first preset value, and the angle between the second first normal and the third first normal is less than or equal to a second preset value, the first equilibrium point between the second first normal and the third first normal is determined as a normal turning point; Based on the obtained normal turning point, the first equilibrium point set is divided into multiple first equilibrium point subsets, wherein the first first equilibrium point in the latter first equilibrium point subset is the last first equilibrium point in the previous first equilibrium point subset, and the first equilibrium point is the normal turning point.
6. The method according to any one of claims 1 to 5, characterized in that For each first equilibrium point subset, determining a boundary line corresponding to the first equilibrium point subset includes: A boundary line is calculated based on each point in the first equilibrium point subset, wherein the sum of squares of vertical distances from all points in the first equilibrium point subset to the boundary line is minimum.
7. The method according to claim 1, characterized in that The obtaining of initial point cloud data of the target environment includes: The initial point cloud data is obtained by rotating a single-point distance measuring unit, wherein the single-point distance measuring unit is used to obtain information of a measurement point through one measurement.
8. A map creation method, characterized in that: The method comprises: Obtaining initial point cloud data of the target environment, wherein the initial point cloud data includes coordinates of each measurement point in the target global coordinate system; Obtaining a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates and weights of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data; Obtaining boundary information of the target environment according to the centroid information set; According to the boundary information, an environmental map of the target environment is obtained, wherein when the environmental map is a 3D map, the centroid information set includes a second centroid information set corresponding to the 3D environment, and the boundary information includes a boundary plane, which is obtained based on a reference plane subset obtained by the second equilibrium point, and the reference plane subset is obtained by dividing the reference plane obtained based on the angle between the reference planes, and the reference plane is obtained by forming a plane into any three second equilibrium points that are closest to each other; wherein, the second centroid closest to the target origin of the target global coordinate system in the second centroid information set is used as the starting point, and the next second centroid closest to the starting point is determined, and the starting point and the next second centroid are used as a second centroid pair, and the next second centroid is updated as the starting point to repeat the step of determining the second centroid pair until the second centroid pair corresponding to the last second centroid is determined, and then for each second centroid pair, the second equilibrium point of the second centroid pair is obtained according to the coordinates and weights of each second centroid in the second centroid pair.
9. The method according to claim 8, characterized in that The origin of the target global coordinates is the starting point of the environment detection, and the centroid information set is obtained from the initial point cloud data, including: Performing grid division on the measurement points corresponding to the initial point cloud data with the target origin of the target global coordinate system as the origin and the first preset length as the side length; For each grid, the coordinates of the centroid of the grid are obtained according to the coordinates of each measurement point in the grid, and the weight corresponding to the centroid of the grid is obtained according to the number of measurement points in the grid.
10. The method according to claim 9, characterized in that In the case where the environment map is a 3D map, before performing grid division, obtaining a centroid information set from the initial point cloud data further includes: For each measurement point in the initial point cloud data, obtaining the number of measurement points within a sphere having the measurement point as the center and a second preset length as the radius; According to the number of measurement points in the sphere corresponding to the measurement point, it is determined whether to remove the measurement point to obtain second target point cloud data, wherein the grid division targets the measurement point corresponding to the second target point cloud data.
11. The method according to claim 8, characterized in that If the reference plane set includes multiple reference planes, the reference plane set is divided into multiple reference plane subsets based on the angles between the reference planes, including: Calculating the second normal of each reference plane to obtain a second normal set; Selecting a second normal from the second normals that have not been assigned to the second normal subset as an element in the current second normal subset, calculating an average normal vector angle based on the elements in the current second normal subset, and determining a current reference plane subset corresponding to the current second normal subset; Finding an adjacent plane from reference planes that are not assigned a reference plane subset according to the second equilibrium point included in the elements in the current reference plane subset; Calculating the vector angle of the second normal of the adjacent plane, and calculating the absolute angle between the average normal vector angle and the vector angle corresponding to the adjacent plane; Determining whether the absolute angle is greater than or equal to a third preset value; If it is less than, then add the adjacent plane to the current reference plane subset, add the second normal of the adjacent plane to the current second normal subset, and if the adjacent plane search is not completed, jump to the step of calculating the average normal vector angle until the adjacent plane search is completed and a reference plane subset is obtained; Repeat the steps of obtaining the reference plane subset to obtain multiple reference plane subsets.
12. The method according to claim 11, characterized in that The step of dividing the reference plane set into a plurality of reference plane subsets based on the angles between the reference planes further includes: If it is greater than or equal to the third preset value, the adjacent plane is not added to the current reference plane subset, and it is determined whether the adjacent plane search is completed; If the adjacent plane search is completed, the current reference plane subset is used as a reference plane subset; If the adjacent planes have not been searched, the process jumps to the step of calculating the average normal vector angle until the adjacent planes are searched and a reference plane subset is obtained.
13. The method according to any one of claims 8 to 12, characterized in that For each reference plane subset, determining a boundary plane corresponding to the reference plane subset includes: Obtaining a second normal line subset corresponding to each reference plane subset, wherein the second normal line subset includes the second normal of each reference plane in the corresponding reference plane subset; For each second normal subset, a target normal is obtained according to the second normal subset, and based on the target normal, a boundary plane corresponding to the reference plane subset corresponding to the second normal subset is obtained, wherein the sum of squares of all second equilibrium points in the reference plane subset to the boundary plane is minimized.
14. The method according to claim 8, characterized in that The obtaining of initial point cloud data of the target environment includes: The initial point cloud data is obtained by rotating a single-point distance measuring unit, wherein the single-point distance measuring unit is used to obtain information of a measurement point through one measurement.
15. A map creation device, characterized in that: The device comprises: A point cloud data acquisition module is used to obtain initial point cloud data of the target environment, wherein the initial point cloud data includes the coordinates of each measurement point in the target global coordinate system; a centroid calculation module, configured to obtain a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates and weights of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data; a boundary calculation module, configured to obtain boundary information of the target environment based on the centroid information set; A processing module is used to obtain an environmental map of the target environment based on the boundary information, wherein when the environmental map is a 2D map, the centroid information set includes a first centroid information set corresponding to the 2D environment, and the boundary information includes a boundary line, which is obtained based on a first equilibrium point subset obtained from the first equilibrium point, and the first equilibrium point subset is obtained by dividing the first equilibrium point obtained based on the normal turning point corresponding to the obtained first equilibrium point; wherein the boundary calculation module uses the first centroid closest to the target origin of the target global coordinate system in the first centroid information set as the starting point, determines the next first centroid closest to the starting point, and uses the starting point and the next first centroid as a first centroid pair, and updates the next first centroid as the starting point to repeat the step of determining the first centroid pair until the first centroid pair corresponding to the last first centroid is determined, and then for each first centroid pair, obtains the first equilibrium point of the first centroid pair according to the coordinates and weights of each first centroid in the first centroid pair.
16. A map creation device, characterized in that: The device comprises: A point cloud data acquisition module is used to obtain initial point cloud data of the target environment, wherein the initial point cloud data includes the coordinates of each measurement point in the target global coordinate system; a centroid calculation module, configured to obtain a centroid information set from the initial point cloud data, wherein the centroid information set includes coordinates and weights of each centroid, and the number of centroids in the centroid information set is less than the number of measurement points in the initial point cloud data; a boundary calculation module, configured to obtain boundary information of the target environment based on the centroid information set; A processing module is used to obtain an environmental map of the target environment based on the boundary information, wherein when the environmental map is a 3D map, the centroid information set includes a second centroid information set corresponding to the 3D environment, and the boundary information includes a boundary plane, which is obtained based on a reference plane subset obtained by the second equilibrium point, and the reference plane subset is obtained by dividing the reference plane obtained based on the angle between the reference planes, and the reference plane is obtained by forming a plane by any three second equilibrium points that are closest to each other; wherein the boundary calculation module uses the second centroid closest to the target origin of the target global coordinate system in the second centroid information set as the starting point, determines the next second centroid closest to the starting point, and uses the starting point and the next second centroid as a second centroid pair, and updates the next second centroid as the starting point to repeat the step of determining the second centroid pair until the second centroid pair corresponding to the last second centroid is determined, and then for each second centroid pair, obtains the second equilibrium point of the second centroid pair according to the coordinates and weights of each second centroid in the second centroid pair.
17. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the map creation method according to any one of claims 1 to 14.
18. The electronic device according to claim 17, wherein: The electronic device further includes a moving unit, a single-point ranging unit, a rotating unit and a posture acquiring unit. The moving unit is used to drive the electronic device to move; The single-point distance measuring unit is used to measure the distance between the single-point distance measuring unit and a measurement point; The rotating unit is used to drive the single-point ranging unit to rotate; The posture acquisition unit is used to obtain posture description information of the electronic device; The processor is electrically connected to the mobile unit, the single-point ranging unit, the rotation unit and the posture acquisition unit, and is used to realize movement by controlling the mobile unit, and obtain the initial point cloud data based on the received ranging information, rotation angle information and posture description information.
19. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the map creation method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Three-dimensional point cloud data feature point extraction method and application
CN111710023A
Boundary extraction method, device and equipment and storage medium
CN112288759A
Edge starting point extraction method and related device
CN114529735A
Point cloud filtering method, system and robot
CN114663616A