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

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

阅读说明:本技术 激光扫地机的位姿重定位方法、装置、设备及介质 (Pose repositioning method, device, equipment and medium of laser sweeper ) 是由 王超 曹开齐 李显炽 于 2021-02-01 设计创作,主要内容包括:本申请涉及一种激光扫地机的位姿重定位方法、装置、设备及介质,其中方法包括:根据历史灰度地图得到第一线特征数据和第一角点信息数据并存储到第一结构体中;采用预设角度阈值根据待定位的点云数据得到第二线特征数据和第二角点信息数据并存储到第二结构体中;将第一结构体和第二结构体进行对比确定待处理的位姿旋转角度;采用似然域概率模型根据历史灰度地图和待处理的位姿旋转角度进行每个候选位姿点的概率值计算,得到候选位姿点概率值集合;基于ICP算法采用预设占用概率平均值和预设概率值根据候选位姿点概率值集合、历史灰度地图和待定位的点云数据进行位姿重定位确定得到位姿重定位结果。缩短了重定位的时间,提高了重定位的准确性。(The application relates to a pose repositioning method, a pose repositioning device, pose repositioning equipment and a pose repositioning medium of a laser sweeper, wherein the method comprises the following steps: obtaining first line characteristic data and first corner point information data according to a historical gray map and storing the first line characteristic data and the first corner point information data into a first structural body; obtaining second line characteristic data and second corner point information data according to the point cloud data to be positioned by adopting a preset angle threshold value and storing the second line characteristic data and the second corner point information data into a second structural body; comparing the first structural body with the second structural body to determine a pose rotation angle to be processed; calculating the probability value of each candidate pose point by adopting a likelihood domain probability model according to the historical gray map and the pose rotation angle to be processed to obtain a candidate pose point probability value set; and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and point cloud data to be positioned by adopting a preset occupation probability average value and a preset probability value based on an ICP (inductively coupled plasma) algorithm to obtain a pose repositioning result. The repositioning time is shortened, and the repositioning accuracy 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 gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure;

acquiring point cloud data to be positioned and a preset angle threshold, extracting the line features and the angle point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line feature data and second angle point information data, and storing the second line feature data and the second angle point information data into a second structural body;

comparing the first structural body with the second structural body, and determining a pose rotation angle to be processed;

calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by adopting a likelihood domain probability model to obtain a candidate pose point probability value set;

and calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result.

2. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of extracting line features and corner information according to the historical gray scale map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data in a first structure body comprises:

carrying out image corrosion, image expansion, edge detection and binarization processing on the historical gray map to obtain a preprocessed historical gray map;

performing straight line extraction according to the preprocessed historical gray map by adopting Hough transform to obtain the first line feature data;

calculating corner information between every two adjacent first line features of all the first line features in the first line feature data to obtain first corner information data;

storing the first line characteristic data and the first corner information data into the first structure in a clockwise direction.

3. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of extracting the line feature and the corner information from the point cloud data to be repositioned by using the preset angle threshold to obtain second line feature data and second corner information data, and storing the second line feature data and the second corner information data in a second structural body comprises:

carrying out gray map conversion on the point cloud data to be positioned to obtain a current gray map;

carrying out image corrosion, image expansion, edge detection and binarization processing on the current gray-scale map to obtain a preprocessed current gray-scale map;

performing straight line extraction according to the preprocessed current gray level map by adopting Hough transform to obtain second line feature data;

based on the preset angle threshold, performing corner information calculation between every two adjacent second line features on all the second line features in the second line feature data to obtain second corner information data;

and storing the second line feature data and the second corner information data into the second structural body in a clockwise direction.

4. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of comparing the first structural body with the second structural body to determine the pose rotation angle to be processed comprises:

performing corner information matching on the first corner information data in the first structural body and the second corner information data in the second structural body to obtain a corner information set to be processed;

judging whether a first line characteristic corresponding to each corner information in the corner information set to be processed in the first structural body corresponds to a second line characteristic corresponding to each corner information in the second structural body;

when a first line feature corresponding to the corner information in the corner information set to be processed in the first structural body and a second line feature corresponding to the corner information in the second structural body are corresponding, taking the first line feature corresponding to the corner information in the first structural body and the second line feature corresponding to the corner information in the corner information set to be processed as the corner information;

and performing coordinate transformation according to the target corner point information and the first line characteristics of the target corner point information in the first structural body to obtain the pose rotation angle to be processed.

5. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by using a likelihood domain probability model to obtain a candidate pose point probability value set comprises the following steps:

generating a grid map according to the historical gray scale map to obtain a historical grid map;

calculating pose points according to the historical grid map by adopting a uniform point scattering mode, preset point scattering intervals and the pose rotation angle to be processed to obtain a plurality of candidate pose points;

and calculating the probability value of each candidate pose point according to the historical grid map by adopting the likelihood domain probability model aiming at each candidate pose point in the candidate pose points to obtain the candidate pose point probability value set.

6. The method for repositioning the pose of the laser sweeper according to claim 1, wherein the step of determining the repositioning of the pose according to the candidate pose point probability value set, the historical gray map and the point cloud data to be positioned by adopting a preset occupation probability average value and a preset probability value in a mode of calculating an error value based on an ICP algorithm and a preset loss function to obtain a repositioning result of the pose comprises the following steps:

carrying out normalization processing on the candidate pose point probability value set to obtain a probability set after normalization processing;

finding out all candidate pose point probability values which are greater than the preset probability value from the probability set after the normalization processing to obtain a candidate pose point probability value set to be processed;

based on the ICP algorithm, calculating an error value by adopting a preset loss function and a random consistency sampling algorithm, and according to the point cloud data to be positioned, respectively correcting the candidate pose point corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed to obtain corrected pose points corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed;

and determining pose repositioning according to all the corrected pose points, the historical gray map and the point cloud data to be positioned by adopting the preset average occupation probability to obtain a pose repositioning result.

7. The pose repositioning method of the laser sweeper according to claim 6, wherein the step of determining pose repositioning according to all the corrected pose points, the historical gray map and the point cloud data to be repositioned by using the preset average occupation probability to obtain the pose repositioning result comprises:

generating a grid map according to the historical gray scale map to obtain a historical grid map;

respectively mapping the point cloud data to be positioned onto the historical grid map according to each corrected pose point to obtain a map area to be calculated corresponding to each corrected pose point;

respectively calculating the average value of the occupation probability of the grids in each map area to be calculated to obtain the average value of the occupation probability to be processed corresponding to each corrected pose point;

finding out all values larger than the preset occupation probability average value from all the to-be-processed occupation probability average values to obtain a candidate occupation probability average value set;

when the candidate occupation probability average value set is not empty, finding out the maximum occupation probability average value from the candidate occupation probability average value set to obtain a target occupation probability average value, taking the corrected pose point corresponding to the target occupation probability average value as the pose repositioning result, and otherwise, determining that the pose repositioning result is repositioning failure.

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 first structure body determining module is used for acquiring a historical gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure body;

the second structure body determining module is used for acquiring point cloud data to be positioned and a preset angle threshold, extracting the line characteristics and the angular point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line characteristic data and second angular point information data, and storing the second line characteristic data and the second angular point information data into a second structure body;

the to-be-processed pose rotation angle determining module is used for comparing the first structural body with the second structural body and determining the to-be-processed pose rotation angle;

a candidate pose point probability value set determining module, configured to calculate a probability value of each candidate pose point according to the historical grayscale map and the pose rotation angle to be processed by using a likelihood domain probability model to obtain a candidate pose point probability value set;

and the pose repositioning result determining module is used for calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be positioned to obtain a pose repositioning result.

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 and rotates, the operations of straight walking, rotation and position and pose repositioning are repeated until the position and pose are repositioned successfully, the repositioning time is prolonged, and the user experience is reduced; and the noise in the rotating process brings about the problem of inaccurate angle, thus influencing the accuracy of relocation.

Disclosure of Invention

The main purpose of the present application is to provide a method, an apparatus, a device, and a medium for repositioning the pose of a laser sweeper, which are intended to solve the technical problems that the repositioning method of the laser sweeper in the prior art repeats straight walking-rotation-pose repositioning operations, the repositioning time is prolonged, the repositioning accuracy is affected by the problem that the angle is inaccurate due to noise in the rotation process, and the user experience is reduced.

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 gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure;

acquiring point cloud data to be positioned and a preset angle threshold, extracting the line features and the angle point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line feature data and second angle point information data, and storing the second line feature data and the second angle point information data into a second structural body;

comparing the first structural body with the second structural body, and determining a pose rotation angle to be processed;

calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by adopting a likelihood domain probability model to obtain a candidate pose point probability value set;

and calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result.

Further, the step of extracting line features and corner information according to the historical grayscale map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data in a first structure includes:

carrying out image corrosion, image expansion, edge detection and binarization processing on the historical gray map to obtain a preprocessed historical gray map;

performing straight line extraction according to the preprocessed historical gray map by adopting Hough transform to obtain the first line feature data;

calculating corner information between every two adjacent first line features of all the first line features in the first line feature data to obtain first corner information data;

storing the first line characteristic data and the first corner information data into the first structure in a clockwise direction.

Further, the step of extracting the line features and the corner information from the point cloud data to be positioned by using the preset angle threshold to obtain second line feature data and second corner information data, and storing the second line feature data and the second corner information data in a second structural body includes:

carrying out gray map conversion on the point cloud data to be positioned to obtain a current gray map;

carrying out image corrosion, image expansion, edge detection and binarization processing on the current gray-scale map to obtain a preprocessed current gray-scale map;

performing straight line extraction according to the preprocessed current gray level map by adopting Hough transform to obtain second line feature data;

based on the preset angle threshold, performing corner information calculation between every two adjacent second line features on all the second line features in the second line feature data to obtain second corner information data;

and storing the second line feature data and the second corner information data into the second structural body in a clockwise direction.

Further, the step of comparing the first structural body with the second structural body and determining the pose rotation angle to be processed includes:

performing corner information matching on the first corner information data in the first structural body and the second corner information data in the second structural body to obtain a corner information set to be processed;

judging whether a first line characteristic corresponding to each corner information in the corner information set to be processed in the first structural body corresponds to a second line characteristic corresponding to each corner information in the second structural body;

when a first line feature corresponding to the corner information in the corner information set to be processed in the first structural body and a second line feature corresponding to the corner information in the second structural body are corresponding, taking the first line feature corresponding to the corner information in the first structural body and the second line feature corresponding to the corner information in the corner information set to be processed as the corner information;

and performing coordinate transformation according to the target corner point information and the first line characteristics of the target corner point information in the first structural body to obtain the pose rotation angle to be processed.

Further, the step of calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by using a likelihood domain probability model to obtain a candidate pose point probability value set includes:

generating a grid map according to the historical gray scale map to obtain a historical grid map;

calculating pose points according to the historical grid map by adopting a uniform point scattering mode, preset point scattering intervals and the pose rotation angle to be processed to obtain a plurality of candidate pose points;

and calculating the probability value of each candidate pose point according to the historical grid map by adopting the likelihood domain probability model aiming at each candidate pose point in the candidate pose points to obtain the candidate pose point probability value set.

Further, the step of calculating an error value based on the ICP algorithm and a preset loss function, determining the pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned by using a preset occupation probability average value and a preset probability value to obtain a pose repositioning result, includes:

carrying out normalization processing on the candidate pose point probability value set to obtain a probability set after normalization processing;

finding out all candidate pose point probability values which are greater than the preset probability value from the probability set after the normalization processing to obtain a candidate pose point probability value set to be processed;

based on the ICP algorithm, calculating an error value by adopting a preset loss function and a random consistency sampling algorithm, and according to the point cloud data to be positioned, respectively correcting the candidate pose point corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed to obtain corrected pose points corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed;

and determining pose repositioning according to all the corrected pose points, the historical gray map and the point cloud data to be positioned by adopting the preset average occupation probability to obtain a pose repositioning result.

Further, the step of determining pose repositioning according to all the corrected pose points, the historical gray map and the point cloud data to be positioned by using the preset average occupation probability to obtain a pose repositioning result includes:

generating a grid map according to the historical gray scale map to obtain a historical grid map;

respectively mapping the point cloud data to be positioned onto the historical grid map according to each corrected pose point to obtain a map area to be calculated corresponding to each corrected pose point;

respectively calculating the average value of the occupation probability of the grids in each map area to be calculated to obtain the average value of the occupation probability to be processed corresponding to each corrected pose point;

finding out all values larger than the preset occupation probability average value from all the to-be-processed occupation probability average values to obtain a candidate occupation probability average value set;

when the candidate occupation probability average value set is not empty, finding out the maximum occupation probability average value from the candidate occupation probability average value set to obtain a target occupation probability average value, taking the corrected pose point corresponding to the target occupation probability average value as the pose repositioning result, and otherwise, determining that the pose repositioning result is repositioning failure.

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 first structure body determining module is used for acquiring a historical gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure body;

the second structure body determining module is used for acquiring point cloud data to be positioned and a preset angle threshold, extracting the line characteristics and the angular point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line characteristic data and second angular point information data, and storing the second line characteristic data and the second angular point information data into a second structure body;

the to-be-processed pose rotation angle determining module is used for comparing the first structural body with the second structural body and determining the to-be-processed pose rotation angle;

a candidate pose point probability value set determining module, configured to calculate a probability value of each candidate pose point according to the historical grayscale map and the pose rotation angle to be processed by using a likelihood domain probability model to obtain a candidate pose point probability value set;

and the pose repositioning result determining module is used for calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be positioned to obtain a pose repositioning result.

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 invention provides a pose repositioning method, a pose repositioning device and a pose repositioning medium of a laser sweeper, wherein a historical gray map is obtained based on a pose repositioning request, line features and corner information are extracted according to the historical gray map to obtain first line feature data and first corner information data, the first line feature data and the first corner information data are stored in a first structural body, point cloud data to be positioned and a preset angle threshold are obtained, the preset angle threshold is adopted to extract the line features and the corner information from the point cloud data to be positioned to obtain second line feature data and second corner information data, the second line feature data and the second corner information data are stored in a second structural body, the first structural body and the second structural body are compared to determine a pose rotation angle to be processed, a likelihood domain probability model is adopted to calculate the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed to obtain a candidate pose point probability value set, an ICP (inductively coupled plasma) algorithm and a preset loss function are adopted to calculate an error value, a preset occupation probability average value and a preset probability value are adopted to determine pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result, so that the fact that the point cloud data to be repositioned obtained by scanning a circle of surrounding environment without walking and/or rotating of the laser sweeper is adopted to determine the pose repositioning result is realized, the repositioning time is shortened, the problem of inaccurate angle caused by noise generated by rotation of the laser sweeper is avoided, and the accuracy of the pose repositioning result is improved, 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 posture repositioning method of the laser sweeper in the prior art repeats straight walking-rotation-posture repositioning operation, repositioning time is prolonged, repositioning accuracy is affected due to the fact that the angle is inaccurate due to noise in the rotating process, and user experience is reduced, the posture repositioning method of the laser sweeper is provided. For example, a laser sweeper, a laser positioning driving automobile, and a laser positioning robot. The laser sweeper posture repositioning method comprises the steps of carrying out laser scanning under the condition of no walking and no rotation, extracting line characteristics and corner information according to a historical gray map, storing the line characteristics and the corner information into a first structural body, extracting line characteristics and the corner information according to point cloud data obtained by laser scanning conversion, storing the line characteristics and the corner information into a second structural body, comparing the first structural body with the second structural body to determine the rotation angle of the laser sweeper posture, and then adopting a likelihood domain probability model and an ICP (inductively coupled plasma) algorithm to carry out posture repositioning determination according to the rotation angle of the laser sweeper posture, the historical gray map and the point cloud data, so that the repositioning posture result can be determined by adopting the point cloud data to be positioned, which is obtained by scanning a circle of surrounding environment under the condition that the laser sweeper does not need to walk and/or rotate, the repositioning time is shortened, and the problem of inaccurate angle caused by the rotation of the laser sweeper is avoided, the accuracy of the pose repositioning result is improved, 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 gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure;

s3: acquiring point cloud data to be positioned and a preset angle threshold, extracting the line features and the angle point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line feature data and second angle point information data, and storing the second line feature data and the second angle point information data into a second structural body;

s4: comparing the first structural body with the second structural body, and determining a pose rotation angle to be processed;

s5: calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by adopting a likelihood domain probability model to obtain a candidate pose point probability value set;

s6: and calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result.

In this embodiment, a historical gray scale map is acquired based on the pose repositioning request, line features and corner information are extracted according to the historical gray scale map to obtain first line feature data and first corner information data, the first line feature data and the first corner information data are stored in a first structural body, point cloud data to be positioned and a preset angle threshold are acquired, the line features and the corner information are extracted from the point cloud data to be positioned by using the preset angle threshold to obtain second line feature data and second corner information data, the second line feature data and the second corner information data are stored in a second structural body, the first structural body and the second structural body are compared to determine a pose rotation angle to be processed, a likelihood domain probability model is used to perform probability value of each candidate pose point according to the historical gray scale map and the pose rotation angle to be processed Calculating to obtain a candidate pose point probability value set, calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and performing pose repositioning determination according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result, so that the pose repositioning result can be determined by scanning the point cloud data to be repositioned obtained in the surrounding environment of a circle without walking and/or rotating the laser sweeper, the repositioning time is shortened, the problem of angle inaccuracy caused by noise generated by rotation of the laser sweeper is solved, the accuracy of the pose repositioning result is improved, and user experience is improved.

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 method and the device realize that the pose repositioning request is triggered when the program file receives a starting signal, puts back any one of a ground signal and a wheel slip signal after starting and leaving the ground.

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

For S2, the historical grayscale map may be obtained from a database or local cache; extracting straight lines from the contour in the historical gray map, performing vector representation on the start coordinate and the end coordinate of each extracted straight line, taking each vector as a line feature (namely a first line feature), and taking all the first line features as first line feature data; and calculating corner information of two adjacent first line features of all the first line features in the first line feature data, taking each calculated corner information as one piece of first corner information, and taking all the first corner information as first corner information data.

Vector-representing the start coordinate and the end coordinate of each extracted straight line, for example, if the start coordinate of the line segment X1 is (0,0) and the end coordinate is (1,1), then vector-representing the line segment X1 as [ 0011 ], the start coordinate of the line segment X2 as (2,2) and the end coordinate as (0,0), then vector-representing the line segment X2 as [ -2-200 ], which is not limited by the examples herein.

The first structure, i.e. the structure. The structure refers to a C + + structure. The C + + construct, a data type defined by a programmer, is used to hold many different data values.

Corner information, i.e. information of corners. The corner point is the intersection of two lines.

And performing corner point information calculation of two adjacent first line features, namely performing vector inner product calculation (namely inner product operation) on the two adjacent first line features.

For S3, the preset angle threshold may be obtained from a database, may also be a preset angle threshold sent by a third-party application system, and may also be written in a program file implementing the present application.

Controlling a laser sensor of the laser sweeper to perform laser scanning on the surrounding environment for a circle, and taking laser data obtained through the 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.

The point cloud data to be positioned is expressed as (x, y), that is to say the point cloud data to be positioned is two-dimensional data.

The calculation formula of x and y in the point cloud data to be positioned, which is 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.

Optionally, a 2d-Lidar (two-dimensional laser) point cloud multi-line fitting algorithm is adopted, line extraction is performed according to point cloud data to be positioned, vector representation is performed on a start coordinate and an end coordinate of each extracted line, each vector is used as a line feature (namely a second line feature), and all second line features are used as second line feature data; and calculating corner information of two adjacent second line features of all second line features in the second line feature data, finding out all values larger than a preset angle threshold value from all the calculated corner information, taking each found value as second corner information, and taking all the second corner information as second corner information data. The specific implementation method for extracting the straight line according to the point cloud data to be positioned by adopting the 2d-Lidar point cloud multi-straight-line fitting algorithm can be selected from the prior art, and is not described herein again.

Optionally, a laser line segment feature extraction method based on seed region growth is adopted, straight line extraction is performed according to point cloud data to be positioned, vector representation is performed on a start coordinate and an end coordinate of each extracted straight line, each vector is used as a line feature (namely, a second line feature), and all second line features are used as second line feature data. The specific implementation method for extracting the straight line according to the point cloud data to be positioned by adopting the laser line segment feature extraction method based on seed region growth can be selected from the prior art, and is not described herein again.

A second structure, i.e. a structure.

It is understood that step S2 and step S3 may be executed synchronously or asynchronously.

For S4, comparing the first corner information in the first structural body with the second corner information in the second structural body, corresponding the first line characteristics of the successfully matched corner information in the first structural body with the second line characteristics in the second structural body, performing coordinate transformation on the first line characteristics of the successfully matched corner information in the first structural body according to the successfully matched corner information and the successfully matched corner information, determining the rotation angle of the pose of the laser sweeper according to the coordinate transformation result, and taking the rotation angle of the pose of the laser sweeper as the to-be-processed pose rotation angle.

For S5, generating a grid map according to the historical gray scale map to obtain a historical grid map; adopting a point scattering mode to scatter points in the historical grid map, and taking each point of the scattered points as a candidate pose point, wherein the rotation angle of the candidate pose point is the same as the rotation angle of the pose to be processed; and respectively calculating probability values of all candidate pose points by adopting the likelihood domain probability model, taking each calculated probability value as a candidate pose point probability value, and taking all candidate pose point probability values as the candidate pose point probability value set.

The specific method for calculating the probability value of each candidate pose point by using the likelihood domain probability model can be selected from the prior art, and is not described herein again.

And the candidate pose points are poses of a two-dimensional space.

For step S6, finding all candidate pose point probability values greater than the preset probability value from the candidate pose point probability value sets, and taking all the found candidate pose point probability values as candidate pose point probability value sets to be processed; correcting candidate pose points corresponding to all candidate pose point probability values in a candidate pose point probability value set to be processed based on an ICP (inductively coupled plasma) algorithm and a mode of calculating error values by a preset loss function to obtain corrected pose points corresponding to the candidate pose point probability values in the candidate pose point probability value set to be processed; calculating the average value of the occupation probability of grids mapped on the historical grid map by the corrected pose points, and determining the pose repositioning result according to the calculated average value of the occupation probability and the preset average value of the occupation probability.

The pose repositioning result comprises: and the pose and the repositioning fail when the repositioning fails. The pose when the repositioning fails successfully refers to the pose in the historical grid map, which is the pose in the two-dimensional space.

Based on the ICP algorithm and the manner of calculating the error value by the preset loss function, the method for correcting the candidate pose points corresponding to all the candidate pose point probability values in the candidate pose point probability value set to be processed can be selected from the prior art, and details are not repeated here.

The ICP algorithm, i.e., Iterative close Point, is an algorithm for performing data registration.

In an embodiment, the extracting line features and corner information according to the historical grayscale map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data in a first structure includes:

s21: carrying out image corrosion, image expansion, edge detection and binarization processing on the historical gray map to obtain a preprocessed historical gray map;

s22: performing straight line extraction according to the preprocessed historical gray map by adopting Hough transform to obtain the first line feature data;

s23: calculating corner information between every two adjacent first line features of all the first line features in the first line feature data to obtain first corner information data;

s24: storing the first line characteristic data and the first corner information data into the first structure in a clockwise direction.

According to the embodiment, the historical gray map is subjected to image corrosion, image expansion, edge detection and binarization processing, so that the outline can be highlighted, the accuracy of the extracted first-line features can be improved, and the accuracy of pose repositioning can be improved.

For S21, the image is eroded to reduce and refine the highlight area or white portion in the image, and the operation result graph is smaller than the highlight area of the original image.

And (4) expanding the image, namely adding pixel values at the edge of the image to expand the whole pixel values so as to achieve the expansion effect of the image.

And edge detection is carried out to mark points with obvious brightness change in the digital image, so that the data volume is greatly reduced, information which can be considered irrelevant is removed, and important structural attributes of the image are reserved.

And the binarization processing is to binarize the value of each pixel point in the image, so that the accuracy of extracting the straight line is improved.

And sequentially carrying out image corrosion, image expansion, edge detection and binarization processing on the historical gray map, and taking the binarized map as the preprocessed historical gray map. That is to say, the value of each pixel point in the preprocessed historical gray map is binarized. For example, the selectable binary values include 0 and 1, that is, the pixel value of a pixel point in the preprocessed historical grayscale map may be 0 or 1, which is not limited in this example.

Optionally, an opencv (BSD license (open source) -based cross-platform computer vision and machine learning software library) library is adopted to sequentially perform image corrosion, image expansion and edge detection on the historical grayscale map.

The binarization processing method can be selected from the prior art, and is not described herein.

And S22, carrying out shape detection of the boundary of the break points on the preprocessed historical gray map by Hough transform, and taking the start coordinate and the end coordinate of the detected straight line as first line features.

For S23, finding out adjacent first line features for each first line feature in the first line feature data, respectively, to obtain a plurality of adjacent first line feature pairs; and respectively carrying out vector inner product calculation on each adjacent first line feature pair to obtain first corner point information corresponding to each adjacent first line feature pair.

The step of finding neighboring first line features for each first line feature in the first line feature data comprises: extracting a first line feature from the first line feature data as a target first line feature; respectively calculating Euclidean distances between the ending coordinate of the target first line feature and the starting coordinate of each first line feature in the first line feature data to obtain a Euclidean distance set corresponding to the target first line feature; and finding out all values larger than a preset distance from the Euclidean distance set corresponding to the target first line feature, and taking the first line feature corresponding to the found values as an adjacent first line feature corresponding to the target first line feature.

For S24, store the first line feature data and the first corner information data into the first structure using a clockwise direction, that is, from the first line feature at the upper left corner of the preprocessed historical gray scale map to the first line feature at the lower right corner of the preprocessed historical gray scale map.

It is understood that the information stored in the first structure includes: the first line feature close to the upper left corner in the adjacent first line feature pairs, the first corner point information and the straight line identification of the straight line corresponding to the first line feature close to the lower right corner of the preprocessed historical gray scale map in the adjacent first line feature pairs.

The straight line identifier may be a line name, a line ID, or the like that uniquely identifies a straight line.

In an embodiment, the extracting, by using the preset angle threshold, the line feature and the corner information of the point cloud data to be positioned to obtain second line feature data and second corner information data, and storing the second line feature data and the second corner information data in a second structural body includes:

s31: carrying out gray map conversion on the point cloud data to be positioned to obtain a current gray map;

s32: carrying out image corrosion, image expansion, edge detection and binarization processing on the current gray-scale map to obtain a preprocessed current gray-scale map;

s33: performing straight line extraction according to the preprocessed current gray level map by adopting Hough transform to obtain second line feature data;

s34: based on the preset angle threshold, performing corner information calculation between every two adjacent second line features on all the second line features in the second line feature data to obtain second corner information data;

s35: and storing the second line feature data and the second corner information data into the second structural body in a clockwise direction.

In the embodiment, the point cloud data to be positioned is subjected to gray scale map conversion to obtain the current gray scale map, and then the current gray scale map is subjected to image corrosion, image expansion, edge detection and binarization processing, so that the outline can be highlighted, the accuracy of the extracted second line features can be improved, and the accuracy of pose repositioning can be improved.

And S31, performing gray map conversion on the point cloud data to be positioned, namely converting the places with the point clouds into black and converting the places without the point clouds into white. The method for performing gray scale map conversion on the point cloud data to be positioned can be selected from the prior art, and is not described herein again.

And S32, sequentially carrying out image corrosion, image expansion, edge detection and binarization processing on the current gray-scale map, and taking the binarized map as the preprocessed current gray-scale map.

And S33, performing shape detection of the boundary of the break point on the preprocessed current gray scale map by Hough transform, and taking the start coordinate and the end coordinate of the detected straight line as second line features.

For S34, finding an adjacent second line feature for each second line feature in the second line feature data, respectively, to obtain a plurality of adjacent second line feature pairs; respectively carrying out vector inner product calculation on each adjacent second line feature pair to obtain corner point information to be analyzed corresponding to each adjacent second line feature pair; and finding out all values smaller than or equal to the preset angle threshold value from the corner point information to be analyzed corresponding to the plurality of adjacent second line feature pairs, and taking each found value as second corner point information. That is, the neighboring second line feature pairs may or may not have qualified second corner information.

For S35, the second line feature data and the second corner information data are stored in the second structural body in a clockwise direction, that is, from the second line feature at the upper left corner of the preprocessed current gray-scale map to the second line feature at the lower right corner of the preprocessed current gray-scale map.

It is understood that the information stored in the second structural body includes: and the second line feature in the adjacent second line feature pair close to the upper left corner, the second corner information and the straight line identification of the straight line corresponding to the second line feature in the adjacent second line feature pair close to the lower right corner of the preprocessed current gray scale map.

In an embodiment, the step of comparing the first structural body with the second structural body to determine the pose rotation angle to be processed includes:

s41: performing corner information matching on the first corner information data in the first structural body and the second corner information data in the second structural body to obtain a corner information set to be processed;

s42: judging whether a first line characteristic corresponding to each corner information in the corner information set to be processed in the first structural body corresponds to a second line characteristic corresponding to each corner information in the second structural body;

s43: when a first line feature corresponding to the corner information in the corner information set to be processed in the first structural body and a second line feature corresponding to the corner information in the second structural body are corresponding, taking the first line feature corresponding to the corner information in the first structural body and the second line feature corresponding to the corner information in the corner information set to be processed as the corner information;

s44: and performing coordinate transformation according to the target corner point information and the first line characteristics of the target corner point information in the first structural body to obtain the pose rotation angle to be processed.

According to the embodiment, the pose rotation angle to be processed is determined according to the comparison between the first structural body and the second structural body, and a data basis is provided for subsequent point scattering.

For S41, each piece of first corner information in the first corner information data in the first structural body is searched in the second corner information data in the second structural body, and when the search is successful, the searched second corner information is used as the corner information to be processed, and all the corner information to be processed is used as the set of the corner information to be processed.

Optionally, the corner information set to be processed is stored in a container, so that the subsequent search and extraction of the corner information set to be processed are facilitated.

For S42, extracting one corner information from the corner information set to be processed as the corner information to be processed; when the start coordinate of a first line feature corresponding to corner information to be processed in the first structural body is the same as the start coordinate of a second line feature corresponding to the corner information to be processed in the second structural body, and the end coordinate of the first line feature corresponding to the corner information to be processed in the first structural body is the same as the end coordinate of the second line feature corresponding to the corner information to be processed in the second structural body, determining that a first line feature corresponding to the corner information to be processed in the first structural body and a second line feature corresponding to the corner information to be processed in the second structural body correspond to each other, otherwise, determining that a first line feature corresponding to the corner information to be processed in the first structural body and a second line feature corresponding to the corner information to be processed in the second structural body do not correspond to each other; and repeatedly executing the step of extracting one corner information from the corner information set to be processed as the corner information to be processed until the extraction of all the corner information in the corner information set to be processed is completed.

For S43, extracting one corner information from the corner information set to be processed as the corner information to be processed; and when the first line characteristics corresponding to the corner information to be processed in the first structural body and the second line characteristics corresponding to the corner information to be processed in the second structural body correspond to each other, taking the corner information to be processed as target corner information.

And S44, performing pose coordinate transformation of the laser sweeper according to the target corner point information and the first line characteristics of the target corner point information in the first structural body, and taking the rotation angle in the transformed pose as the pose rotation angle to be processed.

The method for performing pose coordinate transformation of the laser sweeper according to the target corner information and the first line feature of the target corner information in the first structural body can be selected from the prior art, and is not described herein again.

In an embodiment, the calculating, by using a likelihood domain probability model, a probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed to obtain a candidate pose point probability value set includes:

s51: generating a grid map according to the historical gray scale map to obtain a historical grid map;

s52: calculating pose points according to the historical grid map by adopting a uniform point scattering mode, preset point scattering intervals and the pose rotation angle to be processed to obtain a plurality of candidate pose points;

s53: and calculating the probability value of each candidate pose point according to the historical grid map by adopting the likelihood domain probability model aiming at each candidate pose point in the candidate pose points to obtain the candidate pose point probability value set.

According to the method and the device, the candidate pose points are determined by scattering points on the map, the calculation amount of pose repositioning is reduced by the candidate pose points, the time of pose repositioning is shortened, and the user experience is improved.

For S51, the method for generating the grid map according to the historical grayscale map may be selected from the prior art, and will not be described herein.

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.

For S52, the uniform scattering means that the distances between adjacent scattering points are the same.

The preset scattering point interval is a specific numerical value.

Optionally, the preset scattering point interval is set to 1, that is, scattering points every 1 grid.

And the scattering points are the assumed positions of the laser sweeper in the historical grid map. And each scatter point corresponds to one pose point.

And taking the position data of the scattering points in the historical grid map as the x position and the y position of the candidate pose point, and taking the pose rotation angle to be processed as the rotation angle of the candidate pose point.

It can be understood that after the to-be-processed pose rotation angle of the laser sweeper is determined, the approximate range of the laser sweeper can be preliminarily determined according to the determined information, and then point scattering can be carried out in the rough range of the laser sweeper; and in the point scattering process, a Gaussian model mode is adopted, multiple points are scattered in the rough range where the laser sweeper is preliminarily determined, and less points are scattered in the area outside the rough range where the laser sweeper is preliminarily determined. And taking the pose of each point obtained by scattering points as the candidate pose point.

For S53, the likelihood domain probability model is adopted to respectively calculate the probability value of each candidate pose point in the candidate pose points according to the historical grid map, each probability value obtained through calculation is used as a candidate pose point probability value, and all candidate pose point probability values are used as the candidate pose point probability value set. The likelihood domain probability model is computed like a table look-up process and thus has a faster speed.

In one embodiment, the above manner of calculating the error value based on the ICP algorithm and the preset loss function, which uses a preset occupancy probability average value and a preset probability value, determines the pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned, and obtains the pose repositioning result, includes:

s61: carrying out normalization processing on the candidate pose point probability value set to obtain a probability set after normalization processing;

s62: finding out all candidate pose point probability values which are greater than the preset probability value from the probability set after the normalization processing to obtain a candidate pose point probability value set to be processed;

s63: based on the ICP algorithm, calculating an error value by adopting a preset loss function and a random consistency sampling algorithm, and according to the point cloud data to be positioned, respectively correcting the candidate pose point corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed to obtain corrected pose points corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed;

s64: and determining pose repositioning according to all the corrected pose points, the historical gray map and the point cloud data to be positioned by adopting the preset average occupation probability to obtain a pose repositioning result.

The method and the device realize that the position and orientation repositioning result is determined based on the ICP algorithm, the preset average occupation probability value and the preset probability value, so that the position and orientation repositioning result can be determined by scanning a circle of surrounding environment to obtain point cloud data to be positioned without walking and/or rotating the laser sweeper.

For S61, the set of candidate pose point probability values is normalized such that each value in the set of candidate pose point probability values is normalized to a fraction greater than 0 and less than 1. The normalization method is not described herein.

For step S62, finding all candidate pose point probability values greater than the preset probability value from all candidate pose point probability values in the normalized probability set, and taking all the found candidate pose point probability values as candidate pose point probability value sets to be processed.

For step S63, mapping the point cloud data to be positioned onto the historical grid map based on the candidate pose point corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed, to obtain a region to be calculated corresponding to each candidate pose point probability value in the candidate pose point probability value set to be processed; extracting a candidate pose point from the candidate pose points corresponding to the candidate pose point probability values in the candidate pose point probability value set to be processed as a candidate pose point to be corrected; based on the ICP algorithm, calculating an error value by adopting a preset loss function and a random consistency sampling algorithm (also called RANSAC algorithm), correcting the candidate pose point to be corrected according to the area to be calculated corresponding to the candidate pose point to be corrected, and obtaining the corrected pose point corresponding to the candidate pose point to be corrected; and repeatedly executing the step of extracting one candidate pose point from the candidate pose points corresponding to the candidate pose point probability values in the candidate pose point probability value set to be processed as the candidate pose point to be corrected until the corrected pose point corresponding to the candidate pose point probability values in the candidate pose point probability value set to be processed is determined. The ICP algorithm is used for correcting the candidate pose point to be corrected by combining a mode of calculating an error value by adopting a preset loss function and a random consistency sampling algorithm, so that the problem that the ICP algorithm is trapped in a minimum value calculation error is solved, and the accuracy of correcting the candidate pose point to be corrected is improved.

For S64, respectively mapping the point cloud data to be positioned to the grid map converted by the historical gray scale map based on each corrected pose point, and calculating the average value of the occupation probability of the grid in the mapping area to obtain the average value of the occupation probability to be processed corresponding to each corrected pose point; and determining the pose repositioning according to all the occupation probability average values to be processed and the preset occupation probability average value to obtain a pose repositioning result.

In an embodiment, the step of determining pose repositioning according to all the corrected pose points, the historical gray map, and the point cloud data to be positioned by using the preset average occupancy probability to obtain the pose repositioning result includes:

s641: generating a grid map according to the historical gray scale map to obtain a historical grid map;

s642: respectively mapping the point cloud data to be positioned onto the historical grid map according to each corrected pose point to obtain a map area to be calculated corresponding to each corrected pose point;

s643: respectively calculating the average value of the occupation probability of the grids in each map area to be calculated to obtain the average value of the occupation probability to be processed corresponding to each corrected pose point;

s644: finding out all values larger than the preset occupation probability average value from all the to-be-processed occupation probability average values to obtain a candidate occupation probability average value set;

s645: when the candidate occupation probability average value set is not empty, finding out the maximum occupation probability average value from the candidate occupation probability average value set to obtain a target occupation probability average value, taking the corrected pose point corresponding to the target occupation probability average value as the pose repositioning result, and otherwise, determining that the pose repositioning result is repositioning failure.

In the embodiment, the pose repositioning is determined according to all the corrected pose points, the historical gray map and the point cloud data to be positioned, so that the pose repositioning result can be determined by scanning a circle of surrounding environment to obtain the point cloud data to be positioned under the condition that the laser sweeper does not need to move and/or rotate.

For S642, extracting one corrected pose point from all the corrected pose points to obtain a pose point after the target is corrected; based on the pose point corrected by the target, mapping the point cloud data to be positioned onto the historical grid map, and taking all grids mapped on the historical grid map as a map area to be calculated corresponding to the pose point corrected by the target; and repeatedly executing the step of extracting one corrected pose point from all the corrected pose points to obtain the pose point of the target after correction until determining the map area to be calculated corresponding to all the corrected pose points. It will be appreciated that when mapping the point cloud data to be located onto the historical grid map, at most one point per grid will be mapped. That is, the map area to be calculated is a partial area of the history grid map.

For S643, any map area to be calculated is extracted from all the map areas to be calculated and serves as a target map area to be calculated; and calculating the average value of the occupation probabilities of all the grids in the target map area to be calculated, and taking the calculated average value (namely the occupation probability average value) as the average value of the occupation probabilities to be processed corresponding to the corrected pose points corresponding to the target map area to be calculated.

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 step S644, all the occupation probability average values greater than the preset occupation probability average value are found from all the to-be-processed occupation probability average values, and all the found occupation probability average values are used as the candidate occupation probability average value set.

For S645, when the candidate occupancy probability average value set is not empty, it means that the occupancy probability average value meets the requirement of the lowest occupancy probability average value, at this time, the largest occupancy probability average value may be found from the candidate occupancy probability average value set, the found occupancy probability average value is used as a target occupancy probability average value, and the corrected pose point corresponding to the target occupancy probability average value is used as the pose repositioning result; when the candidate occupation probability average value set is empty, the fact that the occupation probability average value does not meet the requirement of the lowest occupation probability average value means that the laser sweeper is placed in an area where the gray map is not successfully built cannot be repositioned, and at the moment, the fact that the pose repositioning result is repositioning failure is determined.

And when the pose repositioning result is repositioning failure, generating a rescanning map construction signal, wherein the rescanning map construction signal is used for controlling the laser sweeper to carry out comprehensive laser scanning, and constructing a new gray map according to the laser scanning 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 first structure body determining module 200, configured to obtain a historical grayscale map based on the pose repositioning request, extract line features and corner information according to the historical grayscale map, obtain first line feature data and first corner information data, and store the first line feature data and the first corner information data in a first structure body;

the second structure body determining module 300 is configured to acquire point cloud data to be positioned and a preset angle threshold, extract the line feature and the corner information from the point cloud data to be positioned by using the preset angle threshold, obtain second line feature data and second corner information data, and store the second line feature data and the second corner information data in a second structure body;

a to-be-processed pose rotation angle determining module 400, configured to compare the first structural body with the second structural body, and determine a to-be-processed pose rotation angle;

a candidate pose point probability value set determining module 500, configured to calculate a probability value of each candidate pose point according to the historical grayscale map and the pose rotation angle to be processed by using a likelihood domain probability model, so as to obtain a candidate pose point probability value set;

and the pose repositioning result determining module 600 is configured to determine pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be positioned by using a preset occupation probability average value and a preset probability value in a manner of calculating an error value based on an ICP algorithm and a preset loss function, so as to obtain a pose repositioning result.

In this embodiment, a historical gray scale map is acquired based on the pose repositioning request, line features and corner information are extracted according to the historical gray scale map to obtain first line feature data and first corner information data, the first line feature data and the first corner information data are stored in a first structural body, point cloud data to be positioned and a preset angle threshold are acquired, the line features and the corner information are extracted from the point cloud data to be positioned by using the preset angle threshold to obtain second line feature data and second corner information data, the second line feature data and the second corner information data are stored in a second structural body, the first structural body and the second structural body are compared to determine a pose rotation angle to be processed, a likelihood domain probability model is used to perform probability value of each candidate pose point according to the historical gray scale map and the pose rotation angle to be processed Calculating to obtain a candidate pose point probability value set, calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and performing pose repositioning determination according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result, so that the pose repositioning result can be determined by scanning the point cloud data to be repositioned obtained in the surrounding environment of a circle without walking and/or rotating the laser sweeper, the repositioning time is shortened, the problem of angle inaccuracy caused by noise generated by rotation of the laser sweeper is solved, the accuracy of the pose repositioning result is improved, and user experience is improved.

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 gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure; acquiring point cloud data to be positioned and a preset angle threshold, extracting the line features and the angle point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line feature data and second angle point information data, and storing the second line feature data and the second angle point information data into a second structural body; comparing the first structural body with the second structural body, and determining a pose rotation angle to be processed; calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by adopting a likelihood domain probability model to obtain a candidate pose point probability value set; and calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result.

In this embodiment, a historical gray scale map is acquired based on the pose repositioning request, line features and corner information are extracted according to the historical gray scale map to obtain first line feature data and first corner information data, the first line feature data and the first corner information data are stored in a first structural body, point cloud data to be positioned and a preset angle threshold are acquired, the line features and the corner information are extracted from the point cloud data to be positioned by using the preset angle threshold to obtain second line feature data and second corner information data, the second line feature data and the second corner information data are stored in a second structural body, the first structural body and the second structural body are compared to determine a pose rotation angle to be processed, a likelihood domain probability model is used to perform probability value of each candidate pose point according to the historical gray scale map and the pose rotation angle to be processed Calculating to obtain a candidate pose point probability value set, calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and performing pose repositioning determination according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result, so that the pose repositioning result can be determined by scanning the point cloud data to be repositioned obtained in the surrounding environment of a circle without walking and/or rotating the laser sweeper, the repositioning time is shortened, the problem of angle inaccuracy caused by noise generated by rotation of the laser sweeper is solved, the accuracy of the pose repositioning result is improved, and 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 gray map based on the pose repositioning request, extracting line features and corner information according to the historical gray map to obtain first line feature data and first corner information data, and storing the first line feature data and the first corner information data into a first structure; acquiring point cloud data to be positioned and a preset angle threshold, extracting the line features and the angle point information of the point cloud data to be positioned by adopting the preset angle threshold to obtain second line feature data and second angle point information data, and storing the second line feature data and the second angle point information data into a second structural body; comparing the first structural body with the second structural body, and determining a pose rotation angle to be processed; calculating the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed by adopting a likelihood domain probability model to obtain a candidate pose point probability value set; and calculating an error value based on an ICP (inductively coupled plasma) algorithm and a preset loss function, adopting a preset occupation probability average value and a preset probability value, and determining pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result.

In the executed pose repositioning method of the laser sweeper, based on the pose repositioning request, a historical gray scale map is obtained, line features and corner information are extracted according to the historical gray scale map, first line feature data and first corner information data are obtained, the first line feature data and the first corner information data are stored in a first structural body, point cloud data to be positioned and a preset angle threshold are obtained, the preset angle threshold is adopted to extract the line features and the corner information from the point cloud data to be positioned, second line feature data and second corner information data are obtained, the second line feature data and the second corner information data are stored in a second structural body, the first structural body and the second structural body are compared, and a pose rotation angle to be processed is determined, a likelihood domain probability model is adopted to calculate the probability value of each candidate pose point according to the historical gray map and the pose rotation angle to be processed to obtain a candidate pose point probability value set, an ICP (inductively coupled plasma) algorithm and a preset loss function are adopted to calculate an error value, a preset occupation probability average value and a preset probability value are adopted to determine pose repositioning according to the candidate pose point probability value set, the historical gray map and the point cloud data to be repositioned to obtain a pose repositioning result, so that the fact that the point cloud data to be repositioned obtained by scanning a circle of surrounding environment without walking and/or rotating of the laser sweeper is adopted to determine the pose repositioning result is realized, the repositioning time is shortened, the problem of inaccurate angle caused by noise generated by rotation of the laser sweeper is avoided, and the accuracy of the pose repositioning result is improved, the 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.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:激光扫地机的位姿重定位方法、装置、设备及介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!