A robot and its relocalization method, device and medium
By transforming the radar data collected by the cleaning robot and rotating the global map, quickly repositioning is solved, and the problem of robot relocation is improved.
Patent Information
- Application Number
- CN202210148891.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-02-17
AI Technical Summary
Currently, cleaning robots equipped with ranging sensors and vision sensors take a long time to reposition in complex home environments, resulting in low work efficiency.
By collecting the current radar data of the robot, an initial map is constructed, and the radar data is transformed according to the first angle of the initial map relative to the preset coordinate system, the global map is obtained and rotated, and repositioned based on the transformed radar data and the rotated global map.
It shortens the time for robot relocation, reduces memory and CPU usage, and improves the work efficiency of robots.
Smart Images

Figure CN114660583B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot technology, and in particular, to a robot and its relocalization method, device, and medium. Background Art
[0002] Household cleaning robots are particularly favored by users because they can liberate users' hands, perform autonomous cleaning and autonomous charging. With the development of household cleaning robot products, there have emerged various products with different sensor configurations. Among them, cleaning robot products equipped with ranging sensors and visual sensors are known for their low price, high efficiency, and accuracy, and are loved by some young white-collar workers. Such products often have a relocalization function. When the machine is moved, it can effectively and accurately locate its own position in the current environment, making it very intelligent to use.
[0003] Although the current cleaning robot products equipped with ranging sensors and visual sensors are highly efficient and accurate in use, due to their operation in various complex household environments, the relocalization time during use varies depending on the size of the household environment. When the environmental space is large, the relocalization time of the robot is often long and consumes a considerable amount of the machine's memory and CPU occupancy rate. Moreover, the robot cannot perform other cleaning tasks during the relocalization process, resulting in low work efficiency of the robot. Summary of the Invention
[0004] The main purpose of this application is to provide a robot and its relocalization method, device, and medium, aiming to solve the technical problem that the current robot has low work efficiency due to long relocalization time.
[0005] To achieve the above object, in a first aspect, an embodiment of this application provides a robot relocalization method, and the robot relocalization method includes:
[0006] Collect the current radar data of the robot, and construct an initial map based on the current radar data;
[0007] Determine a first angle of the initial map relative to a preset coordinate system, and perform data transformation on the current radar data according to the first angle to obtain target radar data;
[0008] Obtain the global map in the robot, determine a second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map;
[0009] Relocalize the robot based on the target radar data and the target map to obtain the target pose of the robot.
[0010] Optionally, the target map is a grid map, and the step of relocating the robot based on the target radar data and the target map to obtain the target pose of the robot includes:
[0011] Determine a grid as a target grid at a preset distance interval in the target map;
[0012] Based on the relationship that the target radar data and the target map are parallel or perpendicular to each other, set particles in the first preset number of directions of each of the target grids to obtain a first particle set;
[0013] Determine the first matching degree scores of the particles in the first particle set with the target radar data;
[0014] Determine the target pose of the robot based on each of the first matching degree scores.
[0015] Optionally, the step of determining the target pose of the robot based on each of the first matching degree scores includes:
[0016] Filter out the particles in the first particle set with the first matching degree scores less than a preset score threshold;
[0017] Reset particles in the second preset number of directions of the target grids where the remaining particles in the first particle set are located to obtain a second particle set; wherein, the second preset number is greater than the first preset number;
[0018] Determine the second matching degree scores of the particles in the second particle set with the target radar data;
[0019] Determine the particle with the largest second matching degree score in the second particle set as the target particle, and use the pose corresponding to the target particle as the target pose of the robot.
[0020] Optionally, the step of determining the first angle of the initial map relative to the preset coordinate system includes:
[0021] With the center point of the initial map as the center, traverse the initial map based on the preset heading angle range of the initial map to construct a plurality of temporary occupancy grid maps;
[0022] Perform binarization processing on each of the temporary occupancy grid maps to obtain each binarized occupancy grid map including black grids and / or white grids;
[0023] Determine the first angle of the initial map relative to the preset coordinate system based on the number of black grids in each of the binarized occupancy grid maps.
[0024] Optionally, the step of determining the first angle of the initial map relative to the preset coordinate system based on the number of black grids in each of the binarized occupancy grid maps includes:
[0025] Determine the number of black grids on the corresponding rows and columns in each of the binarized occupancy grid maps;
[0026] Determine the binarized occupancy grid map with the largest number of black grids on any row or any column in each of the binarized occupancy grid maps as the target map;
[0027] Take the heading angle corresponding to the target map as the first angle of the initial map relative to the preset coordinate system.
[0028] Optionally, the step of performing data transformation on the current radar data according to the first angle to obtain target radar data includes:
[0029] Construct a circular queue based on the current radar data, where the current radar data includes a preset number of laser rays, and the number of laser rays in the circular queue is a preset multiple of the preset number;
[0030] Perform position transformation on the laser rays in the circular queue based on the first angle to obtain a target circular queue;
[0031] Extract the laser rays in the target circular queue to form target radar data.
[0032] Optionally, the step of performing position transformation on the laser rays in the circular queue based on the first angle to obtain a target circular queue includes:
[0033] Obtain a preset angle threshold;
[0034] If the first angle is greater than the preset angle threshold, rotate all the laser rays in the circular queue counterclockwise by the number of laser ray units corresponding to the first angle to obtain a first circular queue;
[0035] If the first angle is less than the preset angle threshold, rotate all the laser rays in the circular queue clockwise by the number of laser ray units corresponding to the first angle to obtain a second circular queue;
[0036] Determine the first circular queue or the second circular queue as the target circular queue.
[0037] To achieve the above object, in a second aspect, the present application further provides a robot relocalization device, and the robot relocalization device includes:
[0038] An acquisition module, configured to collect the current radar data of the robot and construct an initial map based on the current radar data;
[0039] A data transformation module, configured to determine a first angle of the initial map relative to a preset coordinate system, and perform data transformation on current radar data according to the first angle to obtain target radar data;
[0040] A rotation module, configured to obtain a global map in the robot, determine a second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map;
[0041] A relocalization module, configured to relocalize the robot based on the target radar data and the target map to obtain a target pose of the robot.
[0042] To achieve the above object, in a third aspect, the present application further provides a robot, where the robot includes a memory, a processor, and a robot relocalization program stored on the memory and executable on the processor. When the robot relocalization program is executed by the processor, the steps of the above robot relocalization method are implemented.
[0043] To achieve the above object, in a fourth aspect, the present application further provides a medium, where the medium is a computer-readable storage medium, and a robot relocalization program is stored on the computer-readable storage medium. When the robot relocalization program is executed by a processor, the steps of the above robot relocalization method are implemented.
[0044] An embodiment of the present application provides a robot and its relocalization method, device, and medium. The method includes collecting current radar data of the robot and constructing an initial map based on the current radar data; determining a first angle of the initial map relative to a preset coordinate system, and performing data transformation on the current radar data according to the first angle to obtain target radar data; obtaining a global map in the robot, determining a second angle of the global map relative to the preset coordinate system, and rotating the global map according to the second angle to obtain a target map; relocalizing the robot based on the target radar data and the target map to obtain a target pose of the robot. The present application can construct an initial map through the current radar data of the robot and perform data transformation on the current radar data based on the first angle of the initial map relative to the preset coordinate system. At the same time, obtain the global map and rotate the global map according to the second angle of the global map relative to the preset coordinate system. Through the relative position relationship between the current radar data after data transformation and the global map after rotation, the robot can be quickly relocalized and the pose of the robot can be determined based on the relocalization result, so that the relocalization time of the robot is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot. Description of the Drawings
[0045] Figure 1 It is a schematic structural diagram of the hardware operating environment involved in the embodiment of the robot repositioning method of this application;
[0046] Figure 2 It is a schematic flowchart of the first embodiment of the robot repositioning method of this application;
[0047] Figure 3 It is a schematic diagram of a circular queue of the first embodiment of the robot repositioning method of this application;
[0048] Figure 4 It is a schematic flowchart of the second embodiment of the robot repositioning method of this application;
[0049] Figure 5 It is a schematic flowchart of the third embodiment of the robot repositioning method of this application;
[0050] Figure 6 It is a schematic diagram of the application scenario of the specific embodiment of the robot repositioning method of this application;
[0051] Figure 7 It is a schematic diagram of the functional modules of the preferred embodiment of the robot repositioning device of this application.
[0052] The realization, functional features and advantages of the purpose of this application will be further described with reference to the embodiments and the accompanying drawings. Specific Embodiments
[0053] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.
[0054] An embodiment of the present application provides a robot and its relocalization method, device, and medium. The method includes collecting current radar data of the robot and constructing an initial map based on the current radar data; determining a first angle of the initial map relative to a preset coordinate system, and performing data transformation on the current radar data according to the first angle to obtain target radar data; obtaining a global map in the robot, determining a second angle of the global map relative to the preset coordinate system, and rotating the global map according to the second angle to obtain a target map; and performing relocalization on the robot based on the target radar data and the target map to obtain the target pose of the robot. The present application can construct an initial map through the current radar data of the robot and perform data transformation on the current radar data based on the first angle of the initial map relative to the preset coordinate system. At the same time, the global map is obtained and the global map is rotated according to the second angle of the global map relative to the preset coordinate system. Through the relative position relationship between the current radar data after data transformation and the rotated global map, the robot can be quickly relocalized and the pose of the robot can be determined based on the relocalization result, so that the time for the robot to perform relocalization is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0055] As Figure 1 shown, Figure 1 is a schematic structural diagram of a robot in the hardware operating environment involved in the solution of the embodiment of the present application.
[0056] The relocalization method is applied to an intelligent cleaning device, which can be a robot, such as an unmanned delivery vehicle, an unmanned aerial vehicle, a warehousing robot, a shopping mall service robot, a food delivery robot, a floor cleaning robot, a mopping robot, a sweeping and mopping robot, a floor washer, and other intelligent cleaning devices.
[0057] As an example, the above intelligent cleaning device is a sweeping and mopping robot, and the sweeping and mopping robot 100 can be as Figure 1 shown. Referring to Figure 1 , the sweeping and mopping robot includes a ranging component 102, a control device 104, and a walking component 106. At the same time, the above ranging component 102 can be, for example, a lidar and an odometer, and then the lidar data and the odometer pose are obtained through the ranging component 102. The above walking component 106 includes omnidirectional wheels and drive wheels. The above control device 104 is a controller for driving the walking component 106 to move according to the data collected by the ranging component 102 to control the sweeping and mopping robot to perform different cleaning tasks.
[0058] In an example, the above sweeping and mopping robot further includes an image device, and the image device can be arranged at the front end or the top end of the sweeping and mopping robot, such as a camera, so as to collect environmental images through the image device.
[0059] To better understand the above technical solution, the exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0060] To better understand the above technical solution, the above technical solution will be described in detail below in combination with the accompanying drawings of the specification and specific implementation manners.
[0061] Referring to Figure 2 , Figure 2 is a schematic flowchart of a robot relocalization method provided in the first embodiment of the present application. In this embodiment, the robot relocalization method includes the following steps:
[0062] Step S10, collect the current radar data of the robot, and construct an initial map based on the current radar data;
[0063] In this embodiment, the robot relocalization method is applied to a relocalization system. In this embodiment, the relocalization system can be specifically deployed in a robot, such as an unmanned delivery vehicle, an unmanned aerial vehicle, a warehousing robot, a mall service robot, a food delivery robot, a floor cleaning robot, a mopping robot, a sweeping and mopping robot, a floor washer, etc. In this embodiment, the relocalization system can include a lidar frame rotation module and a relocalization processing module. The lidar frame rotation module provides the radar data after data transformation for the relocalization processing module. The radar data can be lidar data in this embodiment. The lidar frame rotation module can obtain the radar data of the area where the robot is currently located to construct an initial map, and perform data transformation on the current radar data based on the first angle of the initial map relative to the preset coordinate system. At the same time, the relocalization processing module obtains the global map and rotates it, and quickly performs relocalization by combining the current radar data after data transformation received from the lidar frame rotation module with the rotated global map through a particle filter method, and determines the pose of the robot according to the relocalization result, so that the duration of the robot's relocalization is short and does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot. Among them, "obtain" is usually obtained through various sensors on the self-mobile device. The sensors include but are not limited to ranging sensors such as radar, anti-fall sensors, ultrasonic sensors, infrared sensors, magnetometers, accelerometers, gyroscopes, odometers, CCDs, optical detection sensors, etc. The data obtained through the above sensors is saved locally or on the server side.
[0064] Among them, it should be noted that the above-mentioned preset coordinate system is a coordinate system constructed in advance according to the actual situation, such as the world coordinate system. Particle filtering is a process of approximately representing the probability density function by finding a set of random samples propagated in the state space, replacing the integral operation with the sample mean, and then obtaining the minimum variance estimate of the system state. The first angle and the subsequent second angle and / or other angles in this application can be the heading angle. The heading angle refers to the angle between the longitudinal axis of an aircraft or a space shuttle and the North Pole of the Earth, also known as the true heading angle. In this scenario, the heading angle is the angle between the longitudinal axis of the robot and the North Pole of the Earth.
[0065] Specifically, when the robot is moved or within a certain time interval, the relocalization system can determine the area where the robot is currently located as the target area, and obtain the current radar data corresponding to the target area where the robot is located through the lidar in the lidar frame rotation module. Specifically, it can be a frame of lidar data. The lidar data can be point cloud data. After obtaining the current radar data of the robot, an initial map is constructed according to the obtained current lidar data. Specifically, the current radar data is drawn into a temporary occupancy grid map. The value of each map point in the occupancy grid map is represented as (0.0 - 1.0). 0.0 represents black, 1.0 represents white, and the values between 0.0 and 1.0 represent the gradual change process from black to white. This is to facilitate the subsequent calculation of the first angle of the initial map, perform data transformation on the current radar data according to the first angle to obtain the target radar data, and then quickly relocalize the robot based on the target radar data and the obtained rotated target map to determine the current true pose of the robot as the target pose, so that the relocalization time of the robot is shorter and it does not consume too much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0066] Step S20: Determine the first angle of the initial map relative to the preset coordinate system, and perform data transformation on the current radar data according to the first angle to obtain the target radar data;
[0067] After constructing the initial map based on the obtained current radar data, in this embodiment, the current radar data in the initial map can be traversed based on the preset heading angle range, and a preset number of temporary occupancy grid maps corresponding to the current radar data with different heading angles are constructed. The preset heading angle range is an angle range set according to actual needs. In this embodiment, it can be -45° to 45°. The preset number is a numerical value set according to actual needs. For example, in this embodiment, it can be preferably 90. The occupancy grid map is composed of multiple grids, and each grid can be used as a map point or called an occupancy grid map point.
[0068] Further, perform binarization processing on each temporary occupancy grid map to obtain a group of binarized occupancy grid maps. Among them, the method of binarization operation is that if the probability value of the current occupancy grid map point is greater than 0.51, set the map point to white (1.0); if the probability value of the current grid map point is less than 0.49, set the map point to black (0.0). Further, calculate the first angle of the initial map relative to the preset coordinate system based on the group of binarized occupancy grid maps. The specific steps can be: respectively count the number of black map points in each row and each column of each binarized occupancy grid map in the group of binarized occupancy grid maps, determine the binarized occupancy grid map with the largest number of black map points in a row or column as the target map, and determine the heading angle of the current radar data corresponding to the target map as the first angle of the initial map.
[0069] Further, construct a circular queue based on the current radar data. The circular queue is specifically as Figure 3 shown Figure 3 is a schematic diagram of the circular queue in the first embodiment of the robot relocalization method of the present application. In this embodiment, the data capacity of the circular queue is 720, where the data at positions 1 to 360 are 360 rays of the current radar data, and the data at positions 361 to 720 are a copy of the data at positions 1 to 360, that is, the data at position 1 is the same as the data at position 361, and the data at position 360 is the same as the data at position 720. Further, perform position transformation on the data in the constructed circular queue based on the first angle to obtain a target circular queue; the specific position transformation steps can be: compare the first angle with a preset angle threshold to obtain a comparison result. If the comparison result is that the first angle is greater than the preset angle threshold, rotate all the laser rays in the circular queue counterclockwise to obtain the target circular queue; if the comparison result is that the first angle is less than the preset angle threshold, rotate all the laser rays in the circular queue clockwise to obtain the target circular queue, where the preset angle threshold is an angle value set according to actual needs, and the preset angle threshold can be 0° in this embodiment. Finally, extract the data at the corresponding formation positions from the target circular queue as the target radar data. So as to quickly relocalize the robot based on the relative position relationship between the target radar data and the acquired and rotated target map, and determine the current actual pose of the robot as the target pose based on the relocalization result, so that the time for the robot to relocalize is shorter and it does not need to consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0070] Step S30, obtain the global map in the robot, determine the second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map;
[0071] Obtain the current radar data of the area where the robot is located, and construct an initial map based on the current radar data; calculate the first angle of the initial map, and perform data transformation on the current radar data according to the first angle to obtain the target radar data. At the same time, obtain the global map of the area where the robot is currently located through the relocalization processing module, where the global map can be pre-constructed and stored. Further, with the center point of the global map as the center, globally Figure 2 Traverse in sequence from the preset heading angle range, such as -45° to 45°, in the D pose, construct a preset number of, such as 90, temporary occupancy grid maps with different angles, perform binarization operations on these 90 temporary occupancy grid maps, count the sum of the black map points in each row and each column of each binarized occupancy grid map, extract the value with the largest sum of black map points in a row or column as the traversal result, and take out the heading angle information of the temporary occupancy grid map corresponding to the traversal result as the second angle of the global map relative to the preset coordinate system, where the obtained global Figure 2 The D pose is (0, 0, 0), that is, x = 0, y = 0, yaw = 0, where x and y are the abscissa and ordinate respectively, and yaw is the heading angle information.
[0072] Further, determine whether to rotate the global map by judging whether the second angle is greater than a preset angle threshold, such as 0°. Specifically, if the second angle is greater than the preset angle threshold, rotate the global map counterclockwise to obtain the target map, where the rotation angle is the difference between the second angle and the preset angle threshold; if the second angle is less than the preset angle threshold, rotate the global map clockwise to obtain the target map. In order to quickly relocalize the robot based on the relative position relationship between the target radar data and the rotated target map, and determine the current actual pose of the robot based on the relocalization result to obtain the target pose, so that the time for the robot to perform relocalization is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0073] Step S40: Relocalize the robot based on the target radar data and the target map to obtain the target pose of the robot.
[0074] After separately rotating the global map and performing data transformation on the current radar data, particles are set in the target map based on the relative position relationship between the target radar data and the target map to obtain a particle set. The particles set can be a point, and a heading angle can be formed by this point and the center of the grid in the map. The specific steps of scattering particles in the target map based on the relative position relationship between the target radar data and the target map to obtain a particle set can be as follows: Based on the relative position relationship between the target radar data and the target map, target grids for scattering particles are determined in multiple grids of the target map at a preset distance interval. Generally, there are multiple target grids, but the case where there is only one target grid under special conditions is not excluded. The preset distance can be set according to actual needs, such as 14 cm, 15 cm, 16 cm, etc.; Particles are set in the first preset number of directions of each target grid to obtain a first particle set. The first preset number of directions can preferably be four directions of 0°, 90°, 180°, and 270° in this embodiment. In this embodiment, data transformation is performed on the current radar data and the global map is rotated, so that the transformed current radar data and the rotated global map have a relative position relationship that is parallel or perpendicular to each other. This allows for using a small number of directions with a large interval when setting particles in the first preset number of directions of each target grid. For example, the angle interval in this embodiment can be 90°. If data transformation and rotation are not performed on the current radar data and the global map, the angle interval needs to be set to 10° or even smaller during calculation, which will result in a huge amount of calculation and reduce the speed of relocating. Further, based on the obtained particle set, the robot is relocated to determine the target pose of the robot. By quickly determining the pose of the robot, the time for the robot to relocate is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0075] This embodiment provides a relocalization method, which includes collecting the current radar data of a robot and constructing an initial map based on the current radar data; determining a first angle of the initial map relative to a preset coordinate system, and performing data transformation on the current radar data according to the first angle to obtain target radar data; obtaining a global map in the robot, determining a second angle of the global map relative to the preset coordinate system, and rotating the global map according to the second angle to obtain a target map; relocalizing the robot based on the target radar data and the target map to obtain the target pose of the robot. In this application, an initial map can be constructed through the current radar data of the robot, and data transformation can be performed on the current radar data based on the first angle of the initial map relative to the preset coordinate system. At the same time, the global map is obtained and the global map is rotated according to the second angle of the global map relative to the preset coordinate system. Through the relative position relationship between the current radar data after data transformation and the rotated global map, the robot can be quickly relocalized, and the pose of the robot can be determined based on the relocalization result, so that the duration of relocalizing the robot is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0076] Further, referring to Figure 4 , based on the first embodiment of the robot relocalization method of this application, a second embodiment of the robot relocalization method of this application is proposed. In the second embodiment, the step of determining the first angle of the initial map relative to the preset coordinate system includes:
[0077] Step S21: Taking the center point of the initial map as the center, traversing the initial map based on the preset heading angle range of the initial map to construct a plurality of temporary occupancy grid maps;
[0078] Step S22: Performing binarization processing on each of the temporary occupancy grid maps to obtain each binarized occupancy grid map including black grids and / or white grids;
[0079] Step S23: Determining the first angle of the initial map relative to the preset coordinate system based on the number of black grids in each of the binarized occupancy grid maps.
[0080] When calculating the first angle of the initial map, in this embodiment, the center point of the initial map can be used as the center, and the initial map can be traversed based on a preset heading angle range. Since the initial map is constructed from the current radar data, traversing the initial map is essentially equivalent to traversing the current radar data, and a preset number of temporary occupancy grid maps are constructed. In this embodiment, the preset heading angle range can be -45° to 45°, and the preset number is 90. Further, each temporary occupancy grid map is binarized to obtain a corresponding binarized occupancy grid map. Each binarized occupancy grid map obtained by binarization only includes black grids and white grids, and the first angle of the initial map relative to the preset coordinate system is calculated based on each binarized occupancy grid map.
[0081] In a specific embodiment of the present application, it can be: taking the center point corresponding to the current radar data in the initial map as the center, the heading angle in the 2D pose of the current radar data is traversed from -45° to 45° in sequence, 90 current radar data with different angles are constructed, and are respectively drawn into 90 temporary occupancy grid maps. Each of the 90 temporary occupancy grid maps is binarized, and the sum of the black map points in each row and column of each binarized occupancy grid map is counted. The one with the largest sum of black map points in a row or column is extracted as the traversal result, and the heading angle information of the current radar data of the temporary occupancy grid map corresponding to the traversal result is taken out to obtain the first angle of the map. Among them, the 2D pose includes position information x, y, and heading angle information yaw; a lidar data consists of 360 laser rays, these laser rays are emitted from the center point, each laser ray carries the distance information to the obstacle, and the 2D pose of the lidar data is (0, 0, 0), that is, x = 0, y = 0, yaw = 0. So as to perform data transformation on the current radar data according to the first angle to obtain the target radar data, and then based on the relative position relationship between the target radar data and the rotated target map, combined with the particle filter method, quickly reposition the robot and determine the current actual pose of the robot as the target pose based on the repositioning result, so that the time for the robot to perform repositioning is short and it does not need to consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0082] Further, the step of determining the first angle of the initial map relative to the preset coordinate system based on the number of black grids in each of the binarized occupancy grid maps includes:
[0083] Step S231, determining the number of black grids in the corresponding rows and columns of each of the binarized occupancy grid maps;
[0084] Step S232, determining the binarized occupancy grid map with the largest number of black grids in any row or any column of each of the binarized occupancy grid maps as the target map;
[0085] Step S233: Use the heading angle of the target map as the first angle of the initial map relative to the preset coordinate system.
[0086] When calculating the first angle of the initial map relative to the preset coordinate system based on each binary occupancy grid map, count the total number of black map points in each row and column of each binary occupancy grid map. Compare the values of the total number of black map points in each row and column to determine the magnitude relationship between them. Extract the row or column with the largest total number of black map points as the traversal result, and obtain the heading angle information of the current radar data corresponding to the temporary occupancy grid map of the traversal result to get the first angle of the map. This is to facilitate data transformation of the current radar data according to the first angle to obtain target radar data, and then based on the relative position relationship between the target radar data and the obtained rotated target map, quickly reposition the robot using the particle filter method and determine the current actual pose of the robot as the target pose based on the repositioning result, so that the time for the robot to reposition is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0087] Further, the step of performing data transformation on the current radar data according to the first angle to obtain target radar data includes:
[0088] Step S24: Construct a circular queue based on the current radar data, where the current radar data includes a preset number of laser rays, and the number of laser rays in the circular queue is a preset multiple of the preset number;
[0089] Step S25: Perform position transformation on the laser rays in the circular queue according to the first angle to obtain a target circular queue;
[0090] Step S26: Extract the laser rays in the target circular queue to form target radar data.
[0091] After calculating the first angle of the initial map relative to the preset coordinate system, in this embodiment, a circular queue with a data capacity of a preset size, such as 720, is constructed. That is, the data capacity of the circular queue is a preset multiple of the data volume corresponding to the current radar data, such as twice, three times, four times, etc. In this embodiment, it is preferably twice. Among them, the data at positions 1 to 360 are 360 rays of the current radar data, and the data at positions 361 to 720 are a copy of the data at positions 1 to 360. That is, the data at position 1 is the same as the data at position 361, and the data at position 360 is the same as the data at position 720, and so on. Further, based on the calculated first angle of the initial map relative to the preset coordinate system, specifically, it is determined whether to rotate the data in the circular queue clockwise or counterclockwise according to the magnitude relationship between the first angle and the preset angle threshold, and the rotated circular queue is determined as the target circular queue. Further, the data within the preset formation range is taken out from the target circular queue as the target radar data. In this embodiment, specifically, the data at positions 0 to 360 can be extracted as the rotated current radar data to obtain the target radar data. So as to quickly reposition the robot in combination with the particle filter method according to the relative position relationship between the target radar data and the rotated target map, and determine the current actual pose of the robot as the target pose based on the repositioning result, so that the time for the robot to reposition is short and it does not consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0092] Further, the step of performing position transformation on the laser rays in the circular queue based on the first angle to obtain the target circular queue includes:
[0093] Step S251, obtain a preset angle threshold;
[0094] Step S252, if the first angle is greater than the preset angle threshold, rotate all the laser rays in the circular queue counterclockwise by the number of laser ray units corresponding to the first angle to obtain a first circular queue;
[0095] Step S253, if the first angle is less than the preset angle threshold, rotate all the laser rays in the circular queue clockwise by the number of laser ray units corresponding to the first angle to obtain a second circular queue;
[0096] Step S254, determine the first circular queue or the second circular queue as the target circular queue.
[0097] After constructing a circular queue based on the current radar data, in this embodiment, the data transformation operation can be performed with the position 1 in the circular queue as a reference. Specifically, the first angle is compared with the preset angle threshold of 0° to obtain a comparison result. When the first angle is greater than the preset angle threshold of 0°, all the laser rays in the circular queue are rotated counterclockwise by the number of laser ray units corresponding to the first angle to obtain a first circular queue, and the obtained first circular queue is used as the target circular queue. When the first angle is less than the preset angle threshold of 0°, all the laser rays in the circular queue are rotated clockwise by the number of laser ray units corresponding to the first angle, and the obtained second circular queue is used as the target circular queue. Based on the target circular queue, the target radar data is determined, and then according to the relative position relationship between the target radar data and the rotated target map, combined with the particle filter method, the robot is quickly repositioned, and the current actual pose of the robot is determined as the target pose based on the repositioning result, so that the time for the robot to be repositioned is short and it does not need to consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0098] In this embodiment, the first angle of the initial map constructed based on the current radar data relative to the preset coordinate system can be calculated, and the data transformation is performed on the current radar data based on the first angle to obtain the target radar data, so as to quickly reposition the robot according to the relative position relationship between the target radar data and the rotated target map, and determine the current actual pose of the robot as the target pose based on the repositioning result, so that the time for the robot to be repositioned is short and it does not need to consume much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0099] Further, referring to Figure 5 , based on the first embodiment of the robot repositioning method of the present application, the third embodiment of the robot repositioning method of the present application is proposed. In the third embodiment, the target map is a grid map, and the step of repositioning the robot based on the target radar data and the target map to obtain the target pose of the robot includes:
[0100] Step S41, determining a grid as a target grid at a preset distance interval in the target map;
[0101] Step S42, based on the relationship that the target radar data and the target map are parallel or perpendicular to each other, setting particles in the first preset number of directions of each of the target grids to obtain a first particle set;
[0102] Step S43, determining the first matching degree score between each particle in the first particle set and the target radar data;
[0103] Step S44: Determine the target pose of the robot based on each of the first matching score.
[0104] After obtaining the target radar data and the target map, since both the target map and the target radar data are data that have been rotated by a corresponding angle relative to the preset coordinate system, the target map and the target radar data are perpendicular or parallel to each other. Based on this, in this embodiment, this characteristic is used to modify the particle scattering method of the particle filter as follows: In multiple grids of the target map, a grid is taken as the target grid for scattering particles at a certain distance interval, and then a particle is scattered in multiple different angular directions of these target grids. In this embodiment, particles can be set in the four directions of 0°, 90°, 180°, and 270° of each target grid to obtain the first particle set. Further, calculate the first matching score between each particle in the first particle set and the target radar data. Specifically, perform pose matching between the target radar data and each particle to obtain the first matching score between the target radar data and each particle. Further, filter out the first matching scores below the preset score threshold, and use the remaining matching scores as the target matching scores. Resample the target matching scores, and determine the pose of the particle with the highest score among the resampled target matching scores as the relocalization result, and determine the pose of the particle corresponding to the relocalization result as the target pose of the robot. This enables the robot to perform relocalization in a relatively short time without consuming much memory and CPU occupancy rate, effectively improving the working efficiency of the robot. Among them, the preset score threshold is a score value that can be set according to actual needs, such as 70 points, 75 points, 80 points, etc.
[0105] Further, the step of determining the target pose of the robot based on each of the first matching scores includes:
[0106] Step S441: Filter out the particles in the first particle set whose first matching scores are less than the preset score threshold;
[0107] Step S442: Reset particles in the second preset number of directions of the target grids where the remaining particles in the first particle set are located to obtain a second particle set; where the second preset number is greater than the first preset number;
[0108] Step S443: Determine the second matching scores between each particle in the second particle set and the target radar data;
[0109] Step S444: Determine the particle with the largest second matching score value in the second particle set as the target particle, and use the pose corresponding to the target particle as the target pose of the robot.
[0110] Specifically, in a specific embodiment of the present application, when determining the target pose of the robot based on each first matching degree score, each first matching degree score is compared with a preset score threshold respectively, and the particles in the first particle set whose first matching degree scores with the target radar data are less than the preset score threshold are filtered out. Particles are reset in the second preset number of directions of the target grid where the remaining particles in the first particle set are located to obtain a second particle set, where the second preset number is greater than the first preset number. Since in the embodiment of the present application, particles are first set in four directions of 0°, 90°, 180°, and 270° of each target grid, particles can be reset in more directions of the target grid where the remaining particles are located. For example, particles are set in multiple directions such as 0°, 30°, 60°, 90°, 120°, 150°, 180°, 210°, 240°, 270°, 300°, 330°, etc. All the particles set this time form the second particle set.
[0111] Furthermore, calculate the second matching degree scores of each particle in the second particle set with the target radar data respectively. Specifically, perform pose matching between the target radar data and each particle in the second particle set to obtain the second matching degree scores of the target radar data with each particle in the second particle set respectively. Compare each second matching degree score, determine the second matching degree score with the largest value among the second matching degree scores, and determine the particle with the largest second matching degree score value in the second particle set as the target particle. The pose formed by the target particle and the center of the grid where it is located is used as the target pose of the robot.
[0112] This embodiment can quickly set particles in the target map based on the relative position relationship between the current radar data after data transformation and the rotated global map to obtain a particle set; and perform relocalization on the robot based on the particle set in combination with the particle filtering method, and further determine the target pose of the robot according to the relocalization result. This makes the relocalization time of the robot shorter and does not require much memory and CPU occupancy rate, effectively improving the working efficiency of the robot.
[0113] In a specific embodiment of the present application, referring to Figure 6 , Figure 6This is a schematic diagram of the application scenario of the specific embodiment of the robot repositioning method of the present application. In this embodiment, the current radar data of the robot is collected to obtain lidar data, the lidar data is drawn into a temporary map to form an initial map, and the angle of the map (i.e., the initial map, namely the above-mentioned first angle) is calculated. The lidar data is rotated according to this angle, specifically, data transformation is performed on the lidar data. At the same time, the global map of the robot is obtained and rotated, and the robot is repositioned according to the rotated global map and the rotated lidar data. Specifically, the likelihood map of the global map is calculated, and particles are scattered in the global map based on the relative position relationship between the rotated global map and the rotated lidar data. Particles are scattered in 4 directions at each position (in this embodiment, 4 directions such as 0°, 90°, 180°, 270°), particles with a higher matching score with the rotated lidar data are selected from each particle for re-scattering, and after re-scattering, the matching score between each particle and the rotated lidar data is determined. The pose corresponding to the particle with the highest matching score is determined as the result 2D pose, and the result 2D pose is output as the output result to obtain the target pose of the robot.
[0114] Furthermore, the present application also provides a robot repositioning device.
[0115] Referring to Figure 7 , Figure 7 This is a schematic diagram of the functional modules of the first embodiment of the robot repositioning device of the present application.
[0116] The robot repositioning device includes:
[0117] An acquisition module 10, configured to collect the current radar data of the robot and construct an initial map based on the current radar data; wherein, the acquisition module 10 may specifically be a sensor, a camera, a lidar device, etc.
[0118] A data transformation module 20, configured to determine a first angle of the initial map relative to a preset coordinate system, and perform data transformation on the current radar data according to the first angle to obtain target radar data; wherein, the data transformation module 20 may specifically be a calculator, a calculation program, etc.
[0119] A rotation module 30, configured to obtain the global map in the robot, determine a second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map; wherein, the rotation module 30 may specifically be a calculator, a calculation program, etc.
[0120] A relocating module 40, configured to relocate the robot based on the target radar data and the target map, so as to obtain the target pose of the robot. The relocating module 40 may be a computing program including a relocating algorithm.
[0121] In addition, the present application further provides a medium, preferably a computer-readable storage medium, with a robot relocating program stored thereon. When the robot relocating program is executed by a processor, the steps of the above-mentioned various embodiments of the robot relocating method are implemented.
[0122] In the embodiments of the robot relocating device and the computer-readable storage medium of the present application, all the technical features of the above-mentioned various embodiments of the robot relocating method are included. The description and explanation content are basically the same as those of the above-mentioned various embodiments of the robot relocating method, and will not be elaborated herein.
[0123] It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0124] The serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which may be a fixed terminal, such as an Internet of Things intelligent device, including smart home appliances such as smart air conditioners, smart lights, smart power supplies, smart routers; or a mobile terminal, including smart phones, wearable connected AR / VR devices, smart speakers, autonomous driving vehicles, and many other connected devices) to execute the methods described in the various embodiments of the present application.
[0126] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A robot relocalization method, characterized in that, the robot relocalization method includes: Collect the current radar data of the robot, and construct an initial map based on the current radar data; Determine the first angle of the initial map relative to the preset coordinate system, and perform a construction transformation on the current radar data according to the first angle to obtain a target circular queue, and extract the laser rays in the target circular queue to form target radar data; Obtain the global map in the robot, determine the second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map; Based on the target radar data and the target map, perform relocalization on the robot to obtain the target pose of the robot.
2. The robot relocalization method according to claim 1, characterized in that, the target map is a grid map, and the step of performing relocalization on the robot based on the target radar data and the target map to obtain the target pose of the robot includes: Determine a grid as a target grid at a preset distance interval in the target map; Based on the relationship that the target radar data and the target map are parallel or perpendicular to each other, set particles in the first preset number of directions of each target grid to obtain a first particle set; Determine the first matching degree scores of the particles in the first particle set with the target radar data; Based on each of the first matching degree scores, determine the target pose of the robot.
3. The robot relocalization method according to claim 2, characterized in that, the step of determining the target pose of the robot based on each of the first matching degree scores includes: Filter out the particles in the first particle set whose first matching degree scores are less than the preset score threshold; Reset particles in the second preset number of directions of the target grids where the remaining particles in the first particle set are located to obtain a second particle set; wherein, the second preset number is greater than the first preset number; Determine the second matching degree scores of the particles in the second particle set with the target radar data; Determine the particle with the largest second matching degree score value in the second particle set as the target particle, and use the pose corresponding to the target particle as the target pose of the robot.
4. The robot relocalization method according to claim 1, characterized in that, the step of determining the first angle of the initial map relative to the preset coordinate system includes: Taking the center point of the initial map as the center, traversing the initial map based on the preset heading angle range of the initial map to construct multiple temporary occupancy grid maps; Perform binary processing on each of the temporary occupancy grid maps to obtain each binary occupancy grid map including black grids and / or white grids; Determine the first angle of the initial map relative to the preset coordinate system based on the number of black grids in each of the binary occupancy grid maps.
5. The robot relocalization method according to claim 4, characterized in that, The step of determining the first angle of the initial map relative to a preset coordinate system based on the number of black grids in each of the binarized occupancy grid maps includes: Determine the number of black grids on the corresponding rows and columns in each of the binarized occupancy grid maps; Determine the binarized occupancy grid map with the largest number of black grids on any row or any column in each of the binarized occupancy grid maps as the target map; Take the heading angle corresponding to the target map as the first angle of the initial map relative to the preset coordinate system.
6. The robot relocalization method according to claim 1, wherein, The step of performing data transformation on the current radar data according to the first angle to obtain target radar data includes: Construct a circular queue based on the current radar data, where the current radar data includes a preset number of laser rays, and the number of laser rays in the circular queue is a preset multiple of the preset number; Perform position transformation on the laser rays in the circular queue based on the first angle to obtain a target circular queue; Extract the laser rays in the target circular queue to form target radar data.
7. The robot relocalization method according to claim 6, wherein, The step of performing position transformation on the laser rays in the circular queue based on the first angle to obtain a target circular queue includes: Obtain a preset angle threshold; If the first angle is greater than the preset angle threshold, rotate all the laser rays in the circular queue counterclockwise by a number of laser ray units corresponding to the first angle to obtain a first circular queue; If the first angle is less than the preset angle threshold, rotate all the laser rays in the circular queue clockwise by a number of laser ray units corresponding to the first angle to obtain a second circular queue; Determine the first circular queue or the second circular queue as the target circular queue.
8. A robot relocalization device, wherein, The robot relocalization device includes: An acquisition module, configured to collect the current radar data of the robot and construct an initial map based on the current radar data; A data transformation module, configured to determine the first angle of the initial map relative to a preset coordinate system, and perform construction transformation on the current radar data according to the first angle to obtain a target circular queue, and extract the laser rays in the target circular queue to form target radar data; A rotation module, configured to obtain the global map in the robot, determine the second angle of the global map relative to the preset coordinate system, and rotate the global map according to the second angle to obtain a target map; A relocalization module, configured to relocalize the robot based on the target radar data and the target map to obtain the target pose of the robot.
9. A robot, wherein, The robot includes a memory, a processor, and a robot relocalization program stored on the memory and executable on the processor. When the robot relocalization program is executed by the processor, the steps of the robot relocalization method according to any one of claims 1-7 are implemented.
10. A medium, the medium being a computer-readable storage medium, characterized in that, a robot relocalization program is stored on the computer-readable storage medium, and when the robot relocalization program is executed by a processor, the steps of the robot relocalization method according to any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Autonomous global relocation method for robots and robot
CN107908185A
Robot position determination method, non-volatile computer readable storage medium and robot
CN110928312A
Repositioning method and device, terminal equipment and storage medium
CN112710299A