Robot obstacle avoidance method, electronic device, robot and readable storage medium
By dividing the lidar point cloud by height and constructing an obstacle avoidance model, and combining it with reinforcement learning methods, the problems of poor obstacle avoidance performance and computational complexity of heterogeneous 3D robots are solved, achieving efficient and safe obstacle avoidance control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUTENG INNOVATION TECHNOLOGY CO LTD
- Filing Date
- 2026-04-01
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, the method of using lidar to collect point clouds for obstacle avoidance is not very effective for obstacle avoidance of heterogeneous 3D robots and involves a large amount of computation and is complex.
By dividing the point cloud collected by LiDAR into point sets according to different heights and constructing a robot obstacle avoidance model, the state space, action space and reward function are determined by reinforcement learning methods, thus achieving end-to-end obstacle avoidance control.
It improves the obstacle avoidance performance of heterogeneous 3D robots, reduces the amount of computation and simplifies the calculation method, enabling safe and efficient obstacle avoidance in unknown environments.
Smart Images

Figure CN122172833A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of obstacle avoidance technology, and in particular to a robot obstacle avoidance method, electronic device, robot, and readable storage medium. Background Technology
[0002] In the field of mobile robotics, autonomous navigation and obstacle avoidance are indispensable. With the widespread adoption of LiDAR, more and more robots are using point clouds collected by LiDAR for obstacle avoidance. Traditional algorithms require calculating the distance between each data point in the point cloud and the target point, and incorporating this distance into the trajectory optimization constraints to optimize the trajectory for obstacle avoidance. However, this approach is less effective for heterogeneous 3D robots. Summary of the Invention
[0003] This application provides a robot obstacle avoidance method, electronic device, robot, and readable storage medium, which enables heterogeneous 3D robots to have better obstacle avoidance performance.
[0004] In a first aspect, embodiments of this application provide a robot obstacle avoidance method. The robot includes a lidar, and the robot obstacle avoidance method includes: acquiring a point cloud frame collected by the lidar; determining at least two point sets based on the point cloud, wherein each point set is a set of first data points in the point cloud that satisfy preset conditions, the preset conditions including that the height of the first data points is within a corresponding preset height range, and that the preset height ranges corresponding to any two point sets are different; determining an array based on each point set, wherein the array includes multiple second data points, each second data point being determined by the projection of multiple first data points at a position in the array onto a two-dimensional plane; determining a robot obstacle avoidance model based on a state space, an action space, and a reward function, wherein the state space and the reward function are determined based on the array, and the action space includes the linear velocity and angular velocity output by the robot obstacle avoidance model; and controlling the robot to avoid obstacles based on the robot obstacle avoidance model and the actual point cloud collected by the lidar.
[0005] On the one hand, by dividing the point cloud collected by LiDAR according to different heights and constructing a robot obstacle avoidance model based on the division results, when this robot obstacle avoidance method is applied to heterogeneous 3D robots, it enables different height parts of the robot to perform corresponding obstacle avoidance processes, which is beneficial for achieving better obstacle avoidance performance in heterogeneous 3D robots. On the other hand, the robot obstacle avoidance model obtained based on reinforcement learning methods, and using 3D point cloud information extracted as input, can achieve end-to-end safe and efficient obstacle avoidance, thereby adapting to unknown and complex environments.
[0006] In one or more embodiments, the robot includes at least two parts, each of which performs a different function; the preset height range is determined based on the height of each of the at least two parts.
[0007] In one or more embodiments, the preset condition further includes that the distance of the first data point is less than a first preset distance threshold.
[0008] Further determining the conditions that the first data point in the point set must meet from the horizontal direction can further improve the obstacle avoidance effect.
[0009] In one or more embodiments, the second data point includes a projection position and a projection distance; wherein, the projection position is: arctan(yi / xi) / A, where (xi, yi, zi) are the coordinates of the target data point, the target data point is the first data point corresponding to the minimum projection distance of multiple first data points at a position in the array, and A is a preset angle value; the projection distance is: (sqrt(xi*xi+yi*yi+zi*zi)-safe_dis) / (th_d-safe_dis), where safe_dis is a second preset distance threshold, and th_d is a first preset distance threshold.
[0010] In one or more embodiments, the state space is determined based on an array, including: determining the state space based on the distance between the robot and the target point, the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity at the previous moment, and the array, wherein the target point is any data point in the point cloud.
[0011] The distance between the robot and the target point reflects their proximity; a smaller distance indicates greater proximity, while a larger distance indicates less proximity. The angle between the line connecting the robot and the target point and the current orientation is the angle between the direction vector from the robot's position to the target point and the direction vector of the robot's current orientation. This angle is used to determine whether the robot is facing the target point and whether it needs to turn left or right if it is not aligned. The linear and angular velocities from the previous moment (i.e., the linear and angular velocities during the robot's last movement) are introduced to incorporate previous motion states, enabling current acceleration constraints and smooth transitions, thus avoiding abnormal situations such as violent jitter. By determining the state space based on a normalized array, the state space can contain environmental structure information, allowing the robot to determine whether there are obstacles ahead and their geometry. This helps the robot make safe, reasonable, and environmentally adaptable decisions.
[0012] In one or more embodiments, the reward function is determined based on an array, including: determining the reward function based on the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity output by the robot obstacle avoidance model, and the array, wherein the target point is any data point in the point cloud.
[0013] The angle between the line connecting the robot and the target point and the current orientation is used to measure the degree of alignment with the target, and it is a core indicator of navigation directionality. The linear and angular velocities output by the robot obstacle avoidance model reflect the current motion intention. The array reflects the local environment structure, which can be used to determine collision risk, channel width, and environmental complexity. The reward function determined based on the above factors can guide the robot to move towards the target point efficiently and smoothly while safely avoiding obstacles.
[0014] In one or more embodiments, a reward function is determined based on the angle between the line connecting the robot and the target point and the current orientation, the linear and angular velocities output by the robot obstacle avoidance model, and an array, including: Based on the included angle, the target point orientation reward is determined as: abs(g_angle), where g_angle is the included angle; based on the array, the target point distance reward is determined as: 2Σlog(pl_vec) / B, where pl_vec is the array and B is the number of second data points in the array; based on the linear velocity and angular velocity output by the robot obstacle avoidance model, the velocity reward is determined as: vo_x-vo_z*vo_z, where vo_x is the linear velocity output by the robot obstacle avoidance model and vo_z is the angular velocity output by the robot obstacle avoidance model; based on the target point orientation reward, target point distance reward, and velocity reward, the reward function is determined.
[0015] Among them, the target point orientation reward is used to encourage the robot to move towards the target point, the target point distance reward is used to encourage the robot to stay away from obstacles as much as possible, and the speed reward is used to encourage the robot to move forward and avoid rotational movements.
[0016] In a second aspect, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory is coupled to the processor and is used to store instructions or programs, which, when executed by at least one processor, cause at least one processor to perform the robot obstacle avoidance method as described in the first aspect.
[0017] Thirdly, embodiments of this application provide a robot, including a lidar and electronic devices as described in the second aspect.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed, implements the robot obstacle avoidance method as described in the third aspect.
[0019] The beneficial effects of this application are: the robot obstacle avoidance method of this application embodiment can divide the point cloud collected by the lidar according to different heights, and construct a robot obstacle avoidance model according to the division results. Therefore, when the robot obstacle avoidance method provided by this application embodiment is applied to a heterogeneous three-dimensional robot, it can enable the parts of the robot at different heights to perform the corresponding obstacle avoidance process, which is beneficial to enable the heterogeneous three-dimensional robot to have a better obstacle avoidance effect. Attached Figure Description
[0020] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, which are not intended to limit the embodiments, and elements having the same reference numerals in the drawings are designated as similar elements.
[0021] Figure 1 This is a schematic diagram of the robot provided in an embodiment of this application; Figure 2 This is a schematic diagram of one implementation of the robot obstacle avoidance method provided in this application. Figure 3 This is a schematic diagram of one implementation of the robot obstacle avoidance method provided in this application. Figure 4 This is a schematic diagram of one implementation of the robot obstacle avoidance method provided in this application. Figure 5 This is a schematic diagram of one implementation of the robot obstacle avoidance method provided in this application.
[0022] Figure label: 100. Robot; 110. LiDAR; 120. Electronic equipment; 121. Processor; 122. Memory. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0024] It should be noted that when an element is described as "connected" to another element, it can be directly connected to the other element, or there can be one or more intermediate elements between them.
[0025] Furthermore, the technical features involved in the various embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0026] Please refer to Figure 1 , Figure 1 This is a schematic diagram of a robot provided in an embodiment of this application. Figure 1 As shown, robot 100 includes lidar 110 and electronic equipment 120. LiDAR 110 is connected to electronic equipment 120.
[0027] The lidar 110 can be a solid-state lidar, a semi-solid-state lidar, etc., and this application does not limit it to this. The lidar 100 can be applied to any device that needs to perform laser detection, such as mobile robots, ships, or vehicles. The lidar 110 includes a transmitter for emitting detection laser and a receiver for receiving echo signals. Specifically, the transmitter can emit pulsed detection laser, which is projected onto the target object. The signal formed by the reflection of the target object is the echo signal. The receiver receives the echo signal and obtains relevant information about the target object based on the echo signal, such as the distance between the receiver and the target object.
[0028] The electronic device 120 includes at least one processor 121 and a memory 122. The memory 122 can be built into the electronic device 120 or external to the electronic device 120. The memory 122 can also be a remotely configured memory connected to the electronic device 120 via a network.
[0029] Memory 122, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 122 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, memory 122 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 122 may optionally include memory remotely located relative to processor 121, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0030] The processor 121 performs various functions of the terminal and processes data by running or executing software programs and / or modules stored in the memory 122 and calling data stored in the memory 122, thereby performing overall monitoring of the terminal, such as implementing the robot obstacle avoidance method described in any embodiment of this application.
[0031] Processor 121 can be one or more. Figure 1The example provided is a processor 121. The processor 121 and memory 122 can be connected via a bus or other means. The processor 121 may include a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a controller, a field-programmable gate array (FPGA) device, etc. The processor 121 can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0032] In some embodiments, robot 100 is configured as a heterogeneous stereo robot. A heterogeneous stereo robot refers to a three-dimensional robot composed of multiple different types of robots (e.g., a robot vacuum cleaner + a robotic arm). Typically, the different types of robots in a heterogeneous stereo robot have different heights.
[0033] In related technologies, the obstacle avoidance method used for heterogeneous 3D robots involves collecting point clouds using lidar, calculating the distance between each data point in the point cloud and the target point, and incorporating this distance into the trajectory optimization constraints to optimize the trajectory and achieve obstacle avoidance. However, this method is less effective for heterogeneous 3D robots, and it also involves significant computational complexity.
[0034] Based on this, the embodiments of this application provide a robot obstacle avoidance method, which not only enables heterogeneous 3D robots to have better obstacle avoidance performance, but also reduces the amount of computation and simplifies the calculation method.
[0035] Please refer to Figure 2 , Figure 2 A flowchart illustrating a robot obstacle avoidance method provided in an embodiment of this application. The robot includes a lidar sensor; in some embodiments, the robot can utilize, for example... Figure 1 The structure shown is implemented in detail in the above embodiments and will not be repeated here. Figure 2 As shown, the robot obstacle avoidance method includes the following steps S210 to S250.
[0036] Step S210: Acquire a point cloud frame collected by the lidar.
[0037] Point clouds are obtained by lidar by emitting probe light and receiving reflected light signals. For example, flash lidar uses a vertical-cavity surface-emitting laser array as the emission source and a two-dimensional detector array (such as an avalanche photodiode array or a single-photon avalanche diode array) to receive the reflected light signals. Unlike mechanical rotating lidar, which detects point by point, flash lidar acquires the point cloud of the entire field of view at once.
[0038] Step S220: Based on the point cloud, determine at least two point sets, wherein each point set is a set of first data points in the point cloud that satisfy preset conditions. The preset conditions include that the height of the first data points is within a corresponding preset height range, and the preset height ranges corresponding to any two point sets are different.
[0039] Taking two point sets, designated as the first point set and the second point set, as an example, the preset height range corresponding to the first point set is denoted as the first preset height range, and the preset height range corresponding to the second point set is denoted as the second preset height range. Then, the height of each first data point in the first point set is within the first preset range, and the height of each first data point in the second point set is within the second preset range. The first preset height range and the second preset height range are different.
[0040] In some embodiments, the robot includes at least two parts, each of which performs a different function, and a preset height range is determined based on the height of each of the at least two parts.
[0041] For example, in a specific embodiment, the robot includes a sweeping machine and a robotic arm mounted on the sweeping machine. In this case, the robot comprises two parts: the sweeping machine and the robotic arm. The sweeping machine performs floor cleaning and vacuuming functions, while the robotic arm performs the function of grasping obstacles (such as toys). A preset height range can be determined based on the height of the sweeping machine, and another preset height range can be determined based on the height of the robotic arm. For example, if the height of the sweeping machine is 0.2m and the highest point of the robotic arm is 0.8m from the ground, then the preset height range determined based on the height of the sweeping machine can be (0, 0.2], and the preset height range determined based on the height of the robotic arm can be (0.2, 0.8).
[0042] In some embodiments, to further improve obstacle avoidance performance, conditions that the first data point in the point set must satisfy are further determined from the horizontal direction. Specifically, the preset conditions also include that the distance between the first data point and the first data point is less than a first preset distance threshold.
[0043] If the first data point is set to (x1, y1, z1), then the preset condition is: Where th_d is the first preset distance threshold, which is a pre-set maximum distance value. This threshold can be set based on the actual application scenario, and this embodiment does not impose specific limitations on it. Setting the first preset distance threshold is used to exclude obstacles that are too far away, which helps improve algorithm efficiency and also avoids interference from distant obstacles, thus improving system stability.
[0044] Step S230: For each point set, determine an array, wherein the array includes multiple second data points, and each second data point is determined by the projection of multiple first data points at a position in the array onto a two-dimensional plane.
[0045] It is understandable that the information of the points in the point set is all 3D information. Therefore, the first step is to convert the 3D information into 1D signals for subsequent construction of the robot obstacle avoidance model. Specifically, each first data point is projected onto a two-dimensional plane to obtain multiple second data points, and the second data points corresponding to the same point set are grouped into an array. For example, taking the first point set (denoted as pc_low) and the second point set (denoted as pc_high) mentioned above as examples, the multiple second data points obtained by projecting the first point set pc_low onto the two-dimensional plane form the first array (denoted as pl_vec), and the multiple second data points obtained by projecting the second point set pc_high onto the two-dimensional plane form the second array (denoted as ph_vec).
[0046] In some embodiments, the second data point includes a projection position and a projection distance. The projection position is defined as arctan(yi / xi) / A, where (xi, yi, zi) are the coordinates of the target data point, the target data point is the first data point corresponding to the minimum projection distance among multiple first data points at a given position in the array, and A is a preset angle value. The projection distance is defined as (sqrt(xi*xi+yi*yi+zi*zi)-safe_dis) / (th_d-safe_dis), where safe_dis is a second preset distance threshold, and th_d is a first preset distance threshold. Arctan(yi / xi) is... sqrt(xi*xi+yi*yi+zi*zi) is .
[0047] Here, A is a pre-set angle value, which can be set based on the actual application scenario. In a specific implementation, A is determined according to the number of second data points in the corresponding array. The 360-degree circle is divided into K sectors, and the angle of each sector is A. For example, if the number of second data points in the first array pl_vec mentioned above is 60, then A can be set to 360° / 60=6°, indicating that the 360-degree circle is divided into 60 sectors, each sector being 6 degrees. Each sector corresponds to a position in the array. Each position may have the projection of one or more first data points. When a position has only the projection of one first data point, that first data point is the target data point corresponding to that position. When a position has the projection of multiple first data points, the first data point corresponding to the minimum projection distance of the multiple first data points is the target data point corresponding to that position. arctan(yi / xi) / A is used to indicate which sector the target data point falls in, that is, the position of the target data point, which is the projection position of the corresponding second data point.
[0048] The formula for the projected distance is derived using a normalized distance metric, which maps the actual distance of the target data points to a standardized range to unify and standardize the data. The second preset distance threshold is a pre-set distance value that can be set based on the actual application scenario. This second preset distance threshold represents the safe distance, i.e., the minimum safe distance the robot wants to maintain. For example, for a circular sweeping robot with a radius of 0.4m, the second preset distance threshold can be set to 0.4m.
[0049] Step S240: Determine the robot obstacle avoidance model based on the state space, action space, and reward function. The state space and reward function are determined by arrays, and the action space includes the linear velocity and angular velocity output by the robot obstacle avoidance model.
[0050] Specifically, the state space, action space, and reward function are the three elements of a Markov Decision Process (MDP). The state space is the set of all possible states, which are complete descriptions of the environment; the action space is the set of all possible actions, which are the operations the robot can perform; and the reward function is the driving force behind the robot's learning, with positive rewards encouraging desired behaviors and negative rewards (punishments) inhibiting unwanted behaviors.
[0051] In some embodiments, such as Figure 3 As shown, the specific implementation process of determining the state space based on the array in step S240 includes the following step S310.
[0052] Step S310: Determine the state space based on the distance between the robot and the target point, the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity of the previous moment, and the array.
[0053] The target point is any data point in the point cloud. Specifically, the robot moves sequentially with a data point in the point cloud as the target point. The state inputs during the movement include the distance between the robot and the target point, the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity from the previous moment, and related arrays. The distance between the robot and the target point reflects the proximity of the robot to the target point; a smaller distance indicates a higher proximity, and vice versa. The angle between the line connecting the robot and the target point and the current orientation is the angle between the direction vector from the robot's position to the target point and the direction vector of the robot's current orientation (heading). This angle is used to determine whether the robot is directly facing the target point and whether it needs to turn left or right if it is not aligned with the target point. The linear velocity and angular velocity from the previous moment are introduced to incorporate the previous motion state, enabling current acceleration constraints and smooth transitions, thereby avoiding abnormal situations such as violent shaking. By determining the state space based on a normalized array, the state space can contain environmental structure information, enabling the robot to determine whether there are obstacles ahead and the geometry of those obstacles. This helps the robot make safe, reasonable, and environmentally adaptable decisions.
[0054] In some embodiments, such as Figure 4 As shown, the specific implementation process of the reward function determined by the array in step S240 includes the following step S410.
[0055] Step S410: Determine the reward function based on the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity output by the robot obstacle avoidance model, and the array.
[0056] The angle between the line connecting the robot and the target point and the current orientation is used to measure the degree of alignment with the target, and it is a core indicator of navigation directionality. The linear and angular velocities output by the robot obstacle avoidance model reflect the current motion intention. The array reflects the local environmental structure (such as obstacle distribution), which can be used to determine collision risk, channel width, and environmental complexity. The reward function determined based on the above factors can guide the robot to move towards the target point efficiently and smoothly while safely avoiding obstacles.
[0057] In some embodiments, such as Figure 5 As shown, the specific implementation process of step S410 includes the following steps S510 to S540.
[0058] Step S510: Determine the target point orientation reward as abs(g_angle) based on the angle between the line connecting the robot and the target point and the current orientation.
[0059] Here, abs(g_angle) is the absolute value of g_angle, which is used to encourage the robot to move toward the target point. The closer the robot is to the target point, the higher the reward.
[0060] Step S520: Based on the array, determine the target point distance reward as: 2Σlog(pl_vec) / B, where pl_vec is the array and B is the number of second data points in the array.
[0061] Where log(pl_vec) represents taking the natural logarithm (e.g., ln) or the common logarithm (e.g., log) for each second data point in the array. 10 The algorithm calculates B logarithmic values. Σlog(pl_vec) represents the summation of all logarithmic values (i.e., the B logarithmic values). The target point distance reward is used to encourage the robot to stay as far away from obstacles as possible.
[0062] Step S530: Based on the linear velocity and angular velocity output by the robot obstacle avoidance model, determine the velocity reward as: vo_x - vo_z * vo_z, where vo_x is the linear velocity output by the robot obstacle avoidance model and vo_z is the angular velocity output by the robot obstacle avoidance model.
[0063] Here, vo_x is used to encourage forward movement; the greater the linear velocity, the higher the reward. vo_z*vo_z is used to suppress violent rotation; the greater the angular velocity, the heavier the penalty. Thus, this velocity reward is used to encourage the robot to move forward and avoid rotational movements.
[0064] Step S540: Determine the reward function based on the orientation reward, target point distance reward, and speed reward.
[0065] Specifically, the reward function includes three key reward items: the target point orientation reward in step S510, which encourages the robot to move toward the target point; the target point distance reward in step S520, which encourages the robot to stay as far away from obstacles as possible; and the speed reward in step S530, which encourages the robot to move forward and avoid rotational movements, thereby helping the robot to move to the target in a safe, smooth and efficient manner.
[0066] Step S250: Control the robot to avoid obstacles based on the robot obstacle avoidance model and the actual point cloud collected by the lidar.
[0067] Specifically, the lidar collects multiple frames of point cloud data, and each frame of point cloud data is processed through the above steps S220 to S240 to continuously iterate and train the robot, ultimately obtaining the robot obstacle avoidance model.
[0068] Subsequently, in practical applications, after the LiDAR collects the actual point cloud, the actual point cloud is input into the robot obstacle avoidance model. The robot obstacle avoidance model can then directly output the robot's linear velocity and angular velocity to drive the robot's operation and realize the obstacle avoidance process. On the one hand, since the point cloud collected by the LiDAR is divided according to different heights, and the robot obstacle avoidance model is constructed based on the division results, when this robot obstacle avoidance method is applied to heterogeneous 3D robots, it enables different height parts of the robot to perform corresponding obstacle avoidance processes, which is beneficial for heterogeneous 3D robots to have better obstacle avoidance performance. For example, when a robot with a vacuum cleaner and a robotic arm is located under a table, the robot obstacle avoidance method provided in this application embodiment can prevent the robotic arm from hitting the table. On the other hand, the robot obstacle avoidance model obtained based on the reinforcement learning method, and using the extracted 3D point cloud information as information input, can achieve end-to-end safe and efficient obstacle avoidance, thereby adapting to unknown and complex environments.
[0069] This application also provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example, to perform the method steps of any of the embodiments described above.
[0070] This application also provides a computer program product, including a computing program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform the robot obstacle avoidance method in any of the above method embodiments, for example, to perform the method steps of any of the embodiments described above.
[0071] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0072] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order. 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; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A robot obstacle avoidance method, characterized in that, The robot includes a lidar system, and the robot obstacle avoidance method includes: Obtain a point cloud frame acquired by the lidar; Based on the point cloud, at least two point sets are determined, wherein the point set is a set of first data points in the point cloud that satisfy preset conditions, the preset conditions including that the height of the first data points is within a corresponding preset height range, and the preset height ranges corresponding to any two point sets are different. For each set of points, an array is determined, wherein the array includes a plurality of second data points, each second data point being determined by the projection of a plurality of first data points at a position in the array onto a two-dimensional plane; A robot obstacle avoidance model is determined based on the state space, action space, and reward function. The state space and the reward function are determined according to the array, and the action space includes the linear velocity and angular velocity output by the robot obstacle avoidance model. The robot is controlled to avoid obstacles based on the obstacle avoidance model and the actual point cloud collected by the lidar.
2. The method according to claim 1, characterized in that, The robot comprises at least two parts, each of which performs a different function; The preset height range is determined based on the height of each of the at least two parts.
3. The method according to claim 1 or 2, characterized in that, The preset conditions also include that the distance to the first data point is less than a first preset distance threshold.
4. The method according to claim 1, characterized in that, The second data point includes the projection position and projection distance; Wherein, the projection position is: arctan(yi / xi) / A, where (xi, yi, zi) are the coordinates of the target data point, the target data point is the first data point corresponding to the minimum projection distance of multiple first data points at a position in the array, and A is a preset angle value; The projection distance is: (sqrt(xi*xi+yi*yi+zi*zi)-safe_dis) / (th_d-safe_dis), where safe_dis is the second preset distance threshold and th_d is the first preset distance threshold.
5. The method according to claim 1, characterized in that, The state space is determined based on the array and includes: The state space is determined based on the distance between the robot and the target point, the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity at the previous moment, and the array, wherein the target point is any data point in the point cloud.
6. The method according to claim 1, characterized in that, The reward function is determined based on the array and includes: The reward function is determined based on the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity output by the robot obstacle avoidance model, and the array, wherein the target point is any data point in the point cloud.
7. The method according to claim 6, characterized in that, The step of determining the reward function based on the angle between the line connecting the robot and the target point and the current orientation, the linear velocity and angular velocity output by the robot obstacle avoidance model, and the array includes: Based on the included angle, the reward for facing the target point is determined as: abs(g_angle), where g_angle is the included angle; Based on the array, the target point distance reward is determined to be: 2Σlog(pl_vec) / B, where pl_vec is the array and B is the number of second data points in the array; Based on the linear velocity and angular velocity output by the robot obstacle avoidance model, the velocity reward is determined as: vo_x - vo_z * vo_z, where vo_x is the linear velocity output by the robot obstacle avoidance model and vo_z is the angular velocity output by the robot obstacle avoidance model. The reward function is determined based on the orientation reward, the distance reward to the target point, and the speed reward.
8. An electronic device, characterized in that, include: At least one processor and memory; The memory is coupled to the processor and is used to store instructions or programs that, when executed by the at least one processor, cause the at least one processor to perform the robot obstacle avoidance method as described in any one of claims 1-7.
9. A robot, characterized in that, This includes lidar and the electronic device as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the robot obstacle avoidance method as described in any one of claims 1-8.