A robot positioning setting method and system based on cartographer
By obtaining the scene map and initial pose in cartographer positioning, dividing the poses equally and verifying the positioning score, the problem that cartographer positioning needs to be started at the origin is solved, achieving fast and accurate positioning and task reliability of the robot in the case of non-origin startup. .
Patent Information
- Application Number
- CN202411670173.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-21
AI Technical Summary
In the prior art, cartographer positioning needs to be started at the map origin. When the environment changes, the robot cannot be placed at the map origin, it is necessary to re-create the map, and when the positioning is lost, it cannot be re-positioned and set, which affects the execution of the robot task.
By obtaining the map of the current scene and the initial position of the robot, the grid map is created, and the positioning position is equal to a certain range to generate the position of the position to verify the positioning score of each post. , Start a new trajectory.
The robot is quickly and accurately re -positioned when the non -original point starts, solves the problem that cannot be reset after the positioning of the positioning, and improves the reliability of the robot task.
Smart Images

Figure CN119178428B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot application technology, and in particular to a cartographer-based robot positioning setting method and system. Background Art
[0002] Inspection robots are robots that can simulate professional manual operations and are widely used in the power industry, parks, data centers, mining areas and other fields. In order to correctly navigate to the target position, the robot first needs to know its own position, and cartographer positioning has the advantages of high positioning accuracy and strong robustness. However, cartographer positioning must be started at the origin of the map. When the environment changes and the robot cannot be placed at the origin of the map, the map needs to be rebuilt; and when the positioning is lost, it cannot be re-positioned, which has a great impact on the robot's mission. Therefore, how to reset the robot positioning and configure the robot's startup position has become an urgent problem to be solved. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention aims to provide a cartographer-based robot fast and accurate repositioning method and system.
[0004] In order to achieve the above object, the present invention adopts the following technical solution:
[0005] The present invention specifically relates to a robot positioning setting method based on cartographer, which is characterized by comprising the following steps:
[0006] S1. Get the map of the current scene and the initial position of the robot, and create a grid map of the scene based on the scene map:
[0007] S2. Divide the map of the current scene into equal parts within a certain range according to the x-coordinate, y-coordinate and heading angle corresponding to the initial posture of the robot, obtain various postures within a certain range through multiple layers of loops, and generate a posture set:
[0008] S3, extract various postures in the posture set generated in step S2 in sequence, if all are extracted, execute step S5, otherwise execute step S4;
[0009] S4, verifying the posture extracted in step S3 to confirm the positioning score of the posture;
[0010] S5, end the previous trajectory of the cartographer, and then use the pose corresponding to the highest score as the positioning position to start a new trajectory;
[0011] Among them, S4 verifies the posture extracted in step S3 to confirm the positioning score of the posture, specifically including:
[0012] S41, judging the position of the current extracted posture in the map according to the position of the map origin on the map, if the current extracted posture is within the map, executing step S42, otherwise returning to step S3;
[0013] S42, according to the position of the current extracted posture on the map and the corresponding grid map data, obtain the grid corresponding to the current extracted posture, if the grid is occupied, return to step S3, otherwise execute step S43;
[0014] S43, obtaining the position of the laser radar set in the current scene in the map, transforming it into coordinates under the global map, and then downsampling the laser point cloud data received from the laser radar, calculating the coordinates of each laser point under the global map after downsampling, and then executing step S44;
[0015] S44, determining whether the grid of the grid map corresponding to each laser point position is in an occupied state, recording the number of laser points in an occupied state as a matching score, and then executing step S45;
[0016] S45, compare the score with the highest score previously recorded. If the score is greater than the highest score previously recorded, take the current score as the highest score and record it, and record the posture extracted in step S3, then return to step S3, otherwise return directly to step S3.
[0017] Furthermore, in step S2, the map of the current scene is equally divided within a certain range according to the initial x-coordinate, the initial y-coordinate and the predetermined heading angle, and various posture conditions within a certain range are obtained through multi-layer loops, and a data set is generated, specifically including: dividing the range of 1 meter to the left and right of the initial x-coordinate by 0.05 meters to obtain set A, dividing the range of 1 meter to the left and right of the initial y-coordinate by 0.05 meters to obtain set B, dividing the range of 30 degrees to the left and right of the initial angle by 1 degree to obtain set C, and taking a value from set A, set B, and set C respectively to combine and generate a posture set D.
[0018] Furthermore, the step S1 of creating a grid map of the scene based on the scene map specifically includes: the map area is divided into uniform grid cells, and specific attribute information is assigned to each grid cell, and the attribute information includes at least idle state information and / or occupied state information.
[0019] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0020] The present invention also provides a robot positioning setting system based on cartographer, characterized in that it includes:
[0021] An inspection robot comprising a camera, a memory and a processor;
[0022] The camera is used to shoot the current scene, so as to obtain a map of the current scene;
[0023] Memory for storing computer programs;
[0024] A processor, configured to implement the above method when executing the computer program;
[0025] LiDAR is used to confirm the specific location of the robot in the current map.
[0026] The beneficial effects of the present invention are:
[0027] The present invention collects the situation information around the robot in real time and matches it with the map data, so as to adjust the robot's posture state in real time, solving the problem that the cartographer can only start at the origin. In addition, the present invention proposes a positioning calculation method for the robot's posture, which can effectively confirm the robot's surrounding situation information, thereby solving the problem that the robot cannot reset its position after the position is lost. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0029] Figure 1 A schematic diagram of a robot positioning setting method based on cartographer according to an embodiment of the present invention DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0031] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] The present invention will be further described below in conjunction with the accompanying drawings. It should be noted that this embodiment is based on the technical solution and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to this embodiment.
[0033] like Figure 1 As shown, the robot positioning setting method based on cartographer of this embodiment includes the following steps:
[0034] S1. Obtain a map of the current scene and an initial position of the robot, and create a grid map of the scene based on the scene map.
[0035] In this embodiment, the initial position of the robot can be obtained by using the Rviz configuration file, which is not the content of the invention of the present invention and is not specifically limited in this invention. In addition, the map of the current scene can be obtained by the map acquisition step before the robot is officially used, which is not specifically limited in this invention.
[0036] The grid map in this embodiment is a grid-based map representation method, in which the map area is divided into uniform grid cells, and each grid cell is assigned specific attribute information, which can be obtained by previously creating a map, indicating which areas in the map the robot can reach.
[0037] In one embodiment, the step S1 of creating a grid map of the scene based on the scene map specifically includes: the map area is divided into uniform grid units, and specific attribute information is assigned to each grid unit, and the attribute information includes at least idle state information and / or occupied state information. More specifically, -1 can be used to represent unknown, 0 to represent idle (there is no object at this location), and 100 to represent occupied (there is an object at this location).
[0038] S2. Divide the map of the current scene equally within a certain range according to the initial x-coordinate, initial y-coordinate and predetermined heading angle corresponding to the initial posture of the robot, obtain various posture conditions within a certain range through multiple layers of loops, and generate a data set.
[0039] In one embodiment, set A can be obtained by dividing the range of 1 meter to the left and right of the initial x-coordinate into equal parts by 0.05 meters, set B can be obtained by dividing the range of 1 meter to the left and right of the initial y-coordinate into equal parts by 0.05 meters, and set C can be obtained by dividing the range of 30 degrees to the left and right of the initial angle into equal parts by 1 degree. A value is taken from set A, set B, and set C respectively to combine them to generate posture set D.
[0040] S3, extract various postures in the posture set generated in step S2 in sequence, if all are extracted, execute step S5, otherwise execute step S4;
[0041] S4, verifying the posture extracted in step S3 to confirm the positioning score of the posture;
[0042] S5, end the previous trajectory of the cartographer, and then use the pose corresponding to the highest score as the positioning position to start a new trajectory;
[0043] Among them, S4 verifies the posture extracted in step S3 to confirm the positioning score of the posture, specifically including:
[0044] S41, judging the position of the current extracted posture in the map according to the position of the map origin on the map, if the current extracted posture is within the map, executing step S42, otherwise returning to step S3;
[0045] Here, since the initial x and y coordinates are taken within 1 meter to the left and right, when the robot's initial position is near the map boundary, the obtained value may exceed the map, so it is necessary to determine whether the current posture is within the map range.
[0046] S42, according to the position of the current extracted posture on the map and the corresponding grid map data, obtain the grid corresponding to the current extracted posture, if the grid is occupied, return to step S3, otherwise execute step S43;
[0047] S43, obtain the position of the laser radar set in the current scene in the map, transform it into coordinates under the global map, and then downsample the laser point cloud data received from the laser radar, calculate the coordinates of each laser point under the global map after downsampling, and then execute step S44.
[0048] The laser radar in the present invention can be a general product in the market, which is not the invention point of the present invention and is not specifically limited here. By running the program provided by the laser radar manufacturer, the laser radar can be started and the data scanned by the laser radar can be released. The position of the surrounding obstacles relative to the laser radar can be obtained through the laser radar data.
[0049] In addition, since the position of the laser radar relative to the current scene in the coordinate system is fixed, it is usually represented by the installation position of the laser radar relative to the center of the robot. After the laser radar releases the position of the laser point cloud in the laser radar coordinate system, since the position of the laser radar relative to the global map coordinate system is fixed and known, the position of each laser point cloud emitted by the laser radar in the global map coordinate system can be obtained through a simple coordinate rotation and translation transformation.
[0050] In this embodiment, the laser point cloud emitted by the laser radar scans the objects in the current scene, such as walls, and matches them with the grid map. The positioning effect is judged by judging the matching status of each laser point with the obstacles in the grid map, thereby obtaining the positioning score of each posture.
[0051] S44, determining whether the grid of the grid map corresponding to each laser point position is in an occupied state, recording the number of laser points in an occupied state as a matching score, and then executing step S45.
[0052] S45, compare the score with the highest score previously recorded. If the score is greater than the highest score previously recorded, take the current score as the highest score and record it, and record the posture extracted in step S3, then return to step S3, otherwise return directly to step S3.
[0053] It can be understood that the above-mentioned positioning calculation method of the robot's posture can effectively confirm the robot's surrounding condition information, thereby solving the problem of being unable to reset the robot's positioning after the robot's positioning is lost.
[0054] In another embodiment, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0055] In another embodiment, the present invention also provides a robot positioning setting system based on cartographer, which includes:
[0056] An inspection robot comprising a camera, a memory and a processor;
[0057] The camera is used to shoot the current scene, so as to obtain a map of the current scene;
[0058] Memory for storing computer programs;
[0059] A processor, configured to implement the above method when executing the computer program;
[0060] LiDAR is used to confirm the specific location of the robot in the current map.
[0061] As described above, the present invention collects the situation information around the robot in real time and matches it with the map data, so as to adjust the posture state of the robot in real time, thereby solving the problem that the cartographer can only start at the origin.
[0062] For those skilled in the art, various corresponding changes and modifications can be made according to the above technical solutions and concepts, and all of these changes and modifications should be included in the protection scope of the claims of the present invention.
[0063] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A robot positioning setting method based on cartographer, characterized in that: The steps include: S1. Get the map of the current scene and the initial position of the robot, and create a grid map of the scene based on the scene map: S2. Divide the map of the current scene equally within a certain range according to the initial x-coordinate, initial y-coordinate and predetermined heading angle corresponding to the initial posture of the robot, obtain various postures within a certain range through multi-layer loops, and generate a posture set: S3, extract various postures in the posture set generated in step S2 in sequence, if all are extracted, execute step S5, otherwise execute step S4; S4, verifying the posture extracted in step S3 to confirm the positioning score of the posture; S5, end the previous trajectory of the cartographer, and then use the pose corresponding to the highest score as the positioning position to start a new trajectory; Among them, S4 verifies the posture extracted in step S3 to confirm the positioning score of the posture, specifically including: S41, judging the position of the current extracted posture in the map according to the position of the map origin on the map, if the current extracted posture is within the map, executing step S42, otherwise returning to step S3; S42, according to the position of the current extracted posture on the map and the corresponding grid map data, obtain the grid corresponding to the current extracted posture, if the grid is occupied, return to step S3, otherwise execute step S43; S43, obtaining the position of the laser radar set in the current scene in the map, transforming it into coordinates under the global map, and then downsampling the laser point cloud data received from the laser radar, calculating the coordinates of each laser point under the global map after downsampling, and then executing step S44; S44, determining whether the grid of the grid map corresponding to each laser point position is in an occupied state, recording the number of laser points in an occupied state as a matching score, and then executing step S45; S45, compare the score with the highest score previously recorded. If the score is greater than the highest score previously recorded, take the current score as the highest score and record it, and record the posture extracted in step S3, then return to step S3, otherwise return directly to step S3.
2. The robot positioning setting method according to claim 1, characterized in that: In the step S2, the map of the current scene is equally divided within a certain range according to the initial x-coordinate, the initial y-coordinate and the predetermined heading angle, and various posture conditions within a certain range are obtained through multi-layer loops, and a posture set is generated, specifically including: dividing the range of 1 meter to the left and right of the initial x-coordinate by 0.05 meters to obtain a set A, dividing the range of 1 meter to the left and right of the initial y-coordinate by 0.05 meters to obtain a set B, dividing the range of 30 degrees to the left and right of the initial angle by 1 degree to obtain a set C, and taking a value from set A, set B, and set C respectively to combine and generate a posture set D.
3. The robot positioning setting method according to claim 2, characterized in that: The step S1 of creating a grid map of the scene based on the scene map specifically includes: the map area is divided into uniform grid cells, and specific attribute information is assigned to each grid cell, and the attribute information includes at least idle state information and / or occupied state information.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
5. A robot positioning setting system based on cartographer, characterized in that: include: An inspection robot comprising a camera, a memory and a processor; The camera is used to shoot the current scene, so as to obtain a map of the current scene; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 3 when executing the computer program; LiDAR is used to confirm the specific location of the robot in the current map.
Citation Information
Patent Citations
Intelligent robot global positioning method and system based on prior visual guidance
CN116817903A
Quadruped robot control method based on SLAM (Simultaneous Localization and Mapping) of improved Cartograph
CN116985137A