Robot escape method, device, terminal equipment and readable storage medium
By acquiring and processing trajectory and laser point data during robot movement, a convex polygon region is formed to determine the target trajectory point, thus solving the problem of reliable robot escape when obstructed and achieving efficient escape effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UBTECH ROBOTICS CORP LTD
- Filing Date
- 2022-12-28
- Publication Date
- 2026-05-12
AI Technical Summary
When performing tasks, robots are easily blocked by soft obstacles, making it difficult for them to reliably navigate away from trapped areas.
By acquiring trajectory positioning data and laser point pose positioning data during the robot's movement, downsampling and distance expansion are performed to form a convex polygon region, and the first and second target trajectory points are determined. The robot is then controlled to move to these points to escape the obstacle.
This improves the robot's reliability in escaping obstacles when the lidar is blocked, ensuring that the robot can reliably leave enclosed areas.
Smart Images

Figure CN116069026B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of robotics technology, and in particular relates to a method, apparatus, terminal device and readable storage medium for a robot to escape from trouble. Background Technology
[0002] Robot obstacle avoidance control is an important research direction to help robots successfully complete tasks. Related technologies often use data scanned by lidar or other sensors to navigate away from stuck areas. However, when performing tasks, robots sometimes crawl under beds or behind fluttering curtains, where the lidar or other sensors are blocked by the hanging sheets or curtains, making it difficult to navigate away from the stuck area and thus resulting in low reliability. Summary of the Invention
[0003] This application provides a method, apparatus, terminal device, and readable storage medium for robot extrication from difficult situations, which can solve the problem of insufficient reliability of robot extrication methods in related technologies.
[0004] The first aspect of this application provides a method for robot extrication from trouble, comprising: acquiring trajectory positioning data of trajectory points recorded during robot movement; acquiring pose positioning data of laser points collected during robot movement; if the robot is located in an enclosed area, downsampling the laser points and performing distance expansion on the downsampling laser points to obtain target laser points, the target laser points being connected to form a convex polygonal region where the robot is located; determining a first target trajectory point and a second target trajectory point from the trajectory points based on the trajectory positioning data, the first target trajectory point being located within the convex polygonal region and the second target trajectory point being located outside the convex polygonal region; controlling the robot to move towards the first target trajectory point and then towards the second target trajectory point.
[0005] A robot extrication device provided in the second aspect of this application includes: a trajectory positioning unit for acquiring trajectory positioning data of trajectory points recorded during robot movement; a pose positioning unit for acquiring pose positioning data of laser points collected during robot movement; a laser point processing unit for downsampling the laser points and performing distance expansion on the downsampling laser points to obtain target laser points if the robot is located in an enclosed area, wherein the target laser points are connected to form a convex polygonal region where the robot is located; a trajectory point processing unit for determining a first target trajectory point and a second target trajectory point from the trajectory points based on the trajectory positioning data, wherein the first target trajectory point is located within the convex polygonal region and the second target trajectory point is located outside the convex polygonal region; and an extrication control unit for controlling the robot to move towards the first target trajectory point and towards the second target trajectory point.
[0006] A third aspect of this application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described robot escape method.
[0007] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described robot escape method.
[0008] The fifth aspect of this application provides a computer program product that, when run on a terminal device, causes the terminal device to execute the robot escape method described in the first aspect above.
[0009] In the embodiments of this application, by acquiring trajectory positioning data of trajectory points and pose positioning data of laser points recorded during robot movement, if the robot is located in a closed area, the laser points are downsampled and the distance of the downsampled laser points is expanded to obtain target laser points. The target laser points are connected to form a convex polygonal region where the robot is located. The convex polygonal region may include the aforementioned closed area. Therefore, based on the trajectory positioning data, a first target trajectory point within the convex polygonal region and a second target trajectory point outside the convex polygonal region are determined from the trajectory points. The robot is controlled to move towards the first target trajectory point and then towards the second target trajectory point. Even when the laser radar is blocked, a movement method for escaping the obstacle can still be provided. Therefore, the reliability of the robot escaping the obstacle is high. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0011] Figure 1 This is a schematic diagram illustrating the implementation process of a robot extrication method provided in an embodiment of this application;
[0012] Figure 2 This is a schematic diagram illustrating the specific implementation process of step S103 provided in the embodiments of this application;
[0013] Figure 3 This is a schematic diagram illustrating the specific implementation process of step S104 provided in the embodiments of this application;
[0014] Figure 4This is a schematic diagram of the structure of a robot extrication device provided in an embodiment of this application;
[0015] Figure 5 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are protected by this application.
[0017] To illustrate the technical solution of this application, specific embodiments are described below.
[0018] Figure 1 The illustration shows a schematic diagram of the implementation process of a robot extrication method provided in an embodiment of this application. This method can be applied to terminal devices and is applicable to situations where it is necessary to improve the reliability of robot extrication.
[0019] The aforementioned terminal equipment can refer to a robot or a robot dispatching device, such as a smart device like a mobile phone, computer, or tablet. It should be understood that the aforementioned robot can be a delivery robot, cleaning robot, guidance robot, inspection robot, or other types of robot; this application does not impose any restrictions on this.
[0020] Specifically, the above-mentioned method for the robot to escape from a difficult situation may include the following steps S101 to S105.
[0021] Step S101: Obtain trajectory positioning data of trajectory points recorded during robot movement.
[0022] Specifically, during the execution of a task, the robot can record trajectory points along its movement path using its own positioning system, obtaining trajectory positioning data for each point. For example, the robot can record a trajectory point every 0.5 meters it moves, forming trajectory positioning data L1 for each point in its movement path.
[0023] For example, the robot can collect point cloud data using its own LiDAR and perform localization based on the point cloud data to obtain the trajectory localization data of each trajectory point. Alternatively, the robot can determine the trajectory localization data of each trajectory point using visual SLAM (simultaneous localization and mapping).
[0024] It should be noted that the trajectory positioning data L1 can include the location of each trajectory point.
[0025] Step S102: Obtain the pose and positioning data of the laser points collected during the robot's movement.
[0026] Specifically, during its movement, the robot can scan laser points using its own LiDAR to obtain the pose and positioning data of each laser point. In some implementations, the terminal device can acquire the LiDAR data and corresponding pose data of the laser points collected by the robot at a preset sampling frequency during its movement. For ease of subsequent analysis, the LiDAR data and pose data can be converted into polar coordinate data in a polar coordinate system with the laser point at the first sampling moment as the origin O. It should be understood that for any laser point M in the plane, let ρ represent the length of line segment OM, and θ represent the angle from the x-axis to OM. Then ρ can be called the polar radius of laser point M, which can represent the distance between laser point M and laser point O. θ can be called the polar angle of laser point M, which can represent the pose of laser point M. (θ) can be called the polar coordinates of laser point M. Typically, the unit of polar radius is 1 (length unit), and the unit of polar angle is rad (or °).
[0027] For example, the robot can record a frame of LiDAR data and the robot's pose data at the corresponding sampling time every 0.2 meters or 30 degrees. Every 3 frames of LiDAR data are superimposed, and the superimposed LiDAR data is converted into polar coordinate data L2 with the pose of the first frame of LiDAR data as the origin.
[0028] To reduce unnecessary computation, the terminal device can sort the laser points according to their polar angles in the polar coordinate system and filter out some laser points from the sorted polar coordinate data.
[0029] In some implementations, the terminal device can filter out laser points from the sorted polar coordinate data that have a polar radius difference with any of its two adjacent laser points that is less than or equal to a first distance threshold. The specific value of the first distance threshold can be adjusted according to actual conditions. For example, if the polar radius difference between a laser point and the points before or after it is less than 0.02 meters, then that laser point is discarded.
[0030] In other implementations, the terminal device can filter out laser points from the sorted polar coordinate data that have polar radius differences greater than a second distance threshold and polar angle differences less than a first angle threshold. The specific values of the second distance threshold and the first angle threshold can be adjusted according to actual conditions. For example, if a laser point has polar angle differences less than 2° and polar radius differences greater than 0.1 meters with both adjacent laser points, it indicates that the laser point is located behind a surface obstacle, and in this case, the laser point can be discarded.
[0031] In step S103, if the robot is located in a closed area, the laser point is downsampled and the distance of the downsampled laser point is expanded to obtain the target laser point.
[0032] In the embodiments of this application, if the robot is located in an enclosed area, it indicates that the robot is trapped. In this case, the robot can be controlled to pause its task execution and escape using the escape method provided in this application. If the robot is not located in an enclosed area, it indicates that the robot is not trapped, and the robot can be controlled to continue executing its task.
[0033] Specifically, terminal devices can determine whether a robot is located within a closed area in different ways.
[0034] In some implementations, the terminal device can acquire images using a visual sensor to identify whether it is located within an enclosed area.
[0035] In other implementations, the terminal device can calculate the polar radius difference between two adjacent laser points based on polar coordinate data. If the polar radius difference between any two adjacent laser points is less than the robot's width, then the robot is confirmed to be located in an enclosed area. For example, the terminal device can iterate through the aforementioned polar coordinate data L2 to calculate the distance (i.e., polar radius difference) between two adjacent laser points. It should be noted that the distance between the last laser point and the first laser point can be calculated. If, after iterating through the polar coordinate data L2, no two adjacent laser points are found whose distance exceeds the robot's width, then the robot is confirmed to be located in an enclosed area.
[0036] Because the closed area is updated in real time—for example, an exit in a non-closed area will become a closed area when it is blocked by a pedestrian—the robot can detect in real time whether it is in a closed area. After completing a task in a certain area, it can decide whether it needs to escape based on whether it was in a closed area when it completed the task.
[0037] In the embodiments of this application, the terminal device can downsample the laser point and perform distance expansion on the downsampled laser point to obtain the target laser point. When obstacles enclose the aforementioned closed area, the robot is trapped in the closed area, and the scanned laser point is usually located within the closed area. Since some obstacles have a certain thickness, distance expansion can make the area enclosed by the laser point include the aforementioned obstacles. At this time, the convex polygonal region formed by connecting the target laser points can characterize the aforementioned closed area. When the robot leaves the convex polygonal region, it can leave the closed area enclosed by the obstacles.
[0038] Step S104: Based on the trajectory positioning data, determine the first target trajectory point and the second target trajectory point from the trajectory points.
[0039] In the embodiments of this application, the aforementioned trajectory positioning data records the position of each trajectory point. Based on the position of each trajectory point and the positions of each target laser point forming the convex polygon region, it can be determined whether each trajectory point is outside or inside the convex polygon region. Specifically, the first target trajectory point is located inside the convex polygon region, and the second target trajectory point is located outside the convex polygon region; that is, the first target trajectory point is located inside the closed region, and the second target trajectory point is located outside the closed region.
[0040] Step S105: Control the robot to move to the first target trajectory point and then to the second target trajectory point.
[0041] In the embodiments of this application, controlling the robot to move to the first target trajectory point and then to the second target trajectory point can control the robot to move from inside the closed area to outside the closed area, that is, control the robot to leave the closed area and achieve the robot's escape from the predicament.
[0042] In the embodiments of this application, by acquiring trajectory positioning data of trajectory points and pose positioning data of laser points recorded during robot movement, if the robot is located in a closed area, the laser points are downsampled and the distance of the downsampled laser points is expanded to obtain target laser points. The target laser points are connected to form a convex polygonal region where the robot is located. The convex polygonal region may include the aforementioned closed area. Therefore, based on the trajectory positioning data, a first target trajectory point within the convex polygonal region and a second target trajectory point outside the convex polygonal region are determined from the trajectory points. The robot is controlled to move towards the first target trajectory point and then towards the second target trajectory point. Even when the laser radar is blocked, a movement method for escaping the obstacle can still be provided. Therefore, the reliability of the robot escaping the obstacle is high.
[0043] Specifically, such as Figure 2 As shown, in some embodiments of this application, step S103 may include steps S201 to S203.
[0044] Step S201: Calculate the polar angle difference between two adjacent laser points based on the polar coordinate data.
[0045] Step S202: Based on the polar angle difference, the laser point is downsampled to obtain the downsampled laser point.
[0046] Specifically, since polar coordinate data is obtained by sorting laser points according to their polar angles in the polar coordinate system, the terminal device can calculate the polar angle difference between two adjacent laser points to determine whether a laser point needs to be retained. Specifically, the polar angle difference between two adjacent downsampled laser points must be greater than the second angle threshold.
[0047] The specific value of the second angle threshold can be adjusted according to the actual situation. For example, when traversing the laser points in the polar coordinate data L2, if the polar angle Th of the laser point... N The polar angle Th with the previous laser point N-1 If the included angle (polar angle difference) between the two points is greater than the second angle threshold, then record the polar radius and polar angle of the laser point. The polar angle of this laser point is taken as Th. N-1 Then, the next laser point can be found. After completing the traversal, the sequence L3 of downsampled laser points can be obtained. For example, when the second angle threshold is 20°, the sequence L3 of downsampled laser points can include approximately 360 / 20 = 18 downsampled laser points.
[0048] Step S203: Increase the polar radius of each downsampled laser point by a preset length value and remove the concave points to obtain the target laser point.
[0049] The specific value of the preset length can be adjusted according to the actual situation. For example, the polar radius of the downsampled laser points in sequence L3 can be increased by 0.3 meters, and then converted to map coordinates and inserted into list L4. The concave points in list L4 are filtered out, and the remaining points form a list L5 that can form a convex polygon. The remaining points are the target laser points.
[0050] Correspondingly, such as Figure 3 As shown, the terminal device can filter the second target trajectory point and the first target trajectory point through the following steps S301 to S303.
[0051] Step S301: Sort the trajectory points in the trajectory positioning data in order of sampling time from nearest to farthest.
[0052] Specifically, the trajectory positioning data L1 for each trajectory point can include the sampling time of the trajectory point recorded by the robot. The trajectory points in the trajectory positioning data can be sorted according to the order of sampling time from near to far to obtain the sorted trajectory positioning data.
[0053] Step S302: The first trajectory point located outside the convex polygon region is taken as the second target trajectory point.
[0054] Step S303: Take the trajectory point of the previous sampling time of the second target trajectory point as the first target trajectory point.
[0055] Specifically, based on the sorted trajectory localization data, the positions (e.g., coordinates) of each trajectory point and the coordinates of each target laser point in each L5 layer can be used to sequentially determine whether each trajectory point is outside the convex polygon region formed by L5 layers, according to the sampling time from closest to furthest. When a trajectory point is determined to be outside the convex polygon, it is designated as the second target trajectory point, and its coordinates P0 are recorded. Simultaneously, the trajectory point preceding the second target trajectory point can be designated as the first target trajectory point, and its coordinates P1 are recorded. It should be understood that if the second target trajectory point is the trajectory point most recently sampled, then the robot's current position can be used as the first target trajectory point.
[0056] In the embodiments of this application, since the robot initially moves from outside the closed area to inside the closed area, this method can determine the second target trajectory point closest to the robot's arrival in the closed area (i.e., the trajectory point just before entering the closed area), and the first target trajectory point furthest from the robot's arrival in the closed area (i.e., the trajectory point just upon entering the closed area). Furthermore, by controlling the robot to move towards the first target trajectory point and then towards the second target trajectory point, the robot can be controlled to leave the closed area.
[0057] Considering the variability of the environment within the closed area, during the process of controlling the robot to move towards the first target trajectory point and then towards the second target trajectory point, the duration of the robot's movement from the first target trajectory point to the second target trajectory point can be recorded. If the duration exceeds the duration threshold, the robot is controlled to return to the first target trajectory point. After reaching the first target trajectory point, the movement direction is adjusted and the robot moves forward again according to the adjusted movement direction until the current trajectory point of the robot is outside the convex polygon area.
[0058] The adjusted direction of movement is different from the direction from the first target trajectory point to the second target trajectory point.
[0059] For example, the terminal device can control the robot to navigate to P1, then turn towards P0 and move slowly. If the duration is less than or equal to a time threshold, and the robot has reached P0 through positioning, the device can control the robot to stop, confirming successful escape. Correspondingly, the device can also control the robot to continue performing unfinished tasks.
[0060] If the duration exceeds the threshold and the robot still cannot reach P0, the attempt has timed out. The robot can then be controlled to return to P1, turn 20 degrees to the left, and move 0.5 meters forward, continuing to check if its current trajectory point is outside the convex polygon area. If the robot is indeed outside the convex polygon area, the escape is confirmed as successful. If the attempt still fails to reach the convex polygon area after the timeout, the robot can be controlled to return to P1 again, turn 40 degrees to the right, and move 0.5 meters forward, continuing to check if its current trajectory point is outside the convex polygon area. If the attempt still fails to reach the convex polygon area after the timeout, the robot can be controlled to return to P1, confirming the escape attempt has failed. If the escape attempt fails, the robot can also send a rescue signal, such as sending a text message to the user's handheld device, or issuing a voice prompt to request the user's assistance in escaping the obstacle.
[0061] In the embodiments of this application, the above-described escape method can solve the problem of robots being trapped in areas blocked by soft obstacles and unable to escape when performing tasks, thereby improving the reliability of robot escape.
[0062] It should be noted that, for the sake of simplicity, the aforementioned method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders.
[0063] like Figure 4 The diagram shown is a schematic diagram of a robot escape device 400 provided in an embodiment of this application. The robot escape device 400 is configured on a terminal device.
[0064] Specifically, the robot's escape device 400 may include:
[0065] The trajectory positioning unit 401 is used to acquire trajectory positioning data of trajectory points recorded during the robot's movement;
[0066] The pose positioning unit 402 is used to acquire the pose positioning data of the laser point collected during the robot's movement.
[0067] The laser point processing unit 403 is used to downsample the laser points if the robot is located in a closed area, and to perform distance expansion on the downsampled laser points to obtain target laser points. The target laser points are connected to form a convex polygonal region where the robot is located.
[0068] The trajectory point processing unit 404 is used to determine a first target trajectory point and a second target trajectory point from the trajectory points according to the trajectory positioning data, wherein the first target trajectory point is located within the convex polygon region and the second target trajectory point is located outside the convex polygon region.
[0069] The escape control unit 405 is used to control the robot to move to the first target trajectory point and to the second target trajectory point.
[0070] In some embodiments of this application, the above-mentioned pose positioning data is polar coordinate data, and the pose positioning unit 402 can be specifically used to: acquire the lidar data of the laser point and the corresponding pose data collected by the robot at a preset sampling frequency during the movement process; and convert the lidar data and the pose data into polar coordinate data in a polar coordinate system with the laser point at the first sampling time as the origin.
[0071] In some embodiments of this application, the pose positioning unit 402 may also be used to: sort the laser points according to the polar angles in the polar coordinate system; filter out laser points from the sorted polar coordinate data whose polar radius difference with any one of the two adjacent laser points is less than or equal to a first distance threshold; and / or, filter out laser points from the sorted polar coordinate data whose polar radius difference with both of the two adjacent laser points is greater than a second distance threshold and whose polar angle difference is less than a first angle threshold.
[0072] In some embodiments of this application, the robot's escape device 400 may further include a judgment unit, used to calculate the polar radius difference between two adjacent laser points based on the polar coordinate data; if the polar radius difference between any two adjacent laser points is less than the width of the robot, then the robot is confirmed to be located in the enclosed area.
[0073] In some embodiments of this application, the laser point processing unit 403 described above can be specifically used to: calculate the polar angle difference between two adjacent laser points based on the polar coordinate data; downsample the laser points based on the polar angle difference to obtain the downsampled laser points, wherein the polar angle difference between two adjacent downsampled laser points is greater than a second angle threshold; increase the polar diameter of each downsampled laser point by a preset length value and remove concave points to obtain the target laser point.
[0074] In some embodiments of this application, the trajectory point processing unit 404 described above may be specifically used to: sort the trajectory points in the trajectory positioning data in order from nearest to farthest according to the sampling time; take the first trajectory point located outside the convex polygon region as the second target trajectory point; and take the trajectory point at the previous sampling time of the second target trajectory point as the first target trajectory point.
[0075] In some embodiments of this application, the aforementioned escape control unit 405 may be specifically used to: record the duration of the robot's movement from the first target trajectory point to the second target trajectory point; if the duration exceeds a duration threshold, control the robot to return to the first target trajectory point; after reaching the first target trajectory point, adjust the movement direction and move forward again according to the adjusted movement direction until the current trajectory point of the robot is outside the convex polygon area, wherein the adjusted movement direction is different from the direction from the first target trajectory point to the second target trajectory point.
[0076] It should be noted that, for the sake of convenience and brevity, the specific working process of the robot's escape device 400 can be found in the following reference: Figures 1 to 3 The corresponding process of the method will not be described in detail here.
[0077] like Figure 5 The diagram shown is a schematic of a terminal device provided in an embodiment of this application. The terminal device 5 may include: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50, such as a robot escape program. When the processor 50 executes the computer program 52, it implements the steps in the various robot escape method embodiments described above, for example... Figure 1 The steps S101 to S105 are shown. Alternatively, when the processor 50 executes the computer program 52, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 4 The shown components are trajectory positioning unit 401, pose positioning unit 402, laser point processing unit 403, trajectory point processing unit 404, and escape control unit 405.
[0078] The computer program can be divided into one or more modules / units, which are stored in the memory 51 and executed by the processor 50 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0079] For example, the computer program can be divided into: a trajectory positioning unit, a pose positioning unit, a laser point processing unit, a trajectory point processing unit, and an escape control unit.
[0080] The specific functions of each unit are as follows: A trajectory positioning unit, used to acquire trajectory positioning data of trajectory points recorded during robot movement; a pose positioning unit, used to acquire pose positioning data of laser points collected during robot movement; a laser point processing unit, used to downsample the laser points if the robot is located within a closed area, and to perform distance expansion on the downsampled laser points to obtain target laser points, the target laser points being connected to form the convex polygon region where the robot is located; a trajectory point processing unit, used to determine a first target trajectory point and a second target trajectory point from the trajectory points based on the trajectory positioning data, the first target trajectory point being located within the convex polygon region, and the second target trajectory point being located outside the convex polygon region; and an escape control unit, used to control the robot to move towards the first target trajectory point and then towards the second target trajectory point.
[0081] The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 5 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.
[0082] The processor 50 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0083] The memory 51 can be an internal storage unit of the terminal device, such as a hard drive or RAM. The memory 51 can also be an external storage device of the terminal device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 51 can include both internal and external storage units. The memory 51 is used to store the computer program and other programs and data required by the terminal device. The memory 51 can also be used to temporarily store data that has been output or will be output.
[0084] It should be noted that, for the sake of convenience and brevity, the structure of the terminal device described above can also be referred to the specific description of the structure in the method embodiment, which will not be repeated here.
[0085] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0086] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0087] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for various specific applications, but such implementations should not be considered beyond the scope of this application.
[0088] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0089] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0090] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0091] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0092] The above-described 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, and should all be included within the protection scope of this application.
Claims
1. A method for a robot to escape from a difficult situation, characterized in that, include: Acquire trajectory positioning data of trajectory points recorded during robot movement; Acquire lidar data of laser points and corresponding pose data collected by the robot at a preset sampling frequency during its movement; The lidar data and the pose data are converted into polar coordinate data in a polar coordinate system with the laser point at the first sampling time as the origin; The laser points are sorted according to the polar angle in the polar coordinate system; From the sorted polar coordinate data, laser points whose polar radius difference with any of the two adjacent laser points is less than or equal to a first distance threshold are filtered out; and / or, from the sorted polar coordinate data, laser points whose polar radius difference with any of the two adjacent laser points is greater than a second distance threshold and whose polar angle difference is less than a first angle threshold are filtered out. If the robot is located within an enclosed area, the polar angle difference between two adjacent laser points is calculated based on the polar coordinate data. Based on the polar angle difference, the laser point is downsampled to obtain a downsampled laser point, wherein the polar angle difference between two adjacent downsampled laser points is greater than the second angle threshold. The polar radius of each downsampled laser point is increased by a preset length value, and concave points are removed to obtain target laser points. The target laser points are connected to form the convex polygon region where the robot is located. Based on the trajectory positioning data, a first target trajectory point and a second target trajectory point are determined from the trajectory points, wherein the first target trajectory point is located within the convex polygon region and the second target trajectory point is located outside the convex polygon region; The robot is controlled to move towards the first target trajectory point and then towards the second target trajectory point.
2. The robot escape method as described in claim 1, characterized in that, Before downsampling the laser point, the method further includes: Based on the polar coordinate data, calculate the polar radius difference between two adjacent laser points; If the difference in polar radius between any two adjacent laser points is less than the width of the robot, then the robot is confirmed to be located in the enclosed area.
3. The robot extrication method according to any one of claims 1 to 2, characterized in that, The step of determining the first target trajectory point and the second target trajectory point from the trajectory points based on the trajectory positioning data includes: The trajectory points in the trajectory positioning data are sorted in order from most recent to furthest from the sampling time; The first trajectory point located outside the convex polygon region is taken as the second target trajectory point; The trajectory point at the previous sampling time of the second target trajectory point is taken as the first target trajectory point.
4. The robot extrication method according to any one of claims 1 to 2, characterized in that, The process of controlling the robot to move towards the first target trajectory point and then towards the second target trajectory point includes: Record the duration of the robot's movement from the first target trajectory point to the second target trajectory point; If the duration exceeds the duration threshold, the robot is controlled to return to the first target trajectory point. After reaching the first target trajectory point, the robot adjusts its movement direction and moves forward again according to the adjusted movement direction until the current trajectory point of the robot is outside the convex polygon area. The adjusted movement direction is different from the direction from the first target trajectory point to the second target trajectory point.
5. A robot's escape device, characterized in that, include: The trajectory localization unit is used to acquire trajectory localization data of the trajectory points recorded during the robot's movement. The pose localization unit is used to acquire lidar data and corresponding pose data of laser points collected by the robot at a preset sampling frequency during the movement process; convert the lidar data and the pose data into polar coordinate data in a polar coordinate system with the laser point at the first sampling time as the origin; and sort the laser points according to the polar angle in the polar coordinate system. From the sorted polar coordinate data, laser points whose polar radius difference with any of the two adjacent laser points is less than or equal to a first distance threshold are filtered out; and / or, from the sorted polar coordinate data, laser points whose polar radius difference with any of the two adjacent laser points is greater than a second distance threshold and whose polar angle difference is less than a first angle threshold are filtered out. A laser point processing unit is configured to, if the robot is located within a closed area, calculate the polar angle difference between two adjacent laser points based on the polar coordinate data; downsample the laser points based on the polar angle difference to obtain downsampled laser points, wherein the polar angle difference between two adjacent downsampled laser points is greater than a second angle threshold; increase the polar radius of each downsampled laser point by a preset length value and remove concave points to obtain target laser points, wherein the target laser points are connected to form a convex polygonal region where the robot is located; A trajectory point processing unit is used to determine a first target trajectory point and a second target trajectory point from the trajectory points based on the trajectory positioning data, wherein the first target trajectory point is located within the convex polygon region and the second target trajectory point is located outside the convex polygon region. The escape control unit is used to control the robot to move to the first target trajectory point and then to the second target trajectory point.
6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the robot extrication method as described in any one of claims 1 to 5.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the robot extrication method as described in any one of claims 1 to 5.