Pose repositioning method, device, equipment and medium of laser sweeper

文档序号:551882 发布日期:2021-05-14 浏览:2次 中文

阅读说明:本技术 激光扫地机的位姿重定位方法、装置、设备及介质 (Pose repositioning method, device, equipment and medium of laser sweeper ) 是由 王超 杨震宇 曹开齐 李显炽 于 2021-02-01 设计创作,主要内容包括:本申请涉及激光定位技术领域,揭示了一种激光扫地机的位姿重定位方法、装置、设备及介质,其中方法包括:获取位姿重定位请求;基于所述位姿重定位请求,获取历史栅格地图、待定位的点云数据和预设概率阈值;采用分支界定法和所述预设概率阈值,根据所述待定位的点云数据和所述历史栅格地图进行匹配,得到候选区域集合;根据所述候选区域集合,确定位姿重定位结果。从而实现了在不需要激光扫地机走动和/或旋转的情况下进行位姿重定位,避免在遇到复杂环境时无法脱困,减少由于走动和/或旋转带来的误差,提高了位姿重定位的准确性,减少了重定位的时间,提高了用户体验。(The application relates to the technical field of laser positioning, and discloses a method, a device, equipment and a medium for repositioning the pose of a laser sweeper, wherein the method comprises the following steps: acquiring a pose repositioning request; acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request; matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set; and determining a pose repositioning result according to the candidate area set. Therefore, the pose repositioning is realized without walking and/or rotating the laser sweeper, the situation that the laser sweeper cannot get rid of the trouble in a complex environment is avoided, errors caused by walking and/or rotating are reduced, the pose repositioning accuracy is improved, the repositioning time is shortened, and the user experience is improved.)

1. A pose repositioning method of a laser sweeper is characterized by comprising the following steps:

acquiring a pose repositioning request;

acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request;

matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set;

and determining a pose repositioning result according to the candidate area set.

2. The pose repositioning method of the laser sweeper according to claim 1, wherein the step of obtaining the pose repositioning request comprises:

acquiring a repositioning signal, and generating the pose repositioning request according to the repositioning signal, wherein the repositioning signal comprises: and any one of a starting signal, a ground signal and a wheel slip signal is put back after starting up and leaving the ground.

3. The pose repositioning method of the laser sweeper according to claim 2, wherein the step of acquiring the historical grid map, the point cloud data to be positioned and the preset probability threshold comprises:

when the relocation signal is the starting signal, obtaining a historical gray image, filtering the historical gray image to obtain a filtered historical gray image, and generating a grid map according to the filtered historical gray image to obtain the historical grid map;

and when the repositioning signal is the wheel slip signal or the ground signal is returned after the machine is started and the ground is lifted off, obtaining the grid map from the cache to obtain the historical grid map.

4. The pose repositioning method of the laser sweeper according to claim 1, wherein the step of acquiring the historical grid map, the point cloud data to be positioned and the preset probability threshold further comprises:

scanning through a laser sensor to obtain laser data to be processed;

performing point cloud format conversion on the laser data to be processed to obtain point cloud data to be processed;

and carrying out voxel filtering on the point cloud data to be processed according to the historical grid map to obtain the point cloud data to be positioned.

5. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of matching the point cloud data to be repositioned with the historical grid map by using a branch definition method and the preset probability threshold to obtain a candidate area set comprises:

taking the historical grid map as a grid map to be divided;

carrying out region division on the grid map to be divided by adopting a preset region division rule to obtain a plurality of regional grid maps;

respectively mapping the point cloud data to be positioned to each regional grid map in the plurality of regional grid maps to obtain a region to be calculated corresponding to each regional grid map in the plurality of regional grid maps;

respectively carrying out average calculation of the grid occupation probability on each area to be calculated to obtain the occupation probability average value corresponding to each area grid map in the plurality of area grid maps;

finding out all values larger than the preset probability threshold value from the occupation probability average value corresponding to each regional grid map in the regional grid maps to obtain a candidate occupation probability average value set;

respectively using the regional grid map corresponding to each occupation probability average value in the candidate occupation probability average value set as the grid map to be divided;

repeatedly executing the step of performing the area division on the grid map to be divided by adopting the preset area division rule to obtain a plurality of area grid maps until each grid map to be divided reaches the division finishing condition of the preset area division rule;

taking each grid map to be divided as a candidate area;

and obtaining the candidate region set according to all the candidate regions.

6. The pose repositioning method of the laser sweeper according to claim 5, wherein the step of mapping the point cloud data to be positioned to each of the plurality of area grid maps to obtain an area to be calculated corresponding to each of the plurality of area grid maps comprises:

respectively generating a reference pose for each of the grid maps of the plurality of area by adopting a preset reference pose determination rule to obtain a target reference pose corresponding to each grid map of the plurality of area;

and mapping the point cloud data to be positioned to each of the regional grid maps according to the target reference pose corresponding to each of the regional grid maps in the regional grid maps to obtain the region to be calculated corresponding to each of the regional grid maps in the regional grid maps.

7. The method for repositioning the pose of the laser sweeper according to claim 5, wherein the step of determining the result of repositioning the pose according to the set of candidate areas comprises:

finding out a maximum value from the occupation probability average values corresponding to the candidate regions in the candidate region set to obtain a target occupation probability average value;

and determining a pose repositioning result according to the candidate area corresponding to the target occupation probability average value.

8. The utility model provides a position appearance relocation device of laser machine of sweeping floor which characterized in that, the device includes:

the request acquisition module is used for acquiring a pose repositioning request;

the data acquisition module is used for acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request;

the candidate area determining module is used for matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set;

and the pose repositioning result determining module is used for determining a pose repositioning result according to the candidate area set.

9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.

Technical Field

The application relates to the technical field of laser positioning, in particular to a method, a device, equipment and a medium for repositioning the pose of a laser sweeper.

Background

When the position and pose of the laser sweeper in the existing market are needed to be repositioned, the laser sweeper rotates firstly and then repositions the position and pose, if the position and pose are not repositioned successfully, the laser sweeper walks for a certain distance straightly and rotates, then the laser sweeper repositions the position and pose, and the operations of straight walking, rotation and pose repositioning are repeated until the position and pose are repositioned successfully. Because the surrounding environment is unknown, the repeated straight walking-rotation-pose repositioning operation can cause the laser sweeper to be difficult to get rid of when encountering a complex environment, and cannot be cleaned as expected, thereby influencing the user experience; but also straight walking and rotating, prolonging the time of repositioning.

Disclosure of Invention

The main purpose of the application is to provide a method, a device, equipment and a medium for repositioning the pose of a laser sweeper, and the method, the device, the equipment and the medium aim to solve the technical problems that the pose repositioning method of the laser sweeper in the prior art cannot get rid of difficulties and cannot sweep according to expectations when meeting a complex environment, the repositioning time is prolonged, and the user experience is influenced.

In order to achieve the above object, the present application provides a method for repositioning a pose of a laser sweeper, including:

acquiring a pose repositioning request;

acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request;

matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set;

and determining a pose repositioning result according to the candidate area set.

Further, the step of obtaining a pose repositioning request includes:

acquiring a repositioning signal, and generating the pose repositioning request according to the repositioning signal, wherein the repositioning signal comprises: and any one of a starting signal, a ground signal and a wheel slip signal is put back after starting up and leaving the ground.

Further, the step of acquiring the historical grid map, the point cloud data to be positioned and the preset probability threshold includes:

when the relocation signal is the starting signal, obtaining a historical gray image, filtering the historical gray image to obtain a filtered historical gray image, and generating a grid map according to the filtered historical gray image to obtain the historical grid map;

and when the repositioning signal is the wheel slip signal or the ground signal is returned after the machine is started and the ground is lifted off, obtaining the grid map from the cache to obtain the historical grid map.

Further, the step of obtaining the historical grid map, the point cloud data to be positioned and the preset probability threshold further includes:

scanning through a laser sensor to obtain laser data to be processed;

performing point cloud format conversion on the laser data to be processed to obtain point cloud data to be processed;

and carrying out voxel filtering on the point cloud data to be processed according to the historical grid map to obtain the point cloud data to be positioned.

Further, the step of matching the point cloud data to be positioned with the historical grid map by using a branch definition method and the preset probability threshold to obtain a candidate area set includes:

taking the historical grid map as a grid map to be divided;

carrying out region division on the grid map to be divided by adopting a preset region division rule to obtain a plurality of regional grid maps;

respectively mapping the point cloud data to be positioned to each regional grid map in the plurality of regional grid maps to obtain a region to be calculated corresponding to each regional grid map in the plurality of regional grid maps;

respectively carrying out average calculation of the grid occupation probability on each area to be calculated to obtain the occupation probability average value corresponding to each area grid map in the plurality of area grid maps;

finding out all values larger than the preset probability threshold value from the occupation probability average value corresponding to each regional grid map in the regional grid maps to obtain a candidate occupation probability average value set;

respectively using the regional grid map corresponding to each occupation probability average value in the candidate occupation probability average value set as the grid map to be divided;

repeatedly executing the step of performing the area division on the grid map to be divided by adopting the preset area division rule to obtain a plurality of area grid maps until each grid map to be divided reaches the division finishing condition of the preset area division rule;

taking each grid map to be divided as a candidate area;

and obtaining the candidate region set according to all the candidate regions.

Further, the step of mapping the point cloud data to be positioned to each of the grid maps of the plurality of grid maps of the area to obtain the area to be calculated corresponding to each grid map of the area in the grid maps of the area includes:

respectively generating a reference pose for each of the grid maps of the plurality of area by adopting a preset reference pose determination rule to obtain a target reference pose corresponding to each grid map of the plurality of area;

and mapping the point cloud data to be positioned to each of the regional grid maps according to the target reference pose corresponding to each of the regional grid maps in the regional grid maps to obtain the region to be calculated corresponding to each of the regional grid maps in the regional grid maps.

Further, the step of determining a pose repositioning result according to the candidate region set includes:

finding out a maximum value from the occupation probability average values corresponding to the candidate regions in the candidate region set to obtain a target occupation probability average value;

and determining a pose repositioning result according to the candidate area corresponding to the target occupation probability average value.

This application has still provided a position appearance relocation device of laser machine of sweeping floor, the device includes:

the request acquisition module is used for acquiring a pose repositioning request;

the data acquisition module is used for acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request;

the candidate area determining module is used for matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set;

and the pose repositioning result determining module is used for determining a pose repositioning result according to the candidate area set.

The present application further proposes a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.

The present application also proposes a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any of the above.

The pose repositioning method, the pose repositioning device, the equipment and the medium of the laser sweeper acquire the historical grid map, the point cloud data to be positioned and the preset probability threshold value by acquiring the pose repositioning request and based on the pose repositioning request, adopt the branch definition method and the preset probability threshold value, matching according to the point cloud data to be positioned and the historical grid map to obtain a candidate area set, according to the candidate area set, the pose repositioning result is determined, and the pose repositioning can be performed only by acquiring the point cloud data to be positioned, so that the pose repositioning is performed without walking and/or rotating the laser sweeper, the problem that the laser sweeper cannot get rid of the trouble when encountering a complex environment is avoided, errors caused by walking and/or rotating are reduced, the pose repositioning accuracy is improved, the repositioning time is shortened, and the user experience is improved.

Drawings

Fig. 1 is a schematic flow chart of a pose repositioning method of a laser sweeper according to an embodiment of the present application;

fig. 2 is a schematic block diagram of a structure of a pose repositioning device of a laser sweeper according to an embodiment of the present application;

fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.

The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

In order to solve the technical problems that the pose repositioning method of the laser sweeper in the prior art cannot get rid of a trouble when meeting a complex environment, cannot sweep according to expectation, prolongs repositioning time and influences user experience, the application provides the pose repositioning method of the laser sweeper, and the method is applied to the technical field of laser positioning. According to the pose repositioning method of the laser sweeper, when the pose repositioning request is obtained, laser scanning is carried out under the conditions of no walking and no rotation, point cloud data are generated according to the data of the laser scanning, the point cloud data are matched with the historical grid map by adopting a branch definition method, the pose repositioning result is determined according to the matching result, and the pose repositioning can be carried out only by obtaining the point cloud data to be positioned, so that the pose repositioning is carried out under the condition that the laser sweeper does not need to walk and/or rotate, the problem that the laser sweeper cannot get out of position in a complex environment is avoided, errors caused by walking and/or rotating are reduced, the accuracy of the pose repositioning is improved, the time for repositioning is shortened, and the user experience is improved.

Referring to fig. 1, an embodiment of the present application provides a method for repositioning a pose of a laser sweeper, where the method includes:

s1: acquiring a pose repositioning request;

s2: acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request;

s3: matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set;

s4: and determining a pose repositioning result according to the candidate area set.

According to the method, the historical grid map, the point cloud data to be positioned and the preset probability threshold are obtained based on the pose repositioning request, a branch definition method and the preset probability threshold are adopted, matching is carried out according to the point cloud data to be positioned and the historical grid map to obtain the candidate area set, the pose repositioning result is determined according to the candidate area set, and the pose repositioning can be carried out only by obtaining the point cloud data to be positioned, so that the pose repositioning is carried out without walking and/or rotating the laser sweeper, the problem that the laser sweeper cannot get out of position in a complex environment is avoided, errors caused by walking and/or rotating are reduced, the accuracy of the pose repositioning is improved, the repositioning time is shortened, and the user experience is improved.

It can be understood that the pose repositioning method of the laser sweeper can be applied to the laser sweeper and can also be applied to other equipment which adopts laser to position. For example, the laser positioning device drives a car, and the laser positioning device is not limited in this embodiment.

A laser sweeper is a sweeper which adopts laser to position.

For S1, the pose repositioning request may be sent by the user, or may be triggered by the program file implementing the present application.

The pose repositioning request is a request for repositioning the current pose (pose in a two-dimensional space) of the laser sweeper.

And S2, responding to the pose repositioning request, controlling a laser sensor of the laser sweeper to perform laser scanning for one circle on the surrounding environment to obtain laser data, performing point cloud format conversion according to the laser data, and taking all the converted point clouds as point cloud data to be positioned. It can be understood that in the process of laser scanning and point cloud data determination, the laser sweeper does not need to be controlled to move, and the laser sweeper does not need to be controlled to rotate.

The laser sweeper is characterized in that a laser sensor is mounted at the top end of the laser sweeper, the laser sensor is used for emitting laser and receiving laser reflected by an obstacle, and the distance between the laser sweeper and the obstacle is determined according to the time difference between the emitted laser and the reflected laser.

The historical grid map can be obtained from a database, and the historical grid map can also be obtained from a cache.

The historical grid map is generated according to data obtained by historical laser scanning of the laser sweeper.

A grid map, also called a raster image, refers to an image that has been discretized in both space and intensity. We can consider a raster image as a matrix, where any element in the matrix corresponds to a point in the image and the corresponding value corresponds to the gray level of the point, and the elements in the digital matrix are called pixels.

Optionally, the history grid map is a ternary map generated according to a PGM (portable grayscale image format) image in a P5 format (one type of portable grayscale image format), wherein each grid in each ternary map corresponds to one pixel, the resolution of the history grid map is x, each pixel represents x × x (x × x is the area of one grid), when a grid is occupied, the pixel value of the pixel corresponding to the grid is 254, when a grid is not occupied, the pixel value of the pixel corresponding to the grid is 1, and when it is not determined whether a grid is occupied, the pixel value of the pixel corresponding to the grid is 255.

The preset probability threshold value can be obtained from a database, can also be obtained from a cache, and can also be written into a program file for realizing application.

For S3, performing area division on the historical grid map according to a tree structure, mapping the point cloud data to be positioned to areas of the grid map corresponding to the nodes obtained through division for each layer of division, then performing pruning operation by adopting a branch definition method based on the occupation probability of the grid, after the last layer of area division and pruning operation is completed, taking the area of each reserved minimum grid map as a candidate area, and taking all the candidate areas as a candidate area set, wherein when the pruning operation is performed by adopting the branch definition method, nodes smaller than or equal to the preset probability threshold value and all child nodes of the nodes are pruned, namely, the areas of the grid map corresponding to the nodes smaller than or equal to the preset probability threshold value are discarded. That is, the candidate region is a region of the smallest grid map that can be divided.

The preset probability threshold is a value from 0 to 1, and does not include 0 nor 1.

Optionally, the preset probability threshold is set to 0.5. Therefore, the efficiency of branch and bound is improved, and the situation that the candidate area cannot be found in transition pruning is avoided.

For S4, when the candidate region set is not empty, selecting a candidate region with the largest occupation probability average value from the candidate region set, and determining a pose repositioning result according to the selected candidate region; and when the candidate area set is empty, generating a reconstructed map signal, wherein the reconstructed map signal is used for controlling the laser sweeper to reconstruct the grid map through walking and rotating operations.

It will be appreciated that the pose repositioning result in a pose in two-dimensional space.

In an embodiment, the step of obtaining a pose repositioning request includes:

s11: acquiring a repositioning signal, and generating the pose repositioning request according to the repositioning signal, wherein the repositioning signal comprises: and any one of a starting signal, a ground signal and a wheel slip signal is put back after starting up and leaving the ground.

According to the embodiment, the pose repositioning request is automatically generated according to the repositioning signal, so that the automation performance of the laser sweeper is improved, and the user experience is further improved.

For S11, the user may operate the power-on button on the touch screen of the laser sweeper, and the power-on button will automatically trigger the power-on signal when clicked. The user can also press a startup key of the laser sweeper, and the startup key automatically triggers a startup signal when pressed. The user can also operate the start button in the cell-phone APP with laser machine communication connection of sweeping the floor, and the start signal will be triggered automatically when the start button is clicked. The user can also press a starting button in a remote controller which is in communication connection with the laser sweeper, and the starting button automatically triggers a starting signal when pressed.

When the laser sweeper is placed back to the ground after being lifted off under the condition of detecting the power-on state, a signal for placing back to the ground after being started up and lifted off is automatically triggered.

When the laser sweeper detects that the wheel slips, a wheel slip signal is automatically triggered.

When the processor of the laser sweeper receives the repositioning signal, a pose repositioning request is generated and sent to the software program module receiving the request.

In an embodiment, the step of obtaining the historical grid map, the point cloud data to be positioned, and the preset probability threshold includes:

s211: when the relocation signal is the starting signal, obtaining a historical gray image, filtering the historical gray image to obtain a filtered historical gray image, and generating a grid map according to the filtered historical gray image to obtain the historical grid map;

s212: and when the repositioning signal is the wheel slip signal or the ground signal is returned after the machine is started and the ground is lifted off, obtaining the grid map from the cache to obtain the historical grid map.

The method and the device realize the determination of the historical grid map according to the repositioning signal, thereby meeting the pose repositioning requirements of different scenes and being beneficial to improving the pose repositioning efficiency.

For S211, in order to reduce the storage space, when the laser sweeper is turned off, the grid map in the cache needs to be converted into a grayscale image for storage.

When the repositioning signal is the starting signal, the laser sweeper needs to be reloaded into a historical map, at this time, a historical gray image can be obtained from a database, then the historical gray image is subjected to filtering processing, the image obtained through the filtering processing is used as the filtered historical gray image, so that the noise of the image is reduced, finally, grid map generation is carried out on the filtered historical gray image, and the generated grid map is used as the historical grid map.

And the historical gray image is the gray image converted by the grid map.

For S212, when the repositioning signal is the wheel slip signal or the signal that the laser sweeper is turned on and then returned to the ground after being lifted off the ground, the grid map in the cache is the map that the laser sweeper is using, and the map is not yet available to be converted into a gray scale map for storage, so that the grid map can be directly obtained from the cache, and the obtained grid map is used as the historical grid map, thereby improving the speed of obtaining the historical grid map, improving the speed of repositioning the pose, and further improving the user experience.

In an embodiment, the step of obtaining the historical grid map, the point cloud data to be positioned, and the preset probability threshold further includes:

s221: scanning through a laser sensor to obtain laser data to be processed;

s222: performing point cloud format conversion on the laser data to be processed to obtain point cloud data to be processed;

s223: and carrying out voxel filtering on the point cloud data to be processed according to the historical grid map to obtain the point cloud data to be positioned.

According to the method and the device, voxel filtering is carried out on the point cloud data, and downsampling of the point cloud data is achieved, so that at most one point is mapped to the same grid when the point cloud data to be positioned are mapped to the historical grid map, accuracy of determining a candidate area is improved, and accuracy of pose repositioning is improved.

And S221, controlling a laser sensor of the laser sweeper to perform laser scanning on the surrounding environment for one circle, and taking laser data obtained through laser scanning as laser data to be processed.

The points scanned by the laser sweeper during the laser scanning process are collected in a distance and angle mode, that is, the distance and angle of each point are included in the laser data to be processed.

For S222, the point cloud data to be processed is expressed as (x, y), that is, the point cloud data to be processed is two-dimensional data.

The calculation formula of the point cloud data to be processed expressed as (x, y) is as follows:

x=range*cos(θ)

y=range*sin(θ)

where range is a distance of a point of the laser data to be processed, and θ is an angle of the point of the laser data to be processed.

For S223, acquiring the grid map resolution of the historical grid map; and performing voxel filtering on the point cloud data to be processed by adopting a voxel grid filter according to the grid map resolution, and taking the point cloud data left after voxel filtering as the point cloud data to be positioned, so that at most one point is mapped to the same grid when the point cloud data to be positioned is mapped to the historical grid map, thereby removing redundant points and reducing the phenomenon of inaccurate calculation in the matching process caused by the redundant points in the same grid.

The implementation method and principle of the voxel grid filter are not described in detail herein.

In an embodiment, the step of obtaining a candidate area set by matching the point cloud data to be located with the historical grid map by using a branch definition method and the preset probability threshold includes:

s31: taking the historical grid map as a grid map to be divided;

s32: carrying out region division on the grid map to be divided by adopting a preset region division rule to obtain a plurality of regional grid maps;

s33: respectively mapping the point cloud data to be positioned to each regional grid map in the plurality of regional grid maps to obtain a region to be calculated corresponding to each regional grid map in the plurality of regional grid maps;

s34: respectively carrying out average calculation of the grid occupation probability on each area to be calculated to obtain the occupation probability average value corresponding to each area grid map in the plurality of area grid maps;

s35: finding out all values larger than the preset probability threshold value from the occupation probability average value corresponding to each regional grid map in the regional grid maps to obtain a candidate occupation probability average value set;

s36: respectively using the regional grid map corresponding to each occupation probability average value in the candidate occupation probability average value set as the grid map to be divided;

s37: repeatedly executing the step of performing the area division on the grid map to be divided by adopting the preset area division rule to obtain a plurality of area grid maps until each grid map to be divided reaches the division finishing condition of the preset area division rule;

s38: taking each grid map to be divided as a candidate area;

s39: and obtaining the candidate region set according to all the candidate regions.

According to the embodiment, the pruning operation is carried out by adopting a branch definition method based on the occupation probability of the grids, so that the areas needing to be matched are reduced, and the candidate areas can be obtained quickly; and the preset probability threshold is adopted as the lower limit probability of pruning, so that the control on the pruning degree is facilitated.

For step S32, a preset area division rule is adopted to divide the grid map to be divided into a plurality of areas, and each area is taken as an area grid map.

Optionally, the preset region division rule includes a preset division layer number and a minimum region grid number; and calculating to obtain the divided area quantity of each node of each layer according to the preset divided layer number, the minimum area grid quantity and the grid resolution of the grid map to be divided. The total matching time length is favorably controlled by controlling the number of the divided layers. For example, if the number of the divided areas of each node on the layer 1 is 4, the grid map to be divided is divided into 4 areas, and the number of the area grid maps in the plurality of area grid maps is 4, which is not specifically limited in this example.

Optionally, the setting of the preset region division rule includes presetting the number of the divided regions of each node and the minimum number of the grids of the regions, so that the range of pruning is favorably controlled. For example, if the number of the divided areas of each node is preset to be 6, the grid map to be divided is divided into 6 areas, and the number of the area grid maps in the plurality of area grid maps is 6, which is not specifically limited in this example.

For S33, extracting an area grid map from the area grid maps to obtain an area grid map to be mapped; mapping the point cloud data to be positioned to the regional grid map to be mapped, and taking all grids mapped on the regional grid map to be mapped as a region to be calculated corresponding to the regional grid map to be mapped; and repeatedly executing the step of extracting one regional grid map from the plurality of regional grid maps to obtain the regional grid map to be mapped until the region to be calculated corresponding to each regional grid map in the plurality of regional grid maps is determined. It will be appreciated that when mapping the point cloud data to be located onto the grid map of the area to be mapped, at most one point per grid will be mapped. That is, the area to be calculated is a partial area of the area grid map.

For step S34, extracting one region to be calculated from all the regions to be calculated to obtain a target region to be calculated; converting pixel points corresponding to each grid in a region to be calculated of a target into occupation probabilities; calculating the average value of the occupation probabilities of all grids in the target area to be calculated, and taking the calculated average value as the average value of the occupation probabilities corresponding to the target area to be calculated; and repeatedly executing the step of extracting one region to be calculated from all the regions to be calculated to obtain the region to be calculated of the target until the occupation probability average value corresponding to each regional grid map in the plurality of regional grid maps is determined.

For example, when the value of the pixel corresponding to the grid is 1, it is determined that the occupation probability corresponding to the grid is 0.1, when the value of the pixel corresponding to the grid is 254, it is determined that the occupation probability corresponding to the grid is 0.9, and when the value of the pixel corresponding to the grid is 255, it is determined that the occupation probability corresponding to the grid is a value greater than 0.1 and less than 0.9, which is not specifically limited in this example.

For S35, finding all values greater than the preset probability threshold from the occupancy probability average corresponding to each of the grid maps of the plurality of grid maps of regions, taking each of the found occupancy probability averages as a candidate occupancy probability average, and taking all the candidate occupancy probability averages as a candidate occupancy probability average set. That is, the average value of the occupancy probability less than or equal to the preset probability threshold is discarded, so that the pruning operation of the area grid map corresponding to the average value of the occupancy probability less than or equal to the preset probability threshold is realized.

And S36, taking the grid map of the area corresponding to each average value of the occupation probability as the grid map to be divided, and preparing for area division at the next time.

For S37, the steps S32 to S37 are repeatedly performed until each of the grid maps to be divided reaches the end division condition of the preset area division rule. By repeatedly executing the steps S32 to S37, matching is carried out according to the point cloud data to be positioned and the historical grid map by adopting a branch definition method and the preset probability threshold.

Optionally, the grid map to be divided reaches the end division condition of the preset area division rule, which includes but is not limited to: and the average value of the occupation probabilities corresponding to each regional grid map in the regional grid maps corresponding to the grid map to be divided is less than or equal to the preset probability threshold value or reaches the preset number of dividing layers. The grid number of the grid map to be divided is less than or equal to the minimum area grid number of the preset area division rule.

As for S38, the grid maps to be divided remaining after repeatedly performing steps S32 to S37 are all areas satisfying the matching condition, and thus each of the grid maps to be divided can be regarded as one candidate area.

For S39, all the candidate regions are taken as the candidate region set. It is to be understood that the number of the candidate regions in the candidate region set may be 1, may be multiple, or may be 0.

In an embodiment, the step of mapping the point cloud data to be positioned to each of the grid maps of the plurality of area to obtain the area to be calculated corresponding to each of the grid maps of the area includes:

s331: respectively generating a reference pose for each of the grid maps of the plurality of area by adopting a preset reference pose determination rule to obtain a target reference pose corresponding to each grid map of the plurality of area;

s332: and mapping the point cloud data to be positioned to each of the regional grid maps according to the target reference pose corresponding to each of the regional grid maps in the regional grid maps to obtain the region to be calculated corresponding to each of the regional grid maps in the regional grid maps.

According to the method and the device, the point cloud data to be positioned are respectively mapped to each regional grid map in the plurality of regional grid maps based on the target reference pose, so that a foundation is provided for the follow-up calculation of the average value of the occupation probability.

For S331, a preset reference pose determination rule is adopted to perform reference pose generation on each of the grid maps, that is, each grid map has an individual target reference pose.

The preset reference pose determination rules include, but are not limited to: and taking the point at the upper left corner as a reference pose.

For step S332, extracting an area grid map from the plurality of area grid maps to obtain an area grid map to be mapped; based on a target reference pose corresponding to an area grid map to be mapped, mapping the point cloud data to be positioned onto the area grid map to be mapped, and taking all grids mapped on the area grid map to be mapped as an area to be calculated corresponding to the area grid map to be mapped; and repeatedly executing the step of extracting one regional grid map from the plurality of regional grid maps to obtain the regional grid map to be mapped until the region to be calculated corresponding to each regional grid map in the plurality of regional grid maps is determined.

In an embodiment, the step of determining a pose repositioning result according to the candidate region set includes:

s41: finding out a maximum value from the occupation probability average values corresponding to the candidate regions in the candidate region set to obtain a target occupation probability average value;

s42: and determining a pose repositioning result according to the candidate area corresponding to the target occupation probability average value.

According to the method and the device, the pose repositioning result is determined according to the candidate area set, so that the accuracy of determining the pose repositioning result is further improved.

For S41, finding a maximum value from the occupancy probability average values corresponding to the candidate regions in the candidate region set, and taking the occupancy probability average value corresponding to the maximum value as a target occupancy probability average value.

For S42, the candidate region corresponding to the target occupation probability average is taken as a target candidate region.

And taking the target reference pose corresponding to the target candidate area as a pose repositioning result.

Optionally, the center point of the target candidate region is used as a pose repositioning result.

Optionally, the central point of the to-be-calculated region corresponding to the target candidate region is used as a pose repositioning result.

Referring to fig. 2, the present application further provides a pose repositioning device of a laser sweeper, the device including:

a request obtaining module 100, configured to obtain a pose repositioning request;

a data obtaining module 200, configured to obtain a historical grid map, point cloud data to be positioned, and a preset probability threshold based on the pose repositioning request;

a candidate region determining module 300, configured to match the point cloud data to be located with the historical grid map by using a branch definition method and the preset probability threshold to obtain a candidate region set;

and a pose repositioning result determining module 400, configured to determine a pose repositioning result according to the candidate region set.

According to the method, the historical grid map, the point cloud data to be positioned and the preset probability threshold are obtained based on the pose repositioning request, a branch definition method and the preset probability threshold are adopted, matching is carried out according to the point cloud data to be positioned and the historical grid map to obtain the candidate area set, the pose repositioning result is determined according to the candidate area set, and the pose repositioning can be carried out only by obtaining the point cloud data to be positioned, so that the pose repositioning is carried out without walking and/or rotating the laser sweeper, the problem that the laser sweeper cannot get out of position in a complex environment is avoided, errors caused by walking and/or rotating are reduced, the accuracy of the pose repositioning is improved, the repositioning time is shortened, and the user experience is improved.

In one embodiment, the request obtaining module 100 includes: a relocation signal acquisition submodule and a request generation submodule;

the relocation signal acquisition submodule is configured to acquire a relocation signal, where the relocation signal includes: any one of a starting signal, a ground signal and a wheel slip signal is put back after starting up and leaving the ground;

and the request generation submodule is used for generating the pose repositioning request according to the repositioning signal.

In one embodiment, the data obtaining module 200 includes: a first historical grid map acquisition submodule and a second historical grid map acquisition submodule;

the first historical grid map obtaining submodule is used for obtaining a historical gray image when the relocation signal is the starting signal, filtering the historical gray image to obtain a filtered historical gray image, and generating a grid map according to the filtered historical gray image to obtain the historical grid map;

and the second historical grid map acquisition submodule is used for acquiring a grid map from a cache to obtain the historical grid map when the repositioning signal is the wheel slip signal or the ground signal is put back after the machine is started up and the ground is lifted off.

In one embodiment, the data obtaining module 200 further includes: the system comprises a laser scanning sub-module, a point cloud data generation sub-module and a voxel filtering sub-module;

the laser scanning submodule is used for scanning through the laser sensor to obtain laser data to be processed;

the point cloud data generation submodule is used for carrying out point cloud format conversion on the laser data to be processed to obtain point cloud data to be processed;

and the voxel filtering submodule is used for carrying out voxel filtering on the point cloud data to be processed according to the historical grid map to obtain the point cloud data to be positioned.

In one embodiment, the candidate region determining module 300 includes: the device comprises a grid map determining submodule to be divided, a region dividing submodule, a region determining submodule to be calculated, an occupation probability average value determining submodule, a candidate occupation probability average value determining submodule, a circulation control self-module, a candidate region submodule and a candidate region set determining submodule;

the grid map to be divided determining submodule is used for taking the historical grid map as the grid map to be divided;

the area division submodule is used for carrying out area division on the grid map to be divided by adopting a preset area division rule to obtain a plurality of area grid maps;

the to-be-calculated area determining submodule is used for mapping the point cloud data to be positioned to each of the plurality of area grid maps to obtain an area to be calculated corresponding to each of the plurality of area grid maps;

the occupation probability average value determining submodule is used for respectively carrying out average value calculation of grid occupation probability on each area to be calculated to obtain an occupation probability average value corresponding to each regional grid map in the plurality of regional grid maps;

the candidate occupation probability average value determining submodule is used for finding out all values larger than the preset probability threshold value from the occupation probability average value corresponding to each regional grid map in the plurality of regional grid maps to obtain a candidate occupation probability average value set;

the cyclic control self module is configured to respectively use the area grid map corresponding to each occupancy probability average value in the candidate occupancy probability average value set as one grid map to be divided, and repeatedly execute the step of performing area division on the grid map to be divided by using a preset area division rule to obtain a plurality of area grid maps until each grid map to be divided reaches an end division condition of the preset area division rule;

the candidate area sub-module is used for taking each grid map to be divided as a candidate area;

and the candidate region set determining submodule is used for obtaining the candidate region set according to all the candidate regions.

In one embodiment, the area determining submodule to be calculated includes: a target reference pose determining submodule and a point cloud data mapping submodule;

the target reference pose determining submodule is used for generating a reference pose of each of the grid maps of the plurality of area by adopting a preset reference pose determining rule to obtain a target reference pose corresponding to each grid map of the plurality of area;

the point cloud data mapping submodule is used for mapping the point cloud data to be positioned to each of the plurality of regional grid maps according to the target reference pose corresponding to each of the regional grid maps in the plurality of regional grid maps to obtain the region to be calculated corresponding to each of the regional grid maps in the plurality of regional grid maps.

In one embodiment, the pose repositioning result determining module 400 includes: a target occupation probability average value determining submodule and a pose repositioning result determining submodule;

the target occupation probability average value determining submodule is used for finding out a maximum value from the occupation probability average values corresponding to the candidate areas in the candidate area set to obtain a target occupation probability average value;

and the pose repositioning result determining submodule is used for determining a pose repositioning result according to the candidate area corresponding to the target occupation probability average value.

Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer equipment is used for storing data such as a pose repositioning method of the laser sweeper and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a pose repositioning method of the laser sweeper. The pose repositioning method of the laser sweeper comprises the following steps: acquiring a pose repositioning request; acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request; matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set; and determining a pose repositioning result according to the candidate area set.

According to the method, the historical grid map, the point cloud data to be positioned and the preset probability threshold are obtained based on the pose repositioning request, a branch definition method and the preset probability threshold are adopted, matching is carried out according to the point cloud data to be positioned and the historical grid map to obtain the candidate area set, the pose repositioning result is determined according to the candidate area set, and the pose repositioning can be carried out only by obtaining the point cloud data to be positioned, so that the pose repositioning is carried out without walking and/or rotating the laser sweeper, the problem that the laser sweeper cannot get out of position in a complex environment is avoided, errors caused by walking and/or rotating are reduced, the accuracy of the pose repositioning is improved, the repositioning time is shortened, and the user experience is improved.

An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for repositioning a pose of a laser sweeper, and the method includes: acquiring a pose repositioning request; acquiring a historical grid map, point cloud data to be positioned and a preset probability threshold value based on the pose repositioning request; matching the point cloud data to be positioned with the historical grid map by adopting a branch definition method and the preset probability threshold value to obtain a candidate area set; and determining a pose repositioning result according to the candidate area set.

According to the executed pose repositioning method of the laser sweeper, the historical grid map, the point cloud data to be repositioned and the preset probability threshold are obtained through obtaining the pose repositioning request based on the pose repositioning request, the branch definition method and the preset probability threshold are adopted, matching is carried out according to the point cloud data to be repositioned and the historical grid map to obtain the candidate area set, the pose repositioning result is determined according to the candidate area set, the pose repositioning can be carried out only by obtaining the point cloud data to be repositioned, the pose repositioning is carried out under the condition that the laser sweeper does not need to walk and/or rotate, the situation that the laser sweeper cannot get out of position when encountering a complex environment is avoided, errors caused by walking and/or rotating of the pose are reduced, the repositioning accuracy is improved, the repositioning time is shortened, and user experience is improved.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.

The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于RGB-D相机的回环检测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!