Robot positioning method and device, electronic equipment and computer readable storage medium
By obtaining the robot's laser point cloud and probability grid map and using the normal vector matching score to verify the robot's posture, the problem of robot repositioning error was solved, and the accuracy and success rate of repositioning were improved.
Patent Information
- Application Number
- CN202510884425.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-03
AI Technical Summary
In the existing technology, when the robot is relocalized, due to environmental changes and the failure to update the prior map, a simple matching error threshold is not sufficient to distinguish whether there is a deviation in the relocalization result, resulting in relocalization errors and affecting the accuracy of the robot's task execution.
By obtaining the laser point cloud and probability grid map of the robot in the current environment, a set of candidate poses is determined based on the preset initial pose and the first resolution. The normal vector matching scores of the laser point cloud and the probability grid map are used to perform a secondary verification to determine the positioning pose of the robot.
The accuracy and success rate of robot relocalization are improved, ensuring that the robot can accurately identify environmental changes in dynamic environments and reduce relocalization errors.
Smart Images

Figure CN120740591A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics technology, and in particular to a robot positioning method, device, electronic device, and computer-readable storage medium. Background Art
[0002] Simultaneous Localization and Mapping (SLAM) is a core technology in the field of robotics. Two-dimensional laser SLAM, a key branch of SLAM technology, uses two-dimensional lidar sensors to obtain distance information from the environment. It offers advantages such as simple data processing and strong real-time performance, making it widely used in indoor service robots, warehouse logistics robots, and other fields. Relocalization is a key step in two-dimensional laser SLAM systems. Its accuracy directly impacts the robot's ability to perform subsequent tasks. Relocalization involves the robot relying on its sensors and a priori map to find its accurate position within the map, initializing its positioning within the priori map. When the environment changes and the priori map has not been updated, a simple matching error threshold is insufficient to distinguish between deviations in the relocalization results, leading to relocalization errors. Summary of the Invention
[0003] Embodiments of the present application provide a robot positioning method, device, electronic device, and computer-readable storage medium, which can improve the accuracy of robot repositioning.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] An embodiment of the present application provides a robot positioning method, which includes: obtaining a laser point cloud collected by the robot in a current environment and a probability grid map of the robot; determining a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map; determining a first normal vector of each point cloud in the laser point cloud and a second normal vector of each pixel point in the probability grid map; determining a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; and determining the positioning pose of the robot from the candidate pose set based on the matching score.
[0006] An embodiment of the present application provides a robot positioning device, comprising: a data acquisition module for acquiring a laser point cloud collected by the robot in a current environment and a probability grid map of the robot; a first pose determination module for determining a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map; a normal vector determination module for determining a first normal vector for each point cloud in the laser point cloud and a second normal vector for each pixel point in the probability grid map; a score determination module for determining a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; and a second pose determination module for determining the positioning pose of the robot from the candidate pose set based on the matching score.
[0007] In the above scheme, the first pose determination module is also used to determine the second resolution of the laser point cloud based on the preset first resolution; determine the set of windows to be searched based on the first resolution, the second resolution and the preset search window; determine the pose set based on the initial pose and each window to be searched in the set of windows to be searched; determine the probability sum corresponding to the pose based on the point cloud corresponding to each pose in the pose set in the laser point cloud and the probability grid map; and determine the pose whose probability sum is greater than a preset first threshold as a candidate pose in the candidate pose set.
[0008] In the above scheme, the first pose determination module is also used to determine the first distance between each point cloud in the laser point cloud and the laser radar origin; determine the point cloud with the largest first distance as the target point cloud; and determine the second resolution based on the first distance corresponding to the target point cloud and the first resolution.
[0009] In the above scheme, the preset search window includes: a first linear search window, a second linear search window and an angular search window; the first pose determination module is further used to determine the first step number covering the first linear search window based on the first resolution and the first linear search window; determine the second step number covering the second linear search window based on the first resolution and the second linear search window; determine the third step number covering the angular search window based on the second resolution and the angular search window; divide the target search window according to the first step number, the second step number and the third step number to obtain the set of windows to be searched; wherein, the target search window is a search window centered on the initial pose.
[0010] In the above scheme, the first pose determination module is also used to perform the following processing for each pose in the pose set: for each point cloud in the laser point cloud, the first position information of the point cloud in the laser radar coordinate system is transformed by a first transformation matrix to obtain the second position information of the point cloud in the probability grid map coordinate system; based on the second position information and the first probability value of each pixel point in the probability grid map, the second probability value corresponding to the point cloud is determined; the second probability value corresponding to each point cloud is added to obtain the probability sum corresponding to the pose.
[0011] In the above scheme, the second posture determination module is also used to determine the candidate posture whose matching score is greater than a preset second threshold as the target posture from the candidate posture set; in response to the number of target postures being equal to 1, the target posture is determined as the positioning posture of the robot; in response to the number of target postures being greater than 1, the target posture with the largest probability sum is determined as the positioning posture of the robot.
[0012] In the above scheme, the normal vector determination module is also used to scan each point cloud in the laser point cloud according to a preset search radius to obtain the number of point clouds in the first target area corresponding to the search radius; in response to the number being equal to 2, determine the connecting line between the two point clouds in the first target area, and determine the direction vector corresponding to the perpendicular line of the connecting line as the first normal vector; in response to the number being greater than 2, determine the average value of the coordinate values of all point clouds in the first target area on the first coordinate axis of the laser radar coordinate system to obtain a first average value; and determine the average value of the coordinate values of all point clouds in the first target area on the second coordinate axis of the laser radar coordinate system to obtain a second average value; based on the first average value and the second average value, perform coordinate transformation on all point clouds in the first target area to obtain a transformed point cloud corresponding to each point cloud; and determine the first normal vector of each point cloud based on the transformed point cloud corresponding to each point cloud.
[0013] In the above scheme, the normal vector determination module is also used to construct the pixel point direction vector for each pixel point in the probability grid map according to the preset vertical radius and horizontal radius; determine the pixel value of each pixel point in the second target area corresponding to the vertical radius and the horizontal radius; and determine the second normal vector of the pixel point based on the direction vector, the pixel value of each pixel point in the second target area, the vertical radius and the horizontal radius.
[0014] In the above scheme, the score determination module is also used to perform the following processing for each candidate posture in the candidate posture set: for each point cloud in the laser point cloud, the first normal vector of the point cloud is transformed by the second transformation matrix to obtain a third normal vector; the first position information of the point cloud in the laser radar coordinate system is transformed by the third transformation matrix to obtain the third position information of the point cloud in the probability grid map coordinate system; the fourth normal vector corresponding to the point cloud is determined based on the third position information and the second normal vector of each pixel point in the probability grid map; and the matching score of the candidate posture is determined based on the third normal vector and the fourth normal vector.
[0015] In the above scheme, the device also includes a movement control module for controlling the robot to move a target distance in response to the positioning pose of the robot not being determined from the candidate pose set based on the matching score; the data acquisition module is also used to re-acquire the new laser point cloud and the new probability grid map of the robot collected by the robot in the current environment, and reposition the robot based on the new laser point cloud and the new probability grid map.
[0016] An embodiment of the present application provides an electronic device, comprising: a memory for storing computer-executable instructions or computer programs; and a processor for implementing the robot positioning method provided in the embodiment of the present application when executing the computer-executable instructions or computer programs stored in the memory.
[0017] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the robot positioning method provided in the embodiment of the present application when executed by a processor.
[0018] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the robot positioning method provided in the embodiment of the present application is implemented.
[0019] The embodiments of the present application have the following beneficial effects:
[0020] When the robot needs to be repositioned, the laser point cloud and probability grid map collected by the robot in the current environment are first obtained. Then, based on the preset initial pose and the first resolution of the probability grid map, a set of candidate poses for the robot in the current environment is determined, completing the robot's initial repositioning. Next, based on the first normal vector of each point in the laser point cloud and the second normal vector of each pixel in the probability grid map, the matching score of each candidate pose in the candidate pose set is determined. Finally, based on the matching score, the robot's positioning pose is determined from the candidate pose set. In this way, the robot's initial repositioning can be secondary verified, improving the accuracy of the robot's repositioning and, therefore, the success rate of the robot's repositioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is an optional flowchart of the robot positioning method provided in an embodiment of the present application;
[0022] Figure 2 This is another optional flowchart of the robot positioning method provided in an embodiment of the present application;
[0023] Figure 3 Schematic diagram of the implementation process of determining a candidate pose set provided in an embodiment of the present application;
[0024] Figure 4 1 is a schematic diagram of an implementation flow of determining a first normal vector provided in an embodiment of the present application;
[0025] Figure 5 1 is a schematic diagram of an implementation flow of determining a second normal vector provided in an embodiment of the present application;
[0026] Figure 6 This is a schematic diagram of the implementation process of determining the matching score provided in an embodiment of the present application;
[0027] Figure 7 This is a schematic diagram of the implementation process of the robot positioning method provided in the embodiment of the present application;
[0028] Figure 8 This is a structural block diagram of a robot positioning device provided in an embodiment of the present application;
[0029] Figure 9 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0031] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0032] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0033] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0034] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0035] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0036] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0037] 1) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0038] 2) Human-computer interaction interface: an interface used to provide human-computer interaction functions / an interface for displaying relocation information.
[0039] For example, graphical user interface (GUI) display, such as augmented reality (AR) interface, virtual reality (VR) interface, voice user interface (VUI), interactive projection interface (using projection technology to display information on a plane), eye movement detection interface (interface controlled by detecting the user's line of sight), holographic interface (three-dimensional hologram formed by projecting images through holographic projection technology, so that stereoscopic images can be seen without wearing special glasses), multimodal interface (interface that combines multiple interaction methods, such as touch, vision, hearing, etc.), brain-machine interface (BMI) interface, etc.
[0040] 3) Relocalization: refers to the process of a robot re-determining its position and posture in a known global map through its own sensors or external auxiliary equipment.
[0041] In order to better understand the robot positioning method provided in the embodiments of the present application, the robot positioning method in the related art is first described below.
[0042] In related technologies, the verification of relocalization results mainly relies on a simple matching error threshold judgment. For indoor scenes, planar information such as walls or doors is common. When the environment changes and the prior map is not updated, due to the two-sided nature of walls or doors, a simple matching error threshold is not enough to distinguish whether there is a deviation in the relocalization result, resulting in relocalization errors of the robot.
[0043] Based on the problems existing in the related art, an embodiment of the present application provides a robot positioning method. When the robot needs to be repositioned, first, the laser point cloud and probability grid map collected by the robot in the current environment are obtained. Then, based on the preset initial posture and the first resolution of the probability grid map, the candidate posture set of the robot in the current environment is determined to complete the preliminary repositioning of the robot. Then, based on the first normal vector of each point cloud in the laser point cloud and the second normal vector of each pixel point in the probability grid map, the matching score of each candidate posture in the candidate posture set is determined. Finally, based on the matching score, the positioning posture of the robot is determined from the candidate posture set. In this way, the preliminary repositioning of the robot can be secondary verified, the accuracy of the robot repositioning can be improved, and the success rate of the robot repositioning can be improved.
[0044] The robot positioning method provided in the embodiments of the present application can be applied to electronic devices such as laptop computers, tablet computers, desktop computers, robots, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0045] The robot positioning method provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0046] Figure 1 This is an optional flow chart of the robot positioning method provided in the embodiment of the present application, which can be applied to electronic devices. The following will be explained by taking the electronic device as an example. Figure 1 As shown, the method includes the following steps S101 to S105:
[0047] Step S101: Obtain the laser point cloud collected by the robot in the current environment and the probability grid map of the robot.
[0048] In the embodiments of the present application, a laser point cloud may refer to a series of three-dimensional spatial point data collected by a robot using a laser radar sensor in its surrounding environment. This three-dimensional spatial point data represents the location information of the laser beam emitted by the laser radar after it interacts with the surfaces of surrounding objects and is reflected back. Each three-dimensional spatial point data typically contains three coordinate values (x, y, z), representing the location of the three-dimensional spatial point in space. Suppose the robot is in an indoor environment and the laser radar is mounted on the top of the robot. When the laser radar starts operating, it emits a laser beam at a certain angle and frequency. For example, the laser radar rotates at a speed of 10 revolutions per second, emitting 1024 laser lines per revolution. If the robot is located in the center of a room, surrounded by objects such as walls and furniture, when the laser beam is emitted from the wall, the wall will reflect the laser. The laser radar calculates the distance from the laser radar to the point where the laser beam contacts the wall based on principles such as the time difference between laser emission and reception (time of flight method) or the phase difference (phase method). For example, if a laser beam emitted by the laser radar hits a wall 2 meters away from the robot and is reflected back, the laser radar records the location information of this point. Assuming the origin of the robot's coordinate system is at the robot's own location and the LiDAR's coordinate system is consistent with the robot's coordinate system, the coordinates of this point might be (2, 0, 0) (assuming the wall is directly in front of the robot and at a height consistent with the horizontal plane from which the LiDAR emits the laser light). A laser point cloud can also be a two-dimensional laser point cloud, which can be collected by a two-dimensional LiDAR sensor. Two-dimensional LiDAR can be used to measure horizontal distance information around the robot and can be applied to tasks such as robot navigation, obstacle avoidance, and environmental mapping.
[0049] A probabilistic grid map is a type of map used to represent a robot's environment. It divides the robot's environment into grid cells of equal size, with each cell corresponding to a region of the environment. Each grid cell is assigned a probability value, which represents the probability that the cell is occupied (i.e., an obstacle exists). Probability values typically range from 0 to 1, with 0 indicating that the cell is completely unoccupied and 1 indicating that the cell is completely occupied. Values between 0 and 1 indicate the likelihood that the cell is occupied. Probabilistic grid maps can also be represented as grayscale images, mapping the probability value of each grid cell to a grayscale value. For example, a probability value of 0 is mapped to a grayscale value of 255 (white), indicating that the cell is completely unoccupied. A probability value of 1 is mapped to a grayscale value of 0 (black), indicating that the cell is completely occupied. Probability values between 0 and 1 can be linearly mapped to grayscale values between 0 and 255. For example, a probability value of 0.5 can be mapped to a grayscale value of 128 (medium gray).
[0050] For example, consider a robot in an indoor environment, divided into a square grid with sides of 0.1 meters. The robot collects data using sensors (such as lidar) to update its probability grid map. When the lidar scans a wall, the grid cells corresponding to the area where the laser beam illuminates the wall are marked as having a high probability of occupancy. For example, if the lidar scans the wall and determines that the wall is between 2 and 2.1 meters in front of the robot, the grid cells in this area (assuming a 0.1 meter grid resolution, the 20th and 21st grid cells) are marked as having a high probability of occupancy, with a probability value close to 1. For areas around the robot where no obstacles are detected, the probability value of the grid cells decreases accordingly. For example, if there is no obstacle 1 meter in front of the robot, the probability value of the grid cells in this area (the 10th grid cell) may be close to 0. If the lidar scans the wall again while the robot is in motion, the probability value of the grid cells is updated based on the new observation data. For example, if the robot moves and the lidar scans the wall again and finds that the wall's position has changed slightly (perhaps due to sensor error or small unevenness in the wall itself), the robot will adjust the probability value of the grid cell based on the new observation data. If the new observation data shows that the wall has a higher probability of being in the 20th grid cell, the probability value of the 20th grid cell will be further increased, and the probability values of the surrounding grid cells will be adjusted according to the probability update algorithm (such as the Bayesian update formula).
[0051] The laser point cloud and probability grid map collected by the robot can be transmitted to the server in a variety of ways, depending on the robot's hardware configuration, network environment, and data transmission requirements. For example, wired communication: The robot connects to the local area network via an Ethernet port and sends the collected data to the server in the form of data packets. Wireless communication: The robot can connect to a wireless network using its built-in wireless compatibility authentication (WiFi) and send data to the server.
[0052] Step S102 : determining a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map.
[0053] In an embodiment of the present application, the pose may refer to the position and orientation of the robot in space. For example, in a two-dimensional environment, the pose can be represented by a triplet (x, y, θ), where x and y are position coordinates and θ is the direction angle. The initial pose is the starting position and orientation of the robot when it starts the task. The initial pose is pre-set. It should be noted that when there is no initial pose, the origin of the probability grid map can be used as the initial pose. Assume that the robot starts a task in an indoor environment, and the initial pose is set to (x=0, y=0, θ=0). The initial pose indicates that the robot is at the origin of the coordinate system and is facing the positive x-axis.
[0054] The first resolution is the resolution of the probability grid map. The resolution of a probability grid map refers to the side length of each grid cell in the map. Resolution is usually expressed in units of length, such as meters (m) or centimeters (cm). For example, a resolution of 0.1 meters means that the side length of each grid cell is 0.1 meters. Resolution determines the spatial accuracy and level of detail of the map. In a two-dimensional probability grid map, resolution usually refers to the side length of each square grid cell; in a three-dimensional probability grid map, resolution refers to the side length of each cubic grid cell. The higher the resolution, the smaller the grid cells, the richer the map details, but the computational and storage costs are also higher. If the first resolution is 0.1 meters, then the side length of each grid cell is 0.1 meters. If the first resolution is 0.2 meters, then the side length of each grid cell is 0.2 meters.
[0055] During the robot positioning process, due to sensor noise and environmental uncertainty, the server may not be able to accurately determine the position and orientation of the robot. Therefore, the server will generate multiple possible poses (position and orientation combinations), and then filter these possible poses according to some set screening rules. The screened poses can be called candidate poses. These candidate poses constitute a candidate pose set. The candidate pose set may include one candidate pose or multiple candidate poses. It should be noted that if the candidate pose cannot be determined, the current positioning is considered to have failed, and a movement command can be sent to the robot. After the robot moves to the new position, the new laser point cloud collected by the robot in the current environment and the new probability grid map of the robot are re-acquired, and based on the new laser point cloud and the new probability grid map, the candidate pose set of the robot in the current environment is re-determined according to the implementation method of steps S101 and S102.
[0056] The server can determine a set of candidate poses for the robot in the current environment based on a preset initial pose and the first resolution of the probability grid map. For example, a robot is operating in an indoor environment with a known initial pose of (x = 0, y = 0, θ = 0), and a probability grid map with a resolution of 0.1 meters. The server obtains environmental data collected by the robot using a lidar and, combined with the probability grid map, calculates the following pose sets: (x = 0.1, y = 0.2, θ = 0.1), (x = 0.3, y = 0.2, θ = 0), (x = 0.2, y = 0.0, θ = 0.1), (x = 0.3, y = 0.4, θ = 0.2), and so on. The poses in the pose set are filtered according to the preset filtering criteria, resulting in the following candidate pose set: (x = 0.1, y = 0.2, θ = 0.1), (x = 0.3, y = 0.2, θ = 0), and (x = 0.2, y = 0.0, θ = 0.1).
[0057] Step S103 : determining a first normal vector of each point in the laser point cloud and a second normal vector of each pixel in the probability grid map.
[0058] In an embodiment of the present application, the normal vector can be expressed as the perpendicular direction of the surface where a given point is located. Taking a two-dimensional laser point cloud as an example, the first normal vector can represent the perpendicular direction of the surface at each point cloud of the two-dimensional laser point cloud. For example, for each point cloud in the point cloud, find the neighboring points adjacent to the point cloud. These neighboring points can be found by a k-nearest neighbor algorithm or a fixed radius search algorithm. Then calculate the vector between the point cloud and the neighboring points, and then calculate the covariance matrix of these vectors; thereafter, solve the eigenvalues and eigenvectors of the covariance matrix, and the vector corresponding to the minimum eigenvalue in the eigenvector can be used as the normal vector of the point cloud. The above method is only for illustration and does not limit the embodiments of the present application.
[0059] The implementation method of calculating the normal vector of the probability grid map can refer to the method of determining the first normal vector of the point cloud, or other calculation methods can be selected according to actual conditions. The embodiments of this application do not limit this.
[0060] Step S104 : determining a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector.
[0061] In an embodiment of the present application, a matching score for each candidate pose in a candidate pose set is obtained by comparing the degree of match between the laser point cloud data observed by the robot at each candidate pose and the probability grid map. For each point cloud, the second normal vector of the pixel corresponding to the point cloud in the probability grid map is first determined. After that, the angle between the first and second normal vectors of the point cloud can be calculated. Then, the average or sum of the angles corresponding to all point clouds can be calculated and used as the matching score. The smaller the angle, the higher the matching score, indicating a better match between the observed data and the probability grid map.
[0062] Step S105: Determine the positioning pose of the robot from the candidate pose set based on the matching score.
[0063] In an embodiment of the present application, the server can determine the robot's positioning pose from a set of candidate poses based on the matching score. For example, the candidate pose with the highest matching score can be used as the robot's positioning pose; alternatively, a threshold value is set for the matching score, and a filter is performed. The filtered candidate poses are then filtered again according to other preset filtering conditions, and the filtered candidate poses are used as the robot's positioning pose. This embodiment of the present application does not limit this, and the selection can be made based on actual circumstances.
[0064] In an embodiment of the present application, when the robot needs to be repositioned, first, the laser point cloud and probability grid map collected by the robot in the current environment are obtained. Then, based on the preset initial pose and the first resolution of the probability grid map, the candidate pose set of the robot in the current environment is determined, and the preliminary repositioning of the robot is completed. Next, based on the first normal vector of each point cloud in the laser point cloud and the second normal vector of each pixel point in the probability grid map, the matching score of each candidate pose in the candidate pose set is determined. Finally, based on the matching score, the positioning pose of the robot is determined from the candidate pose set. In this way, the preliminary repositioning of the robot can be secondary verified, thereby improving the accuracy of the robot repositioning and thereby improving the success rate of the robot repositioning.
[0065] In some embodiments, the robot positioning method can also be implemented by the robot itself, that is, the robot itself obtains the laser point cloud collected in the current environment and the probability grid map of the robot; then, the robot itself determines the candidate pose set of the robot in the current environment based on the preset initial pose and the first resolution of the probability grid map; and, the robot itself determines the first normal vector of each point cloud in the laser point cloud, and the second normal vector of each pixel point in the probability grid map; then, the robot itself determines the matching score of each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; finally, the robot itself determines the positioning pose of the robot from the candidate pose set based on the matching score.
[0066] The following is an example of the application scenario of the robot positioning method provided in the embodiment of the present application.
[0067] In office scenarios, robots are used for document delivery and conference room guidance. Walls and glass doors are common obstacles, but these planar structures are visually similar. When a glass door opens or closes, a failure to update the prior map can lead to robot repositioning errors. For example, the robot may mistake a closed glass door for a wall, causing it to stop moving or take an incorrect detour. A simple matching error threshold cannot distinguish between the two sides of a glass door, resulting in frequent positioning deviations in dynamic environments, affecting task execution efficiency. The robot positioning method provided in the embodiments of the present application can first determine a set of candidate poses for the robot in the office scenario, completing the robot's preliminary repositioning. Next, based on the first normal vector of each point cloud in the laser point cloud and the second normal vector of each pixel in the probability grid map, a matching score is determined for each candidate pose in the candidate pose set. Finally, based on the matching score, the robot's positioning pose is determined from the candidate pose set. A secondary verification of the robot's preliminary repositioning improves the accuracy of the robot's repositioning, thereby increasing the robot's repositioning success rate.
[0068] Similarly, in a hotel environment, robots can deliver items to guest rooms and guide guests. Corridor walls and room doors look similar, and the open and closed states of doors can alter the layout of the environment. If the prior map isn't updated promptly, robots can easily misidentify closed doors as walls or open doorways as obstacles during relocalization. Similarly, in hospital wards, robots can deliver medications and guide patients. Room doors and corridor walls also visually share similar planar features. If room doors open and close frequently and the prior map isn't updated, robots are prone to relocalization errors. For example, a robot might mistake a closed door for a wall, preventing it from entering the room, or misidentify an open doorway as an obstacle and circumvent it. This can lead to inaccurate positioning in complex environments, impacting the efficiency of medical tasks. Furthermore, in a home environment, robots can be used for cleaning and carrying items. Doors and walls in a home are visually similar, and the open and closed states of doors can alter the layout of the environment. When the prior map isn't updated promptly, the robot can easily misidentify a closed door as a wall or an open doorway as an obstacle during relocation. For example, the robot might stop or take an incorrect route when entering a room because it can't accurately identify the door's status. However, the present embodiment allows for a secondary verification of the robot's initial relocation, improving the accuracy and success rate of the robot's relocation.
[0069] The robot positioning method of the embodiment of the present application will be described below in combination with the above scenarios.
[0070] Figure 2 This is another optional flow chart of the robot positioning method provided in the embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S201 to S213:
[0071] Step S201: The robot receives a robot task operation input by a user.
[0072] The robot task operation includes a selection operation or an input operation. The selection operation is used to control the robot to perform the task to be performed, or the input operation is used to input the task identifier of the task to be performed by the robot.
[0073] In step S202 , the robot encapsulates the task identifier of the task to be executed into a robot positioning request.
[0074] The robot positioning request is used to request the server to locate the robot.
[0075] Step S203: The robot sends a robot positioning request to the server.
[0076] In the embodiment of the present application, the robot sends a robot positioning request to the server to request the server to locate the robot. Of course, in some embodiments, the server can also actively locate the robot. The server can be the control server of the robot.
[0077] In step S204 , the server responds to the robot positioning request and obtains the laser point cloud collected by the robot in the current environment and the probability grid map of the robot.
[0078] It should be noted that step S204 is the same as the above-mentioned step S101, and the implementation details of step S204 are not repeated in this embodiment of the application.
[0079] In step S205 , the server determines a set of candidate poses of the robot in the current environment based on the preset initial pose and the first resolution of the probability grid map.
[0080] In some embodiments, see Figure 3 , Figure 3 It shows that step S205 can be implemented by the following steps S2051 to S2055:
[0081] Step S2051: Determine a second resolution of the laser point cloud based on a preset first resolution.
[0082] The second resolution is the angular resolution of the laser point cloud. Angular resolution represents the angular interval between adjacent laser beams during a laser radar scan. For example, if a laser radar rotates 360 degrees and emits a laser every 1 degree, the angular resolution is 1 degree.
[0083] In some embodiments, step S2051 can also be implemented by performing the following processing: first, determining the first distance between each point cloud in the laser point cloud and the laser radar origin; then, determining the point cloud with the largest first distance as the target point cloud; finally, determining the second resolution based on the first distance and first resolution corresponding to the target point cloud.
[0084] In the embodiment of the present application, the laser radar origin is the installation location of the laser radar sensor, which is usually also the origin of the laser radar coordinate system (0,0,0). All laser point cloud data are measured relative to the origin. First, the first distance between each point cloud in the laser point cloud and the laser radar origin is determined. The first distance can be the Euclidean distance. The calculation formula for the first distance can be formula (1):
[0085]
[0086] Where d is the first distance, x is the horizontal coordinate of the point cloud in the lidar coordinate system, and y is the vertical coordinate of the point cloud in the lidar coordinate system.
[0087] Traverse each point in the laser point cloud to obtain the first distance corresponding to each point. Then, compare the first distances corresponding to each point cloud and determine the point cloud with the largest first distance as the target point cloud. Finally, according to the pre-set second resolution calculation formula, the first distance corresponding to the target point cloud and the first resolution are used to determine the second resolution.
[0088] For example, the preset calculation formula for the second resolution may be formula (2):
[0089]
[0090] Among them, δ θ is the second resolution, r is the first resolution, d max is the first distance, and arccos is the inverse cosine function.
[0091] Through the above processing, the first distance corresponding to the point cloud farthest from the laser radar origin in the laser point cloud and the first resolution of the probability grid map can be used to calculate the second resolution. The second resolution can be dynamically adjusted according to the first resolution of the probability grid map to adapt to the laser radar measurement requirements in different environments and improve the positioning accuracy of the robot in complex environments.
[0092] Step S2052: Determine a set of windows to be searched based on the first resolution, the second resolution, and the preset search window.
[0093] In some embodiments, the preset search windows include: a first linear search window, a second linear search window, and an angular search window; step S2052 can also be implemented by performing the following processing: first, based on the first resolution and the first linear search window, determine the first step number covering the first linear search window; then, based on the first resolution and the second linear search window, determine the second step number covering the second linear search window; thereafter, based on the second resolution and the angular search window, determine the third step number covering the angular search window; finally, divide the target search window according to the first step number, the second step number, and the third step number to obtain a set of windows to be searched; wherein, the target search window is a search window centered on the initial posture.
[0094] In the embodiment of the present application, the lengths of the first linear search window and the second linear search window, and the angle of the angular search window are preset. For example, the lengths of the first linear search window and the second linear search window are preset to 10 meters, and the angle of the angular search window is preset to 180 degrees.
[0095] Calculate using formula (3) to get the first step number:
[0096]
[0097] Where r is the first resolution, W x is the length of the first linear search window, w x is the first step number.
[0098] For example, if the first resolution is 0.1m, then the first step number is 100.
[0099] Calculate the second step number using formula (4):
[0100]
[0101] Where r is the first resolution, W y is the length of the second linear search window, w y It is the second step number.
[0102] For example, if the first resolution is 0.1m, then the second step number is 100.
[0103] Calculate the third step number using formula (5):
[0104]
[0105] Among them, δ θ is the second resolution, W θ is the angle of the angle search window, w y It is the second step number.
[0106] For example, if the second resolution is 1 degree, then the third step number is 180.
[0107] Finally, through formula (6), the set of windows to be searched can be obtained:
[0108]
[0109] in, is the set of windows to be searched, w x is the first step number, w y is the second step number, w y It is the second step number.
[0110] The first step is 100, the second step is 100, and the third step is 180, so,
[0111] Through the above processing, the number of steps in three dimensions can be determined through the first resolution and the second resolution as well as the preset angle range and search window length, and then the set of windows to be searched can be determined, so that the search range can be dynamically adjusted according to the resolution, thereby improving the positioning accuracy of the robot in complex environments.
[0112] Step S2053: Determine a pose set based on the initial pose and each window to be searched in the set of windows to be searched.
[0113] In the embodiment of the present application, the pose set can be obtained by adding the search window set of the three dimensions to be searched and the initial pose. The method of determining the pose set can be expressed by formula (7):
[0114]
[0115] in, is the set of windows to be searched, (j x ,j y ,j θ ) is a window to be searched composed of three dimensions in the set of windows to be searched, ξ0 is the initial pose, r is the first resolution, δ θ is the second resolution, and W is the set of poses.
[0116] Assume that (j x ,j y ,j θ ) is (100,100,180), the first resolution is 0.1m, the second resolution is 1 degree, ξ0 is (0,0,0), for example, a pose in the pose set W can be (10,10,180), and so on.
[0117] Step S2054: Determine the probability sum corresponding to each pose in the pose set based on the point cloud corresponding to each pose in the laser point cloud and the probability grid map.
[0118] In some embodiments, step S2054 can also be implemented by performing the following processing: for each pose in the pose set, perform the following processing: first, for each point cloud in the laser point cloud, the first position information of the point cloud in the laser radar coordinate system is transformed by the first transformation matrix to obtain the second position information of the point cloud in the probability grid map coordinate system; then, based on the second position information and the first probability value of each pixel point in the probability grid map, the second probability value corresponding to the point cloud is determined; finally, the second probability value corresponding to each point cloud is added to obtain the probability sum corresponding to the pose.
[0119] In an embodiment of the present application, each pose in the pose set is traversed and the following processing is performed. Taking a pose as an example, first, the first transformation matrix corresponding to the current pose is obtained. The first transformation matrix is a transformation matrix that converts the point cloud from the lidar coordinate system to the probability grid map coordinate system. For example, the first position information of the point cloud in the lidar coordinate system is (1,1), and the first transformation matrix is a 2×2 homogeneous transformation matrix. It is assumed that the second position information of the point cloud in the probability grid map coordinate system is (3,2). Then, the first probability value of each pixel in the probability grid map is determined, and then the second probability value corresponding to the point cloud is determined to be 0.7 based on the first probability value of the pixel corresponding to the second position information (3,2) (for example, 0.7). The implementation method for obtaining the second probability value corresponding to the point cloud is the same as the above method and will not be repeated here. It should be noted that if the second position information obtained is not an integer, the coordinate value is first rounded to obtain the new second position information, and then the second probability value corresponding to the point cloud is determined based on the new second position information. For example, if the second position information is (3.2, 2.7), then the new second position information is (3, 3). Finally, the second probability values corresponding to each point cloud are added together to obtain the probability sum corresponding to the pose. The implementation method for obtaining the probability sum corresponding to the pose is the same as above and will not be repeated here.
[0120] Through the above processing, the probability sum of each posture can be obtained by adding the corresponding probability values of each point cloud in the probability grid map. The probability sum is used to achieve a quantitative evaluation of each posture in the posture set, providing a basis for subsequent posture selection.
[0121] Step S2055: Determine the posture whose probability sum is greater than a preset first threshold as a candidate posture in the candidate posture set.
[0122] In the embodiment of the present application, the first threshold is pre-set, and the value of the first threshold can be set according to actual conditions, and the embodiment of the present application does not limit this. The probability sum corresponding to each posture is compared with the first threshold, and the posture with a probability sum greater than the first threshold is determined as a candidate posture in the candidate posture set.
[0123] It should be noted that if there is no probability corresponding to a posture greater than the first threshold, the current positioning is considered to have failed, and a movement instruction can be sent to the robot to re-acquire the new laser point cloud collected by the robot in the current environment and the new probability grid map of the robot, and based on the new laser point cloud and the new probability grid map, the robot can be re-determined in accordance with the implementation method of steps S101 and S102, or the implementation method of steps S201 to S205, for the candidate posture set of the robot in the current environment.
[0124] Through steps S2051 to S2055, the second resolution is first determined based on the first resolution. When the first resolution changes, the second resolution can also be dynamically adjusted to meet the needs of different environments. Next, based on the first resolution, the second resolution, and a preset search window, a set of windows to be searched is determined, and then a pose set is generated by combining the initial pose. The probability sum of each pose is then calculated to quantitatively evaluate the poses. Finally, poses with a probability sum greater than a preset threshold are selected as a candidate pose set, providing a basis for subsequent robot positioning.
[0125] In step S206 , the server determines a first normal vector of each point cloud in the laser point cloud.
[0126] In some embodiments, see Figure 4 , Figure 4 It shows that step S206 can be implemented by the following steps S2061 to S2065:
[0127] Step S2061 : Scan each point cloud in the laser point cloud according to a preset search radius to obtain the number of point clouds in the first target area corresponding to the search radius.
[0128] In the embodiments of this application, the search radius can be pre-set based on actual conditions and is not limited in this embodiment. Each point cloud is scanned with the search radius as the center, and the number of point clouds contained within the circular area formed by the search radius is counted. It should be noted that the point cloud at the center of the scan is included in the point cloud count.
[0129] Step S2062 : In response to the number being equal to 2, determining a connecting line between two point clouds in the first target area, and determining a direction vector corresponding to a perpendicular line of the connecting line as a first normal vector.
[0130] In the embodiment of the present application, when the number of point clouds is 2, the line between the two point clouds is determined, and the direction vector corresponding to the perpendicular line of the line is determined as the first normal vector. For example, the point cloud at the scanning center is P1 with coordinates (x1, y1), and the other point cloud is P2 with coordinates (x2, y2). Then the vector corresponding to the line between the two point clouds is (x2-x1, y2-y1), and the direction vector perpendicular to the vector (x2-x1, y2-y1) is (-(y2-y1), x2-x1), and the first normal vector is (-(y2-y1), x2-x1).
[0131] In step S2063, in response to the number being greater than 2, the average coordinate values of all point clouds within the first target area on the first coordinate axis of the lidar coordinate system are determined to obtain a first average value. Furthermore, the average coordinate values of all point clouds within the first target area on the second coordinate axis of the lidar coordinate system are determined to obtain a second average value.
[0132] In the embodiment of the present application, when the number of point clouds is greater than 2. For example, there are N point clouds, each point cloud P i The coordinates are (x i ,y i ). Determine the average value of the coordinate values of all point clouds on the first coordinate axis of the laser radar coordinate system, that is, the x-axis, and obtain the first average value. The first average value is Determine the average value of the coordinate values of all point clouds on the second coordinate axis of the laser radar coordinate system, that is, the y-axis, and obtain the second average value. The first average value is
[0133] Step S2064 : performing coordinate transformation on all point clouds in the first target area based on the first average value and the second average value to obtain a transformed point cloud corresponding to each point cloud.
[0134] In the embodiment of the present application, for each point cloud P i The coordinates are (x i ,y i ), the transformed point cloud P corresponding to each point cloud is obtained by subtracting the first average value from the coordinate value on the first coordinate axis and subtracting the second average value from the coordinate value on the second coordinate axis. i ′, transform point cloud P i The coordinates of ′ are
[0135] Step S2065 : determining a first normal vector of each point cloud based on the transformed point cloud corresponding to each point cloud.
[0136] In the embodiment of the present application, the covariance matrix corresponding to the transformed point cloud can be determined by formula (8):
[0137]
[0138] Where ∑ is the covariance matrix, n is the number of point clouds, and p i ′ is the transformed point cloud.
[0139] Then, the eigenvectors and eigenvalues of the covariance matrix are calculated using formula (9):
[0140] ∑v=λv (9)
[0141] Where ∑ is the covariance matrix, v is the eigenvector, and λ is the eigenvalue.
[0142] For a two-dimensional covariance matrix, there are two eigenvectors. The eigenvector v corresponding to the smaller eigenvalue is min That is the first normal vector n p , that is, n p =v min .
[0143] Through steps S2061 to S2065, the number of point clouds in the neighborhood of each point cloud can be counted. When the number of point clouds is 2, the line between the two point clouds is calculated, and the perpendicular direction vector of the line is determined as the first normal vector. When the number of point clouds is greater than 2, the coordinate average of all point clouds in the lidar coordinate system is calculated, the point clouds are coordinate-transformed, and the normal vector is calculated using the eigenvector of the covariance matrix. In this way, the calculation method of the normal vector can be dynamically adjusted according to the local density and distribution of the point cloud, thereby improving the accuracy and robustness of point cloud feature extraction and providing a more reliable foundation for subsequent point cloud processing and analysis.
[0144] Step S207: The server determines a second normal vector for each pixel in the probability grid map.
[0145] In some embodiments, see Figure 5 , Figure 5 It shows that step S207 can be implemented by the following steps S2071 to S2073:
[0146] Step S2071 : For each pixel point in the probability grid map, a pixel direction vector is constructed according to a preset vertical radius and a preset horizontal radius.
[0147] In the embodiment of the present application, the vertical radius and the horizontal radius can be pre-set according to the actual situation. Then, with each pixel in the probability grid map as the origin, according to the preset vertical and horizontal radii i and j as the direction, a pixel direction vector d is constructed, where d = (i, j), i = [0, I], j = [0, J].
[0148] Step S2072: Determine the pixel value of each pixel point in the second target area corresponding to the vertical radius and the horizontal radius.
[0149] In the embodiment of the present application, the vertical radius and the horizontal radius can be pre-set based on actual conditions. Then, a rectangle is constructed using each pixel as a starting point, with the vertical radius as the height and the horizontal radius as the width. This rectangle serves as the second target area. Next, based on the corresponding position of the second target area in the probability grid map, the pixel value corresponding to each pixel at that position is obtained.
[0150] Step S2073: Determine a second normal vector of the pixel point based on the direction vector, the pixel value of each pixel point in the second target area, the vertical radius, and the horizontal radius.
[0151] In the embodiment of the present application, the second normal vector can be calculated by formula (10):
[0152]
[0153] Among them, i is the vertical radius, j is the horizontal radius, the function M(o,j) means that when the pixel value of the pixel point corresponding to (i,j) is 255, the function value is 1, and when the pixel value is not 255, the function value is 0, that is, only the pixel value of 255 is calculated and accumulated, the function nor means the normalization operation of the accumulated vector, d is the direction vector, n m is the second normal vector.
[0154] Through steps S2071 to S2073, the preset vertical radius and horizontal radius are used to determine the second target area of each pixel point, and weighted accumulation is performed according to the pixel values of the pixels in the area. Finally, the second normal vector is obtained through normalization operation, which can effectively capture the local structural information around the pixel point and enhance the perception of environmental features, thereby improving the positioning accuracy of the robot in complex environments.
[0155] In step S208 , the server determines a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector.
[0156] In some embodiments, see Figure 6 , Figure 6 It shows that step S208 can be implemented by following steps S2081 to S2084:
[0157] For each candidate pose in the candidate pose set, perform the following processing:
[0158] Step S2081: For each point cloud in the laser point cloud, the first normal vector of the point cloud is transformed by a second transformation matrix to obtain a third normal vector.
[0159] In the embodiment of the present application, the second transformation matrix is the transformation matrix corresponding to the current candidate pose, and the second transformation matrix is the transformation matrix that converts the first normal vector of the point cloud from the lidar coordinate system to the probability grid map coordinate system. For example, the first normal vector n p , the second transformation matrix can be a 2×2 homogeneous transformation matrix, which transforms n p After transformation, the third normal vector n′ is obtained p .
[0160] Step S2082: transform the first position information of the point cloud in the lidar coordinate system through a third transformation matrix to obtain third position information of the point cloud in the probability grid map coordinate system.
[0161] In the embodiment of the present application, the third transformation matrix is the transformation matrix corresponding to the current candidate pose, and the third transformation matrix is the transformation matrix that converts the point cloud from the laser radar coordinate system to the probability grid map coordinate system. For example, the coordinates of the point cloud in the laser radar coordinate system are (x i ,y i ), the third transformation matrix can be a 2×2 homogeneous transformation matrix, which transforms (x i ,y i ) is transformed to obtain the third position information (x″ i ,y″ i ).
[0162] Step S2083: Determine a fourth normal vector corresponding to the point cloud according to the third position information and the second normal vector of each pixel in the probability grid map.
[0163] In the embodiment of the present application, according to the third position information (x″ i ,y″ i ) can determine the pixel point in the probability grid map corresponding to the position information, and the third position information (x″) can be determined according to the second normal vector corresponding to the pixel point i ,y″ i ) and determine the second normal vector corresponding to the point cloud as the fourth normal vector corresponding to the point cloud.
[0164] Step S2084: Determine the matching score of the candidate pose based on the third normal vector and the fourth normal vector.
[0165] In the embodiment of the present application, the dot product of the third normal vector and the fourth normal vector can be calculated, and the dot product results corresponding to each point cloud can be summed to serve as the matching score for the current candidate pose. Alternatively, the dot product results greater than 0 corresponding to each point cloud can be summed to serve as the matching score for the current candidate pose. This embodiment of the present application is not limited to this.
[0166] Through steps S2081 to S2084, the first normal vector of the point cloud is first transformed from the lidar coordinate system to the probability grid map coordinate system using the second transformation matrix to obtain the third normal vector. Next, the position information of the point cloud is transformed from the lidar coordinate system to the probability grid map coordinate system using the third transformation matrix to obtain third position information. Then, based on the third position information, the corresponding pixel point and second normal vector in the probability grid map are found, and the second normal vector is used as the fourth normal vector. Finally, by calculating the dot product of the third normal vector and the fourth normal vector and summing the dot product results of all point clouds, the matching score of the current candidate pose is obtained. This can effectively evaluate the degree of match between the candidate pose and the environment, thereby providing a basis for precise positioning of the robot and improving the robot's positioning accuracy.
[0167] In step S209 , the server determines the positioning pose of the robot from the candidate pose set based on the matching score.
[0168] In some embodiments, step S209 can also be implemented by performing the following processing: from the candidate posture set, determining the candidate posture with a matching score greater than a preset second threshold as the target posture; in response to the number of target postures being equal to 1, determining the target posture as the positioning posture of the robot; in response to the number of target postures being greater than 1, determining the target posture with the largest probability sum as the positioning posture of the robot.
[0169] In the embodiment of the present application, the second threshold value can be pre-set according to actual conditions, and the embodiment of the present application does not limit this. The matching score of each candidate posture in the candidate posture set is compared with the second threshold value, and the candidate posture with a matching score greater than the second threshold value is determined as the target posture. If the number of target postures is equal to 1, then the target posture can be determined as the positioning posture of the robot. If the number of target postures is greater than 1, the target posture with the largest probability sum can be determined as the positioning posture of the robot.
[0170] Through the above processing, the matching score can be compared with the second threshold, and the most suitable positioning posture can be selected from multiple possible candidate postures. When the most suitable positioning posture is not unique, the candidate posture with the maximum probability sum is determined as the final positioning posture, which further ensures the reliability of positioning and makes the robot's positioning in complex environments more accurate and stable.
[0171] In step S210 , in response to the fact that the positioning pose of the robot is not determined from the candidate pose set based on the matching score, the server controls the robot to move a target distance.
[0172] In an embodiment of the present application, when the positioning posture of the robot cannot be determined from the candidate posture set based on the matching score, a movement instruction can be sent to the robot to control the robot to move the target distance. The target distance can be set according to actual conditions. For example, the robot can be controlled to move to an open area.
[0173] In step S211 , the server reacquires a new laser point cloud collected by the robot in the current environment and a new probability grid map of the robot, and relocates the robot based on the new laser point cloud and the new probability grid map.
[0174] In the embodiment of the present application, the implementation method of step S211 can refer to the implementation method of steps S101 to S105 or the implementation method of steps S204 to S209, which will not be repeated here.
[0175] Through steps S210 to S211, when the exact position of the robot cannot be determined, the robot can be controlled to move to the target distance, re-collect the laser point cloud and probability grid map, and re-position based on the new data, thereby improving the robot's adaptability and positioning accuracy in complex environments, and ensuring that the robot can operate stably and complete the task.
[0176] Step S212: The server sends the positioning result to the robot.
[0177] Step S213: The robot performs the task according to the positioning result.
[0178] When the robot needs to be repositioned, the embodiment of the present application first obtains the laser point cloud and probability grid map collected by the robot in the current environment. Then, based on the preset initial posture and the first resolution of the probability grid map, the candidate posture set of the robot in the current environment is determined, and the preliminary repositioning of the robot is completed. Then, based on the first normal vector of each point cloud in the laser point cloud and the second normal vector of each pixel point in the probability grid map, the matching score of each candidate posture in the candidate posture set is determined. Finally, based on the matching score, the positioning posture of the robot is determined from the candidate posture set. In this way, the preliminary repositioning of the robot can be secondary verified, thereby improving the accuracy of the robot repositioning, and further improving the accuracy of the robot repositioning.
[0179] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0180] For indoor scenes, when the environment changes and the prior map is not updated, the robot can be positioned using the embodiments of this application. Figure 7 , Figure 7 The following is a schematic diagram of the implementation flow of the robot positioning method provided in the embodiment of the present application. The following is an exemplary description using the execution subject as a server as an example.
[0181] Step S701A, obtain the laser point cloud. Step S701B, obtain the probability grid map. It should be noted that steps S701A and S701B are the same as the above-mentioned step S101, and the implementation details of steps S701A and S701B are not repeated here.
[0182] Then, the server can extract the normal vector features of the two-dimensional laser point cloud and the probability grid map. Since the two-dimensional laser point cloud and the probability grid map are both based on a two-dimensional plane, the two-dimensional vector n p =(n px ,n py ) can represent the normal vector (i.e. the first normal vector) of each laser point cloud, and the two-dimensional vector n m =(n mx,n my ) can represent the normal vector (i.e., the second normal vector) of each pixel point in the probability grid map.
[0183] Step S702A, calculating the point cloud normal vector.
[0184] To calculate the normal vector for each scanned point in the laser point cloud, an appropriate neighborhood search radius is first selected. A K-Dimensional Tree (KD-Tree) search algorithm is then used to find the neighboring point set P for each scanned point in real time. The neighborhood search radius should be selected based on the angular resolution of the lidar sensor to ensure that it does not increase computational cost excessively and introduce large errors in normal vector calculation. Due to the characteristics of lidar, point clouds obtained from close-range scans are denser, while those obtained from long-range scans are sparser. Choosing an appropriate radius ensures that too many points are searched at close range, which would incur excessive computational cost, while too few points are searched at long distances, which would lead to errors in normal vector calculation. For example, for a single-line lidar, which has an inherent horizontal angular resolution, assuming it is theta, the horizontal spacing can be calculated linearly with the distance D between the target point and the radar: horizontal spacing = 2Dsin(theta / 2) ≈ D*theta. To calculate the neighborhood search radius r, a neighborhood coverage factor k is defined, with empirical values of k = 3-5, and r = k*D*theta. For example, when theta = 0.75° = 0.013 rad, k = 4, and D = 10 m, r = 4*10*0.013 = 0.52 m.
[0185] According to the number N (i.e., the number of point clouds) of the neighborhood point set P, the normal vector calculation can be divided into three categories: (1) N = 1. Due to laser noise or the large interval between adjacent laser points, the normal vector feature of the scan point is not calculated; (2) N = 2, the vertical direction of the line connecting the two points (i.e., the direction vector corresponding to the vertical line) is directly calculated as the normal vector; (3) N>2, the normal vector feature is calculated using the principal component analysis method. First, the average value (i.e., the first average value and the second average value) of the neighborhood point set P in the x-axis (i.e., the first coordinate axis) and the y-axis (i.e., the second coordinate axis) (the coordinate system here is the laser radar coordinate system, and the origin is the laser radar optical center) is calculated. Then, the average value is subtracted from the neighborhood point set P to obtain the point set P′ with the average value as the origin. Each point in P′ (i.e., the transformed point cloud) is obtained by the following formulas (11) and (12):
[0186]
[0187] Among them, (x i ,y i ) is the coordinate of the point cloud in the point set P, (x i ′,y i′) are the coordinates of the point cloud in the point set P′, and N is the number of point clouds.
[0188] Next, calculate the covariance matrix of all point clouds in the point set P′ to calculate the eigenvectors and eigenvalues. Please refer to the above formulas (8) and (9), which will not be repeated here. For a two-dimensional covariance matrix, there are two eigenvectors. The eigenvector v corresponding to the smaller eigenvalue is min That is the normal vector n p , that is, n p =v min .
[0189] Step S702B: Calculate the probabilistic grid map normal vector.
[0190] The probability grid map can be represented as a grayscale image, where a pixel value of 0 indicates occupation, a pixel value of 255 indicates idle, and a pixel value of 128 indicates unknown. For each pixel in the probability grid map, the method for calculating the normal vector can be referred to the above formula (10), which will not be repeated here.
[0191] Step S703: repositioning based on the two-dimensional laser radar and the probability grid map, outputting a pose result and determining whether the result meets a first score threshold.
[0192] First, the initial pose ξ0 is given. If there is no initial pose, the origin of the probability grid map is used as the initial pose.
[0193] Then, let the probability grid map resolution be r (i.e., the first resolution), then the angular resolution δ of the lidar θ The calculation formula of (ie, the second resolution) can be found in the above formula (2), which will not be repeated here.
[0194] d in formula (2) max (i.e. the first distance) can also be calculated using formula (13):
[0195]
[0196] Among them, N is the current frame point cloud s p The number of midpoint clouds, Indicates taking the maximum value, ||s p || represents point cloud s p Distance to the lidar origin, s p The above formula (13) can be expressed as taking the point cloud with the largest distance from the laser radar origin as the farthest point (i.e., the target point cloud), and taking the distance between the farthest point and the laser radar origin as d max .
[0197] Next, a linear search window (ie, a first linear search window and a second linear search window) is preset.x =W y =10m, angle search window W θ =180°, the integer number of steps covering the window can be obtained. The specific calculation formula can be found in the above formulas (3) to (5), which will not be repeated here. Finally, a finite search window centered on the initial pose ξ0 is obtained, which can be found in the above formula (6), which will not be repeated here.
[0198] In formula (6) It can also represent a discrete search range set obtained by dividing the search window by the number of search steps in the preset search window. In the above example, the preset linear search window is 10m, the angular search range is 180°, and the search steps are calculated based on the map resolution and angular resolution. The search windows in the three dimensions are discretized and combined to obtain the set of windows to be searched.
[0199] The set of search windows in three dimensions to be searched Adding it to the initial pose ξ0 yields the pose set W, which can be found in the above formula (7) and will not be repeated here.
[0200] The optimal pose ξ can be obtained by calculating the maximum probability sum of the current frame point cloud on the probability grid map through formula (14) * (Each grid in the probability grid map stores the probability that there is an obstacle in the current grid. The maximum probability and corresponding position of the current frame point cloud on the probability grid map can represent the most likely position of the robot, that is, the optimal posture. However, in relocalization, the ground Figure 1 This is usually a historical map from a long time ago. In indoor environments, due to environmental changes and the duality of many walls, the maximum probability and corresponding position may not necessarily be the correct position, so a verification step is added to reduce relocation errors or deviations.)
[0201]
[0202] Among them, W is the pose set, N is the number of point clouds, M nearest Indicates that the parameter T ξ s p Round to the nearest grid point and get the parameter T ξ s p The probability value on the probability grid map, T ξ represents the transformation matrix corresponding to the candidate pose (i.e., the first transformation matrix), s p is the laser point cloud of the current frame, ξ is an element in the pose set W, representing one of the candidate poses. W is finite and can be traversed from beginning to end.
[0203] A first score threshold S1 (ie, the first threshold) is set. When the sum of the probabilities corresponding to the postures is greater than the first score threshold S1, the process proceeds to step S704.
[0204] Step S704: obtaining a single or multiple candidate poses.
[0205] These candidate poses are added to the candidate pose set, and the candidate poses in the candidate pose set enter the candidate pose result verification stage based on normal vector matching.
[0206] If the sum of the probabilities of no posture is greater than the first score threshold S1, the process proceeds to step S705.
[0207] Step S705: Relocation fails.
[0208] If the relocation fails, the robot may be controlled to move a certain distance (preferably to a wider area of the environment), and then steps S701A to S703 may be repeated at the new location.
[0209] Step S706 : performing normal vector matching calculation between the point cloud and the probability grid map based on the candidate pose, and determining whether the result meets a second score threshold.
[0210] In step S703, a single or multiple candidate poses that meet the first score threshold S1 are calculated, and the normal vector matching score S between the point cloud and the probability grid map is calculated based on the candidate poses. ξ (i.e. matching score), see formula (15):
[0211]
[0212] Among them, N represents the number of normal vectors, and the function L indicates that the result is 1 when the parameter is greater than 0, and the result is 0 when the parameter is less than or equal to 0. is the rotation matrix from the image coordinate system to the radar coordinate system (i.e., the second transformation matrix), n p Represents the normal vector of the laser point, and the function N represents obtaining the normal vector of the pixel point in the probability grid map corresponding to its parameters. represents the transformation matrix from the image coordinate system to the radar coordinate system (i.e., the third transformation matrix), l p Represents a radar point, in the lidar coordinate system, by Convert it to the image coordinate system to get a pixel point in the image. Function N represents the normal vector corresponding to this pixel point, which is the n calculated above. m .
[0213] A second score threshold S2 (ie, the second threshold) is set to determine whether the result is greater than the second score threshold.
[0214] If the matching score of any candidate pose is greater than the second score threshold S2, the process proceeds to step S707.
[0215] Step S707 : sort the candidate poses that meet the second score threshold in descending order according to the first score, and output the first candidate pose as the final relocalization result.
[0216] When the normal vector matching score is greater than the second score threshold S2, the candidate pose is considered to be a suitable relocalization pose. Finally, if only one candidate pose meets the first score threshold and the second score threshold requirements, the candidate pose is used as the final relocalization pose. If there are multiple candidate poses that meet the first score threshold and the second score threshold requirements, they are sorted in descending order according to the first score threshold, and the first candidate pose is used as the final relocalization pose.
[0217] If no candidate pose has a matching score greater than the second score threshold S2, the process proceeds to step S708.
[0218] Step S708: Relocation fails.
[0219] If the relocation fails, the robot may be controlled to move a certain distance (preferably to a wider area of the environment), and then steps S701A to S706 may be repeated at the new location.
[0220] In the embodiment of the present application, the relocation results based on the prior map can be re-verified through the normal vector information of the laser point cloud and the probability grid map, thereby solving the problem that a simple matching error threshold is not sufficient to distinguish whether there is a deviation in the relocation results in indoor multi-sided planar feature scenarios, and can improve the relocation accuracy in such scenarios.
[0221] Based on the robot positioning method described in the above embodiment, Figure 8 A structural block diagram of a robot positioning device provided in an embodiment of the present application is shown. The robot positioning device 100 can be a device in an electronic device (for example, a server). The robot positioning device can be implemented in software, which can be software in the form of programs and plug-ins, etc., including the following software modules: a data acquisition module 101, a first pose determination module 102, a normal vector determination module 103, a score determination module 104 and a second pose determination module 105. These modules are logical and can therefore be arbitrarily combined or further split according to the functions implemented.
[0222] Among them, the data acquisition module 101 is used to obtain the laser point cloud collected by the robot in the current environment and the probability grid map of the robot; the first pose determination module 102 is used to determine the candidate pose set of the robot in the current environment based on the preset initial pose and the first resolution of the probability grid map; the normal vector determination module 103 is used to determine the first normal vector of each point cloud in the laser point cloud and the second normal vector of each pixel point in the probability grid map; the score determination module 104 is used to determine the matching score of each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; the second pose determination module 105 is used to determine the positioning pose of the robot from the candidate pose set based on the matching score.
[0223] In some embodiments, the first pose determination module 102 is further used to determine the second resolution of the laser point cloud based on the preset first resolution; determine a set of windows to be searched based on the first resolution, the second resolution and a preset search window; determine a pose set based on the initial pose and each window to be searched in the set of windows to be searched; determine the probability sum corresponding to the pose based on the point cloud corresponding to each pose in the pose set in the laser point cloud and the probability grid map; and determine the pose whose probability sum is greater than a preset first threshold as a candidate pose in the candidate pose set.
[0224] In some embodiments, the first pose determination module 102 is also used to determine the first distance between each point cloud in the laser point cloud and the laser radar origin; determine the point cloud with the largest first distance as the target point cloud; and determine the second resolution based on the first distance corresponding to the target point cloud and the first resolution.
[0225] In some embodiments, the preset search window includes: a first linear search window, a second linear search window and an angular search window; the first pose determination module 102 is further used to determine the first step number covering the first linear search window based on the first resolution and the first linear search window; determine the second step number covering the second linear search window based on the first resolution and the second linear search window; determine the third step number covering the angular search window based on the second resolution and the angular search window; divide the target search window according to the first step number, the second step number and the third step number to obtain the set of windows to be searched; wherein, the target search window is a search window centered on the initial pose.
[0226] In some embodiments, the first pose determination module 102 is also used to perform the following processing for each pose in the pose set: for each point cloud in the laser point cloud, the first position information of the point cloud in the laser radar coordinate system is transformed by a first transformation matrix to obtain the second position information of the point cloud in the probability grid map coordinate system; based on the second position information and the first probability value of each pixel point in the probability grid map, the second probability value corresponding to the point cloud is determined; the second probability value corresponding to each point cloud is added to obtain the probability sum corresponding to the pose.
[0227] In some embodiments, the second posture determination module 105 is further used to determine the candidate posture whose matching score is greater than a preset second threshold as the target posture from the candidate posture set; in response to the number of target postures being equal to 1, the target posture is determined as the positioning posture of the robot; in response to the number of target postures being greater than 1, the target posture with the largest probability sum is determined as the positioning posture of the robot.
[0228] In some embodiments, the normal vector determination module 103 is also used to scan each point cloud in the laser point cloud according to a preset search radius to obtain the number of point clouds in the first target area corresponding to the search radius; in response to the number being equal to 2, determine the connecting line between the two point clouds in the first target area, and determine the direction vector corresponding to the perpendicular line of the connecting line as the first normal vector; in response to the number being greater than 2, determine the average value of the coordinate values of all point clouds in the first target area on the first coordinate axis of the laser radar coordinate system to obtain a first average value; and determine the average value of the coordinate values of all point clouds in the first target area on the second coordinate axis of the laser radar coordinate system to obtain a second average value; based on the first average value and the second average value, perform coordinate transformation on all point clouds in the first target area to obtain a transformed point cloud corresponding to each point cloud; and determine the first normal vector of each point cloud based on the transformed point cloud corresponding to each point cloud.
[0229] In some embodiments, the normal vector determination module 103 is also used to construct the pixel point direction vector for each pixel point in the probability grid map according to a preset vertical radius and horizontal radius; determine the pixel value of each pixel point in the second target area corresponding to the vertical radius and the horizontal radius; and determine the second normal vector of the pixel point based on the direction vector, the pixel value of each pixel point in the second target area, the vertical radius and the horizontal radius.
[0230] In some embodiments, the score determination module 104 is also used to perform the following processing for each candidate posture in the candidate posture set: for each point cloud in the laser point cloud, the first normal vector of the point cloud is transformed by the second transformation matrix to obtain a third normal vector; the first position information of the point cloud in the laser radar coordinate system is transformed by the third transformation matrix to obtain the third position information of the point cloud in the probability grid map coordinate system; the fourth normal vector corresponding to the point cloud is determined based on the third position information and the second normal vector of each pixel point in the probability grid map; and the matching score of the candidate posture is determined based on the third normal vector and the fourth normal vector.
[0231] In some embodiments, the device also includes a motion control module for controlling the robot to move a target distance in response to the positioning pose of the robot not being determined from the candidate pose set based on the matching score; the data acquisition module 101 is also used to re-acquire the new laser point cloud collected by the robot in the current environment and the new probability grid map of the robot, and reposition the robot based on the new laser point cloud and the new probability grid map.
[0232] It should be noted that the description of the device embodiment of the present application is similar to the description of the method embodiment described above, and has similar beneficial effects as the method embodiment, so it will not be repeated. For technical details not disclosed in the device embodiment, please refer to the description of the method embodiment of the present application for understanding.
[0233] An embodiment of the present application provides an electronic device, Figure 9 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 9 As shown, the electronic device 130 includes: at least one processor 131 ( Figure 9 Only one is shown), a memory 132 and computer executable instructions 133 stored in the memory 132 and executable on at least one processor 131, when the processor 131 executes the computer executable instructions 133, the steps of any of the above-mentioned robot positioning method embodiments are implemented.
[0234] The electronic device may include but is not limited to a processor 131 and a memory 132. It will be understood by those skilled in the art that Figure 9 This is merely an example of the electronic device 130 and does not constitute a limitation on the electronic device 130 . The electronic device 130 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0235] The processor 131 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPG), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0236] In some embodiments, the memory 132 may be an internal storage unit of the electronic device 130, such as a hard disk or memory of the electronic device 130. In other embodiments, the memory 132 may also be an external storage device of the electronic device 130, such as a plug-in hard disk equipped on the electronic device 130, a smart memory card (SMC, Smart Media Card), a secure digital (SD, Secure Digital) card, a flash card, etc. Furthermore, the memory 132 may include both an internal storage unit of the electronic device 130 and an external storage device. The memory 132 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of a computer program. The memory 132 may also be used to temporarily store data that has been output or is about to be output.
[0237] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the robot positioning method described in the embodiment of the present application.
[0238] The embodiment of the present application provides a computer-readable storage medium in which computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the robot positioning method provided by the embodiment of the present application, for example, Figure 1 The robot positioning method is shown.
[0239] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0240] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0241] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0242] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0243] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. A robot positioning method, characterized in that: The method comprises: Obtaining a laser point cloud collected by the robot in the current environment and a probability grid map of the robot; Determining a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map; Determine a first normal vector for each point in the laser point cloud and a second normal vector for each pixel in the probability grid map; Determining a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; Based on the matching score, the positioning pose of the robot is determined from the candidate pose set.
2. The method according to claim 1, characterized in that The step of determining a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map includes: Determining a second resolution of the laser point cloud based on the preset first resolution; Determining a set of windows to be searched based on the first resolution, the second resolution, and a preset search window; Determining a pose set based on the initial pose and each window to be searched in the set of windows to be searched; Determine the probability sum corresponding to each pose in the pose set based on the point cloud corresponding to the laser point cloud and the probability grid map; The posture whose probability and value are greater than a preset first threshold is determined as a candidate posture in the candidate posture set.
3. The method according to claim 2, characterized in that The determining the second resolution of the laser point cloud based on the preset first resolution includes: Determining a first distance between each point cloud in the laser point cloud and a laser radar origin; Determine the point cloud with the largest first distance as the target point cloud; The second resolution is determined according to a first distance corresponding to the target point cloud and the first resolution.
4. The method according to claim 2, characterized in that The preset search windows include: a first linear search window, a second linear search window, and an angular search window; and determining a set of windows to be searched based on the first resolution, the second resolution, and the preset search windows includes: determining, based on the first resolution and the first linear search window, a first step number covering the first linear search window; determining a second number of steps covering the second linear search window based on the first resolution and the second linear search window; determining a third number of steps covering the angular search window based on the second resolution and the angular search window; The target search window is divided according to the first number of steps, the second number of steps, and the third number of steps to obtain the set of windows to be searched; wherein, the target search window is a search window centered on the initial posture.
5. The method according to claim 2, characterized in that The determining, based on the point cloud corresponding to each pose in the pose set in the laser point cloud and the probability grid map, the probability sum corresponding to the pose includes: For each pose in the pose set, perform the following processing: For each point cloud in the laser point cloud, transform first position information of the point cloud in the laser radar coordinate system by using a first transformation matrix to obtain second position information of the point cloud in the probability grid map coordinate system; Determining a second probability value corresponding to the point cloud based on the second position information and the first probability value of each pixel in the probability grid map; The second probability values corresponding to each point cloud are added together to obtain the probability sum corresponding to the posture.
6. The method according to claim 2, characterized in that Determining the positioning pose of the robot from the candidate pose set based on the matching score includes: From the candidate pose set, determine the candidate pose having the matching score greater than a preset second threshold as the target pose; In response to the number of the target poses being equal to 1, determining the target pose as a positioning pose of the robot; In response to the number of the target poses being greater than 1, the target pose having the maximum probability sum is determined as the positioning pose of the robot.
7. The method according to claim 1, characterized in that Determining a first normal vector of each point cloud in the laser point cloud includes: Scanning each point cloud in the laser point cloud according to a preset search radius to obtain the number of point clouds in the first target area corresponding to the search radius; In response to the number being equal to 2, determining a connecting line between two point clouds in the first target area, and determining a direction vector corresponding to a perpendicular line of the connecting line as the first normal vector; In response to the number being greater than 2, determining an average value of coordinate values of all point clouds in the first target area on a first coordinate axis of the laser radar coordinate system to obtain a first average value; and determining an average value of coordinate values of all point clouds in the first target area on a second coordinate axis of the laser radar coordinate system to obtain a second average value; Based on the first average value and the second average value, coordinate transformation is performed on all point clouds in the first target area to obtain a transformed point cloud corresponding to each point cloud; Based on the transformed point cloud corresponding to each point cloud, a first normal vector of each point cloud is determined.
8. The method according to claim 1, characterized in that Determining a second normal vector for each pixel in the probability grid map includes: For each pixel point in the probability grid map, construct the pixel point direction vector according to the preset vertical radius and horizontal radius; Determine a pixel value of each pixel point in a second target area corresponding to the vertical radius and the horizontal radius; A second normal vector of the pixel point is determined based on the direction vector, the pixel value of each pixel point in the second target area, the vertical radius and the horizontal radius.
9. The method according to claim 1, characterized in that The determining, based on the first normal vector and the second normal vector, a matching score for each candidate pose in the candidate pose set includes: For each candidate pose in the candidate pose set, perform the following processing: For each point cloud in the laser point cloud, transform the first normal vector of the point cloud using a second transformation matrix to obtain a third normal vector; Transforming the first position information of the point cloud in the laser radar coordinate system by a third transformation matrix to obtain third position information of the point cloud in the probability grid map coordinate system; Determining a fourth normal vector corresponding to the point cloud based on the third position information and the second normal vector of each pixel in the probability grid map; A matching score of the candidate pose is determined based on the third normal vector and the fourth normal vector.
10. The method according to any one of claims 1 to 9, characterized in that After determining a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector, the method further includes: In response to not determining the positioning pose of the robot from the set of candidate poses based on the matching score, controlling the robot to move a target distance; Reacquire a new laser point cloud collected by the robot in the current environment and a new probability grid map of the robot, and reposition the robot based on the new laser point cloud and the new probability grid map.
11. A robot positioning device, characterized in that: The device comprises: A data acquisition module, used to obtain the laser point cloud collected by the robot in the current environment and the probability grid map of the robot; a first pose determination module, configured to determine a set of candidate poses of the robot in the current environment based on a preset initial pose and a first resolution of the probability grid map; a normal vector determination module, configured to determine a first normal vector of each point in the laser point cloud and a second normal vector of each pixel in the probability grid map; A score determination module is configured to determine a matching score for each candidate pose in the candidate pose set based on the first normal vector and the second normal vector; The second posture determination module is used to determine the positioning posture of the robot from the candidate posture set based on the matching score.
12. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; The processor is configured to implement the robot positioning method according to any one of claims 1 to 10 when executing the computer executable instructions or computer program stored in the memory.
13. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the robot positioning method according to any one of claims 1 to 10 is implemented.