Robot control method and device, robot and medium
By obtaining obstacle position information, controlling the robot to avoid obstacles around obstacles and return to the target path, the problem that traditional algorithms cannot avoid dynamic obstacles is solved, and efficient and accurate robot obstacle avoidance and navigation is achieved.
Patent Information
- Application Number
- CN202410251646.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2025-09-05
AI Technical Summary
The existing robot navigation obstacle avoidance technology based on traditional algorithms cannot adaptively avoid dynamic obstacles on planned paths, resulting in the inability to effectively avoid obstacles.
By obtaining the position information of the obstacle, the robot controls the obstacle avoidance movement around the obstacle, and maintains a distance from the obstacle within the preset threshold during the obstacle avoidance process until the angle condition is met, and returns to the target path to avoid re-planning the path.
It realizes efficient and precise local adaptive obstacle avoidance, reduces the demand for computing resources, avoids the cost of path re-planning, and improves the degree of automation of robot navigation.
Smart Images

Figure CN120595786A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of robots, and in particular to a robot control method, device, robot, and medium. Background Art
[0002] Currently, there are three main path planning methods for robot navigation and obstacle avoidance: traditional algorithms, deep learning, and reinforcement learning. Due to computational and resource costs, traditional algorithm-based path planning methods are more widely used. Among them, the A* algorithm can plan an obstacle-avoiding navigation path for a robot in a known environment. However, if dynamic obstacles appear on the planned path, the robot cannot adaptively avoid them. Summary of the Invention
[0003] To overcome the problems existing in the related art, the present disclosure provides a robot control method, device, robot and medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a robot control method is provided, comprising:
[0005] Determining a target path for the robot to move, wherein the target path includes a plurality of target nodes;
[0006] Obtaining position information of an obstacle on the target path, wherein the position information of the obstacle includes an angle and a distance of the obstacle relative to the robot;
[0007] Based on the position information of the obstacle, controlling the robot to perform obstacle avoidance movement around the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold;
[0008] During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path for movement.
[0009] In some exemplary embodiments of the present disclosure, controlling the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle includes:
[0010] If the position information indicates that the obstacle is located within the radiation range of a first preset area of the robot, control the robot to rotate by a preset angle in a preset direction to a first position with the current position as a reference position, wherein the preset direction is determined based on the position of the obstacle within the radiation range of the first preset area;
[0011] determining motion parameters of the obstacle avoidance motion based on the position information;
[0012] Based on the motion parameters, the robot is controlled to move around the obstacle starting at the first position.
[0013] In some exemplary embodiments of the present disclosure, controlling the robot to rotate to a first position by a preset angle in a preset direction with the current position as a reference position includes:
[0014] If at least a portion of the structure of the obstacle is located within the radiation range of the first sub-area, controlling the robot to rotate in a first direction by the preset angle with the current position as a reference position;
[0015] If at least a portion of the structure of the obstacle is located within the radiation range of the second sub-area, controlling the robot to rotate in a second direction by the preset angle with the current position as a reference position;
[0016] The first preset area is divided into the first sub-area and the second sub-area by a preset reference line, and the first sub-area and the second sub-area are symmetrically arranged with the preset reference line as a symmetry axis;
[0017] The current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
[0018] In some exemplary embodiments of the present disclosure, controlling the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle includes:
[0019] If the position information indicates that the obstacle is located within a radiation range of a second preset area of the robot, determining motion parameters of the obstacle avoidance motion based on the position information, wherein the second preset area is outside the first preset area;
[0020] determining an initial direction for the robot to move around the obstacle based on a position of the obstacle in the second preset area;
[0021] Based on the motion parameters, the robot is controlled to move around the obstacle along the initial direction starting from the current position of the robot.
[0022] In some exemplary embodiments of the present disclosure, determining an initial direction for the robot to move around the obstacle based on the position of the obstacle in the second preset area includes:
[0023] If at least a portion of the structure of the obstacle is located within the radiation range of the third sub-area, determining the first direction as the initial direction;
[0024] If at least a portion of the structure of the obstacle is located within the radiation range of the fourth sub-area, determining the second direction as the initial direction;
[0025] The second preset area is divided into the third sub-area and the fourth sub-area by a preset reference line, and the third sub-area and the fourth sub-area are symmetrically arranged with the preset reference line as a symmetry axis. The third sub-area is located on a side of the first sub-area away from the preset reference line, and the fourth sub-area is located on a side of the second sub-area away from the preset reference line.
[0026] The current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
[0027] In some exemplary embodiments of the present disclosure, the robot is disc-shaped, and determining the motion parameters of the obstacle avoidance motion based on the position information includes:
[0028] determining a first angular error value of the robot at a current moment based on a distance of the obstacle relative to the robot, a radius of the robot, and a distance between the obstacle and the robot;
[0029] The motion parameter is determined based on a second angle error value, a cumulative error value and the first angle error value, wherein the second angle error value is the angle error value of the robot at the previous moment before the current moment, and the cumulative error value is the sum of the angle error values of all moments from the moment when the robot rotates from the reference position to the preset direction by a preset angle to the current moment.
[0030] In some exemplary embodiments of the present disclosure, the control method further includes:
[0031] Obtaining first position information of the robot at a current moment;
[0032] Acquire second position information of the next target node to be reached by the robot;
[0033] Based on the first position information and the second position information, the angular velocity and linear velocity of the robot at the next moment are determined.
[0034] In some exemplary embodiments of the present disclosure, if the angle between the robot and the next target node to be reached by the robot satisfies a preset condition, the robot returns to the target path, including:
[0035] If the robot performs obstacle avoidance movement around the obstacle in a counterclockwise direction, when the third angle error value is greater than the first preset parameter, the robot returns to the target path, wherein the third angle error value is determined based on the first position information and the second position information.
[0036] In some exemplary embodiments of the present disclosure, if the angle between the robot and the next target node to be reached by the robot satisfies a preset condition, the robot returns to the target path, including:
[0037] If the robot performs obstacle avoidance movement around the obstacle in a clockwise direction, and the third angle error value is less than a second preset parameter, the robot returns to the target path;
[0038] The first preset parameter and the second preset parameter are opposite numbers of each other.
[0039] In some exemplary embodiments of the present disclosure, the control method further includes:
[0040] Determining a first distance between the robot and the target node based on the first position information and the second position information;
[0041] If the first distance is greater than a preset distance, the target path is re-determined based on the first position information and the end point information of the target path.
[0042] According to a second aspect of an embodiment of the present disclosure, there is provided a control device for a robot, comprising:
[0043] An acquisition module, configured to determine a target path for the robot to move, wherein the target path includes a plurality of target nodes;
[0044] The acquisition module is further configured to acquire position information of obstacles on the target path, wherein the position information of the obstacles includes an angle and a distance of the obstacles relative to the robot;
[0045] an execution module, configured to control the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold;
[0046] During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path for movement.
[0047] According to a third aspect of the embodiments of the present disclosure, a robot is provided, comprising:
[0048] processor;
[0049] a memory for storing processor-executable instructions;
[0050] The processor is configured to execute the executable instructions in the memory to implement the robot control method provided in the first aspect of the present disclosure.
[0051] According to the fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program that can be executed is stored. When the computer program is executed by the processor of the robot, the robot control method provided by the first aspect of the present disclosure is implemented.
[0052] The above-mentioned method disclosed in the present invention has the following beneficial effects: the present invention does not require real-time calculation of obstacle avoidance logic. Only when an obstacle appears on the target path, the robot performs obstacle avoidance movement according to the position information of the obstacle, realizing local adaptive obstacle avoidance, with good obstacle avoidance effect and high precision. After successfully avoiding the obstacle, the robot will automatically return to the target path without the need to replan the robot's operating path, realizing automatic navigation, and the obstacle avoidance process does not require data training, which can effectively save computing power and other cost overheads.
[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0055] Figure 1 The figure is a flowchart of a method for controlling a robot according to an exemplary embodiment.
[0056] Figure 2a It is a schematic diagram of an application scenario according to an exemplary embodiment.
[0057] Figure 2b It is a schematic diagram of an application scenario according to an exemplary embodiment.
[0058] Figure 2c It is a schematic diagram of an application scenario according to an exemplary embodiment.
[0059] Figure 3 is a schematic diagram of a robot control method according to an exemplary embodiment.
[0060] Figure 4 The figure is a flowchart of a method for controlling a robot according to an exemplary embodiment.
[0061] Figure 5a is a schematic diagram illustrating an obstacle avoidance motion process of a robot according to an exemplary embodiment.
[0062] Figure 5b is a schematic diagram illustrating an obstacle avoidance motion process of a robot according to an exemplary embodiment.
[0063] Figure 5c is a schematic diagram illustrating an obstacle avoidance motion process of a robot according to an exemplary embodiment.
[0064] Figure 6 The figure is a flowchart of a method for controlling a robot according to an exemplary embodiment.
[0065] Figure 7 The figure is a flowchart of a method for controlling a robot according to an exemplary embodiment.
[0066] Figure 8 is a block diagram of a robot control device according to an exemplary embodiment.
[0067] Figure 9 is a block diagram of a robot according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0069] At present, there are three main types of robot navigation and obstacle avoidance technologies: path planning methods based on traditional algorithms, path planning methods based on deep learning, and path planning methods based on reinforcement learning.
[0070] Traditional path planning algorithms include the A* algorithm, Dijkstra's algorithm, the RRT algorithm, and the D* algorithm. These algorithms offer fast computational speeds, but their path planning performance in complex environments is suboptimal. Deep learning technologies enable robots to learn and train using convolutional neural networks and recurrent neural networks, continuously improving their path planning capabilities. While deep learning can handle path planning in complex environments, it requires extensive training data and computing resources. Reinforcement learning technologies enable robots to continuously learn and optimize path planning strategies through interaction with the environment through methods such as Q-learning and DQN. While reinforcement learning can handle path planning in complex environments and does not require extensive training data, it does require extended training time and computing resources.
[0071] For research and applications with practical engineering needs, computational and resource costs are important considerations. Therefore, path planning methods based on traditional algorithms, such as the A* and D* algorithms, are more widely used in practical applications. The A* algorithm can plan an obstacle-avoiding navigation path for a robot in a known environment, but if dynamic obstacles appear on the planned path, the robot cannot adaptively avoid them. The D* algorithm can solve problems in dynamic environments through quadratic local planning, but its implementation is complex and computationally intensive, and the resulting path planning result is not necessarily the optimal solution.
[0072] In order to solve the above problems, the present disclosure provides a robot control method, which determines the target path of the robot's movement; obtains the position information of obstacles on the target path; and based on the position information of the obstacle, controls the robot to perform obstacle avoidance movement around the obstacle. During the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold. If the angle between the robot and the next target node to be reached meets the preset conditions, the robot returns to the target path. The present disclosure does not require real-time calculation of obstacle avoidance logic. Only when an obstacle appears on the target path, the robot performs obstacle avoidance movement based on the position information of the obstacle, achieving local adaptive obstacle avoidance. The obstacle avoidance effect is good and the accuracy is high. After successfully avoiding the obstacle, the robot automatically returns to the target path without the need to replan the robot's operating path, achieving automatic navigation. In addition, the obstacle avoidance process does not require the use of data training, which can effectively save computing power and other cost expenses.
[0073] The exemplary embodiments of the present disclosure provide a robot control method, which is applied to robots such as sweeping robots,
[0074] like Figure 1 As shown, the control method of the robot shown in the present disclosure includes:
[0075] S101, determining a target path for robot movement, where the target path includes multiple target nodes;
[0076] S102, obtaining position information of obstacles on the target path, where the position information of the obstacles includes the angle and distance of the obstacles relative to the robot;
[0077] S103, controlling the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold;
[0078] S104 , during the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path.
[0079] In step S101, the robot can use laser sensors, ToF (Time of Flight) sensors, lidar and other devices to collect environmental data, obtain two-dimensional information about the environment, and use Simultaneous Localization and Mapping (SLAM) technology to construct a two-dimensional grid map. The two-dimensional grid map shows the areas where the robot is allowed to pass. The robot can also obtain a map of the robot's environment through communication, such as receiving a map of the robot's current environment directly input by the user. If the robot has been in the current environment before, the robot can directly obtain a map from relevant historical records.
[0080] Based on the task they want the robot to complete, users can specify the starting and ending points of the robot's movement on a map. The robot then uses algorithms such as A* and D* to plan a target path based on the environmental information in the map and the locations of the starting and ending points, allowing the robot to move along the determined target path from the starting point to the end point. If the robot is not currently at the starting point specified by the user, it must first move to the starting point and then move along the target path. If the user only specifies the end point without specifying the starting point, the robot will use its current location as the starting point and use the algorithm to plan the target path to the end point. In addition, the target path can also be a path specified by the user on the map, with the starting point and end point of the specified path being the starting point and end point, respectively. It should be noted that the target path is not necessarily the optimal path, as long as the target path can achieve the robot's desired task.
[0081] For example, in Figure 2aIn the example, robot 1 is located in a kitchen scene with table 3, refrigerator 4, and chair 5. The user sets table 3 as the starting point and refrigerator 4 as the end point. Based on the starting and end points, the robot 1 plans a target path 6 using an algorithm. This means that the robot 1 will move directly from table 3 to refrigerator 4. Alternatively, the user can specify that the robot move along a target path 7. This means that the robot 1 will move from table 3 to chair 5 and then to refrigerator 4.
[0082] In order to ensure that the robot can complete the movement on the entire target path, the target path contains multiple target nodes, that is, the longer target path is divided into multiple target sections, and the movement of the entire target path is completed by moving between the target sections.
[0083] In step S102, when there are no obstacles on the target path, the robot will move along the determined target path. When an obstacle appears on the target path, for example, a small ball rolls onto the target path and the user stands on the target path, the robot needs to avoid the obstacle to avoid colliding with the obstacle and causing damage to the robot. In order to ensure that the robot can avoid obstacles in time, during the operation phase of the robot, the robot uses devices such as laser sensors, ToF sensors or lidars to scan the environment around the robot in real time. Different devices have different performances and can scan different ranges and distances. In order to improve the effect of obstacle avoidance, the robot can choose to use a device with a wider scanning range and a longer distance to scan obstacles. The robot uses the data obtained by the sensor or radar to determine whether there are obstacles around the robot, as well as the location information of the obstacles. Among them, the location information of the obstacle includes the angle and distance of the obstacle relative to the robot. Usually, robots are mostly regular in shape. A coordinate system can be established with the center point of the robot, and the angle and distance of the obstacle relative to the robot can be determined based on the coordinates of the obstacle. Among them, the way to establish the coordinate system is not unique, and the directions of the x-axis and y-axis can be determined according to the needs of the calculation. For example, Figure 3 As shown, robot 1 is a regular circle. An xy coordinate axis can be established with the center of robot 1 as the origin, with the robot's right side as the positive x-axis direction and the robot's front as the positive y-axis direction. For another example, an xy coordinate axis can be established with the robot's center as the origin, with the robot's front as the positive x-axis direction and the robot's left as the positive y-axis direction. When a robot scans for obstacles using sensors and other devices, it acquires multiple obstacle data. To avoid collisions, the angle and distance corresponding to the point on the obstacle that is shortest relative to the robot is selected as the position information.
[0084] In step S103, the angle and distance of the obstacle relative to the robot affect the robot's rotation direction and movement distance. The robot adjusts its angular velocity and linear velocity based on the angle and distance of the obstacle relative to the robot, allowing the robot to avoid the obstacle. For example, if the angular obstacle is located in front of the robot's left and very close, the robot will collide with the obstacle if it does not change its angular velocity and linear velocity. Therefore, the robot needs to change its angular velocity and reduce its linear velocity, causing the robot to move counterclockwise to avoid the obstacle. For another example, if the angular obstacle is located in front of the robot's right and farther away, the robot can maintain its linear velocity and change its angular velocity, causing the robot to move clockwise to avoid the obstacle. It should be noted that when the angular obstacle is directly in front of the robot relative to the robot, the robot needs to first rotate according to the angle and then determine its angular velocity and linear velocity to avoid a collision.
[0085] To prevent the robot from straying from its target path due to circling obstacles, it must move as close to the obstacle as possible. During obstacle avoidance, the distance between the robot and the obstacle must be within a preset threshold, meaning the robot maintains a certain distance from the obstacle throughout its movement. The preset threshold can be a numeric value or a range. The threshold can be set based on the robot's performance and task requirements. For example, to ensure thorough cleaning, the threshold can be set relatively low, such as 0.5 cm, even though the robot can rotate as close to the obstacle as possible without contact. Alternatively, to avoid collisions between the robot and the obstacle, the threshold can be set relatively high, such as [0.8 cm, 1 cm].
[0086] In step S104, the robot's obstacle avoidance maneuver involves circling an obstacle within a specific target segment of the target path. If the obstacle completely blocks the robot's target path, the robot must circumvent at least half of the obstacle. If the obstacle partially blocks the robot's target path, the robot only needs to circumvent a portion of the obstacle. Since the robot's obstacle avoidance maneuver aims to return to the target path after circumventing the obstacle, there's no need to plan a new target path to reach the end point. Therefore, before performing the obstacle avoidance maneuver, the robot records the information of the next target node to be reached. By comparing the angle between the robot and the next target node with a preset condition, the robot determines whether it has returned to the target path. For example, during the obstacle avoidance maneuver, the robot calculates in real time the angle between its current position and the next target node relative to the target path. If the angle is significantly greater than the preset condition, the robot has not yet returned to the target path; if the angle is close to the preset condition, the robot is gradually approaching the target path; and if the angle meets the preset condition, the robot has returned to the target path.
[0087] like Figure 2a As shown, the robot 1 performs a cleaning task in the kitchen, with the table 3 as the starting point and the refrigerator 4 as the end point. The robot 1 uses the A* algorithm to plan a target path 6, and the robot moves along the target path 6 to the refrigerator 4. Figure 2b In the example, obstacle 2 appears on the target path 6. When robot 1 detects obstacle 2, it performs obstacle avoidance motion based on the position information of obstacle 2 relative to robot 1. During the obstacle avoidance process, robot 1 moves around obstacle 2, and the distance to obstacle 2 is always kept within the preset threshold. Figure 2c As shown, after bypassing obstacle 2, the next target node is refrigerator 4, and the angle between robot 1 and refrigerator 4 meets the preset conditions, that is, robot 1 returns to the target path and still moves along the target path to the location of refrigerator 4.
[0088] In the present disclosure, the robot does not need to calculate the obstacle avoidance logic in real time. Only when an obstacle appears on the target path, the robot performs obstacle avoidance movement based on the position information of the obstacle, realizing local adaptive obstacle avoidance. The obstacle avoidance effect is good and the accuracy is high. After successfully avoiding the obstacle, the robot will automatically return to the target path. There is no need to replan the robot's operation path, and automatic navigation is realized. In addition, the obstacle avoidance process does not require data training, which can effectively save computing power and other cost overheads.
[0089] According to an exemplary embodiment, Figure 4 As shown, the robot control method in this embodiment includes:
[0090] S401, determining a target path for the robot's motion, where the target path includes a plurality of target nodes;
[0091] S402, determining whether there is an obstacle on the target path, if there is an obstacle on the target path, executing step S404; if there is no obstacle on the target path, executing step S403;
[0092] S403, controlling the robot to move along the target path;
[0093] S404: Obtaining the position information of obstacles on the target path, where the position information of the obstacles includes the angle and distance of the obstacles relative to the robot;
[0094] S405: Determine whether the position information indicates that the obstacle is within the radiation range of the first preset area of the robot. If the obstacle is within the radiation range of the first preset area of the robot, execute step S406; if the obstacle is not within the radiation range of the first preset area of the robot, execute step S409.
[0095] S406, controlling the robot to rotate in a preset direction and by a preset angle to a first position with the current position as a reference position;
[0096] S407: Determine motion parameters of the obstacle avoidance motion based on the position information;
[0097] S408, starting to control the robot to move around the obstacle at the first position based on the motion parameters;
[0098] S409: Determine motion parameters of the obstacle avoidance motion based on the position information;
[0099] S410, determining an initial direction for the robot to move around the obstacle based on the position of the obstacle in the second preset area;
[0100] S411, based on the motion parameters, controlling the robot to move around the obstacle along the initial direction starting from the current position of the robot;
[0101] S412: During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path.
[0102] Among them, steps S401, S404, and S412 are the same as those in the above embodiment and will not be repeated here.
[0103] In step S402, to prevent the robot from colliding with obstacles and causing damage, the robot uses laser sensors, lidar, and other devices to scan the environment in real time during operation to determine whether there are any obstacles around the robot. Due to differences in the performance of laser sensors and other devices, the angles and ranges they can scan vary. Some devices can scan wide areas and long distances, while others can only scan smaller areas and closer distances. Therefore, obstacle avoidance is not necessary when an obstacle is detected. If a distant obstacle does not block the robot's target path, obstacle avoidance is not required. The robot aggregates the data detected by the sensors and other devices through data fusion and uses an obstacle detection function to determine whether obstacle avoidance is necessary. If obstacle avoidance is determined to be necessary, step S404 and subsequent steps are executed, causing the robot to avoid the obstacle based on the angle and distance of the obstacle relative to the robot. If obstacle avoidance is determined not to be necessary, step S403 is executed to control the robot to move along the target path.
[0104] In one example, the position information of the robot at the current time k is obtained, where the position information can be presented in the form of coordinates. k (x, y) represents the specific position of the robot on the entire map, and the obstacle detection function h is used, that is, D = h (Robot k (x,y)) to determine whether the robot needs to avoid obstacles. The obstacle detection function h will output the result D, which has two values: 0 and 1. When D is 1, it means that the robot needs to avoid obstacles; when D is 0, it means that the robot does not need to avoid obstacles.
[0105] In step S405, since the robot determines the angular velocity and linear velocity of the movement around the obstacle based on the angle and distance of the obstacle relative to the robot, in order to improve the accuracy of the robot's obstacle avoidance, the scanning range of the robot when scanning with a laser sensor, laser radar or other device can be divided into multiple areas. The first preset area refers to the area directly in front of the robot and the area on both sides that is biased towards the front. The second preset area refers to the area in front of the robot other than the first preset area. The second preset area is located outside the first preset area. For example, Figure 3As shown, the front of the robot 1 includes a range of [-90°, 90°]. The [-45°, 45°] of the robot 1 can be used as the first preset area, and the second preset area is [-90°, -45°) and (45°, 90°] in front except the first preset area; in order to improve the accuracy of obstacle avoidance, the first preset area can be expanded, and the [-60°, 60°] of the robot 1 can be used as the first preset area, and the second preset area is [-90°, -60°) and (60°, 90°]; if the robot's movement performance is more sensitive, the first preset area can be reduced, and the [-30°, 30°] of the robot 1 can be used as the first preset area, and the second preset area is [-90°, -30°) and (30°, 90°].
[0106] Since the obstacle is uncontrollable, when the position information indicates that the obstacle is located in the radiation area of the first preset area, the robot needs to rotate to avoid the obstacle first, and then perform obstacle avoidance movement around the obstacle, that is, execute step S406; when the position information indicates that the obstacle is not located within the radiation range of the robot's first preset area, that is, it is located within the radiation range of the robot's second preset area, the robot does not need to rotate to avoid the obstacle, and can perform obstacle avoidance movement according to the position information, that is, it can directly execute step S409.
[0107] In step S406, the robot uses its current position as a reference and rotates in a predetermined direction and angle to remove the obstacle from the robot's first predetermined area. The predetermined direction is determined based on the obstacle's position within the robot's first predetermined area. For example, if the obstacle is located to the left of the robot's first predetermined area, the right direction can be used as the predetermined direction; if the obstacle is located to the right of the robot's first predetermined area, the left direction can be used as the predetermined direction.
[0108] The preset angle is sufficient as long as it prevents obstacles from falling within the robot's first preset area. The preset angle can be determined based on the size of the first preset area. If the first preset area is large, the preset angle can be appropriately increased; if the first preset area is small, the preset angle can be appropriately decreased. For example, if the first preset area is [-45°, 45°] of the robot, the preset angle can be set to 90°; for another example, if the first preset area is [-30°, 30°] of the robot, the preset angle can be set to 60°. The position of the robot after rotating the preset angle in the preset direction with the current position as the reference position is defined as the first position.
[0109] In step S407, after the robot rotates to the first position, a coordinate system is established based on the center point of the robot with the current first position as a reference, with the front of the robot as the positive direction of the x-axis and the left side of the robot as the positive direction of the y-axis. The angle of the obstacle relative to the robot is determined based on the coordinates of the obstacle in the coordinate system. angle and distance obstacle dist , further determining the robot's motion parameters for obstacle avoidance. The motion parameters include the robot's angular velocity w and / or linear velocity v, which are determined using the robot's rotation function Rotate. For example, when the first preset area is [-45°, 45°] of the robot, the robot's motion parameters are determined based on the following formula:
[0110] (v,w)=Rotate(obstacle angle +90°)
[0111] This obtains the robot's motion parameters for the first position. In step S408, the robot begins controlling its movement around the obstacle at the first position based on the motion parameters. During subsequent obstacle avoidance maneuvers, the robot continuously adjusts its motion parameters based on the position of the obstacle relative to the robot.
[0112] In one example, if Figure 5a As shown, robot 1's first preset area is [-45°, 45°]. Robot 1 scans the environment and obtains the position information of the point closest to obstacle 2 from robot 1. This information is used as the obstacle's position information. This means that obstacle 2 is located at 0° relative to robot 1 and within the radiation range of the first preset area. Robot 1 rotates 90° to the left, placing the obstacle directly to the right and parallel to the robot.
[0113] The implementation of step S409 is the same as that of step S407 and will not be repeated here.
[0114] In step S410, if the obstacle is within the robot's second preset area, the robot does not need to rotate. The robot's initial direction of movement around the obstacle is determined based on the obstacle's position within the second preset area. Since the second preset area is outside the first preset area and is allocated to the area in front of the robot near the left and right directions, if the obstacle is located near the left in the second preset area, the robot's initial direction is determined to be left. If the obstacle is located near the right in the second preset area, the robot's initial direction is determined to be right.
[0115] In step S411, the robot controls the robot to move around the obstacle along the initial direction starting from the current position of the robot based on the motion parameters. If the initial direction of the robot is to the right, it will move around the obstacle clockwise or counterclockwise during the obstacle avoidance process; if the initial direction of the robot is to the left, it will move around the obstacle counterclockwise during the obstacle avoidance process.
[0116] In one example, if Figure 5b As shown, the second preset area of robot 1 is [-90°, -45°) and (45°, 90°]. Robot 1 scans the environment and obtains the position information of the point closest to obstacle 2 from robot 1 as the position information of the obstacle. That is, obstacle 2 is located at 90° to the right of robot 1 and is within the radiation range of the second preset area. It can be determined that the initial direction is to the right. Robot 1 does not need to rotate again. The motion parameters are determined based on the position information, and robot 1 moves clockwise around obstacle 2.
[0117] In the present disclosure, the robot can determine whether it needs to rotate to avoid the obstacle first and then move around the obstacle based on the position information of the obstacle, without using other data, which reduces the robot's computing pressure, effectively improves the accuracy of obstacle avoidance, and reduces the possibility of the robot colliding with the obstacle.
[0118] According to an exemplary embodiment, Figure 6 As shown, the robot control method in this embodiment includes:
[0119] S601, determining a target path for the robot's motion, where the target path includes a plurality of target nodes;
[0120] S602: Obtaining position information of obstacles on the target path, where the position information of the obstacles includes the angle and distance of the obstacles relative to the robot;
[0121] S603: Determine whether the position information indicates that the obstacle is within the radiation range of the first preset area of the robot. If the obstacle is within the radiation range of the first preset area of the robot, execute step S604; if the obstacle is not within the radiation range of the first preset area of the robot, execute step S610.
[0122] S604: Determine whether at least part of the structure of the obstacle is located within the radiation range of the first sub-area. If at least part of the structure of the obstacle is located within the radiation range of the first sub-area, execute step S605; if at least part of the structure of the obstacle is not located within the radiation range of the first sub-area, execute step S606.
[0123] S605, controlling the robot to rotate in a first direction by a preset angle with the current position as a reference position;
[0124] S606, controlling the robot to rotate in a second direction by a preset angle with the current position as a reference position;
[0125] S607, controlling the robot to rotate in a preset direction and by a preset angle to a first position with the current position as a reference position;
[0126] S608: Determine motion parameters of the obstacle avoidance motion based on the position information;
[0127] S609: Starting to control the robot to move around the obstacle at the first position based on the motion parameters;
[0128] S610: Determine motion parameters of obstacle avoidance motion based on the position information;
[0129] S611, determining an initial direction for the robot to move around the obstacle based on the position of the obstacle in the second preset area;
[0130] S612: Based on the motion parameters, control the robot to move around the obstacle along the initial direction starting from the current position of the robot;
[0131] S613: Determine whether the robot is performing obstacle avoidance movement around the obstacle in a counterclockwise direction. If the robot is performing obstacle avoidance movement around the obstacle in a counterclockwise direction, execute step S614; if the robot is performing obstacle avoidance movement around the obstacle in a clockwise direction, execute step S615.
[0132] S614: When the third angle error value is greater than the first preset parameter, the robot returns to the target path;
[0133] S615: When the third angle error value is less than the second preset parameter, the robot returns to the target path.
[0134] Among them, steps S601-S603 and S607-S612 are the same as those in the above embodiment and will not be repeated here.
[0135] In step S604, the first preset area is divided into a first sub-area and a second sub-area by a preset reference line, and the first sub-area and the second sub-area are symmetrically arranged with the preset reference line as the symmetry axis. Figure 3As shown, the first preset area is [-45°, 45°], the preset reference line is the axis of symmetry corresponding to 0°, the left side of the preset reference line is divided into a first sub-area, and the right side of the preset reference line is divided into a second sub-area, that is, the first sub-area is (0°, 45°] and the second sub-area is [-45°, 0°], or the first sub-area is [0°, 45°] and the second sub-area is [-45°, 0°). In another example, the right side of the preset reference line can be divided into the first sub-area, and the left side of the preset reference line can be divided into the second sub-area, that is, the first sub-area is [-45°, 0°) and the second sub-area is [0°, 45°], or the first sub-area is [-45°, 0°] and the second sub-area is (0°, 45°].
[0136] If at least part of the obstacle's structure is within the radiation range of the first sub-area, it indicates that the obstacle is located on one side of the robot, and step S605 is executed to control the robot to rotate by a preset angle in the first direction with the current position as a reference position. If at least part of the obstacle's structure is within the radiation range of the second sub-area, it indicates that the obstacle is located on the other side of the robot, and step S606 is executed to control the robot to rotate by a preset angle in the second direction with the current position as a reference position.
[0137] The current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line. The first direction and the second direction need to be determined based on the settings of the first sub-area and the second sub-area. For example, Figure 3 As shown, the preset reference line is the symmetry axis corresponding to 0°. If the first sub-area is (0°, 45°] and the second sub-area is [-45°, 0°], it can be determined that the first direction is to the right of the preset reference line and the second direction is to the left of the preset reference line.
[0138] In some embodiments, the robot is disc-shaped. Steps S608 and S610 determine the motion parameters of the obstacle avoidance motion based on the position information, including:
[0139] Determine a first angle error value of the robot at a current moment based on the distance of the obstacle relative to the robot, the radius of the robot, and the distance between the obstacle and the robot;
[0140] The motion parameters are determined based on the second angle error value, the cumulative error value and the first angle error value, wherein the second angle error value is the angle error value of the robot at the previous moment before the current moment, and the cumulative error value is the sum of the angle error values of all moments from the moment when the robot rotates from the reference position to the preset direction by a preset angle to the current moment.
[0141] When the robot avoids obstacles, it must maintain a distance from them within a preset threshold to ensure it returns to its target path after circumventing them. However, during the robot's actual obstacle avoidance, its operational control may not be precise enough, causing the distance between the robot and the obstacle to change and fail to remain within the preset threshold, resulting in distance error. This distance error accumulates throughout the entire obstacle avoidance process. To facilitate robot control, the distance error can be converted into an angular error. By adjusting the motion parameters, the robot can maintain the distance from the obstacle within the preset threshold.
[0142] Because the robot's coordinate system is based on the robot's center point and the robot is disk-shaped, the robot's first angle error at the current moment is determined based on the obstacle's distance from the robot, the robot's radius, and the distance between the obstacle and the robot. The robot then determines motion parameters based on the second angle error, the accumulated error, and the first angle error, and moves according to these parameters.
[0143] In one example, the robot uses the atan inverse tangent function to convert distance error into angle error:
[0144] error angle =atan(obstacle y +robot_radius+dist,obstacle x )
[0145] Among them, error anhle is the first angle error value, atan is the inverse tangent function, robot_radius is the radius of the robot, dist is the distance between the obstacle and the robot, obstacle x is the horizontal coordinate of the point where the obstacle is closest to the robot. y is the ordinate of the point closest to the robot. The robot uses the inverse tangent function atan to convert the distance error into an angle error and obtain the robot's first angle error at the current moment.
[0146] The robot uses a PID controller to calculate motion parameters:
[0147] w=K p *error angle +K i *error angle_sum +K d *(error angle -error angle_last )
[0148] Among them, K p , K i , K d is the PID parameter, error angle is the first angle error value, error angle_sum Is the cumulative error value, error angle_last is the second angle error value, and w is the angular velocity in the motion parameters.
[0149] In some embodiments, step S611 determines the initial direction of the robot's movement around the obstacle based on the position of the obstacle in the second preset area, including:
[0150] If at least a portion of the structure of the obstacle is located within the radiation range of the third sub-area, determining the first direction as the initial direction;
[0151] If at least a portion of the structure of the obstacle is located within the radiation range of the fourth sub-area, the second direction is determined as the initial direction.
[0152] The second preset area is divided into a third sub-area and a fourth sub-area by a preset reference line. The third sub-area and the fourth sub-area are symmetrically arranged with the preset reference line as a symmetry axis. The third sub-area is located on a side of the first sub-area away from the preset reference line, and the fourth sub-area is located on a side of the second sub-area away from the preset reference line.
[0153] The current position is determined based on a position of a preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
[0154] Since the second preset area is located outside the first preset area, and the first preset area is divided according to the preset reference line, the third sub-area and the fourth sub-area of the second preset area are also symmetrically distributed on both sides of the preset reference line and away from the preset reference line. Figure 3 As shown, the first preset area is [-45°, 45°], and the preset reference line is the symmetry axis corresponding to 0°, wherein the first preset area is [-45°, 45°], wherein the first sub-area is (0°, 45°], the second sub-area is [-45°, 0°], the second preset area is [-90°, -45°) and (45°, 90°], wherein the third sub-area is (45°, 90°], which is located on the side of the first sub-area away from the preset reference line, and the fourth sub-area is [-90°, -45°), which is located on the side of the second sub-area away from the preset reference line.
[0155] When at least part of the obstacle structure is within the radiation range of the third sub-area or the fourth sub-area, the robot needs to determine the initial direction of the obstacle avoidance movement based on the distribution of the third sub-area and the fourth sub-area, wherein one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line. Figure 3 As shown, the third sub-area is (45°, 90°], and the fourth sub-area is [-90°, -45°). If at least part of the structure of the obstacle is located in the third sub-area, that is, the obstacle is located on the left side of the robot, the robot needs to rotate left to avoid the obstacle, so the first direction is the left side of the preset reference line, and the initial direction is left; if at least part of the structure of the obstacle is located in the fourth sub-area, that is, the obstacle is located on the right side of the robot, the robot needs to rotate to avoid the obstacle, so the first direction is the right side of the preset reference line, and the initial direction is right.
[0156] In some embodiments, the target path includes multiple target nodes, and the control method further includes:
[0157] Get the robot's first position information at the current moment;
[0158] Obtaining the second position information of the next target node to be reached by the robot;
[0159] Based on the first position information and the second position information, the angular velocity and linear velocity of the robot at the next moment are determined.
[0160] When the robot does not detect the location information of the obstacle, the robot will move from the starting point to the end point along the planned target path. In order to ensure that the robot can complete the long-distance movement from the starting point to the end point, multiple target nodes are set on the target path, and the target path is divided into multiple sections, that is, the robot completes the movement of the entire target path by moving from one target node to the next target node. Since not all target paths are regular straight lines, the robot needs to continuously adjust the linear speed and angular velocity in the process of moving along the target path in order to move from one target node to the next target node. During the movement process, the first position information of the robot at the current moment k can be obtained. The first position information is presented in the form of coordinates and can be used by Robot k (x, y) indicates the specific position of the robot on the entire map. At the same time, the second position information of the next target node m to be reached by the robot is obtained. The second position information is also presented in the form of coordinates and can be expressed as Point m(x, y) represents the specific position of the next node on the entire map. The first position information and the second position information are both determined in the same coordinate system. Therefore, the first position information and the second position information can be used to determine the orientation relationship between the robot's current position and the next target node to be reached. The navigation function in the following formula is used to determine the angular velocity and linear velocity that the robot needs to move at the next moment:
[0161] (v,w) k+1 =f(Robot k (x,y),Point m (x,y)),m≤N
[0162] Where v represents linear velocity, w represents angular velocity, k represents the current moment, k+1 represents the next moment, f represents the navigation function, m represents the next target node, and N represents the total number of target nodes. Alternatively, PID control functions or model predictive control (MPC) can be used to determine the robot's angular velocity and linear velocity at the next moment based on analysis of the first and second position information.
[0163] In step S613, during the entire obstacle avoidance process, the robot has two possibilities: counterclockwise or clockwise movement around the obstacle. If the robot moves around the obstacle in a counterclockwise direction, that is, the initial direction is left, the obstacle will always be on the left side of the robot during the obstacle avoidance process. If the robot moves around the obstacle in a clockwise direction, that is, the initial direction is right, the obstacle will always be on the right side of the robot during the obstacle avoidance process. Figure 5b As shown in the figure, during the obstacle avoidance movement, the obstacle is always located on the right side of the robot, and the robot moves around the obstacle in a clockwise direction to avoid the obstacle.
[0164] When the robot avoids obstacles in a clockwise direction, the target path is on the right side of the robot; when the robot avoids obstacles in a counterclockwise direction, the target path is on the left side of the robot, and the robot needs to return to the target path after completing the obstacle avoidance movement. Therefore, different standards need to be used to determine whether the robot returns to the target path according to whether the robot avoids obstacles in a clockwise or counterclockwise direction.
[0165] When the robot performs obstacle avoidance movement in a counterclockwise direction around an obstacle, the robot is judged to have returned to the target path by comparing the third angle error value with the first preset parameter; when the robot performs obstacle avoidance movement in a clockwise direction around an obstacle, the robot is judged to have returned to the target path by comparing the third angle error value with the second preset parameter. The third angle error value is determined based on the first position information of the robot at the current moment and the second position information of the next target node to be reached by the robot. When the robot detects the presence of an obstacle in the surrounding area and determines that obstacle avoidance movement is required, the robot will record the second position information of the next target node to be reached. During the obstacle avoidance movement, the robot can calculate the second angle error value in real time or at intervals.
[0166] The first preset parameter and the second preset parameter are opposite numbers of each other. The first preset parameter can be set using an empirical value. For example, if the first preset parameter is set to 0.45, the second preset parameter is -0.45. If the robot moves around the obstacle clockwise during the obstacle avoidance movement, the second angle error value calculated by the PID controller is less than 0. When the third angle error value is greater than 0 and the third angle error value is greater than the first preset parameter, it proves that the robot has returned to the target path. If the robot moves around the obstacle counterclockwise during the obstacle avoidance movement, the third angle error value calculated by the PID controller is greater than 0. When the third angle error value is less than 0 and the third angle error value is less than the second preset parameter, it proves that the robot has returned to the target path. That is, it can be determined using the following formula:
[0167]
[0168] Among them, Robot k (x, y) is the first position information of the robot at the current moment, Point m (x, y) is the second position information of the next target node that the robot wants to reach. k (x,y),Point m (x,y)) to obtain the robot's angular velocity and linear velocity, and further obtain the third angle error value, parameter return Is the first preset parameter, -parameter returnis the second preset parameter. R represents the monitoring logic of the robot returning to the target path. The values of R are 0 and 1. When the value of R is 1, it indicates that the robot has returned to the target path; when the value of R is 0, it indicates that the robot has not returned to the target path. It should be noted that the first position information and the second position information can be determined by the coordinate axis established with the robot as the center of the coordinate system, or by the coordinate axis established by the map. For example, the center of the robot can be used as the origin of the coordinate axis, the front of the robot can be used as the positive direction of the x-axis, and the left side of the robot can be used as the positive direction of the y-axis. Since the robot is moving, that is, the entire coordinate axis will move, the second position information will change accordingly. When the obstacle is located in the first quadrant of the coordinate system, the robot moves clockwise around the obstacle, and the calculated third angle error value is a positive number; when the obstacle is located in the second quadrant of the coordinate system, the robot moves counterclockwise around the obstacle, and the calculated third angle error value is a negative number.
[0169] like Figure 5c As shown, robot 1 performs obstacle avoidance movement clockwise around obstacle 2. During this obstacle avoidance movement, robot 1 calculates the third angular error between itself and the next target node to be reached in real time. Before robot 1 returns to the target path, the calculated third angular error is always less than 0. If the calculated third error is greater than 0 and greater than a first preset parameter, it indicates that robot 1 has avoided obstacle 2 and returned to the target path. For example, if the first preset parameter is set to 0.45, and the calculated third angular error is -0.2, it indicates that the robot is still not close to the target path. If the calculated third angular error is 0.2, which is greater than 0 but less than the first preset parameter of 0.45, it indicates that the robot is gradually approaching the target path. If the calculated third angular error is 0.5, which is greater than 0 and greater than the first preset parameter of 0.45, it indicates that the robot has returned to the target path.
[0170] In the present disclosure, the position of the obstacle relative to the robot is divided into multiple sub-areas, the rotation direction and movement direction of the robot are determined, the accuracy of the robot's obstacle avoidance movement is further improved, automatic navigation and automatic obstacle avoidance are realized, and the movement on the target path is completed.
[0171] According to an exemplary embodiment, Figure 7 As shown, the robot control method in this embodiment includes:
[0172] S701, determining a target path for the robot's motion, where the target path includes a plurality of target nodes;
[0173] S702: Obtaining the position information of obstacles on the target path, where the position information of the obstacles includes the angle and distance of the obstacles relative to the robot;
[0174] S703, obtaining second position information of the next target node to be reached by the robot;
[0175] S704: Based on the position information of the obstacle, control the robot to perform obstacle avoidance movement around the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold;
[0176] S705, obtaining the first position information of the robot at the current moment;
[0177] S706, determining a first distance between the robot and the target node based on the first position information and the second position information;
[0178] S707, determining whether the first distance is greater than a preset distance, if the first distance is greater than the preset distance, executing step S708; if the first distance is less than or equal to the preset distance, executing step S709;
[0179] S708: re-determine the target path based on the first location information and the end point information of the target path;
[0180] S709: If the angle between the robot and the next target node to be reached by the robot meets the preset condition, the robot returns to the target path.
[0181] Among them, steps S701-S705 and S709 are the same as those in the above embodiment and will not be repeated here.
[0182] In step S706, the first position information and the second position information are both recorded in the form of coordinates. The distance between the robot and the next target node can be calculated using the Euclidean distance formula, that is, the first distance can be calculated using the following formula:
[0183] Dist=D(Robot t (x,y),Point m (x,y))
[0184] Among them, Robot k (x, y) is the first position information of the robot at the current moment, Point m (x, y) is the second position of the next target node that the robot wants to reach, D is the Euclidean distance formula, and Dist is the first distance. The coordinate information can be determined in the coordinate system established by the robot or the coordinate system established by the map.
[0185] In step S707, the preset distance can be set based on empirical values, such as 40 cm; it can also be determined based on the robot's specifications and performance. For example, some robots require greater precision, so the preset distance can be set to 50 cm. If the first distance is greater than the preset distance, it indicates that the robot is circling the obstacle further and further away from the next target node in the target path during the obstacle avoidance process, and the robot is unable to avoid the obstacle. Therefore, step S708 is executed. Based on the robot's current first position information and the target path endpoint information, the robot uses a path planning algorithm such as the A* algorithm and the D* algorithm to replan a target path so that the robot can eventually reach the endpoint and complete the task set by the user.
[0186] In the present disclosure, the robot is provided with computing logic to prevent the robot from going further and further around obstacles. If the first distance of the robot is greater than the preset distance, it means that the robot is moving further and further around the obstacle and cannot achieve local adaptive obstacle avoidance, resulting in a decrease in navigation efficiency. Therefore, the path needs to be replanned to ensure that the robot can reach the end point of the original target path and improve the performance of the robot's automatic navigation.
[0187] The exemplary embodiment of the present disclosure provides a control device for a robot. Figure 8 As shown, a block diagram of a robot control device shown in the present disclosure.
[0188] The block diagram includes: an acquisition module 81 and an execution module 82. The acquisition module 81 is used to determine the target path of the robot's movement, which includes multiple target nodes. The acquisition module 81 is also used to obtain the position information of obstacles on the target path, which includes the angle and distance of the obstacles relative to the robot. The execution module 82 is used to control the robot to perform obstacle avoidance movement around the obstacle based on the obstacle position information, wherein, during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold. During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path.
[0189] In an exemplary embodiment of the present disclosure, the execution module 82 is also used to: if the position information indicates that the obstacle is located within the radiation range of a first preset area of the robot, control the robot to rotate in a preset direction by a preset angle to a first position with the current position as a reference position, wherein the preset direction is determined based on the position of the obstacle within the radiation range of the first preset area; determine the motion parameters of the obstacle avoidance motion based on the position information; and control the robot to move around the obstacle starting at the first position based on the motion parameters.
[0190] In an exemplary embodiment of the present disclosure, the execution module 82 is also used to: if at least part of the structure of the obstacle is located within the radiation range of the first sub-area, control the robot to rotate a preset angle in the first direction with the current position as the reference position; if at least part of the structure of the obstacle is located within the radiation range of the second sub-area, control the robot to rotate a preset angle in the second direction with the current position as the reference position; wherein, the first preset area is divided into a first sub-area and a second sub-area by a preset reference line, and the first sub-area and the second sub-area are symmetrically arranged with the preset reference line as the axis of symmetry; the current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
[0191] In an exemplary embodiment of the present disclosure, the execution module 82 is also used to: if the position information indicates that the obstacle is located within the radiation range of a second preset area of the robot, determine the motion parameters of the obstacle avoidance motion based on the position information, wherein the second preset area is located outside the first preset area; determine the initial direction of the robot's movement around the obstacle based on the position of the obstacle in the second preset area; and control the robot to move around the obstacle along the initial direction starting from the current position of the robot based on the motion parameters.
[0192] In an exemplary embodiment of the present disclosure, the execution module 82 is also used to: if at least part of the structure of the obstacle is located within the radiation range of the third sub-area, determine the first direction as the initial direction; if at least part of the structure of the obstacle is located within the radiation range of the fourth sub-area, determine the second direction as the initial direction; wherein the second preset area is divided into a third sub-area and a fourth sub-area by a preset reference line, the third sub-area and the fourth sub-area are symmetrically arranged with the preset reference line as the axis of symmetry, the third sub-area is located on the side of the first sub-area away from the preset reference line, and the fourth sub-area is located on the side of the second sub-area away from the preset reference line; the current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
[0193] In an exemplary embodiment of the present disclosure, the robot is disc-shaped, and the execution module 82 is further used to: determine the first angle error value of the robot at the current moment based on the distance of the obstacle relative to the robot, the radius of the robot, and the distance between the obstacle and the robot; determine the motion parameters based on the second angle error value, the cumulative error value and the first angle error value, wherein the second angle error value is the angle error value of the robot at the previous moment of the current moment, and the cumulative error value is the sum of the angle error values of all moments from the moment when the robot rotates from the reference position to the preset direction by a preset angle to the current moment.
[0194] In the exemplary embodiment of the present disclosure, the acquisition module 81 is further configured to: acquire first position information of the robot at the current moment; acquire second position information of the next target node to be reached by the robot;
[0195] The execution module 82 is further configured to determine the angular velocity and linear velocity of the robot at the next moment based on the first position information and the second position information.
[0196] In an exemplary embodiment of the present disclosure, the execution module 82 is also used for: if the robot performs obstacle avoidance movement around an obstacle in a counterclockwise direction, when the third angle error value is greater than the first preset parameter, the robot returns to the target path movement, wherein the third angle error value is determined based on the first position information and the second position information.
[0197] In an exemplary embodiment of the present disclosure, the execution module 82 is also used for: if the robot performs obstacle avoidance movement around an obstacle in a clockwise direction, when the third angle error value is less than the second preset parameter, the robot returns to the target path movement; wherein the first preset parameter and the second preset parameter are opposite numbers of each other.
[0198] In an exemplary embodiment of the present disclosure, the execution module 82 is also used to: determine a first distance between the robot and the target node based on the first position information and the second position information; if the first distance is greater than the preset distance, redetermine the target path based on the first position information and the end point information of the target path.
[0199] Regarding the control device of the robot in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method and will not be elaborated here.
[0200] Figure 9 1 is a block diagram of a robot 900 according to an exemplary embodiment. For example, the robot 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0201] Reference Figure 9 The robot 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0202] The processing component 902 generally controls the overall operation of the robot 900, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 902 may include one or more modules to facilitate interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
[0203] The memory 904 is configured to store various types of data to support operations on the robot 900. Examples of such data include instructions for any application or method operating on the robot 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0204] The power supply assembly 906 provides power to the various components of the robot 900. The power supply assembly 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the robot 900.
[0205] The multimedia component 908 includes a screen that provides an output interface between the robot 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the robot 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
[0206] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC) that is configured to receive external audio signals when the robot 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode. The received audio signals may be further stored in the memory 904 or transmitted via the communication component 916. In some embodiments, the audio component 910 further includes a speaker for outputting audio signals.
[0207] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0208] The sensor assembly 914 includes one or more sensors for providing various status assessments of the robot 900. For example, the sensor assembly 914 can detect the open / closed state of the robot 900, the relative positioning of components, such as the display and keypad of the robot 900. The sensor assembly 914 can also detect changes in the position of the robot 900 or a component of the robot 900, the presence or absence of user contact with the robot 900, the orientation or acceleration / deceleration of the robot 900, and changes in the temperature of the robot 900. The sensor assembly 914 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0209] The communication component 916 is configured to facilitate wired or wireless communication between the robot 900 and other devices. The robot 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0210] In an exemplary embodiment, the robot 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described methods.
[0211] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions. The instructions are executable by the processor 920 of the robot 900 to implement the above-described robot control method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0212] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a robot, enables the processing device of the robot to execute the robot control method provided by the exemplary embodiment of the present disclosure.
[0213] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing what is disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0214] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A robot control method, characterized in that: include: Determining a target path for the robot to move, wherein the target path includes a plurality of target nodes; Obtaining position information of an obstacle on the target path, wherein the position information of the obstacle includes an angle and a distance of the obstacle relative to the robot; Based on the position information of the obstacle, controlling the robot to perform obstacle avoidance movement around the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold; During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path for movement.
2. The robot control method according to claim 1, characterized in that: The controlling the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle includes: If the position information indicates that the obstacle is located within the radiation range of a first preset area of the robot, control the robot to rotate by a preset angle in a preset direction to a first position with the current position as a reference position, wherein the preset direction is determined based on the position of the obstacle within the radiation range of the first preset area; determining motion parameters of the obstacle avoidance motion based on the position information; Based on the motion parameters, the robot is controlled to move around the obstacle starting at the first position.
3. The robot control method according to claim 2, characterized in that: The controlling the robot to rotate to a first position by a preset angle in a preset direction with the current position as a reference position includes: If at least a portion of the structure of the obstacle is located within the radiation range of the first sub-area, controlling the robot to rotate in a first direction by the preset angle with the current position as a reference position; If at least a portion of the structure of the obstacle is located within the radiation range of the second sub-area, controlling the robot to rotate in a second direction by the preset angle with the current position as a reference position; The first preset area is divided into the first sub-area and the second sub-area by a preset reference line, and the first sub-area and the second sub-area are symmetrically arranged with the preset reference line as a symmetry axis; The current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
4. The robot control method according to claim 2, characterized in that: The controlling the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle includes: If the position information indicates that the obstacle is located within a radiation range of a second preset area of the robot, determining motion parameters of the obstacle avoidance motion based on the position information, wherein the second preset area is outside the first preset area; determining an initial direction for the robot to move around the obstacle based on a position of the obstacle in the second preset area; Based on the motion parameters, the robot is controlled to move around the obstacle along the initial direction starting from the current position of the robot.
5. The robot control method according to claim 4, characterized in that: The determining, based on the position of the obstacle in the second preset area, an initial direction for the robot to move around the obstacle includes: If at least a portion of the structure of the obstacle is located within the radiation range of the third sub-area, determining the first direction as the initial direction; If at least a portion of the structure of the obstacle is located within the radiation range of the fourth sub-area, determining the second direction as the initial direction; The second preset area is divided into the third sub-area and the fourth sub-area by a preset reference line, and the third sub-area and the fourth sub-area are symmetrically arranged with the preset reference line as a symmetry axis. The third sub-area is located on a side of the first sub-area away from the preset reference line, and the fourth sub-area is located on a side of the second sub-area away from the preset reference line. The current position is determined based on the position of the preset reference line, one of the first direction and the second direction is to the left of the preset reference line, and the other of the first direction and the second direction is to the right of the preset reference line.
6. The robot control method according to claim 2 or 4, characterized in that: The robot is disc-shaped, and determining the motion parameters of the obstacle avoidance motion based on the position information includes: determining a first angular error value of the robot at a current moment based on a distance of the obstacle relative to the robot, a radius of the robot, and a distance between the obstacle and the robot; The motion parameter is determined based on a second angle error value, a cumulative error value and the first angle error value, wherein the second angle error value is the angle error value of the robot at the previous moment before the current moment, and the cumulative error value is the sum of the angle error values of all moments from the moment when the robot rotates from the reference position to the preset direction by a preset angle to the current moment.
7. The robot control method according to any one of claims 1 to 5, characterized in that: The control method further includes: Obtaining first position information of the robot at a current moment; Acquire second position information of the next target node to be reached by the robot; Based on the first position information and the second position information, the angular velocity and linear velocity of the robot at the next moment are determined.
8. The robot control method according to claim 7, characterized in that: If the angle between the robot and the next target node to be reached by the robot satisfies a preset condition, the robot returns to the target path and moves, comprising: If the robot performs obstacle avoidance movement around the obstacle in a counterclockwise direction, when the third angle error value is greater than the first preset parameter, the robot returns to the target path, wherein the third angle error value is determined based on the first position information and the second position information.
9. The robot control method according to claim 8, characterized in that: If the angle between the robot and the next target node to be reached by the robot satisfies a preset condition, the robot returns to the target path and moves, comprising: If the robot performs obstacle avoidance movement around the obstacle in a clockwise direction, and the third angle error value is less than a second preset parameter, the robot returns to the target path; The first preset parameter and the second preset parameter are opposite numbers of each other.
10. The robot control method according to claim 7, characterized in that: The control method further includes: Determining a first distance between the robot and the target node based on the first position information and the second position information; If the first distance is greater than a preset distance, the target path is re-determined based on the first position information and the end point information of the target path.
11. A robot control device, characterized in that: include: An acquisition module, configured to determine a target path for the robot to move, wherein the target path includes a plurality of target nodes; The acquisition module is further configured to acquire position information of obstacles on the target path, wherein the position information of the obstacles includes an angle and a distance of the obstacles relative to the robot; an execution module, configured to control the robot to perform obstacle avoidance movement around the obstacle based on the position information of the obstacle, wherein during the obstacle avoidance movement, the distance between the robot and the obstacle is within a preset threshold; During the obstacle avoidance movement, if the angle between the robot and the next target node to be reached by the robot meets a preset condition, the robot returns to the target path for movement.
12. A robot, characterized in that: The robot comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions in the memory to implement the robot control method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium, characterized in that A computer program capable of being executed is stored thereon, and when the computer program is executed by a processor of the robot, it is used to implement the robot control method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Dubins path based obstacle avoidance control device and method for driverless car
CN108536149A
Robot motion control method, apparatus, storage medium and robot
CN108780320A
Obstacle avoiding method and device of robot and robot
CN111090282A
Autonomous navigation improvement method for intelligent walking robot in complex environment
CN114460939A
Robot motion control method, robot and computer readable storage medium
CN115877852A