Positioning method and apparatus, robot, and storage medium

CN116772851BActive Publication Date: 2026-08-11SHENZHEN PENGXING INTELLIGENT RES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

但这种定位方法中,对于相同语义物体的匹配往往存在精确度不高的问题,容易导致机器人定位不准确

Benefits of technology

[0008] The solution provided in this application obtains at least one environmental edge line in the robot's current environment and the corresponding environmental map. When the environmental edge line is curved, it is converted into a first polyline. The first polyline is matched with a second polyline in the environmental map to obtain a matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. Based on the matching error distance, the position of the robot in the preset map is determined. By converting the environmental edge line in the current environment into a first polyline, and determining the matching error distance based on the first polyline and the second polyline corresponding to the first polyline in the environmental map, the accurate position of the robot in the environmental map can be determined. Simultaneously, continuous positioning of the robot during movement can be achieved, effectively improving the accuracy of robot positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116772851B_ABST
    Figure CN116772851B_ABST
Patent Text Reader

Abstract

This application discloses a positioning method, apparatus, robot, and storage medium. The method acquires at least one environmental edge line in the robot's current environment and an environmental map corresponding to the current environment; when the environmental edge line is curved, it is converted into a first polyline; the first polyline is matched with a second polyline in the environmental map to obtain a matching error distance, where the second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map; based on the matching error distance, the position of the robot in a preset map is determined. By converting the environmental edge line into a first polyline and determining the matching error distance based on the first polyline and the second polyline corresponding to the first polyline in the environmental map, the accurate position of the robot in the environmental map can be determined, and continuous positioning of the robot during movement can be achieved, thus improving the accuracy of robot positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robotics, and more specifically, to a positioning method, apparatus, robot, and storage medium. Background Technology

[0002] When locating a robot in an outdoor environment, semantic objects representing the environment, such as driveways, sidewalks, and lawns, are crucial for localization data. Robots typically use their onboard sensors to scan for semantic objects in their surroundings and then match them with semantic objects recorded in a pre-acquired environmental map to achieve localization. However, this method often suffers from low accuracy when matching identical semantic objects, leading to inaccurate robot localization. Summary of the Invention

[0003] In view of the above problems, this application proposes a positioning method, device, robot, and storage medium to achieve accurate positioning of the robot.

[0004] In a first aspect, embodiments of this application provide a positioning method, the method comprising: acquiring at least one environmental edge line in the current environment where the robot is located, and an environmental map corresponding to the current environment; when the environmental edge line is a curve, converting the environmental edge line into a first polyline; matching the first polyline with a second polyline in the environmental map to obtain a matching error distance, wherein the second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map; and determining the position of the robot in the environmental map based on the matching error distance.

[0005] Secondly, embodiments of this application provide a positioning device, the device comprising: an edge line acquisition module, an edge line conversion module, a polyline matching module, and a position determination module, wherein the edge line acquisition module is used to acquire at least one environmental edge line in the current environment where the robot is located, and an environmental map corresponding to the current environment; the edge line conversion module is used to convert the environmental edge line into a first polyline when the environmental edge line is a curve; the polyline matching module is used to match the first polyline with a second polyline in the environmental map to obtain a matching error distance, wherein the second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map; and the position determination module is used to determine the position of the robot in the environmental map based on the matching error distance.

[0006] Thirdly, embodiments of this application provide a robot, including: a body; and a control system communicating with the body, the control system including a processor and a memory communicating with the processor, the memory storing instructions, the instructions being executed on the processor to cause the processor to perform the positioning method provided in the first aspect above.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the positioning method provided in the first aspect above.

[0008] The solution provided in this application obtains at least one environmental edge line in the robot's current environment and the corresponding environmental map. When the environmental edge line is curved, it is converted into a first polyline. The first polyline is matched with a second polyline in the environmental map to obtain a matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. Based on the matching error distance, the position of the robot in the preset map is determined. By converting the environmental edge line in the current environment into a first polyline, and determining the matching error distance based on the first polyline and the second polyline corresponding to the first polyline in the environmental map, the accurate position of the robot in the environmental map can be determined. Simultaneously, continuous positioning of the robot during movement can be achieved, effectively improving the accuracy of robot positioning. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 A schematic diagram of the hardware structure of the robot provided in an embodiment of this application is shown.

[0011] Figure 2 A schematic diagram of the mechanical structure of the robot provided in an embodiment of this application is shown.

[0012] Figure 3 A flowchart illustrating a positioning method provided in one embodiment of this application is shown.

[0013] Figure 4 A flowchart illustrating a positioning method provided in another embodiment of this application is shown.

[0014] Figure 5A schematic diagram of the specific process of step S240 in another embodiment of this application is shown.

[0015] Figure 6 A schematic diagram of the specific process of step S241 in another embodiment of this application is shown.

[0016] Figure 7 A schematic diagram of a second distance acquisition is shown in another embodiment of this application.

[0017] Figure 8 Another schematic diagram of second distance acquisition is shown in another embodiment of this application.

[0018] Figure 9 A schematic diagram of the sampling point location is shown in an embodiment of this application.

[0019] Figure 10 This illustration shows a schematic diagram of the second distance corresponding to the sampling point in an embodiment of this application.

[0020] Figure 11 This illustration shows another schematic diagram of the second distance corresponding to the sampling point in an embodiment of this application.

[0021] Figure 12 A schematic diagram showing the first distance corresponding to the sampling points in the embodiments of this application is shown.

[0022] Figure 13 This illustration shows a schematic diagram of adjusting the position of the first broken line in an embodiment of this application.

[0023] Figure 14 This illustration shows a schematic diagram of adjusting the position of the first broken line in an embodiment of this application.

[0024] Figure 15 A flowchart illustrating a positioning method provided in yet another embodiment of this application is shown.

[0025] Figure 16 This illustrates another schematic diagram of adjusting the position of the first broken line in an embodiment of this application.

[0026] Figure 17 A schematic diagram illustrating the principle of positioning deviation in the robot in this embodiment of the application is shown.

[0027] Figure 18 A schematic diagram illustrating the principle of adjusting the robot's position in an embodiment of this application is shown.

[0028] Figure 19 A structural block diagram of the positioning device provided in an embodiment of this application is shown.

[0029] Figure 20A structural block diagram of a robot provided in an embodiment of this application is shown.

[0030] Figure 21 A structural block diagram of a computer-readable storage medium provided in an embodiment of this application is shown. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0032] The inventors have proposed a positioning method, device, robot, and storage medium provided in the embodiments of this application. By converting the environmental edge line in the current environment into a first polyline, and determining the matching error distance based on the first polyline and a second polyline in the environmental map corresponding to the first polyline, the accurate position of the robot in the environmental map can be determined. At the same time, continuous positioning of the robot during movement can be achieved, which effectively improves the accuracy of robot positioning.

[0033] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0034] In the following description, the use of suffixes such as "module," "component," or "unit" to denote parts is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "component," or "unit" may be used interchangeably.

[0035] Please see Figure 1 , Figure 1 This is a schematic diagram of the hardware structure of a robot 100 provided in one embodiment of this application. The robot 100 can be any of various robot types, specifically including but not limited to at least one of wheeled robots, legged robots, tracked robots, crawling robots, worm-like robots, or swimming robots. For example, the robot 100 can specifically be a legged robot, or a robot combining legged and wheeled configurations. Legged robots include monopodial robots, bipodial robots, or multipodial robots. Multipodial robots refer to robots with three or more legs; for example, a multipodial robot can specifically be a quadrupedal robot. A robot is a machine capable of performing semi-autonomous or fully autonomous tasks. Robots are not limited to humanoid machine devices and can also include robots with configurations such as dogs, horses, snakes, fish, apes, or monkeys. For example, a robot can specifically be a quadrupedal robotic horse. Figure 1In the illustrated embodiment, robot 100 includes a mechanical unit 101, a communication unit 102, a sensing unit 103, an interface unit 104, a storage unit 105, a display unit 106, an input unit 107, a control module 110, and a power supply 111. The various components of robot 100 can be connected in any way, including wired or wireless connections. Those skilled in the art will understand that... Figure 1 The specific structure of the robot 100 shown does not constitute a limitation on the robot 100. The robot 100 may include more or fewer parts than shown. Some parts are not essential components of the robot 100 and may be omitted or combined as needed without changing the nature of the invention.

[0036] Figure 2 This is a schematic diagram of the mechanical structure of a robot according to an embodiment of this application. The following is in conjunction with... Figure 1 and Figure 2 A detailed introduction to each component of Robot 100:

[0037] Mechanical unit 101 is the hardware of robot 100. For example... Figure 1 As shown, the mechanical unit 101 may include a drive board 1011, a motor 1012, and a mechanical structure 1013, such as... Figure 2 As shown, the mechanical structure 1013 may include a main body 1014, extendable legs 1015, and feet 1016. In other embodiments, the mechanical structure 1013 may also include an extendable robotic arm (not shown), a rotatable head structure 1017, a rocking tail structure 1018, a cargo-carrying structure 1019, a saddle structure 1020, a camera structure 1021, etc. It should be noted that the various component modules of the mechanical unit 101 can be one or multiple, depending on the specific situation. For example, there may be four legs 1015, and each leg 1015 may be equipped with three motors 1012, resulting in a total of twelve motors 1012.

[0038] The communication unit 102 can be used for receiving and sending signals, and can also communicate with networks and other devices. For example, it can receive instructions from a remote control or other robot 100 to move in a specific direction at a specific speed according to a specific gait, and then transmit these instructions to the control module 110 for processing. The communication unit 102 includes modules such as WiFi, 4G, 5G, Bluetooth, and infrared modules.

[0039] The sensing unit 103 is used to acquire information data about the environment surrounding the robot 100 and to monitor parameter data of various components inside the robot 100, and then sends this data to the control module 110. The sensing unit 103 includes various sensors, such as sensors for acquiring information about the surrounding environment: lidar (for remote object detection, distance determination, and / or velocity determination), millimeter-wave radar (for short-range object detection, distance determination, and / or velocity determination), cameras, infrared cameras, and Global Navigation Satellite System (GNSS). Sensors for monitoring various components inside the robot 100 include: an inertial measurement unit (IMU) (for measuring velocity, acceleration, and angular velocity values), foot sensors (for monitoring the position of the foot's contact point, foot posture, magnitude and direction of the contact force), and temperature sensors (for detecting component temperature). Other sensors that can be configured on the robot 100, such as load sensors, touch sensors, motor angle sensors, and torque sensors, are not detailed here.

[0040] The interface unit 104 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within the robot 100, or it can be used to output to external devices (e.g., data, power, etc.). The interface unit 104 may include a power port, a data port (such as a USB port), a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, etc.

[0041] Storage unit 105 is used to store software programs and various data. Storage unit 105 may mainly include a program storage area and a data storage area. The program storage area may store operating system programs, motion control programs, application programs (such as text editors), etc.; the data storage area may store data generated by the robot 100 during use (such as various sensor data acquired by the sensing unit 103, log file data, etc.). Furthermore, storage unit 105 may include high-speed random access memory, and may also include non-volatile memory, such as disk storage, flash memory, or other volatile solid-state memory.

[0042] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0043] Input unit 107 can be used to receive input numerical or character information. Specifically, input unit 107 may include touch panel 1071 and other input devices 1072. Touch panel 1071, also known as touch screen, can collect user touch operations (such as operations performed by the user using their palm, fingers, or suitable accessories on or near touch panel 1071) and drive corresponding connection devices according to a pre-set program. Touch panel 1071 may include two parts: touch detection device 1073 and touch controller 1074. Touch detection device 1073 detects the user's touch position and the signal generated by the touch operation, and transmits the signal to touch controller 1074; touch controller 1074 receives touch information from touch detection device 1073, converts it into touch point coordinates, and sends it to control module 110, and can also receive and execute commands from control module 110. In addition to touch panel 1071, input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, one or more of the following: remote control handles, etc., without any specific limitation here.

[0044] Furthermore, the touch panel 1071 can cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the control module 110 to determine the type of touch event. Subsequently, the control module 110 provides corresponding visual output on the display panel 1061 according to the type of touch event. Although in Figure 1 In this embodiment, the touch panel 1071 and the display panel 1061 are two independent components that implement input and output functions respectively. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement input and output functions. The specific implementation is not limited here.

[0045] The control module 110 is the control center of the robot 100. It connects all the components of the robot 100 through various interfaces and lines. It controls the robot 100 as a whole by running or executing the software program stored in the storage unit 105 and calling the data stored in the storage unit 105.

[0046] Power supply 111 supplies power to various components. Power supply 111 may include a battery and a power control board. The power control board controls battery charging, discharging, and power consumption management. Figure 1 In the illustrated embodiment, power supply 111 is electrically connected to control module 110. In other embodiments, power supply 111 may also be electrically connected to sensing unit 103 (such as camera, radar, speaker, etc.) and motor 1012. It should be noted that each component may be connected to a different power supply 111, or may be powered by the same power supply 111.

[0047] Based on the above embodiments, specifically, in some embodiments, a terminal device can be used to communicate with the robot 100. When the terminal device communicates with the robot 100, it can send instruction information to the robot 100. The robot 100 can receive the instruction information through the communication unit 102 and, upon receiving the instruction information, can transmit it to the control module 110, so that the control module 110 can process the instruction information to obtain the target speed value. The terminal device includes, but is not limited to, mobile phones, tablets, servers, personal computers, wearable smart devices, and other electrical appliances with image capture capabilities.

[0048] The instruction information can be determined based on preset conditions. In one embodiment, the robot 100 may include a sensing unit 103, which can generate instruction information based on the current environment of the robot 100. The control module 110 can determine whether the current speed value of the robot 100 meets the corresponding preset conditions based on the instruction information. If it does, the robot 100 will maintain its current speed value and current gait; if it does not, the control module 110 will determine a target speed value and a corresponding target gait based on the corresponding preset conditions, thereby controlling the robot 100 to move at the target speed value and the corresponding target gait. Environmental sensors may include temperature sensors, air pressure sensors, vision sensors, and sound sensors. Instruction information may include temperature information, air pressure information, image information, and sound information. The communication method between the environmental sensors and the control module 110 can be wired or wireless. Wireless communication methods include, but are not limited to: wireless networks, mobile communication networks (3G, 4G, 5G, etc.), Bluetooth, and infrared.

[0049] The following describes the application scenarios of the positioning method provided in the embodiments of this application.

[0050] The positioning method provided in this application is applied to a robot. The robot can acquire real-time local map data of its current environment by pre-configured sensors such as LiDAR or cameras, including environmental edge lines such as lane lines, sidewalk lines, and flower bed boundaries. This real-time local map data can characterize the robot's accurate position in the current environment. For example, the sensors measure a distance of 5 meters between the robot and the left edge of the garden and 3 meters between the robot and the front edge of the garden. The robot can adjust or correct its position in the environmental map based on this accurate local map data. The environmental map refers to a pre-acquired overall map including the robot's current environment. The specific form of the environmental map can be determined according to actual application requirements; for example, the environmental map can be a semantic map, a grid map, or a visual feature map. The robot can obtain its position in the environmental map based on the Global Positioning System (GPS) or other positioning technologies. For example, if the robot determines through GPS positioning technology that its position in the environmental map is 6 meters from the left edge of the garden and 3.5 meters from the front edge of the garden, it can obtain its position in the environmental map. Clearly, the robot's position obtained through localization technology differs from the actual distance measured by sensors. This indicates a discrepancy between the robot's position on the environmental map and its actual position in the environment. This discrepancy can lead to errors in subsequent path planning, movement, and task execution, impacting the robot's safety. To improve the accuracy of the robot's position, it can match the local map data corresponding to the current environment obtained from the sensors with a pre-acquired environmental map to determine the error distance between the two. This error distance, representing the difference between the robot's actual and actual positions, allows for correction of the robot's position on the environmental map, resulting in more precise localization.

[0051] The positioning method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0052] Please see Figure 3 , Figure 3 This paper illustrates a flowchart of a positioning method provided in one embodiment of this application. The following will focus on... Figure 3 The process shown will be described in detail. The positioning method may specifically include the following steps:

[0053] Step S110: Obtain at least one environmental edge line in the current environment where the robot is located, and the environmental map corresponding to the current environment.

[0054] In this embodiment, the robot can acquire environmental edge lines in its current environment through its own configured sensors, or it can acquire environmental edge lines from external detection devices, such as drones or terminal devices that interact with the robot. The environmental edge lines can be road edges such as lane lines or sidewalk edges, or indoor wall corner edges or stair railing edges. Acquiring environmental edge lines can be achieved by scanning the robot's current environment using pre-installed sensors such as radar or cameras, obtaining at least one environmental edge line. In some implementations, the robot can acquire 3D point cloud data of the current environment and then filter the 3D point cloud data to obtain at least one environmental edge line; the robot can also acquire multiple frames of depth images corresponding to the current environment using a depth camera, and then obtain at least one environmental edge line based on the depth images; the robot can also acquire multiple frames of RGB images of the current environment using an RGB camera, and then identify the RGB images using a pre-trained image recognition model to obtain at least one environmental edge line; the robot can also first identify the 2D image of the current environment, obtain the environmental edge line, and then convert the coordinates of each sampling point on the environmental edge line into 3D spatial coordinate data based on a predetermined transformation relationship, and then perform subsequent matching and positioning operations. The length of the environmental edge line acquired by the robot can be fixed or variable, depending on the actual application requirements or the detection results of the environmental edge line. Specifically, if the robot acquires the environmental edge line through its own installed sensors, the robot can pre-determine the relative positional relationship between the sensors and the robot. After the sensors collect the environmental edge line based on their positions, the relative position between the robot and the environmental edge line can be determined accordingly. The robot can also obtain an environmental map corresponding to the current environment based on the current positioning information. Obviously, the environmental map includes map edge lines corresponding to the environmental edge lines. The environmental edge lines and their corresponding map edge lines are used to represent the same lines in the current environment.

[0055] It's important to note that the environmental edge lines acquired by the robot at this stage are unprocessed lines that match the actual edges of objects in the environment. To accurately locate itself on the environmental map, the robot needs to match the acquired environmental edge lines with their corresponding map edge lines to determine the distance between them. However, if the environmental edge line is curved, its corresponding line on the environmental map will also be curved, and accurate matching between two curves is difficult. Therefore, the robot can further process the environmental edge lines in subsequent steps to calculate the distance between the environmental edge lines and the map edge lines.

[0056] The robot can acquire at least one environmental edge line within a preset distance range centered on its current location, based on limitations such as sensor accuracy or processor computing power. In other words, the area displayed by the robot's acquired environmental map is larger than the area formed by the environmental edge lines actually acquired by the robot; the environmental edge lines can be found as corresponding map edge lines within the environmental map. Specifically, environmental edge lines or map edge lines can be semantic lines in a semantic map or represented by multiple grids in a raster map, depending on the map format. The specific representation of environmental edge lines and map edge lines is not limited here.

[0057] Step S120: When the environment edge line is a curve, convert the environment edge line into a first polyline.

[0058] In this embodiment, for curved environmental edge lines, their corresponding map edge lines in the environmental map are also curved. However, it is difficult for a robot to directly match two curves or calculate the error distance between them. Therefore, the robot can convert curved environmental edge lines into a first polyline. Simultaneously, the robot can pre-convert curved map edge lines in the environmental map into polylines accordingly. Thus, the robot can then match the converted first polyline with its corresponding second polyline in the environmental map in subsequent steps. This simplifies the robot's localization calculation process while ensuring matching accuracy, effectively improving the robot's localization efficiency.

[0059] Understandably, if the environmental edge line captured by the sensor is a polyline, the robot can omit processing it and directly use it as the first polyline to match the corresponding second polyline in the environmental map. Conversely, if the environmental edge line captured by the sensor is a straight line, it can be treated as a special curve with zero curvature, and this straight-line environmental edge line can be directly used as the first polyline to match the corresponding second polyline in the environmental map.

[0060] In some implementations, the robot can convert curves into polylines in various ways. For example, an iterative adaptive point algorithm can be used to convert a curve-type environment edge line into a first polyline. Specifically, firstly, a straight line is drawn between the first and last points of the curve-type environment edge line. The distances from all other points to this line are calculated, and the largest distance is compared with a threshold. If the distance is greater than the threshold, the point with the largest distance is retained; otherwise, all points between the two ends of the line are discarded. Based on the retained points, the known curve is divided into two parts for processing. The above steps are repeated iteratively, that is, the largest distance is still compared with the threshold, and so on, until no points can be discarded. Finally, a first polyline that meets the preset accuracy limit is obtained.

[0061] Step S130: Match the first polyline with the second polyline in the environment map to obtain the matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environment edge line in the environment map.

[0062] In this embodiment, after converting the acquired environmental edge line into a first polyline, the robot can match the first polyline with a corresponding second polyline in the environmental map, that is, obtain the matching error distance between the first and second polylines. It is understood that if the robot's position in the environmental map coincides with its actual position, i.e., there is no positioning deviation, the first polyline should perfectly match the second polyline, meaning the matching error distance is zero. If the matching error distance between the first and second polylines is not zero, it indicates that there is a deviation between the robot's position in the environmental map and its actual position. Therefore, the robot can determine whether its position in the environmental map is accurate by obtaining the matching error distance between the first and second polylines, and can also correct its position based on the matching error distance between the first and second polylines.

[0063] In some implementations, the robot can pre-convert all the second edge lines in the environment map into second polylines. When the robot moves into the current environment and needs to perform positioning calibration, it can directly obtain the second polyline corresponding to the first polyline from the environment map after converting the acquired environment edge lines into first polylines, thereby reducing the calculation steps in the robot's positioning process.

[0064] Step S140: Determine the robot's position in the environment map based on the matching error distance.

[0065] In this embodiment, the matching error distance obtained by the robot based on the first and second broken lines can characterize the distance between the robot's position on the environmental map and its actual position. For example, if the robot obtains an environmental edge line representing a lane line in the current environment and converts it into a first broken line, this first broken line is located 1 meter to the left of the robot and parallel to the robot's direction of travel. However, the robot's positioning information on the environmental map shows that the distance between it and the second broken line corresponding to the map edge line representing the same lane line on the left is 1.5 meters. Obviously, the 0.5-meter difference between the two is the matching error distance between the first and second broken lines. Therefore, the robot can determine its accurate position on the environmental map based on the matching error distance between the first and second broken lines. At this time, the robot can adjust its position on the environmental map, moving it 0.5 meters to the left so that the adjusted position of the robot is 1 meter away from the left lane line.

[0066] It is understood that when the robot locates its position in the environmental map using the method provided in the embodiments of this application, it can be done either before the robot moves or continuously in real time during the robot's movement, and no specific limitation is made here.

[0067] In some implementations, the robot can also assess the matching error distance to confirm that it accurately reflects the distance between the robot's position on the environmental map and its actual position. That is, if the matching error distance is less than a preset threshold, the robot's position on the environmental map can be directly determined based on the matching error distance; if the matching error distance is greater than the preset threshold, it means the robot's position on the environmental map is far from the actual position determined by the sensor. This situation may be caused by a poor robot signal or positioning deviation. In this case, the robot can re-position itself on the environmental map, update the environmental map, or re-obtain the environmental edge lines based on the sensor to avoid significant errors in the robot's positioning process.

[0068] The positioning method provided in this application acquires the environmental edge line and the corresponding environmental map in the current environment. When the environmental edge line is a curve, it is converted into a first polyline. The first polyline is matched with a second polyline in the environmental map to obtain a matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. Based on the matching error distance, the position of the robot in a preset map is determined. By converting the environmental edge line in the current environment into a first polyline, and determining the matching error distance based on the first polyline and the second polyline corresponding to the first polyline in the environmental map, the accurate position of the robot in the environmental map can be determined. This method also enables continuous positioning of the robot during movement, effectively improving the accuracy of robot positioning.

[0069] Please see Figure 4 , Figure 4 A flowchart illustrating a positioning method provided in another embodiment of this application is shown below. Figure 4 The process shown will be explained in detail. The positioning method may specifically include the following steps:

[0070] Step S210: Obtain at least one environmental edge line in the current environment where the robot is located, and the environmental map corresponding to the current environment.

[0071] Step S220: When the environment edge line is a curve, convert the environment edge line into a first polyline.

[0072] In the embodiments of this application, steps S210 and S220 can be referred to the contents of other embodiments, and will not be repeated here.

[0073] Step S230: Sample the first broken line to obtain multiple sampling points on the first broken line.

[0074] In this embodiment, the second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. Since both the first and second polylines include at least one polyline segment, and the length and direction of each polyline segment may be different, the robot can convert the calculation of the matching error distance between the first and second polylines into the calculation of the distances between multiple sampling points on the first polyline and the second polyline, and then determine the matching error distance between the first and second polylines based on the distances between the multiple sampling points and the second polyline. Therefore, the robot can sample the first polyline to obtain multiple sampling points on the first polyline, so as to facilitate the subsequent determination of the distance between each sampling point and the second polyline. Here, multiple means two or more. Specifically, the robot can obtain multiple sampling points with the same spacing on the first polyline according to a preset interval length, or it can set the size of the interval distance between the sampling points based on the distance between the sampling points and the robot. For example, on the polyline segments on the first polyline where the distance between the robot and the robot is greater than the preset distance, sampling can be performed according to the first interval distance, and on the polyline segments where the distance between the robot and the robot is less than or equal to the preset distance, sampling can be performed according to the second interval distance which is less than the first interval distance. The robot can also use other methods to sample the first polyline; no specific sampling method or strategy is restricted here. Understandably, the smaller the spacing between sampling points, the more accurate the matching error distance between the obtained first and second polylines.

[0075] Step S240: Obtain the first distance between multiple sampling points on the first broken line and the second broken line.

[0076] In this embodiment, after the robot samples multiple sampling points on the first polyline, it can obtain a first distance between each sampling point and the second polyline based on the position of each sampling point. Since the second polyline also includes at least one polyline segment, the first distance between each sampling point and the second polyline can also be obtained from the second distance between each sampling point and each corresponding polyline segment on the second polyline. For example... Figure 5 As shown, the specific method for obtaining the first distance can be referred to the following steps:

[0077] Step S241: Obtain the second distance between the target sampling point and multiple line segments on the second broken line, thus obtaining multiple second distances corresponding to the target sampling point.

[0078] In this embodiment, the target sampling point is any sampling point on the first polyline. Both the first and second polylines include multiple different polyline segments, where "multiple" refers to two or more segments. The robot can determine the distance between the target sampling point and the entire second polyline by obtaining the second distance between the target sampling point and each polyline segment on the second polyline. It is understood that the first polyline includes multiple different polyline segments, and the target sampling point must lie on one of these segments. The distance between the target sampling point and each polyline segment on the second polyline can also be determined using different methods based on the different positional relationships between the target sampling point's position on the first polyline and the various polyline segments in the second polyline. For example,... Figure 6 As shown, the second distance between the target sampling point and each segment of the second polyline can be obtained through the following steps:

[0079] Step S2411: Obtain the projection point of the target sampling point on the target polyline segment, and obtain the third distance between the projection point and the two endpoints of the target polyline segment.

[0080] In this embodiment, the target polyline segment is any polyline segment on the second polyline. The robot can convert the matching error distance between the first and second polylines into a first distance between any target sampling point on the first polyline and the second polyline. Furthermore, the robot can convert the first distance between the target sampling point and the second polyline into a second distance between the target sampling point and any target polyline segment on the second polyline. Clearly, the robot cannot directly use the projection distance from the target sampling point to the straight line containing the target polyline segment as the second distance between the target sampling point and the target polyline segment; it needs to determine this second distance based on the relative positional relationship between the target polyline segment and the target sampling point. Specifically, the robot can first obtain the projection point of the target sampling point on the target polyline segment. Obviously, this projection point can be located inside or outside the target polyline segment. The robot can use different methods to determine the second distance between the target sampling point and the target polyline segment depending on the location of the projection point. Therefore, the robot can also obtain the third distances between the projection point and the two endpoints of the target polyline segment. Obviously, the target polyline segment includes two endpoints. Therefore, the robot can obtain two third distances based on the target sampling point and the target polyline segment, and then determine the positional relationship between the projection point and the target polyline segment based on the third distances.

[0081] Step S2412: If the third distances corresponding to the projection points are all less than or equal to the length of the target polyline segment, then determine the distance between the target sampling point and the projection point as the second distance between the target sampling point and the target polyline segment.

[0082] In this embodiment, if both third distances corresponding to the projection point are less than or equal to the length of the target polyline segment, it means that the projection point corresponding to the target sampling point on the target polyline segment is located inside the target polyline segment. In this case, the robot can directly use the projection distance from the target sampling point to the target polyline segment as the second distance between the target sampling point and the target polyline segment, that is, use the distance between the target sampling point and the projection point on the target polyline segment as the second distance. Figure 7 As shown, the projection point of the target sampling point P on the target polyline segment MN is Q. The lengths of line segments MQ and NQ are both less than or equal to the length of the target polyline segment MN. That is, the projection point Q is located between the two endpoints M and N of the target polyline segment, indicating that the spatial position between the target sampling point and the target polyline segment is also close. At this time, the robot can directly use the projection distance PQ from the target sampling point to the target polyline segment as the second distance between the target sampling point and the target polyline segment.

[0083] Step S2413: If either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then obtain the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment respectively, and determine the smallest fourth distance among the fourth distances corresponding to the target sampling point as the second distance between the target sampling point and the target polyline segment.

[0084] In this embodiment of the application, if either of the two third distances corresponding to the projection point of the target sampling point on the target polyline segment is greater than the length of the target polyline segment, that is, if the distance between one of the two endpoints of the target polyline segment and the projection point is greater than the length of the target polyline segment, it indicates that the projection point is located outside the target polyline segment, meaning that the target sampling point is far away from the target polyline segment in space. Figure 8 As shown, the projection point Q of the target sampling point P on the first broken line segment is located outside the two endpoints of the target broken line segment. It can be seen that point Q is outside the two endpoints of the target broken line segment, meaning there exists an endpoint M on the target broken line segment such that the length of segment MQ is greater than the length of MN. In this case, the robot can obtain the fourth distances between the target sampling point and the two endpoints of the target broken line segment, and select the smaller of these fourth distances as the second distance between the target sampling point and the target broken line segment. In other words, the robot can obtain the fourth distances between the target sampling point P and endpoints M and N, respectively, and select the smaller of these fourth distances, PN, as the second distance between the target sampling point P and the target broken line segment MN.

[0085] In some implementations, if the distance between the target endpoint of the target polyline segment and the target projection point is greater than the length of the target polyline segment, the robot needs to select one of the endpoints on the target polyline segment and use the distance between the target sampling point and that endpoint as the second distance between the target sampling point and the target polyline segment. In this case, the robot can further eliminate potential external interference through the following steps to make the final second distance, as well as the further obtained first distance and matching error distance, more accurate:

[0086] If either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then the fourth distances between the target sampling point and the two endpoints of the target polyline segment are obtained respectively, and the target endpoint of the target polyline segment corresponding to the smallest of the two fourth distances corresponding to the target sampling point is determined; if the target endpoint is not the start or end point of the second polyline, then the smallest of the two fourth distances corresponding to the target sampling point is taken as the second distance between the target sampling point and the target polyline segment; if the target endpoint is the start or end point of the second polyline, then the target sampling point is deleted from the first polyline.

[0087] Specifically, before determining the second distance between the target sampling point and the target polyline segment based on the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment, the robot should also consider the position of the target polyline segment within the second polyline. If the target polyline segment is located at the head or tail of the second polyline, meaning one endpoint of the target polyline segment is the endpoint (start or end) of the entire second polyline, then to ensure the accuracy of the second distance corresponding to each sampling point, the robot cannot directly use the fourth distance between the endpoints of the target sampling point and the target polyline segment as the second distance between the target sampling point and the target polyline segment. Figure 9 As shown, the endpoint Q of the target polyline segment is also the endpoint of the second polyline. Therefore, the distance between the target sampling point P and the target polyline segment cannot be represented by the distance between P and Q. In this case, the robot can directly delete the target sampling point P from the first polyline, meaning that when calculating the matching error distance between the first and second polylines, the data of the target sampling point P is no longer referenced.

[0088] Step S242: Obtain the reference angle between the first and second polyline segments where the target sampling point is located.

[0089] In this embodiment, the second segment is any segment on the second broken line. After obtaining the second distance between the target sampling point and each segment on the second broken line, the robot can also obtain the reference angle between the first segment of the first broken line where the target sampling point is located and any segment of the second broken line. This reference angle is used to determine the positional relationship between the first and second broken line segments, adjust the reference distance between the target sampling point and the second broken line segment, and thus make the matching error distance between the first and second broken lines more accurate.

[0090] Specifically, such as Figure 10 As shown, the second distance between the target sampling point P and the second broken line segment m is the length of line segment PM, and the second distance between the target sampling point P and the second broken line segment n is the length of line segment PN. If the second broken line only includes the second broken line segments m and n, then obviously the first distance between the target sampling point and the second broken line should be the length of PN, that is, the smaller of the multiple second distances is selected as the first distance from the target sampling point to the second broken line. However, there are some cases, such as... Figure 11 As shown, the second distance between the target sampling point P and the second broken line segment m is the length of line segment PM, and the second distance between the target sampling point P and the second broken line segment n is the length of line segment PN. The length of PM is greater than the length of PN. However, it is clear that the second broken line segment m is the part of the first broken line segment l where the target sampling point is located in the actual environment. If the smallest second distance is directly selected as the first distance between the target sampling point and the second broken line, then this first distance cannot truly reflect the matching error distance between the first and second broken lines. Therefore, after determining the second distances between the target sampling point and each second broken line segment on the second broken line, the robot can also obtain the reference angle between the first and second broken line segments where the target sampling point is located. This reference angle is used to determine the actual positional relationship between the first and second broken line segments, and then the multiple second distances obtained for the target sampling point are adjusted to make the final first distance between the target sampling point and the second broken line more accurate.

[0091] Step S243: If the reference angle is greater than the preset angle, then update the second distance between the target sampling point and the second broken line segment to the preset distance.

[0092] In this embodiment, based on the above analysis, if the reference angle between the first segment of the broken line where the target sampling point is located and the second segment of the second broken line is greater than a preset angle, then the areas of the road edge lines in the actual environment represented by the first segment and the second segment may be different. Even if the second distance between the target sampling point and the second segment is the smallest among all the second distances corresponding to the target sampling point, the robot can update the reference distance between the target sampling point and the second segment to a preset distance based on the difference between the edge lines in the current environment actually represented by the first segment and the second segment. This ensures that when the robot selects the smallest second distance from multiple second distances corresponding to the target sampling point in subsequent steps, it will not select the second distance between the target sampling point and the second segment. The preset distance can be the average of the second distances obtained by the robot during multiple localization processes, or it can be the maximum value of the second distances that can be stored in the storage medium.

[0093] Step S244: Determine the smallest second distance among multiple second distances corresponding to the target sampling point, and use it as the first distance between the target sampling point and the second broken line.

[0094] In this embodiment of the application, after the robot obtains multiple second distances corresponding to the target sampling point through the above steps, it can select the smallest reference distance as the first distance between the target sampling point and the second broken line. For example... Figure 12 As shown, the first broken line A includes P1 to P... n Multiple sampling points are used, and the first distance between each sampling point and the second piecewise linear B is obtained based on the above method, which are d1 to d2 respectively. n The robot can determine the matching error distance between the first and second broken lines based on the first distance between each sampling point and the second broken line.

[0095] Step S250: Based on the first distances corresponding to multiple sampling points, determine the matching error distance between the first and second polylines; based on the matching error distance, determine the robot's position in the environmental map.

[0096] In this embodiment, after determining the first distance between each sampling point in the first fold line and the second fold line, the robot can further determine the matching error distance between the first fold line and the second fold line, and then adjust the robot's position in the environmental map based on the matching error distance. It is understood that, excluding interference from special cases, the first distance between each target sampling point and the second fold line can, to some extent, reflect the overall distance relationship between the first fold line and the second fold line.

[0097] In some implementations, the matching error distance between the first and second polyline can be determined by: determining the average distance between each sampling point and the second polyline, and using the average value as the distance between the first and second polyline.

[0098] In some implementations, if the matching error distance is greater than a preset threshold, the robot can adjust its position on the environmental map based on the matching error distance.

[0099] Specifically, if the matching error distance between the first and second broken lines is greater than a preset threshold, it indicates that the environmental edge line acquired by the robot in the current environment does not coincide with the corresponding map edge line in the environmental map. In other words, the robot's position in the environmental map does not accurately reflect its true position in the current environment. Therefore, the robot can adjust its position in the environmental map based on the matching error distance to achieve precise robot localization. Understandably, if the matching error distance is small, it may be due to calculation errors during the calculation process, or it may be a small error caused by precision limitations when the sensor acquires the environmental edge line. In this case, the robot can ignore this small matching error distance.

[0100] In general, such as Figure 13 As shown in the figure, the box represents the robot, the arrow indicates the robot's movement direction, the dashed line represents the first polygonal line in the current environment collected by the robot, and the solid line represents the second polygonal line corresponding to the first polygonal line in the environment map. It can be seen that the first and second polygonal lines do not coincide, meaning there is a deviation in the robot's localization. In this case, the robot can use the localization method provided in this application to obtain the matching error distance between the first and second polygonal lines, and then adjust the robot's position in the environment map, such as... Figure 14 As shown, the robot's position on the environment map can be moved downwards so that the first fold line coincides with the second fold line, thus making the robot's positioning on the environment map more accurate.

[0101] The positioning method provided in this application acquires the environmental edge line collected by the robot in the current environment, converts it into a first polyline, obtains the second distance between each sampling point on the first polyline and each polyline segment in the second polyline, determines the first distance between each sampling point and the second polyline, and then determines the matching error distance between the first polyline and the second polyline based on the average of the first distances between multiple sampling points and the second polyline. Thus, the position of the robot in the environmental map is determined based on the matching error distance, which can achieve accurate positioning of the robot in the environmental map and continuous positioning during robot movement, effectively improving the accuracy of robot positioning.

[0102] Please see Figure 15 , Figure 15 This paper presents a schematic flowchart of a positioning method provided in another embodiment of this application. The following will focus on... Figure 15 The process shown will be explained in detail. The positioning method may specifically include the following steps:

[0103] Step S310: Obtain at least one environmental edge line in the current environment where the robot is located, and the environmental map corresponding to the current environment.

[0104] Step S320: When the environmental edge line is a curve, convert the environmental edge line into a first polyline.

[0105] Step S330: Match the first polyline with the second polyline in the environment map to obtain the matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environment edge line in the environment map.

[0106] Step S340: Determine the position of the robot in the environment map based on the matching error distance.

[0107] In the embodiments of this application, steps S310 and S340 can be referred to the contents of other embodiments, and will not be repeated here.

[0108] Step S350: Obtain the fifth distance corresponding to multiple sampling points on the first fold line. The fifth distance is the projection length of the target connection line on the second fold line. The target connection line is the connection between the first position of the same sampling point before the robot adjusts its position and the second position after the robot adjusts its position.

[0109] In this embodiment, after determining the matching error distance between the first and second broken lines, the robot can adjust its position on the environmental map based on this distance. It is understood that even after determining the matching error distance, the robot may not be able to adjust its position accurately in one go; the position adjustment may involve multiple adjustments. In this case, to ensure that the robot can gradually reduce the matching error distance during multiple adjustments, the robot can determine the comprehensive error of its current position adjustment based on the first position of the same sampling point on the first broken line before the robot's adjustment and the second position after the robot's adjustment. This allows the robot to continuously optimize its position on the environmental map based on the comprehensive error. Specifically, the robot can determine the offset of its current position adjustment based on the projection length of the line connecting the first and second positions corresponding to the same sampling point on the second broken line.

[0110] Understandably, typically, when a robot adjusts its position based on the matching error distance between the first and second fold lines, it aims to position the first fold line perpendicular to the second fold line. Figure 16 As shown, ideally, the first broken line m should be located at position m' after adjustment. However, in reality, because the robot may continue to move forward during the adjustment process, the actual adjusted position of the first broken line m may deviate from m', such as... Figure 17 The broken line "m" is shown in the figure.

[0111] Clearly, the robot's position adjustment process based on the matching error distance is not completed in one go, but rather in segments and multiple times. For example... Figure 17 As shown, the robot can first adjust the first fold line m to the middle position m', and then adjust the first fold line at m' to the final position m”. Therefore, during the adjustment process, the robot has the opportunity to adjust the position of the first fold line in real time to finally adjust the first fold line to the final position m”. Figure 16 At position m' in the diagram. Specifically, after each position adjustment, the robot can obtain the projection length of the line connecting the first and second positions corresponding to each sampling point on the second fold line, so as to determine the overall error of this adjustment based on the fifth distance corresponding to each sampling point.

[0112] It is worth noting that the positioning method provided in this embodiment is applied to cases where the environmental edge line is a straight line. Obviously, if the environmental edge line is a straight line, its corresponding map edge line in the environmental map is also a straight line. If there is a matching error distance between the environmental edge line and the corresponding map edge line, then... Figure 16 and Figure 17 As shown, even if the robot adjusts its position to align the environmental edge with the map edge, there may still be forward or backward offsets or misalignments between the two edges. These offsets and misalignments are not reflected in the matching error distance. Therefore, when the environmental edge is a straight line, after determining the matching error distance, the robot can further determine the comprehensive error based on the fifth distance. This comprehensive error can then be used to adjust the robot's position on the environmental map, avoiding offsets and misalignments between straight lines and making the robot's positioning on the environmental map more accurate.

[0113] Step S360: Based on the fifth distance and the first distance corresponding to each sampling point, determine the comprehensive error corresponding to the first piecewise linear line.

[0114] In this embodiment, after the robot obtains the fifth distance corresponding to each sampling point after one adjustment, it can determine the comprehensive error corresponding to the first polygonal line based on the fifth distance and the first distance corresponding to the same sampling point. The first distance can be obtained through the steps of the above embodiments and will not be specifically described here. In some implementations, the robot can use the sum of the squares of the fifth distance and the first distance as the sixth distance, and determine the comprehensive error corresponding to the first polygonal line based on the sixth distance corresponding to each sampling point on the first polygonal line. This can be achieved by using the sum of the sixth distances corresponding to each sampling point on the first polygonal line as the comprehensive error, or by using the average of the sixth distances corresponding to each sampling point on the first polygonal line as the comprehensive error. The specific calculation method for determining the comprehensive error based on the sixth distance is not limited here. For example... Figure 17 As shown, for the same sampling point A on the first zigzag line, its first distance at the initial position is 'a'. After the robot adjusts it to the middle position, the fifth distance corresponding to sampling point A is 'a'. The robot can then obtain the sixth distance corresponding to sampling point A based on the first distance 'a' and the fifth distance 'a', which is the square of the distance moved between the previous and current positions of sampling point A during the first adjustment process. The robot can obtain the sixth distance corresponding to each sampling point on the first zigzag line using the same method, and then determine the comprehensive error corresponding to the first zigzag line based on the sixth distance corresponding to each sampling point. Clearly, since the robot considers the offset of the sampling point during the adjustment process when calculating the sixth distance corresponding to each sampling point, the comprehensive error corresponding to the first zigzag line is also affected by the offset of each sampling point. Therefore, the robot can subsequently adjust the position of the first zigzag line based on the comprehensive error of the first zigzag line to minimize the offset of the final adjusted first zigzag line.

[0115] Step S370: Based on the comprehensive error, adjust the robot's position on the environmental map until the comprehensive error is less than the preset error distance.

[0116] In this embodiment, according to the calculation process of the comprehensive error, if the robot has adjusted the first fold line to the position where it coincides with the second fold line, but the comprehensive error of the first fold line is still greater than or equal to the preset error distance, it indicates that there is an offset between the first fold line and the second fold line. That is, even if the positions of the first fold line and the second fold line coincide, there may still be a positional offset between them. At this time, the robot still needs to continue adjusting the position of the first fold line on the second fold line based on the comprehensive error until the comprehensive error corresponding to the first fold line is less than the preset error distance. Only then can the robot determine that the first fold line has been adjusted to the matching position on the second fold line. For example... Figure 17As shown, the robot adjusted the position of the first fold line twice to make it coincide with the second fold line, but there was still a misalignment between the two fold lines after the adjustment. The robot can determine the magnitude of the misalignment between the first and second fold lines by the comprehensive error corresponding to the first fold line, and then reduce the degree of misalignment during the adjustment of the first fold line. Specifically, as... Figure 18 As shown, after the robot adjusts the position of the first broken line m for the first time, it obtains the first broken line m' located in the middle position. At this time, the robot can determine whether the adjustment is appropriate based on the comprehensive error between m and m'. If the comprehensive error corresponding to the first broken line is greater than or equal to the preset error distance, the robot continues to adjust the position of the first broken line m' to return it to the position of m”. At this time, the comprehensive error corresponding to the first broken line is less than the preset error distance, and the robot can complete the position adjustment of the first broken line.

[0117] The positioning method provided in this application, when the environmental edge line is a straight line, after the robot determines the matching error distance, can determine the comprehensive error corresponding to the first broken line based on the fifth distance and the first distance corresponding to each sampling point on the first broken line. Then, based on the comprehensive error, the robot's position in the environmental map is adjusted until the comprehensive error is less than a preset error distance. Therefore, by adjusting the robot's position through the comprehensive error, it can be ensured that the first broken line (a straight line) in the environmental map can also accurately and without offset coincide with the second broken line, further improving the accuracy of robot positioning.

[0118] Please see Figure 19 The diagram illustrates a structural block diagram of a positioning device 200 provided in an embodiment of this application. The positioning device 200 includes: an edge line acquisition module 210, an edge line conversion module 220, a polyline matching module 230, and a position determination module 240. The edge line acquisition module 210 is used to acquire at least one environmental edge line in the current environment where the robot is located, and the environmental map corresponding to the current environment. The edge line conversion module 220 is used to convert the environmental edge line into a first polyline when the environmental edge line is a curve. The polyline matching module 230 is used to match the first polyline with a second polyline in the environmental map to obtain a matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. The position determination module 240 is used to determine the position of the robot in the environmental map based on the matching error distance.

[0119] In one possible implementation, the polyline matching module 230 includes a sampling point determination unit, a distance acquisition unit, and an error determination unit. The sampling point determination unit samples a first polyline to obtain multiple sampling points on the first polyline; the distance acquisition unit acquires first distances between the multiple sampling points on the first polyline and a second polyline; and the error determination unit determines the matching error distance between the first polyline and the second polyline based on the first distances corresponding to the multiple sampling points.

[0120] In one possible implementation, the distance acquisition unit includes a reference distance acquisition component and a distance determination component. The reference distance acquisition component acquires a second distance between a target sampling point and multiple line segments on a second broken line, thus obtaining multiple second distances corresponding to the target sampling point, where the target sampling point is any sampling point on a first broken line. The distance determination component determines the smallest second distance among the multiple second distances corresponding to the target sampling point, using this smallest distance as the first distance between the target sampling point and the second broken line.

[0121] In one possible implementation, the reference distance acquisition component is further configured to acquire the projection point corresponding to the target sampling point on the target polyline segment, and acquire the third distances corresponding to the two endpoints of the projection point and the target polyline segment, wherein the target polyline segment is any polyline segment on the second polyline; if the third distances corresponding to the projection point are all less than or equal to the length of the target polyline segment, then the distance between the target sampling point and the projection point is determined as the second distance between the target sampling point and the target polyline segment; if either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment are acquired, and the smallest fourth distance among the fourth distances corresponding to the target sampling point is determined as the second distance between the target sampling point and the target polyline segment.

[0122] In one possible implementation, the reference distance acquisition component is further configured to: if either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, acquire the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment, and determine the target endpoint of the target polyline segment corresponding to the smallest of the two fourth distances corresponding to the target sampling point; if the target endpoint is not the start or end point of the second polyline, take the smallest of the two fourth distances corresponding to the target sampling point as the second distance between the target sampling point and the target polyline segment; if the target endpoint is the start or end point of the second polyline, delete the target sampling point from the first polyline.

[0123] As one possible implementation, the distance acquisition unit further includes an angle acquisition component and a distance update component. The angle acquisition component is used to acquire a reference angle between the target sampling point and the second polyline segment. The distance update component is used to update the second distance between the target sampling point and the second polyline segment to a preset distance if the reference angle is greater than a preset angle.

[0124] In one possible implementation, the positioning device 200 further includes a fifth distance determination module, a comprehensive error determination module, and a position adjustment module. The fifth distance determination module acquires the fifth distances corresponding to multiple sampling points on the first zigzag line. The fifth distance is the projected length of the target line on the second zigzag line, where the target line is the line connecting the first position of the same sampling point before the robot's position adjustment and the second position after the robot's position adjustment. The comprehensive error determination module determines the comprehensive error corresponding to the first zigzag line based on the fifth distance and the first distance for each sampling point. The position adjustment module adjusts the robot's position on the environmental map based on the comprehensive error until the comprehensive error is less than a preset error distance.

[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0126] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0127] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0128] In summary, the solution provided in this application obtains at least one environmental edge line in the robot's current environment and the corresponding environmental map. When the environmental edge line is curved, it is converted into a first polyline. The first polyline is matched with a second polyline in the environmental map to obtain a matching error distance. The second polyline is obtained by converting the map edge line corresponding to the environmental edge line in the environmental map. Based on the matching error distance, the robot's position in a preset map is determined. By converting the environmental edge line in the current environment into a first polyline, and determining the matching error distance based on the first polyline and the second polyline corresponding to the first polyline in the environmental map, the accurate position of the robot in the environmental map can be determined. This also enables continuous localization of the robot during movement, effectively improving the accuracy of robot localization.

[0129] Please refer to Figure 20 This document illustrates a structural block diagram of a robot 100 provided in an embodiment of this application. The robot 100 in this application may include one or more of the following components: a body 110, and a control system 120 communicating with the body 110. The control system 120 includes a processor 121 and a memory 122 communicating with the processor 121. The memory 122 is used to store instructions, and when the stored instructions are executed on the processor 121, the processor 121 may perform the methods described in the foregoing method embodiments.

[0130] Processor 121 may include one or more processing cores. Processor 121 connects to various parts of the computer device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 122, and by calling data stored in memory 122. Optionally, processor 121 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 121 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 121 and may be implemented separately using a communication chip.

[0131] The memory 122 may include random access memory (RAM) or read-only memory (ROM). The memory 122 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 122 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created during the use of the computer device (such as phonebook data, audio and video data, chat log data, etc.).

[0132] Please refer to Figure 21This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0133] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A positioning method, characterized in that, Applied to robots, the method includes: Obtain at least one environmental edge line in the current environment where the robot is located, and the environmental map corresponding to the current environment; When the environmental edge line is a curve, the environmental edge line is converted into a first polyline; The first polyline is matched with the second polyline in the environment map to obtain the matching error distance. The second polyline is obtained by converting the map edge line in the environment map that corresponds to the environment edge line. The step of matching the first polyline with the second polyline in the environment map to obtain the matching error distance includes: The first polyline is sampled to obtain multiple sampling points on the first polyline; Obtain the first distance between the plurality of sampling points on the first polyline and the second polyline; Based on the first distance corresponding to the plurality of sampling points, the matching error distance between the first polyline and the second polyline is determined; Based on the matching error distance, the position of the robot in the environmental map is determined; After determining the robot's position in the environmental map based on the matching error distance, the method further includes: Obtain the fifth distance corresponding to multiple sampling points on the first fold line. The fifth distance is the projection length of the target line on the second fold line. The target line is the line connecting the same sampling point at its first position before the robot adjusts its position and at its second position after the robot adjusts its position. Based on the fifth distance and the first distance corresponding to each sampling point, the comprehensive error corresponding to the first polyline is determined; Based on the overall error, the position of the robot in the environmental map is adjusted until the overall error is less than a preset error distance.

2. The method according to claim 1, characterized in that, The second polyline includes multiple polyline segments, and obtaining the first distance between the multiple sampling points on the first polyline and the second polyline includes: Obtain the second distance between the target sampling point and multiple line segments on the second line, and obtain multiple second distances corresponding to the target sampling point, wherein the target sampling point is any sampling point on the first line. The smallest second distance among the multiple second distances corresponding to the target sampling point is determined as the first distance between the target sampling point and the second polyline.

3. The method according to claim 2, characterized in that, The step of obtaining the second distance between the target sampling point and each of the polyline segments on the second polyline includes: Obtain the projection point of the target sampling point on the target polyline segment, and obtain the third distance between the projection point and the two endpoints of the target polyline segment respectively, wherein the target polyline segment is any polyline segment on the second polyline; If the third distances corresponding to the projection points are all less than or equal to the length of the target polyline segment, then the distance between the target sampling point and the projection point is determined as the second distance between the target sampling point and the target polyline segment; If either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment are obtained respectively, and the smallest fourth distance among the fourth distances corresponding to the target sampling point is determined as the second distance between the target sampling point and the target polyline segment.

4. The method according to claim 3, characterized in that, If either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then the fourth distances corresponding to the two endpoints of the target sampling point and the target polyline segment are obtained respectively, and the smallest matching distance among the two fourth distances corresponding to the target sampling point is determined as the second distance between the target sampling point and the target polyline segment, including: If either of the two third distances corresponding to the projection point is greater than the length of the target polyline segment, then the fourth distances between the target sampling point and the two endpoints of the target polyline segment are obtained respectively, and the target endpoint of the target polyline segment corresponding to the smallest of the two fourth distances corresponding to the target sampling point is determined. If the target endpoint is not the start or end point of the second polyline, then the smallest of the two fourth distances corresponding to the target sampling point is taken as the second distance between the target sampling point and the target polyline segment. The method further includes: If the target endpoint is the start or end point of the second polyline, then the target sampling point is deleted from the first polyline.

5. The method according to claim 2, characterized in that, Before determining the smallest second distance among multiple second distances corresponding to the target sampling point, the method further includes: Obtain the reference angle between the first and second polyline segments containing the target sampling point; If the reference angle is greater than the preset angle, the second distance between the target sampling point and the second polyline segment is updated to the preset distance.

6. A positioning device, characterized in that, The device includes: an edge line acquisition module, an edge line conversion module, a polyline matching module, a position determination module, a fifth distance determination module, a comprehensive error determination module, and a position adjustment module. The edge line acquisition module is used to acquire at least one environmental edge line in the current environment where the robot is located, as well as the environmental map corresponding to the current environment; The edge line conversion module is used to convert the environmental edge line into a first polyline when the environmental edge line is a curve; The polyline matching module is used to match the first polyline with a second polyline in the environment map to obtain a matching error distance, wherein the second polyline is obtained by converting the map edge line corresponding to the environment edge line in the environment map; the step of matching the first polyline with the second polyline in the environment map to obtain a matching error distance includes: sampling the first polyline to obtain multiple sampling points on the first polyline; obtaining a first distance between the multiple sampling points on the first polyline and the second polyline respectively; and determining the matching error distance between the first polyline and the second polyline based on the first distances corresponding to the multiple sampling points respectively. The location determination module is used to determine the position of the robot in the environmental map based on the matching error distance; The fifth distance determination module is used to determine the position of the robot in the environment map based on the matching error distance, and then obtain the fifth distance corresponding to multiple sampling points on the first polyline. The fifth distance is the projection length of the target line on the second polyline. The target line is the line connecting the same sampling point at the first position before the robot adjusts its position and the second position after the robot adjusts its position. The comprehensive error determination module is used to determine the comprehensive error corresponding to the first polyline based on the fifth distance and the first distance corresponding to each sampling point; The position adjustment module is used to adjust the position of the robot in the environmental map based on the comprehensive error until the comprehensive error is less than a preset error distance.

7. A robot, characterized in that, The robot includes: body; A control system in communication with the fuselage, the control system comprising a processor and a memory in communication with the processor, the memory storing instructions which, when executed on the processor, cause the processor to perform the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for calculating Hausdorff distance approximate value between Bezier curves

    CN101916310A

  • Road matching method based on GIS (Geographic Information System)

    CN102155950A

  • Map matching method and device, computer equipment and storage medium

    CN115326082A

  • Vehicle positioning correction method, storage medium and terminal equipment

    CN116105755A