Robot positioning method and device, electronic equipment, storage medium and program product
By identifying the second area from the electronic map to obtain relocation data with different characteristics, the problem of accurate relocation after the robot positioning fails is solved and the relocation success rate is improved.
Patent Information
- Application Number
- CN202410496688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-08-27
AI Technical Summary
The robot's positioning fails due to loss or deviation of position information during the execution of the task. Existing relocation methods are difficult to successfully relocate in areas where it is difficult to collect environmental information due to large randomness.
By identifying a second area different from the current area of the robot from the electronic map, the target point for relocation is determined, and relocation data is obtained in this area for accurate relocation.
The accuracy of the robot repositioning results is improved, ensuring that data different from the first area is obtained in the second area, thereby achieving accurate recovery of the robot's position.
Smart Images

Figure CN118548889A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of robotics technology, and in particular to a robot positioning method, device, electronic device, storage medium, and program product. Background Art
[0002] Relocalization is a technology that performs relocalization after a positioning failure to increase the success rate of positioning. When the robot encounters some unexpected situations during the execution of the task, such as being picked up and the battery is exhausted, being moved, etc., the robot's position information may be lost or deviated. At this time, the robot will use the laser point cloud to collect environmental information and compare it with the original map to relocalize and restore its own positioning information. However, during this process, the robot may be in an area where it is difficult to collect environmental information or the environment has been changed, resulting in the current environmental information being unable to match the original map, resulting in positioning failure and the robot's positioning being lost.
[0003] In the related art, when the robot fails to locate, the robot will be allowed to randomly navigate a distance and then use a relocation method to restore the positioning, so as to improve the positioning success rate.
[0004] However, due to the high randomness of relocalization, this method has a high probability that the robot will still be in an area where it is difficult to collect environmental information and still cannot be successfully localized, resulting in relocalization failure. Summary of the invention
[0005] The embodiments of the present application provide a robot positioning method, device, electronic device, storage medium and program product. Since a second area different from the first area where the robot is currently located is identified from an electronic map and repositioned using the second area, it is ensured that repositioning data different from the first area can be obtained in the second area, and the robot is accurately repositioned based on the different repositioning data, thereby improving the accuracy of the robot repositioning result.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] An embodiment of the present application provides a robot positioning method, comprising: in a process in which the robot moves based on an electronic map, obtaining current positioning information of the robot at a current moment; if it is determined based on the current positioning information that the current positioning state of the robot is positioning failure, based on map data of the electronic map, identifying from the electronic map at least one second area different from a first area currently located by the robot; determining a repositioning target point from the at least one second area; obtaining repositioning data collected at the target point; and repositioning the robot based on the repositioning data.
[0008] An embodiment of the present application provides a robot positioning device, including: an acquisition module, used to acquire current positioning information of the robot at a current moment when the robot performs a navigation task based on a navigation map; an area segmentation module, used to identify at least one second area different from the first area where the robot is currently located from the electronic map based on map data of the electronic map if the current positioning state of the robot is determined to be positioning failure based on the current positioning information; a determination module, used to determine a repositioning target point from the at least one second area; and a repositioning module, used to acquire repositioning data collected at the target point, and reposition the robot based on the repositioning data.
[0009] In some embodiments, the repositioning module is further used to: control the robot to move from the current position of the robot to the target point; and collect the repositioning data at the target point by the robot.
[0010] In some embodiments, the relocation module is further used to: determine an electronic device located in a second area where the target point is located as a target electronic device; and receive the relocation data collected by the target electronic device.
[0011] In some embodiments, the current positioning information includes a first positioning confidence; the area segmentation module is also used to: if the first positioning confidence is less than or equal to a preset confidence threshold, determine that the current positioning state of the robot is a positioning failure; based on the map data of the electronic map, perform map contour recognition on the electronic map to obtain contour information of the electronic map; based on the contour information, perform map reconstruction on the electronic map to obtain a reconstructed map; and identify the at least one second area from the reconstructed map.
[0012] In some embodiments, the map data of the electronic map has a specific array type; the region segmentation module is further used to: based on a preset first kernel parameter, perform image corrosion processing on the map data having the specific array type to obtain the corroded map data; perform edge detection on the corroded map data to obtain a plurality of edge pixels of the electronic map; use each of the edge pixels as a contour point, use a preset thickness parameter to perform contour drawing, and obtain contour information of the electronic map.
[0013] In some embodiments, the region segmentation module is further used to: perform image dilation processing on the map contour corresponding to the contour information based on a preset second kernel parameter to obtain the dilated map data; and perform map drawing based on the dilated map data to obtain the reconstructed map.
[0014] In some embodiments, the electronic map and the reconstructed map are both binarized images; the region segmentation module is further used to: obtain the pixel value of each pixel in the reconstructed map and the electronic map; the pixel at each position in the reconstructed map corresponds to the pixel at the corresponding position in the electronic map; determine the pixel value difference between each pixel in the reconstructed map and the corresponding pixel in the electronic map; and extract the at least one second region from the reconstructed map based on the pixel value difference.
[0015] In some embodiments, the current positioning information also includes a current positioning posture, and the current positioning posture includes at least the position coordinates of the robot at its current position; the determination module is also used to: determine the coordinates of the center of mass point of each second area; based on the position coordinates of the current position and the coordinates of the center of mass point of each second area, determine a target second area from the at least one second area; the target second area is a second area that the robot can reach and is closest to the current position; and determine the center of mass point of the target second area as the target point for repositioning.
[0016] In some embodiments, the electronic map includes multiple environmental areas; the area segmentation module is also used to: filter out a target environmental area to be identified from the multiple environmental areas; and identify at least one second area different from the first area where the robot is currently located from the target environmental area.
[0017] In some embodiments, the repositioning result of the repositioning includes a second positioning reliability and a repositioning posture; the current positioning information includes a first positioning reliability and a current positioning posture; the device also includes: a displacement data acquisition module, which is used to obtain the displacement data of the robot from the current position of the robot to the target point after the robot is repositioned based on the repositioning data, if the second positioning reliability is less than or equal to a preset score threshold; an updated posture determination module, which is used to determine the updated posture of the robot based on the displacement data and the current positioning posture; a repositioning verification module, which is used to reposition the repositioning posture based on the posture distance between the updated posture and the repositioning posture; a task execution module, which is used to control the robot to perform the target task according to the repositioning posture when the verification result of the repositioning verification is verification passed.
[0018] In some embodiments, the repositioning verification module is also used to: obtain the updated position coordinates in the updated posture and the updated posture information of the robot, and obtain the repositioning position coordinates in the repositioning posture and the repositioning posture information of the robot; determine the posture distance between the updated posture and the repositioning posture based on the updated position coordinates, the repositioning position coordinates, the updated posture information and the repositioning posture information; if the posture distance is less than a preset resolution, generate a repositioning verification result that passes the verification; if the posture distance is greater than or equal to the preset resolution, generate a repositioning verification result that fails the verification.
[0019] In some embodiments, the device also includes: a repositioning state acquisition module, which is used to obtain the repositioning state of the current repositioning process when the repositioning verification result is a verification failure; a new target point determination module, which is used to determine a new target point for repositioning from the at least one second area again when the repositioning state does not meet the preset repositioning stop condition; the new target point is the center of mass point in the second area that has not been determined as the target point; a re-repositioning module, which is used to obtain new repositioning data collected at the new target point, and reposition the robot based on the new repositioning data until the verification result of the repositioning verification is a verification pass; an alarm module, which is used to generate an alarm message of repositioning failure when the repositioning state meets the repositioning stop condition; and control the robot to output the alarm message.
[0020] An embodiment of the present application provides an electronic device, comprising: a memory for storing executable instructions; and a processor for implementing the above-mentioned robot positioning method when executing the executable instructions stored in the memory.
[0021] An embodiment of the present application provides a computer program product, which includes executable instructions, and the executable instructions are stored in a computer-readable storage medium; wherein a processor of an electronic device reads the executable instructions from the computer-readable storage medium, and when executing the executable instructions, the above-mentioned robot positioning method is implemented.
[0022] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-mentioned robot positioning method.
[0023] The embodiments of the present application have the following beneficial effects:
[0024] In the process of the robot moving based on the electronic map, the current positioning information of the robot at the current moment is obtained, and the robot is positioned in real time based on the current positioning information; if the current positioning state of the robot is determined to be positioning failure based on the current positioning information, then based on the map data of the electronic map, at least one second area different from the first area where the robot is currently located is identified from the electronic map, so as to determine the target point for repositioning in the second area, and reposition the robot through the repositioning data collected at the target point. In this way, since the second area different from the first area where the robot is currently located is identified from the electronic map, and the second area is used for repositioning, it is ensured that repositioning data different from the first area can be obtained in the second area, and when the robot is repositioned based on the different repositioning data, the robot can be accurately repositioned, thereby improving the accuracy of the robot repositioning result. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An optional flowchart of a robot positioning method provided in an embodiment of the present application;
[0026] Figure 2 is a schematic diagram of an implementation flow of identifying at least one second area provided in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of the implementation process of map contour recognition provided by the embodiment of the present application;
[0028] Figure 4 is a schematic diagram of an implementation flow of identifying at least one second area from a reconstructed map provided in an embodiment of the present application;
[0029] Figure 5 is a schematic diagram of a scenario in which a second area is identified under multiple environmental areas provided in an embodiment of the present application;
[0030] Figure 6 is a schematic diagram of a scenario for obtaining relocation data provided in an embodiment of the present application;
[0031] Figure 7 Another optional flowchart of the robot positioning method provided in an embodiment of the present application;
[0032] Figure 8 It is a schematic diagram of the implementation process of the relocation check provided in the embodiment of the present application;
[0033] Fig. 9 It is a schematic diagram of the overall process of the robot positioning method provided in the embodiment of the present application;
[0034] Fig.10 It is an electronic map with a specific array type provided in an embodiment of the present application;
[0035] Fig.11 is a denoised map image provided by an embodiment of the present application;
[0036] Fig.12 is a map image after binarization processing provided in an embodiment of the present application;
[0037] Fig.13 is a map image after corrosion processing provided by an embodiment of the present application;
[0038] Fig.14 is a schematic diagram of the outline of the map provided in the embodiment of the present application;
[0039] Fig.15 It is a schematic diagram of the outline of a drawn map provided in an embodiment of the present application;
[0040] Fig.16 The expansion provided by the embodiment of the present application Fig.15 The image obtained after the map outline is obtained;
[0041] Fig.17 It is a schematic diagram of several areas for determining the target point of navigation provided in the embodiment of the present application;
[0042] Fig.18 It is an electronic map with navigation points marked provided by an embodiment of the present application;
[0043] Fig.19 A structural block diagram of a robot positioning device provided in an embodiment of the present application;
[0044] Fig. 20 It is a schematic diagram of the structure of the robot provided in the embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0046] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is 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. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art of the technical field of the embodiments of the present application. 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.
[0047] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with 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.
[0048] An embodiment of the present application provides a robot positioning method. After the robot fails to position itself, the method uses a method that can quickly divide different areas of an electronic map to find a navigation target point for repositioning, allowing the robot to quickly navigate to another area, thereby obtaining sub-map data of different features with a high probability, or directly obtaining sub-map data of the other area, and then collecting the sub-map data again for repositioning to obtain a repositioning result. At the same time, the odometer displacement data between the two previous and subsequent positionings and the failed posture of the first positioning are combined to give an accurate repositioning posture.
[0049] Specifically, in the robot positioning method provided by the embodiment of the present application, first, in the process of the robot moving based on the electronic map, the current positioning information of the robot at the current moment is obtained. If the current positioning state of the robot is determined to be positioning failure based on the current positioning information, at least one second area different from the first area where the robot is currently located is identified from the electronic map based on the map data of the electronic map; then, the target point for relocation is determined from the at least one second area; then, the relocation data collected at the target point is obtained; finally, the robot is relocated based on the relocation data. In this way, since the second area different from the first area where the robot is currently located is identified from the electronic map, and the second area is used for relocation, it is ensured that the relocation data different from the first area can be obtained in the second area. When the robot is relocated based on the different relocation data, the robot can be accurately relocated, thereby improving the accuracy of the robot relocation result.
[0050] The robot positioning method provided in the embodiments of the present application can be applied to electronic devices such as robots, laptops, tablet computers, desktop computers, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices, smart home appliances, and smart vehicle-mounted devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0051] The robot positioning method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0052] Figure 11 is an optional flow chart of the robot positioning method provided in the embodiment of the present application, and the method can be applied to electronic devices. The following will take the electronic device as an example of a robot for exemplary description. Figure 1 As shown, the method may include steps S101 to S105:
[0053] Step S101, in the process of the robot moving based on the electronic map, obtaining the current positioning information of the robot at the current moment.
[0054] Here, the robot can be a self-moving device that moves within a certain space. For example, the robot can be a sweeping robot, a food delivery robot, etc., or the robot can also be any kind of mobile robot such as a wheeled robot, a legged robot, a flying car robot, etc. The electronic map refers to the navigation map of the robot, which can be a pre-drawn map. When the electronic map is drawn in advance, the environmental information can be obtained through a series of sensors, and the electronic map can be generated by steps such as map construction, positioning and path planning. In the implementation process, when the sensor data is obtained, the robot is usually equipped with various sensors, such as laser radar, camera, ultrasonic sensor, which can provide data such as the topological structure, obstacle information, position and direction of the environment. Then, based on the sensor data, the robot can build a map of the environment, including information such as obstacle location, room structure, road grid, etc. The electronic map may be a two-dimensional plane map, or a three-dimensional map or a semantic map.
[0055] In an embodiment of the present application, when the robot is moving based on an electronic map or performing a task based on an electronic map, it will collect the current positioning information at the current moment in real time, and locate the robot based on the current positioning information to obtain the robot's real-time current positioning state. Among them, robot positioning refers to the process of determining the position and posture of the robot in the environment, which is a key step in achieving autonomous navigation and path planning. In an embodiment of the present application, any of the following positioning methods can be used for robot positioning: odometer positioning, inertial navigation system, lidar positioning, visual positioning, global positioning system positioning, and fusion positioning. The embodiment of the present application will be described using lidar positioning as an example.
[0056] The current positioning information includes the current positioning posture of the robot at the current moment and the first positioning reliability at the current positioning. The current positioning posture at least includes the position coordinates of the robot at the current position and the posture information of the robot. Here, laser radar positioning is used as an example for explanation. When the robot is positioned, the distance and direction between the robot and the surrounding environment are measured to realize the positioning and navigation of the robot in space. That is to say, the laser radar will emit a laser beam to scan the surrounding environment of the space where the robot is currently located. The laser beam will interact with the objects in the surrounding environment and reflect back to the laser radar. After receiving the reflected laser, the laser radar records the time and direction of the reflection, thereby calculating the distance between the object and the laser radar. The distance and direction information obtained by the laser radar will be processed into point cloud data to represent the three-dimensional shape of the surrounding environment. When positioning, the positioning algorithm can be used to match the point cloud data with the electronic map to obtain the matching score between each area in the electronic map, that is, to obtain the positioning reliability, and then determine the possible current position and posture of the robot based on the area with the highest positioning reliability (that is, the first positioning reliability), thereby obtaining the current positioning information of the robot at the current moment.
[0057] Step S102: if it is determined based on the current positioning information that the current positioning state of the robot is positioning failure, based on the map data of the electronic map, identify from the electronic map at least one second area different from the first area where the robot is currently located.
[0058] In the embodiment of the present application, after obtaining the current positioning information of the robot at the current moment, it is possible to determine whether the robot is successfully positioned at the current moment based on the current positioning information. In the implementation process, the first positioning reliability can be extracted from the current positioning information, and then based on the first positioning reliability, it is determined whether the robot is successfully positioned at the current moment.
[0059] In some embodiments, see Figure 2 In step S102, identifying at least one second area different from the first area where the robot is currently located from the electronic map can be achieved by following the steps S1021 to S1024:
[0060] Step S1021: If the first positioning reliability is less than or equal to a preset reliability threshold, it is determined that the current positioning state of the robot is positioning failure.
[0061] Here, the preset confidence threshold can be a manually set confidence value, for example, the preset confidence threshold can be set to 80%. Then, when the first fixed position confidence obtained at the time of current positioning is greater than 80%, it can be determined that the current positioning state of the robot is a successful positioning, then at this time, the position and posture in the current positioning information obtained by the current positioning can be directly used to control the further movement of the robot to perform subsequent tasks of the robot. When the first fixed position confidence obtained at the time of current positioning is less than or equal to 80%, it can be determined that the current positioning state of the robot is a positioning failure, therefore, it is necessary to adopt the robot positioning method provided in the embodiment of the present application to reposition the positioning result of the robot at the current moment, so as to ensure that the robot can obtain accurate positioning information and perform subsequent tasks based on accurate positioning information.
[0062] It should be noted that since the first positioning confidence is the confidence obtained after similarity matching based on the collected point cloud data, even if the current positioning state is positioning failure, there is still a current positioning information, and the current positioning information has the position and posture of the robot corresponding to the first positioning confidence, but the probability of whether the position and posture are the actual position of the robot is equal to the first positioning confidence.
[0063] Step S1022: Based on the map data of the electronic map, map outline recognition is performed on the electronic map to obtain outline information of the electronic map.
[0064] In some embodiments, the map data of the electronic map has a specific array type, and the specific array type can be determined according to a map recognition tool that performs map contour recognition on the electronic map. For example, when OpenCV is used to perform map contour recognition, the specific array type can be in cv::Mat format.
[0065] See also Figure 3 In step S1022, the map outline recognition of the electronic map can be implemented by following the steps S10221 to S10223:
[0066] Step S10221: Based on a preset first kernel parameter, image corrosion processing is performed on map data having a specific array type to obtain map data after corrosion processing.
[0067] The first kernel parameter refers to the kernel size of the erosion processing function used when performing image erosion processing. For example, when OpenCV is used for map contour recognition, the image erosion processing is performed using the OpenCV function, and the kernel size is the first kernel parameter. For example, the first kernel parameter can be set to 5x5.
[0068] In the embodiment of the present application, the image erosion processing is performed on the map data with a specific array type, the purpose of which is to reduce the brightness area in the electronic map, so that the map corresponding to the eroded map data has a smaller highlight area than the original electronic map. In the implementation process, the image erosion processing is performed on the map data with a specific array type, which can be a small structural element (such as a rectangle, a circle or a custom shape) to gradually remove the area with higher brightness in the electronic map, thereby reducing the area of the bright area in the electronic map. The image erosion processing of the map data with a specific array type can be used to remove small objects in the electronic map, smooth the boundaries of larger objects, and increase the connectivity of objects. Alternatively, it is also possible to use a structural element to scan each pixel in the electronic map, and use each pixel in the structural element to perform an "and" operation with the pixel it covers. If both are 0, the pixel is 0, otherwise it is 1; the result of this operation is that the protruding points on the periphery of the electronic map will be eroded, the bright area (white area) will become thinner, and the black area will become larger.
[0069] In the embodiment of the present application, when the electronic map is an indoor environment, the distance between the "doors" of different areas can be further reduced by performing image corrosion processing on the map data having a specific array type.
[0070] Step S10222: performing edge detection on the eroded map data to obtain a plurality of edge pixels of the electronic map.
[0071] Here, edge detection is a basic task in computer vision and image processing. Edge detection aims to find points with significant brightness changes in the image corresponding to the map data after corrosion processing. These brightness changes usually indicate the boundaries of objects in the image. Edge detection is crucial for subsequent image analysis, such as contour extraction, shape recognition, and image segmentation. In the embodiments of the present application, when performing edge detection, edge detection operators can be used to implement it. The edge detection operators here include Sobel operator, Canny operator, Prewitt operator, Roberts operator, etc. These operators detect edges by calculating the gradient of image brightness. The size and direction of the gradient represent the strength and direction of the edge.
[0072] In the embodiment of the present application, when edge detection is performed on the map data after corrosion processing, the edge detection result of the central area of the electronic map is obtained. The edge detection result includes multiple edge pixels. By connecting the edge pixels, the edges of each area in the electronic map can be obtained.
[0073] Step S10223, taking each edge pixel as a contour point, using a preset thickness parameter to draw the contour, and obtaining the contour information of the electronic map.
[0074] In the embodiment of the present application, after obtaining edge pixels, the edge pixels can be used as contour points, and the contour of the electronic map can be drawn using a contour drawing function to obtain contour information of the electronic map. During the drawing process, the contour thickness can be set, that is, the preset thickness parameter, so that the contour of the drawn electronic map has the contour thickness. For example, in OpenCV, the drawcountours contour drawing function can be called, the contour thickness can be set to 2, and the contour can be drawn based on each edge pixel as a contour point, so as to obtain the contour information of the electronic map.
[0075] Step S1023, reconstructing the electronic map based on the contour information to obtain a reconstructed map.
[0076] In the embodiment of the present application, after the contour information is obtained, the electronic map can be reconstructed based on the contour information. When the electronic map is reconstructed based on the contour information, the map contour corresponding to the contour information can be image-expanded based on the preset second kernel parameter to obtain the expanded map data; then, the map is drawn based on the expanded map data to obtain the reconstructed map.
[0077] The second kernel parameter refers to the size of the kernel of the expansion processing function used when performing image expansion processing. For example, when using OpenCV for map reconstruction, the OpenCV function can be used to perform image expansion processing, and the kernel size is the second kernel parameter. For example, the second kernel parameter can be set to 13x13.
[0078] In an embodiment of the present application, the map contour corresponding to the contour information is subjected to image dilation processing, the purpose of which is to increase the area of the bright area in the image. In the implementation process, the image dilation processing can be to gradually increase the area of the image with lower brightness through a small structural element, thereby increasing the area of the bright area in the large image. Image dilation processing can be used to fill small holes, connect adjacent objects, and increase the area of objects. Image dilation processing can expand the highlight area in the image, and the rendering has a larger highlight area than the original image. In the implementation process, a structural element can also be used to scan each pixel in the image, and each pixel in the structural element is used to perform an "AND" operation with the pixel it covers. If both are 1, the pixel is 1, otherwise it is 0; the result of this operation is that the protruding points on the periphery of the image will be corroded, the bright area (white area) will become thinner, and the black area will become larger.
[0079] In the embodiment of the present application, when the electronic map is an indoor environment, by performing image expansion processing on the map outline corresponding to the outline information, the "room door" area can be expanded and the required area can be segmented out.
[0080] Step S1024: identifying at least one second area from the reconstructed map.
[0081] In some embodiments, both the electronic map and the reconstructed map are binarized images, wherein the binarization of the image refers to setting the grayscale value of the pixel points on the image to 0 or 255, that is, presenting the entire image with an obvious visual effect of only black and white.
[0082] See also Figure 4 In step S1024, identifying at least one second area from the reconstructed map can be achieved by following the steps S10241 to S10243:
[0083] Step S10241, obtaining the pixel value of each pixel point in the reconstructed map and the electronic map.
[0084] Here, the pixel point at each position in the reconstructed map corresponds to the pixel point at the corresponding position in the electronic map.
[0085] Step S10242, determining the pixel value difference between each pixel point in the reconstructed map and the corresponding pixel point in the electronic map.
[0086] Here, for each pixel in the reconstructed map, the pixel value difference between each pixel in the reconstructed map and the corresponding pixel in the electronic map can be calculated. Since both the electronic map and the reconstructed map are binarized images, that is, each pixel in the electronic map and the reconstructed map has a value of either 0 or 255, the pixel value difference includes three cases: 0, 255 and -255.
[0087] In some embodiments, the binarization processing of the electronic map and the reconstructed map may also be processing the electronic map and the reconstructed map into images with other pixel values, that is, not the case of values of 0 and 255. In this way, in terms of visual effect, the electronic map and the reconstructed map present images with other two color effects. The specific values of the binarization processing can be set according to actual needs, and the embodiments of the present application do not limit it.
[0088] When the binary pixel value is other than 0 and 255, the value included in the pixel value difference will also change accordingly. In the embodiment of the present application, taking the binary pixel values K1 and K2 as an example, when determining the pixel value difference between each pixel in the reconstructed map and the corresponding pixel in the electronic map, the pixel value difference includes three cases: 0, K1-K2 and K2-K1.
[0089] Step S10243: extract at least one second area from the reconstructed map based on the pixel value difference.
[0090] In an embodiment of the present application, the values included in the pixel value difference can be determined based on the values of the pixel points during binarization processing, and then based on the pixel value difference between the electronic map and the reconstructed map, pixel points with specific pixel value difference can be extracted from the reconstructed map to form at least one second area.
[0091] For example, if the binarization process sets the pixel values of the pixels to 0 and 255, then when extracting the second area, the pixels with a pixel value difference equal to 255 may be extracted, and then the area formed by the extracted continuous pixels is determined as the second area.
[0092] In some embodiments, the electronic map may include multiple environmental areas, and the environmental area refers to an area under the same environmental conditions, for example, a floor or a room can be considered as an environmental area. In step S102, identifying at least one second area different from the first area where the robot is currently located from the electronic map can also be achieved in the following manner: first, screening out a target environmental area to be identified from the multiple environmental areas; then, identifying at least one second area different from the first area where the robot is currently located from the target environmental area.
[0093] In the embodiment of the present application, when there are multiple different environmental areas in the electronic map, in order to improve the efficiency of identifying the second area, it is not necessary to identify each environmental area, but only some of the environmental areas in the multiple environmental areas need to be identified. Therefore, the target environmental area to be identified can be screened out from the multiple environmental areas, and then at least one second area different from the first area where the robot is currently located can be identified from the target environmental area. In the implementation process, when screening the target environmental area to be identified, the target environmental area to be identified can be screened out from the multiple environmental areas according to the current location of the robot; or the target environmental area to be identified can be screened out from the multiple environmental areas according to the regional attributes of the environmental area.
[0094] When the target environmental area to be identified is screened out from multiple environmental areas based on the current position of the robot, the distance between the current position of the robot located in the current positioning information and the area center of each environmental area can be determined, and then the environmental area with a distance less than a preset distance threshold can be determined as the target environmental area. Alternatively, all environmental areas can be sorted in order of distance from small to large to form an environmental area sequence, and then the first N environmental areas in the environmental area sequence can be determined as the target environmental areas.
[0095] When the target environmental area to be identified is screened out from multiple environmental areas according to the regional attributes of the environmental area, the regional attributes of each environmental area can be obtained from the database first, where the regional attributes include but are not limited to: floor, room area, room type, etc. Then, according to the regional attributes of the environmental area, the environmental areas that are not suitable for the robot to go to and the environmental areas that are suitable for the robot to go to are determined, so that the environmental areas suitable for the robot to go to are determined as the target environmental areas. For example, when the robot is a sweeping robot, and some environmental areas are stairwells or utility rooms, these areas do not need to be cleaned and are not suitable for the robot to clean, therefore, these environmental areas are environmental areas that are not suitable for the robot to go to; for another example, when a certain environmental area is on the third floor, and the robot is currently on the first floor, therefore, this environmental area is also an environmental area that is not suitable for the robot to go to.
[0096] See also Figure 5 The schematic diagram of the scene including multiple environmental areas shown in FIG. 5 shows, in which the robot 501 is currently located in room A. In order to reduce the efficiency of identifying the second area, it is not necessary to identify all the remaining three rooms. Therefore, two rooms (for example, Figure 5 Room B and Room C in the robot are used as the target environment area, and the remaining room D does not need to be identified; then, at least one second area different from the room A where the robot is currently located is identified from the target environment area. For example, Figure 5 The second area B1 is identified from room B, and the second areas C1 and C2 are identified from party building C.
[0097] It should be noted that the second area identified from the target environment area can be the complete target environment area or a partial area of the target environment area. In other words, for the same target environment area, one second area or multiple second areas can be identified.
[0098] In the embodiment of the present application, the second area identified from the electronic map is an area different from the first area where the robot is currently located.
[0099] In some embodiments, after the second area is identified, the second area can also be screened. When the second area identified from the electronic map partially overlaps with the first area where the robot is currently located, it is determined whether to delete the second area based on the overlapping area. For example, the proportion of the overlapping surface to the second area can be determined. If the proportion is greater than a preset proportion threshold, it indicates that the area overlaps more with the current area. In this way, during subsequent relocation, it is highly likely that the same point cloud data collected in the first area will be collected, which will cause relocation failure again, so the second area is deleted. It should be noted that the first area of the robot refers to a circular area generated with the current location of the robot as the center and a preset distance as the radius.
[0100] Step S103: determining a relocated target point from at least one second area.
[0101] In some embodiments, the current positioning information also includes the current positioning posture, and the current positioning posture includes at least the position coordinates of the robot at the current position. When determining the target point of relocation from at least one second area, it can be achieved in the following manner: first, determine the coordinates of the centroid point of each second area; then, based on the position coordinates of the current position and the coordinates of the centroid point of each second area, determine the target second area from at least one second area; the target second area here is a second area that the robot can reach and is closest to the current position; finally, determine the centroid point of the target second area as the target point of relocation.
[0102] In some embodiments, when determining the target second area from at least one second area, in addition to determining a second area that the robot can reach and is closest to the current location, after identifying multiple second areas, a certain number of second areas can be selected from the multiple second areas to determine the target point for relocation. In other words, a certain number of second areas can be selected first, and then a corresponding number of target points can be determined from the certain number of second areas, so as to control the robot to reach each target point in turn.
[0103] When selecting the second area, any one of the following methods can be used: selecting a certain number of second areas in a random selection manner, selecting a certain number of second areas in order of distance from the robot from near to far, selecting a certain number of second areas in order of distance from each second area to the center of the electronic map from near to far, selecting a certain number of second areas in order of the number of objects in each second area (determining the number of objects in each second area through a target detection algorithm, or determining the number of objects in each second area through area attribute parameters of each second area in the electronic map) from many to few, (because the more objects there are, the greater the probability that the second area includes new features).
[0104] Step S104, obtaining the relocation data collected at the target point.
[0105] In the embodiment of the present application, when obtaining the relocation data, it can be implemented in at least the following two ways:
[0106] Method 1: Control the robot to move from its current position to the target point, and then use the robot to collect relocation data at the target point.
[0107] It should be noted here that the robot fails to locate at the current position, which does not mean that there is no position information at all. It is just that the confidence of the position information at the current position is low, and the confidence is less than the threshold (that is, the result score of the positioning is less than the threshold). At this time, the posture with the highest confidence will still be determined as the current posture (that is, the coordinates of the possible position of the robot are determined), and the robot is controlled to move from this position to the target point. After the robot moves according to the position of the target point, when the robot moves to the target point, the point cloud data of the second area where the target point is located can be collected by the robot to obtain the point cloud data of the second area, that is, the relocation data collected by the target point is obtained.
[0108] Method 2: The electronic device located in the second area where the target point is located is determined as the target electronic device; then the relocation data is collected through the target electronic device, and the robot receives the relocation data collected by the target electronic device.
[0109] Here, the electronic device includes an image acquisition device, a laser radar device, and a robot. The embodiment of the present application can be applied to the following scenarios: the area of the entire map area corresponding to the electronic map is relatively large, and each room or most rooms are equipped with a camera device, or there are robots in other rooms. When the current robot fails to locate at the current moment, and after determining the target point, it can be determined whether there are other electronic devices in the second area where the target point is located. If so, the current robot can send a relocation data collection request to the target electronic device in the second area without moving. When the target electronic device receives the relocation data collection request, it can respond to the relocation data collection request, collect the environmental features of the second area, obtain relocation data, and send the relocation data to the robot. In this way, the robot can obtain the point cloud data of the new area without moving, so that the subsequent relocation process can be completed based on the point cloud data of the new area.
[0110] See also Figure 6 The robot 600 is currently located in room A, and the second area C1 corresponding to the determined target point is located in room C, and there is a camera 601 in room C. Therefore, the robot 600 does not need to move to the target point of the second area C1. The camera 601 can collect point cloud data of the second area C1 to obtain relocation data, and the collected relocation data is sent to the robot 600.
[0111] Step S105, repositioning the robot based on the repositioning data.
[0112] Here, the process of repositioning the robot based on the repositioning data is the same as the implementation process of positioning the robot at the current position, and the embodiments of the present application will not be repeated.
[0113] The robot positioning method provided in the embodiment of the present application obtains the current positioning information of the robot at the current moment during the process of the robot moving based on the electronic map, and performs real-time positioning of the robot based on the current positioning information; if the current positioning state of the robot is determined to be positioning failure based on the current positioning information, then based on the map data of the electronic map, at least one second area different from the first area where the robot is currently located is identified from the electronic map, so as to determine the target point for repositioning in the second area, and reposition the robot through the repositioning data collected at the target point. In this way, since the second area different from the first area where the robot is currently located is identified from the electronic map, and the second area is used for repositioning, it is ensured that the repositioning data different from the first area can be obtained in the second area, and when the robot is repositioned based on the different repositioning data, the robot can be accurately repositioned, thereby improving the accuracy of the robot repositioning result.
[0114] In some embodiments, the repositioning result of the repositioning includes the second positioning confidence and the repositioning posture; the current positioning information includes the first positioning confidence and the current positioning posture. Figure 7 , after relocating the robot based on the relocation data (wherein, Figure 7 A in the figure represents the above steps S101 to S105), and may further include the following steps S201 to S209:
[0115] Step S201: if the second positioning reliability is less than or equal to a preset score threshold, obtaining displacement data of the robot moving from the current position of the robot to the target point.
[0116] In the embodiment of the present application, if the second positioning score is greater than the preset score threshold, the robot is controlled according to the repositioning posture. If the second positioning confidence is less than or equal to the preset score threshold, the displacement data of the robot moving from the current position of the robot to the target point is obtained, and the repositioning posture is further repositioned based on the displacement data for repositioning verification.
[0117] Step S202, determining the updated posture of the robot based on the displacement data and the current positioning posture.
[0118] Here, the sum of the current positioning posture and the displacement data can be calculated to obtain the updated posture of the robot. That is to say, the displacement data of the robot moving to the target point can be added to the current positioning posture where the robot fails to position, to obtain the updated posture of the robot.
[0119] Step S203, performing repositioning verification on the repositioning pose based on the pose distance between the updated pose and the repositioning pose.
[0120] In some embodiments, see Figure 8 In step S203, the repositioning verification of the repositioning posture can be achieved by the following steps:
[0121] Step S2031, obtaining the update position coordinates in the update posture and the update posture information of the robot, and obtaining the repositioning position coordinates in the repositioning posture and the repositioning posture information of the robot.
[0122] In the embodiment of the present application, the updated posture includes the updated position coordinates and the updated posture information of the robot, and the relocated posture includes the relocated position coordinates and the relocated posture information of the robot.
[0123] Step S2032, determining a posture distance between the updated posture and the repositioned posture based on the updated position coordinates, the repositioned position coordinates, the updated posture information and the repositioned posture information.
[0124] In the embodiment of the present application, the posture distance between the updated posture and the repositioned posture can be calculated by updating the position coordinates, repositioning the position coordinates, updating the posture information and repositioning the posture information, and using a preset distance formula.
[0125] Step S2033, if the posture distance is less than the preset resolution, a repositioning verification result that passes the verification is generated.
[0126] For example, if one pixel represents a distance of 0.05m, then a resolution corresponds to a value of 0.05. Accordingly, assuming that the preset resolution is 2, the preset resolution corresponds to a value of 0.1. Therefore, when the pose distance is less than 0.1, a relocalization verification result is generated that passes the verification.
[0127] In an embodiment of the present application, if the posture distance is less than the preset resolution, it indicates that the updated posture of the robot determined based on the displacement data and the current positioning posture is smaller than the repositioning posture. In other words, the repositioning posture can basically correspond to the updated posture obtained after the robot moves from the current position to the target point. Therefore, it can be determined that the repositioning posture is an accurately positioned posture, so a repositioning verification result that passes the verification is generated.
[0128] Step S2034, if the posture distance is greater than or equal to the preset resolution, a repositioning verification result that fails the verification is generated.
[0129] In an embodiment of the present application, if the posture distance is greater than or equal to the preset resolution, it indicates that the updated posture of the robot determined based on the displacement data and the current positioning posture is significantly different from the repositioning posture, that is, the repositioning posture cannot correspond to the updated posture obtained after the robot moves from the current position to the target point. Therefore, it can be determined that the repositioning posture is not an accurate positioning posture, so a repositioning verification result that fails the verification is generated.
[0130] Step S204, when the verification result of the repositioning verification is verification passed, the robot is controlled to perform the target task according to the repositioning posture.
[0131] In some embodiments, when the relocation check result is that the check fails, the following steps may be further performed:
[0132] Step S205, obtaining the relocation status of the current relocation process.
[0133] Here, the relocation status includes status parameters such as relocation duration and relocation times.
[0134] Step S206, determining whether the relocation state satisfies a preset relocation stop condition.
[0135] In the embodiment of the present application, it can be determined whether the relocation duration is greater than a preset duration threshold, or whether the number of relocations is greater than a preset number threshold. If the relocation duration is greater than the preset duration threshold, or the number of relocations is greater than the preset number threshold, it is determined that the preset relocation stop condition is currently met.
[0136] If the judgment result is no, execute step S207; if the judgment result is yes, execute step S209.
[0137] Step S207: determining a new target point for relocation again from at least one second area.
[0138] The new target point is a centroid point in the second area that has not been determined as a target point.
[0139] Step S208, acquiring new repositioning data collected at the new target point, and repositioning the robot based on the new repositioning data, until the verification result of the repositioning verification is verification passed.
[0140] Step S209, generating an alarm message of repositioning failure, and controlling the robot to output the alarm message.
[0141] In the embodiment of the present application, if the repositioning fails, multiple repositionings such as secondary repositioning, tertiary repositioning, etc. can be performed until the repositioning is successful. The repositioning stop condition can also be set. When the repositioning stop condition is met, the process is terminated. In this way, it is avoided that the robot is placed in a new environment (no electronic map is built) and the infinite repositioning causes a waste of resources.
[0142] In some embodiments, the entire process may be terminated directly when repositioning fails, and the robot may be controlled to generate an alarm message of repositioning failure to report an error. This can greatly avoid the waste of resources caused by multiple repositionings.
[0143] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.
[0144] After positioning fails or repositioning fails, a problem with the related technology in secondary repositioning is that the secondary repositioning navigates a short distance, resulting in not getting out of the positioning environment of the previous repositioning, causing the secondary repositioning to fail again. The first problem solved by the embodiments of the present application is how to avoid the situation where the robot cannot navigate to an area with new environmental features after repositioning fails, causing the acquired laser features to be similar to those at the time of repositioning, resulting in the secondary repositioning still failing. The second problem is how to use the posture results of the two repositionings combined with the odometer information to infer whether the posture results of the secondary repositioning are true.
[0145] Based on the problems existing in the related art, the positioning method provided in the embodiment of the present application can use a method that can quickly segment different areas of the electronic map to find the navigation target point for the second relocation after positioning fails or relocation fails, so that the robot can quickly navigate to another area (so that sub-image data with different features can be obtained with a high probability), and then collect the sub-image data (current laser features) for relocation to obtain the positioning result of the second relocation, thereby combining the odometer displacement data between the two relocations and the failed posture of the first relocation to give an accurate relocation posture. The embodiment of the present application mainly focuses on a method for quickly segmenting different areas of an electronic map and a method for predicting the result of the second relocation posture using odometer information during navigation.
[0146] Fig. 9 The figure is a schematic diagram of the overall process of the robot positioning method provided in the embodiment of the present application. The robot positioning method in the embodiment of the present application can also be called a robot repositioning method, which is a method for repositioning the robot after a first positioning failure. It can also be understood as a method for performing a secondary repositioning after a repositioning failure. Therefore, the secondary repositioning proposed in the embodiment of the present application can be understood as a repositioning process after a positioning failure. Fig. 9 The method includes the following steps S301 to S309:
[0147] Step S301, after the first relocation, a relocation result determination is performed to determine whether the relocation score exceeds a threshold.
[0148] First, the robot needs to detect whether a relocation failure has occurred. Here, the judgment is usually made by comparing the relocation score of the robot relocation (i.e., the first positioning confidence mentioned above) and a preset threshold (i.e., the preset confidence threshold mentioned above). If the judgment result is that the relocation is successful, step S302 is executed; if the judgment result is that the relocation fails, step S303 is executed and the secondary relocation process is entered.
[0149] Step S302, refresh the current positioning posture in the current repositioning result, and output the current positioning posture.
[0150] Step S303, record the current positioning posture p1 (x1, y1, theta1).
[0151] Step S304: segment the electronic map to determine the navigation target point for secondary relocation.
[0152] In the embodiment of the present application, once the relocation fails, a method that can quickly and effectively segment the electronic map is used to segment the electronic map into different areas (i.e., the second area). Then, the centroid of the different areas is used as the target point, and this target point should ensure that the robot navigates to another area different from the current environment.
[0153] The following is a description of a method for determining a navigation target point in an embodiment of the present application.
[0154] like Fig.10 As shown, an electronic map having a cv::Mat format (ie, a specific array type).
[0155] First, we can use a dilation and corrosion operation to Fig.10 The electronic map is de-noised (for example, the OpenCV function can be used, and when the OpenCV function is used, the kernel size can be set to 3x3), and the following is obtained: Fig.11 The electronic map shown (i.e., the map image after denoising) is designed to remove some noise points that may affect the segmentation effect.
[0156] Then, yes Fig.11 The electronic map is binarized and the Fig.12 The electronic map shown (i.e. the map image after binary processing); then, Fig.12 The electronic map is eroded once (when using the OpenCV function, the kernel size can be set to 5x5), and the Fig.13 The electronic map shown in (i.e. the map image after corrosion processing) is used to further reduce the distance between the "gates" in different areas; then, the Canny operator is used to Fig.13 The electronic map shown in the figure is subjected to edge detection to obtain the outline of the map (i.e., pixels), and the Fig.14 The outline of the map shown; then, find Fig.14 The contour points (i.e. a series of points) of the contour of the map in the figure are drawn (using the drawcou ntours function of OpenCV with a drawing thickness of 2) to obtain Fig.15 The map outline shown. Then, expand Fig.15 The outline of (for example, when using the OpenCV function, the kernel size is set to 13x13), resulting in Fig.16 The purpose of this step is to expand the "room door" area and segment the required area. Fig.11 Subtract the pixel value of each pixel in Fig.16 The pixel values of the corresponding pixels in are obtained to obtain the pixel value difference, and the part with a difference of 255 is retained to obtain Fig.17 The three regions shown in the figure are as follows. In this way, this step extracts several regions used to determine the target point of navigation. Finally, find Fig.17 The number of connected domains in , calculate the centroid of each connected domain, and mark the coordinates corresponding to each centroid to Fig.10 , thus obtaining Fig.18 ( Fig.18 An electronic map with navigation points marked with midpoint 181, point 182 and point 183).
[0157] In the embodiment of the present application, after obtaining the electronic map marked with navigation points, a breadth-first search algorithm (BFS, Breadth-First Search) can be used to verify several navigation points (i.e. Fig.18 Check whether the navigation points marked in the figure are reachable from the robot position. If they are reachable, they are retained as the final target points. At this point, the search for the target points is completed. The target points can be explored one by one by taking the shortest path from near to far according to their distance from the robot.
[0158] Step S305, controlling the robot to quickly navigate to a new area where the target point is located.
[0159] The robot quickly moves to the new area based on the selected target point. The goal of this step is to leave the current area to increase the possibility of obtaining different feature sub-graph data.
[0160] Step S306: collect sub-image data in the new area, and perform secondary relocation based on the collected sub-image data.
[0161] After arriving at a new area, the robot collects new sub-map data (i.e., laser point cloud), which will be used for relocalization again.
[0162] In an embodiment of the present application, the robot can perform secondary repositioning using the newly collected sub-graph data to obtain the secondary repositioning result posture p2(x2, y2, theta2) (i.e., the above-mentioned repositioning posture).
[0163] Step S307, determining whether the relocation score of the secondary relocation (ie, the second location reliability) is greater than a threshold (ie, a preset score threshold).
[0164] If it is greater than the threshold, the current positioning posture in the current repositioning result is refreshed, and the posture p2 is directly output as the current true posture, and the process ends; if it is less than the threshold, execute step S308.
[0165] Step S308 , combining the displacement data x (dx, dy, dtheta) of the robot and the posture p1 (x1, y1, theta1) where relocalization failed, to determine the updated posture p2 ′ of the robot.
[0166] Here, the robot combines the odometer displacement data between the two relocalizations with the failed pose of the first relocalization to obtain a more accurate relocalization result. Based on the odometer information, the updated pose can be calculated as shown in the following formulas (1) to (3):
[0167] x2'=x1+dx (1)
[0168] y2'=y1+dy (2)
[0169] theta2'=theta1+dtheta (3);
[0170] In this way, the updated pose calculated based on the odometer is obtained as p2'(x2', y2', theta2').
[0171] Step S309, calculate the Euclidean distance d (i.e., posture distance) between the posture p2 obtained by the secondary relocation and the updated posture p2', and determine whether d is less than a preset resolution (for example, two resolutions, if one pixel represents 0.05m, the resolution is 0.05), and the calculation process of d is as follows:
[0172]
[0173] If d is smaller than the preset resolution, that is, d is smaller than the size of two resolutions, the pose p2 is considered to be the current true pose, and the pose is refreshed, and p2 is used as the current true pose and output, otherwise the secondary relocalization is considered to have failed.
[0174] The robot positioning method provided in the embodiment of the present application combines an effective and rapid setting method for determining the navigation target point and a secondary repositioning posture processing strategy to realize a rapid secondary repositioning process for the robot when repositioning fails. This process greatly improves the robot's positioning success rate.
[0175] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0176] Based on the robot positioning method described in the above embodiment, Fig.19 A structural block diagram of a robot positioning device 190 provided in an embodiment of the present application is shown. The robot positioning device may be a device in an electronic device (e.g., a robot). The robot positioning device may be implemented in software, which may be software in the form of programs and plug-ins, etc., including the following software modules: an acquisition module 191, a region segmentation module 192, a determination module 193, and a repositioning module 194. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented.
[0177] Among them, the acquisition module 191 is used to obtain the current positioning information of the robot at the current moment when the robot performs a navigation task based on the navigation map; the area segmentation module 192 is used to identify at least one second area different from the first area where the robot is currently located from the electronic map based on the map data of the electronic map if the current positioning state of the robot is determined to be positioning failure based on the current positioning information; the determination module 193 is used to determine the repositioning target point from the at least one second area; the repositioning module 194 is used to obtain the repositioning data collected at the target point, and reposition the robot based on the repositioning data.
[0178] In some embodiments, the repositioning module 194 is further used to: control the robot to move from the current position of the robot to the target point; and collect the repositioning data at the target point by the robot.
[0179] In some embodiments, the relocation module 194 is further used to: determine an electronic device located in the second area where the target point is located as a target electronic device; and receive the relocation data collected by the target electronic device.
[0180] In some embodiments, the current positioning information includes a first positioning confidence; the region segmentation module 192 is also used to: if the first positioning confidence is less than or equal to a preset confidence threshold, determine that the current positioning state of the robot is a positioning failure; based on the map data of the electronic map, perform map contour recognition on the electronic map to obtain contour information of the electronic map; based on the contour information, perform map reconstruction on the electronic map to obtain a reconstructed map; and identify the at least one second region from the reconstructed map.
[0181] In some embodiments, the map data of the electronic map has a specific array type; the region segmentation module 192 is further used to: based on a preset first kernel parameter, perform image corrosion processing on the map data having the specific array type to obtain the corroded map data; perform edge detection on the corroded map data to obtain a plurality of edge pixels of the electronic map; use each of the edge pixels as a contour point, use a preset thickness parameter to perform contour drawing, and obtain contour information of the electronic map.
[0182] In some embodiments, the region segmentation module 192 is further used to: perform image dilation processing on the map contour corresponding to the contour information based on a preset second kernel parameter to obtain the dilated map data; and perform map drawing based on the dilated map data to obtain the reconstructed map.
[0183] In some embodiments, the electronic map and the reconstructed map are both binarized images; the region segmentation module 192 is also used to: obtain the pixel value of each pixel in the reconstructed map and the electronic map; the pixel at each position in the reconstructed map corresponds to the pixel at the corresponding position in the electronic map; determine the pixel value difference between each pixel in the reconstructed map and the corresponding pixel in the electronic map; and extract the at least one second region from the reconstructed map based on the pixel value difference.
[0184] In some embodiments, the current positioning information also includes a current positioning posture, and the current positioning posture includes at least the position coordinates of the robot at the current position; the determination module 193 is also used to: determine the coordinates of the center of mass point of each second area; based on the position coordinates of the current position and the coordinates of the center of mass point of each second area, determine a target second area from the at least one second area; the target second area is a second area that the robot can reach and is closest to the current position; and determine the center of mass point of the target second area as the target point for repositioning.
[0185] In some embodiments, the electronic map includes multiple environmental areas; the area segmentation module 192 is also used to: filter out a target environmental area to be identified from the multiple environmental areas; and identify at least one second area different from the first area where the robot is currently located from the target environmental area.
[0186] In some embodiments, the repositioning result of the repositioning includes a second positioning reliability and a repositioning posture; the current positioning information includes a first positioning reliability and a current positioning posture; the device also includes: a displacement data acquisition module, which is used to obtain the displacement data of the robot from the current position of the robot to the target point after the robot is repositioned based on the repositioning data, if the second positioning reliability is less than or equal to a preset score threshold; an updated posture determination module, which is used to determine the updated posture of the robot based on the displacement data and the current positioning posture; a repositioning verification module, which is used to reposition the repositioning posture based on the posture distance between the updated posture and the repositioning posture; a task execution module, which is used to control the robot to perform the target task according to the repositioning posture when the verification result of the repositioning verification is verification passed.
[0187] In some embodiments, the repositioning verification module is also used to: obtain the updated position coordinates in the updated posture and the updated posture information of the robot, and obtain the repositioning position coordinates in the repositioning posture and the repositioning posture information of the robot; determine the posture distance between the updated posture and the repositioning posture based on the updated position coordinates, the repositioning position coordinates, the updated posture information and the repositioning posture information; if the posture distance is less than a preset resolution, generate a repositioning verification result that passes the verification; if the posture distance is greater than or equal to the preset resolution, generate a repositioning verification result that fails the verification.
[0188] In some embodiments, the device also includes: a repositioning state acquisition module, which is used to obtain the repositioning state of the current repositioning process when the repositioning verification result is a verification failure; a new target point determination module, which is used to determine a new target point for repositioning from the at least one second area again when the repositioning state does not meet the preset repositioning stop condition; the new target point is the center of mass point in the second area that has not been determined as the target point; a re-repositioning module, which is used to obtain new repositioning data collected at the new target point, and reposition the robot based on the new repositioning data until the verification result of the repositioning verification is a verification pass; an alarm module, which is used to generate an alarm message of repositioning failure when the repositioning state meets the repositioning stop condition; and control the robot to output the alarm message.
[0189] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0190] The present application further provides an electronic device, which may be a robot. Fig. 20 Schematic diagram of the structure of the robot provided in the embodiment of the present application. Fig. 20 As shown, the robot 200 includes: at least one processor 201 ( Fig. 20 Only one is shown in the figure), a memory 202, and executable instructions 203 stored in the memory 202 and executable on at least one processor 201, when the processor 201 executes the executable instructions 203, the steps in any of the above robot positioning method embodiments are implemented. The robot may include but is not limited to the processor 201 and the memory 202. It can be understood by those skilled in the art that Fig. 20This is merely an example of the robot 200 and does not constitute a limitation of the robot 200 , which may include more or fewer components than those shown in the figure, or a combination of certain components, or different components, for example, may also include input and output devices, network access devices, etc.
[0191] The processor 201 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 the processor may be any conventional processor, etc.
[0192] In some embodiments, the memory 202 may be an internal storage unit of the robot 200, such as a hard disk or memory of the robot 200. In other embodiments, the memory 202 may also be an external storage device of the robot 200, such as a plug-in hard disk, a smart memory card (SMC, Smart Media Card), a secure digital (SD, Secure Digital) card, a flash card, etc. equipped on the robot 200. Further, the memory 202 may also include both an internal storage unit of the robot 200 and an external storage device. The memory 202 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs. The memory 202 may also be used to temporarily store data that has been output or is to be output.
[0193] The embodiment of the present application also provides a computer program product, which includes an executable instruction, which is a computer instruction; the executable instruction is stored in a computer-readable storage medium. When a processor of an electronic device (such as a robot) reads the executable instruction from the computer-readable storage medium and the processor executes the executable instruction, the electronic device executes the method described above in the embodiment of the present application.
[0194] The present application embodiment provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the present application embodiment, for example, Figure 1In some embodiments, the storage medium may be a computer-readable storage medium, for example, a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disk-read-only memory (CD-ROM); or various devices including one or any combination of the above memories.
[0195] In some embodiments, 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.
[0196] As an example, executable instructions may, but need not correspond to, a file in a file system, may be stored as part of a file storing other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions). As an example, executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected by a communication network.
[0197] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A robot positioning method, characterized in that: The method comprises: In the process of the robot moving based on the electronic map, obtaining the current positioning information of the robot at the current moment; If it is determined based on the current positioning information that the current positioning state of the robot is positioning failure, based on the map data of the electronic map, identifying at least one second area different from the first area where the robot is currently located from the electronic map; determining a relocated target point from the at least one second area; Acquire relocation data collected at the target point; The robot is repositioned based on the repositioning data.
2. The method according to claim 1, characterized in that The acquiring of the repositioning data collected at the target point comprises: Controlling the robot to move from the current position of the robot to the target point; The repositioning data is collected at the target point by the robot.
3. The method according to claim 1, characterized in that The acquiring of the repositioning data collected at the target point comprises: determining an electronic device located in a second area where the target point is located as a target electronic device; The relocation data collected by the target electronic device is received.
4. The method according to claim 1, characterized in that The current positioning information includes a first positioning reliability; if it is determined based on the current positioning information that the current positioning state of the robot is positioning failure, based on the map data of the electronic map, identifying at least one second area different from the first area where the robot is currently located from the electronic map, including: If the first positioning confidence is less than or equal to a preset confidence threshold, determining that the current positioning state of the robot is positioning failure; Based on the map data of the electronic map, map contour recognition is performed on the electronic map to obtain contour information of the electronic map; Reconstructing the electronic map based on the contour information to obtain a reconstructed map; The at least one second region is identified from the reconstructed map.
5. The method according to claim 4, characterized in that The map data of the electronic map has a specific array type; the map contour recognition of the electronic map based on the map data of the electronic map to obtain the contour information of the electronic map includes: Based on a preset first kernel parameter, performing image corrosion processing on the map data having the specific array type to obtain the map data after corrosion processing; Performing edge detection on the map data after the corrosion process to obtain a plurality of edge pixels of the electronic map; Each edge pixel is taken as a contour point, and a preset thickness parameter is used to perform contour drawing to obtain contour information of the electronic map.
6. The method according to claim 5, characterized in that The step of reconstructing the electronic map based on the contour information to obtain a reconstructed map includes: Based on a preset second kernel parameter, performing image expansion processing on the map contour corresponding to the contour information to obtain map data after the expansion processing; Map drawing is performed based on the map data after the expansion process to obtain the reconstructed map.
7. The method according to claim 6, characterized in that The electronic map and the reconstructed map are both binarized images; and identifying the at least one second area from the reconstructed map includes: Obtaining the pixel value of each pixel point in the reconstructed map and the electronic map; the pixel point at each position in the reconstructed map corresponds to the pixel point at the corresponding position in the electronic map; Determining a pixel value difference between each pixel point in the reconstructed map and a corresponding pixel point in the electronic map; Based on the pixel value difference, the at least one second region is extracted from the reconstructed map.
8. The method according to claim 7, characterized in that The current positioning information also includes a current positioning posture, and the current positioning posture at least includes the position coordinates of the robot at its current position; The step of determining a relocated target point from the at least one second area comprises: determining the coordinates of the centroid point of each of the second regions; Based on the position coordinates of the current position and the coordinates of the centroid of each second area, a target second area is determined from the at least one second area; the target second area is a second area that the robot can reach and is closest to the current position; The centroid point of the target second area is determined as the relocated target point.
9. The method according to claim 1, characterized in that: The electronic map includes a plurality of environmental areas; The step of identifying at least one second area different from the first area where the robot is currently located from the electronic map comprises: Screening out a target environmental area to be identified from the multiple environmental areas; At least one second area different from a first area where the robot is currently located is identified from the target environment area.
10. The method according to any one of claims 1 to 9, characterized in that: The repositioning result of the repositioning includes the second positioning reliability and the repositioning posture; the current positioning information includes the first positioning reliability and the current positioning posture; After relocating the robot based on the relocation data, the method further includes: If the second positioning confidence is less than or equal to a preset score threshold, obtaining displacement data of the robot moving from the current position of the robot to the target point; Determining an updated posture of the robot based on the displacement data and the current positioning posture; Based on a posture distance between the updated posture and the repositioned posture, performing a repositioning check on the repositioned posture; When the verification result of the repositioning verification is verification passed, the robot is controlled to perform the target task according to the repositioning posture.
11. The method according to claim 10, characterized in that The repositioning verification of the repositioning posture based on the posture distance between the updated posture and the repositioning posture comprises: Acquire the update position coordinates in the update posture and the update posture information of the robot, and acquire the repositioning position coordinates in the repositioning posture and the repositioning posture information of the robot; Determining a posture distance between the update posture and the repositioned posture based on the update position coordinates, the repositioned position coordinates, the update posture information, and the repositioned posture information; If the posture distance is less than the preset resolution, a repositioning verification result is generated; If the posture distance is greater than or equal to the preset resolution, a repositioning verification result indicating that the verification failed is generated.
12. The method according to claim 10, characterized in that When the relocation check result is a check failure, the method further includes: Get the relocation status of the current relocation process; When the relocation state does not satisfy a preset relocation stop condition, determining a new target point for relocation from the at least one second area again; the new target point is a centroid point in the second area that has not been determined as a target point; Acquire new repositioning data collected at the new target point, and reposition the robot based on the new repositioning data until the verification result of the repositioning verification is verification passed; When the repositioning state satisfies the repositioning stop condition, a warning message of repositioning failure is generated; and the robot is controlled to output the warning message.
13. A robot positioning device, characterized in that: The device comprises: An acquisition module, used to acquire the current positioning information of the robot at the current moment when the robot performs a navigation task based on the navigation map; A region segmentation module, configured to identify at least one second region different from the first region currently located by the robot from the electronic map based on the map data of the electronic map if the current positioning state of the robot is determined to be positioning failure based on the current positioning information; A determination module, configured to determine a target point for relocation from the at least one second area; The repositioning module is used to obtain the repositioning data collected at the target point and reposition the robot based on the repositioning data.
14. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, configured to implement the robot positioning method according to any one of claims 1 to 12 when executing the executable instructions stored in the memory.
15. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute the executable instructions to implement the robot positioning method according to any one of claims 1 to 12.
16. A computer program product, the computer program product comprising executable instructions stored in a computer-readable storage medium; When the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the robot positioning method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Point cloud data processing method, robot and storage medium
CN121048615A
