Robot self-following method and unmanned sanitation robot
Through the combination of single-line lidar and algorithms, the robot can achieve stable following and obstacle avoidance when illumination changes and obstacles exist, solving the problems of tracking errors and low robustness in the existing technology, and improving the reliability and reliability of robot following. consciousness.
Patent Information
- Application Number
- CN202111537659.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-12-15
AI Technical Summary
Existing robot following technology is prone to errors when illumination changes, rapid movement and the presence of obstacles, and has low robustness, and Bluetooth or UWB wireless following cannot achieve obstacle avoidance.
Single-line lidar is used to scan point cloud data, the DBSCAN algorithm is used for clustering to generate bounding boxes, the Kalman filter and GIOU algorithm are combined for trajectory tracking and matching, the operator's leg position is searched, and the robot is controlled based on the tracking and loss status judgment to achieve The robot follows and avoids obstacles consciously.
It improves the robustness of the robot's following, reduces the probability of incorrect and lost following, realizes the following and obstacle avoidance of small targets, and ensures that the robot follows consciously for a long time.
Smart Images

Figure CN114510021B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of robot control, and in particular to a robot self-following method and an unmanned sanitation robot. Background Art
[0002] With the continuous development of the field of robotics, following robots are widely used in many scenes of life. In the related art, methods for achieving robot following based on camera image following, single-line laser radar following, Bluetooth or UWB wireless following are disclosed. However, the related art has the following problems:
[0003] (1) When the camera image is following, if the operator is dressed the same as other personnel and there is appearance deformation, lighting changes, rapid movement, and motion blur, the camera is likely to fail to follow.
[0004] (2) Some single-line LiDAR tracking algorithms are simple in design and only track angles. They may mistrack when there are occlusions or obstacles and have low robustness.
[0005] (3) Bluetooth or UWB wireless following positioning can achieve following but cannot achieve obstacle avoidance. Summary of the invention
[0006] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one object of the present invention is to provide a robot self-following method. The method can reduce the probability of the robot following the wrong target, restore the following when the robot loses the target, and can achieve the following of small targets.
[0007] The second object of the present invention is to provide an unmanned sanitation robot.
[0008] To achieve the above-mentioned purpose, the first embodiment of the present invention proposes a robot self-following method, wherein the robot is provided with a single-line laser radar, comprising the following steps: performing a single-frame scan by the single-line laser radar to obtain current frame point cloud data, and obtaining the first position of the operator in the current frame point cloud data; clustering the current frame point cloud data using the DBSCAN algorithm, and obtaining n according to the clustering results. i A bounding box, wherein the parameters of the DBSCAN algorithm are set according to the first distance between the first position and the single-line laser radar, i is the frame number of the current frame point cloud data, i is an integer greater than or equal to 0, and n i is the number of bounding boxes corresponding to the i-th frame point cloud data; use n i The bounding boxes are tracked to obtain m i According to the first position and the m iThe robot is controlled according to the first position and the leg position, and the tracking and losing state is judged.
[0009] In addition, the robot self-following method of the embodiment of the present invention may also have the following additional technical features:
[0010] According to one embodiment of the present invention, when the frame number i of the current frame point cloud data is 0, the first position of the operator of the current frame point cloud data is obtained according to the current frame point cloud data, and initial m0 trajectories are newly created based on n0 bounding boxes, where m0=n0;
[0011] When the frame number i of the current frame point cloud data is greater than 0, the use of the n i Track the bounding boxes and get m i Tracks include: Get the m obtained after tracking using the bounding box of the previous frame of point cloud data i-1 trajectories; for the m i-1 Each of the trajectories uses Kalman filtering to predict the box of each trajectory and obtain n' i-1 prediction boxes; use the GIOU algorithm to predict the n' i-1 prediction boxes and the n i A GIOU operation is performed on a bounding box to generate a GIOU matrix, and the prediction box and the bounding box are matched according to the GIOU matrix to obtain the trajectory of the matched prediction box, the trajectory of the unmatched prediction box and the unmatched bounding box; for the matched trajectory, the matched bounding box is used to update the trajectory; for the unmatched trajectory, when it is not matched in N consecutive frames of point cloud data, the trajectory is deleted, where N is an integer greater than 1; for the unmatched bounding box, a new trajectory is created.
[0012] According to an embodiment of the present invention, the first position and the m i The method of searching the leg position of the operator includes: searching the leg position of the operator according to the first position and the m i A trajectory is used to search for the second position of the first leg of the operator in the point cloud data of the current frame; when the second position is found, according to the second position and the m i A trajectory is used to search for the third position of the second leg of the operator in the current frame point cloud data.
[0013] According to one embodiment of the present invention, the m i Each of the trajectories is correspondingly provided with an ID, and the ID is set according to the first position and the m iThe method further comprises: searching the second position of the first leg of the operator in the point cloud data of the current frame using a trajectory, comprising: searching the second position of the first leg of the operator according to the first position and the m i determine the trajectory ID of the first leg; find out whether the trajectory ID of the first leg is in the m i-1 The historical leg ID queue in the trajectory; if it is, then through the m i-1 The trajectories within the first preset distance size from the first position in the trajectories are searched from near to far for the first leg, otherwise the m i-1 The first leg is searched from near to far for the trajectories within a second preset distance size from the first position, wherein the second preset distance size is smaller than the first preset distance size; the position of the first leg whose shape size is first searched and is smaller than the first shape size threshold is taken as the second position.
[0014] According to an embodiment of the present invention, the i The method further comprises: searching the third position of the second leg of the operator in the point cloud data of the current frame using a trajectory, comprising ... according to the second position and the m i determine the trajectory ID of the second leg; find out whether the trajectory ID of the second leg is in the m i-1 The historical leg ID queue in the trajectory; if it is, then through the m i-1 The second leg is searched for in the trajectories within the first preset distance size from the second position from near to far, otherwise the second leg is searched for in the m ... i-1 The second leg is searched from near to far for the trajectories within the second preset distance size from the second position in the trajectories; and the position of the second leg whose shape size is smaller than the first shape size threshold value is taken as the third position.
[0015] According to one embodiment of the present invention, the lost-tracking state includes a normal following state, a semi-lost-tracking state and a completely lost-tracking state, and the lost-tracking state judgment based on the first position and the leg position includes: setting a lost-tracking variable, and judging whether the robot is in a normal following state, a semi-lost-tracking state or a completely lost-tracking state according to the value of the lost-tracking variable in the current frame.
[0016] According to one embodiment of the present invention, the lost-tracking variable is related to the search results of the second position and the third position, and the determination of whether the robot is in a normal following state, a semi-lost state or a completely lost state based on the value of the lost-tracking variable in the current frame includes: when the second position and the third position are searched, the first position of the operator in the point cloud data of the current frame is updated according to the second position and the third position, and the lost-tracking variable is set to zero, and the robot is determined to be in a normal following state; when the second position is searched and the third position is not searched, the first position is updated according to the second position, and the lost-tracking variable is increased by a first preset value, and when the lost-tracking variable after the increase by the first preset value is greater than a first threshold value, the robot is determined to be in a completely lost state, and after the increase by the first preset value When the lost-tracking variable after the preset value is greater than or equal to the second threshold and less than or equal to the first threshold, the robot is determined to be in a semi-lost-tracking state; when the lost-tracking variable after the first preset value is increased is less than the second threshold, the robot is determined to be in a following state; when the second position and the third position are not searched, the lost-tracking variable is increased by a second preset value; when the lost-tracking variable after the second preset value is increased is greater than the first threshold, the robot is determined to be in a completely lost-tracking state; when the lost-tracking variable after the second preset value is increased is greater than or equal to the second threshold and less than or equal to the first threshold, the robot is determined to be in a semi-lost-tracking state; when the lost-tracking variable after the second preset value is increased is less than the second threshold, the robot is determined to be in a normal following state; when the robot is in a semi-lost-tracking state, the m i-1 The historical leg ID queue in the trajectory looks up the m i The robot is judged to determine whether the leg trajectory ID in the trajectory exists, and if so, updates the first position of the operator in the point cloud data of the current frame; otherwise, the robot is judged to be in a completely lost state; wherein the updated first position is the first position of the operator in the point cloud data of the next frame.
[0017] According to one embodiment of the present invention, the lost track variable is also related to the point cloud data acquisition result of the current frame and the acquisition result of the bounding box. The method also includes: when the point cloud data cannot be acquired in the current frame, the lost track variable is increased by a third preset value; when the bounding box cannot be acquired in the current frame, the lost track variable value is increased by a fourth preset value.
[0018] According to one embodiment of the present invention, the controlling the robot according to the judgment result includes: setting the driving direction of the robot according to the angle between the updated first position and the driving direction of the robot, and setting the driving speed of the robot to increase as the distance between the robot and the updated first position increases; when encountering an obstacle on the left side, controlling the robot to stop the obstacle, and controlling the robot to resume following after the updated first position is at a first preset angle in the right direction of the robot; when encountering an obstacle on the right side, controlling the robot to stop the obstacle, and controlling the robot to resume following after the updated first position is at the first preset angle in the left direction of the robot; when encountering an obstacle in the middle, controlling the robot to stop the obstacle and ending the following.
[0019] To achieve the above-mentioned objectives, the second aspect of the present invention proposes an unmanned sanitation robot, comprising: a single-line laser radar; a controller, the controller is connected to the single-line laser radar, the controller comprises a memory, a processor and a computer program stored on the memory, and when the computer program is executed by the processor, the above-mentioned robot self-following method of the present invention is implemented.
[0020] According to the robot self-following method and unmanned sanitation robot of the embodiment of the present invention, the target tracking algorithm is optimized to achieve the following of small targets, and different search distances are used for different tracking IDs to reduce the situation where the robot follows the wrong target or loses the target. In addition, when it is judged that the robot is in the state of following the wrong target or losing the target, the historical leg trajectory ID information is used and processed in time, so that the robot can consciously realize the state conversion and achieve the robot's long-term self-following.
[0021] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a robot self-following method according to an embodiment of the present invention;
[0023] Figure 2 is a flow chart when i>0 in step S103 of an embodiment of the present invention;
[0024] Figure 3 is a flowchart of step S104 of an embodiment of the present invention;
[0025] Figure 4 This is a flow chart of a lost tracking judgment according to an embodiment of the present invention;
[0026] Figure 5 is a flow chart of a tracking-and-lost judgment according to another embodiment of the present invention;
[0027] Figure 6 is a flow chart of a tracking-and-lost judgment according to another embodiment of the present invention;
[0028] Figure 7 is a flow chart of controlling a robot to stop an obstacle according to an embodiment of the present invention;
[0029] Figure 8 It is a structural block diagram of the unmanned sanitation robot according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0031] Please refer to the following Figure 1-8 And specific implementation methods describe the robot self-following method and unmanned sanitation robot of the embodiments of the present invention.
[0032] Figure 1 4 is a flow chart of a robot self-following method according to an embodiment of the present invention.
[0033] In this embodiment, a single-line laser radar may be provided on the robot. Figure 1 As shown, the specific steps of the robot self-following method are:
[0034] S101, performing a single-frame scan by a single-line laser radar to obtain point cloud data of the current frame, and obtaining the first position of the operator in the point cloud data of the current frame.
[0035] Among them, the current frame point cloud data can be directly collected by the single-line laser radar mounted on the robot. Each point in the point cloud data obtained by scanning the single-line laser radar contains three-dimensional coordinate information, which may include the coordinates in the X and Y directions that we often say.
[0036] As a feasible implementation method, when the frame number i of the current frame point cloud data is 0, it means that the robot starts to execute the self-following process. At this time, the first position of the operator in the current frame point cloud data can be obtained according to the current frame point cloud data. The first position is the initialization position of the operator.
[0037] Specifically, when the above initialization position is obtained, the initialization function of the robot can be turned on, and the operator can be at a certain distance in front of the robot. The single-line laser radar can collect point cloud data of the area formed by an angle from its own center position to both sides, which is used to initialize the position of the person. The position of the point cloud midpoint closest to the single-line laser radar in the area can be used as the initialization position. After initialization, the initialization function is turned off, and the initialization frame number i=0 is set.
[0038] S102, clustering the point cloud data of the current frame using the DBSCAN algorithm, and obtaining n according to the clustering results i The parameters of the DBSCAN algorithm are set according to the first distance between the first position and the single-line laser radar, i is the frame number of the current frame point cloud data, i is an integer greater than or equal to 0, and n i is the number of bounding boxes corresponding to the i-th frame point cloud data.
[0039] Specifically, the point cloud of the set angle and area can be filtered and retained. According to the distance from the operator's first position to the single-line laser radar, different parameters can be set for DBSCAN clustering, so that legs at different distances can be clustered into different categories and reach a certain percentage probability.
[0040] As an example, based on the clustering results, we get n i Bounding boxes, including: According to the clustering results, n i Classes generate n i The minimum enclosing rectangle is n i The minimum bounding rectangle is n i Wherein, i is a positive integer, such as 1, 2. Therefore, by setting the minimum bounding rectangle, the tracking accuracy can be improved.
[0041] It should be noted that, for the point cloud clustering results, the minimum bounding rectangle corresponding to each category can be generated. When the rectangle is small and it is difficult to track a small target, the bounding rectangle can be expanded by a certain distance.
[0042] As a feasible implementation, the DBSCAN algorithm does not need to know the number of clustering categories in advance and can be applied to the scenario where the robot follows a person. The DBSCAN algorithm is based on a set of neighborhoods to describe the compactness of the sample set. The parameters of the DBSCAN algorithm include the scanning radius eps and the minimum number of included points minPts.
[0043] In the embodiment of the present invention, eps is positively correlated with the first distance, that is, eps increases as the distance between the single-line laser radar and the operator increases, and decreases as the distance between the single-line laser radar and the operator decreases. minPts is negatively correlated with the first distance, that is, minPts decreases as the distance between the single-line laser radar and the operator increases, and increases as the distance between the single-line laser radar and the operator decreases.
[0044] It should be noted that different parameters can be set according to the distance between the single-line laser radar and the operator to perform DBSCAN fusion to solve the problem that one parameter cannot be applied in different situations, that is, multiple parameters are used to process the same point cloud data multiple times to find the most suitable clustering effect. You can also use related segmentation and recognition algorithms (such as clustering-based segmentation algorithms) to segment single-frame point cloud data into independent objects according to shape features to optimize the clustering effect.
[0045] S103, use n i Track the bounding boxes and get m i A trajectory.
[0046] Specifically, the current frame point cloud data is obtained through S101, and then the DBSCAN clustering algorithm is used to cluster the obtained current frame point cloud data in S102. After a bounding box is generated according to the clustering result, the optimized multi-target tracking algorithm can be used to track the bounding box generated by clustering to obtain the corresponding trajectory. Each trajectory has a corresponding ID. The multi-target tracking algorithm can ensure that the ID of each object is switched as little as possible, which can solve the problem of small targets being difficult to track in related technologies to a certain extent.
[0047] It should be noted that when the frame number i of the current frame point cloud data is 0, n0 bounding boxes are used for tracking to obtain m0 trajectories, including: directly using Kalman filtering on each of the n0 bounding boxes, creating n0 trajectories (ie, n0=m0), and initializing them. Each of the n0 trajectories can be set with an ID for subsequent tracking processing.
[0048] S104, according to the first position and m i trajectories to search for the operator's leg positions.
[0049] Specifically, according to the first position and m i The search for the leg position of the operator may include: searching for the leg position of the operator according to the first position and m i The second position of the first leg of the operator in the current frame point cloud data is searched by a trajectory; when the second position is found, according to the second position and m i A trajectory searches for the third position of the second leg of the operator in the point cloud data of the current frame.
[0050] That is, according to the first position obtained in S101 and the n i The bounding boxes are tracked to obtain m i A trajectory is used to search for the position of the first leg of the operator in the current frame point cloud data; when the position of the first leg is found, according to the position of the first leg and m i The position of the second leg of the operator in the current frame of point cloud data is searched for by a trajectory. Further, the position of the operator can be updated according to the leg position, and the updated position of the operator can be used as the first position of the operator in the next frame of point cloud data, so that step S101 can obtain the corresponding first position when processing the next frame of point cloud data.
[0051] S105, determining the tracking-lost state according to the first position and the leg position, and controlling the robot according to the determination result.
[0052] Among them, when searching for the leg position of the operator in S104, three situations may occur: no legs found, one leg found, and two legs found. Different judgment conditions can be set in different situations, and the robot can be controlled according to different judgment results. For example, the robot can be controlled to turn, continue driving, etc.
[0053] The robot self-following method utilizes the operator's legs for tracking, which can make it less likely for the robot to follow the wrong person; the lost tracking state is judged according to the first position and the leg position, and multiple judgment results can be obtained, and then the robot is followed and controlled according to the multiple judgment results, which can realize recovery following in the event of wrong following or lost tracking to a certain extent.
[0054] Figure 2 This is a flowchart when i>0 in step S103 of an embodiment of the present invention.
[0055] See also Figure 2 , when the frame number i of the current frame point cloud data is greater than 0, the multi-target tracking algorithm can be used to track n i Track the bounding boxes and get m i The process of obtaining the trajectory by tracking may specifically include:
[0056] S201, obtain the m obtained after tracking using the bounding box of the previous frame of point cloud data i-1 A trajectory.
[0057] As an example, when i=1, first obtain m0 trajectories obtained by using the bounding box of the previous frame of point cloud data, i.e., the point cloud data when i=0; when i=2, first obtain m1 trajectories obtained by using the bounding box of the previous frame of point cloud data, i.e., the point cloud data when i=1.
[0058] S202, for m i-1 Each of the trajectories uses Kalman filtering to predict the box of each trajectory and obtain n' i-1 prediction box.
[0059] As an example, when i=2, a Kalman filter is used to predict a frame of each track in the m1 tracks acquired in S201, and n′1 predicted frames are obtained.
[0060] S203, use GIOU algorithm to calculate n' i-1 prediction boxes and n i The GIOU operation is performed on the bounding boxes to generate the GIOU matrix, and the prediction box and the bounding box are matched according to the GIOU matrix to obtain the trajectory of the matched prediction box, the trajectory of the unmatched prediction box, and the unmatched bounding box.
[0061] It should be noted that for the operator's fast-moving legs, the front and rear frames are prone to have little overlap or no overlap. In this environment, the GIOU algorithm can be applied to evaluate the frames with little overlap or no overlap.
[0062] Optionally, an algorithm for solving the assignment problem can be used when matching the prediction box and the bounding box according to the GIOU matrix. The Hungarian algorithm can be used. In order to obtain better matching results, a higher GIOU threshold can be preset. The assignment result less than the GIOU threshold is invalid. The GIOU threshold can be dynamically adjusted according to the number of legs searched to increase tracking safety.
[0063] S204, for the matched trajectory, use the matched bounding box to update the trajectory; for the unmatched trajectory, when it is not matched in N consecutive frames of point cloud data, delete the trajectory, where N is an integer greater than 1; for the unmatched bounding box, create a new trajectory.
[0064] For the unmatched bounding boxes, when creating new trajectories, the method used is the same as the method of creating m0 trajectories based on n0 bounding boxes when i=0.
[0065] Therefore, through the above-mentioned tracking of the bounding box, the problems of ID switching caused by the large moving distance between the previous and next frames in the ordinary tracking algorithm, the problem of the robot following the wrong target, and the problem of recovering to the correct target after following the wrong target can be solved to a certain extent.
[0066] It should be noted that when the GIOU algorithm is used for tracking, the position of object A will appear on object B in one frame. At this time, there will be a local misalignment problem. However, through the combination of subsequent steps and dynamic GIOU threshold adjustment, it can be suitable for robot following. In addition, the multi-target tracking algorithm needs to use the results of searching for legs to set the GIOU threshold. When only a single leg is searched or no legs are found, a stricter threshold is used to make robot following safer. In the process of searching for human legs, global variables are used to store the historical leg ID queue. The historical leg ID queue is used in both leg search and loss judgment.
[0067] Figure 3 is a flowchart of step S104 of an embodiment of the present invention.
[0068] See also Figure 3 , the above is based on the first position and m i The detailed steps of searching the position of the operator's legs may include:
[0069] S301, according to the first position and m i The trajectory ID of the first leg is determined by the trajectory.
[0070] S302, check whether the trajectory ID of the first leg is in m i-1 Queue of historical leg IDs in each trajectory.
[0071] S303, if yes, then pass m i-1 Search the first leg from near to far among the trajectories within the first preset distance size from the first position, otherwise pass m i-1 The trajectories within a second preset distance size from the first position in the trajectories search for the first leg from near to far, wherein the second preset distance size is smaller than the first preset distance size.
[0072] S304: The position of the first leg whose shape size is smaller than the first shape size threshold that is first searched out is used as the second position.
[0073] S305, according to the second position and m i The trajectory ID of the second leg is determined by the trajectory ID of the second leg.
[0074] S306, check whether the trajectory ID of the second leg is in m i-1 Queue of historical leg IDs in each trajectory.
[0075] S307, if yes, then pass m i-1 Search the second leg from near to far among the trajectories within the first preset distance size from the second position, otherwise pass m i-1 The second leg is searched from near to far for the trajectories within the second preset distance size from the second position.
[0076] S308: The position of the second leg whose shape size is smaller than the first shape size threshold that is first searched out is used as the third position.
[0077] In order to achieve more reliable tracking, the position of the operator needs to be updated in real time. As an embodiment of the present invention, the position of the operator can be used to first search for the position of one leg of the operator, and then the position of this leg can be used to search for the other leg. Among them, after only the position of one leg is searched, a larger GIOU threshold can be set to prevent the trajectory ID in the historical leg ID queue from being captured by other objects and to prevent the wrong target from being searched. Preferably, the results of the arc-like human leg shape recognition algorithm or the machine learning recognition algorithm can be used to screen out possible legs, which can further prevent the wrong target from being followed.
[0078] In one embodiment of the present invention, the tracking-lost state may include a normal following state, a semi-tracking-lost state and a complete tracking-lost state. The tracking-lost state is judged according to the first position and the leg position, which may include: setting a tracking-lost variable, and judging whether the robot is in a normal following state, a semi-tracking-lost state or a complete tracking-lost state according to the value of the tracking-lost variable in the current frame.
[0079] Specifically, according to the value of the tracking and losing variable of the current frame, it is determined whether the robot is in a normal following state, a semi-tracking and losing state, or a completely tracking and losing state, which may include Figure 4 , Figure 5 , Figure 6 process.
[0080] Figure 4 It is a flow chart of the tracking-lost judgment of a specific embodiment of the present invention.
[0081] See also Figure 4 When both the second position and the third position are searched, the lost state determination may include the following determination methods:
[0082] S401, updating the first position of the operator in the current frame point cloud data according to the second position and the third position.
[0083] S402, setting the lost tracking variable to zero.
[0084] S403, determining that the robot is in a normal following state.
[0085] Figure 5 It is a flow chart of the tracking-and-losing judgment of another specific embodiment of the present invention.
[0086] See also Figure 5 When the second position is searched but the third position is not searched, the lost state judgment may include the following judgment methods:
[0087] S501: Update the first position according to the second position.
[0088] S502: Increase the tracking-lost variable by a first preset value.
[0089] S503, when the tracking-loss variable after adding the first preset value is greater than the first threshold, the robot is judged to be in a completely lost state; when the tracking-loss variable after adding the first preset value is greater than or equal to the second threshold and less than or equal to the first threshold, the robot is judged to be in a semi-lost state; when the tracking-loss variable after adding the first preset value is less than the second threshold, the robot is judged to be in a normal following state.
[0090] The first threshold may be twice the second threshold.
[0091] Figure 6 This is a flow chart of a tracking-and-lost judgment according to another specific embodiment of the present invention.
[0092] See also Figure 6 When neither the second position nor the third position is searched, the lost state determination may include the following determination methods:
[0093] S601, increasing the tracking-lost variable by a second preset value.
[0094] S602, when the lost-follow variable after adding the second preset value is greater than the first threshold, the robot is judged to be in a completely lost-follow state; when the lost-follow variable after adding the second preset value is greater than or equal to the second threshold and less than or equal to the first threshold, the robot is judged to be in a semi-lost state; when the lost-follow variable after adding the second preset value is less than the second threshold, the robot is judged to be in a normal following state.
[0095] It should be noted that when the robot is in a semi-lost state, i-1 Lookup m in the historical leg ID queue of trajectories i The first position after the update can be used as the first position of the operator in the next frame of point cloud data, so as to be obtained when the next frame of point cloud data is processed in step S101.
[0096] In the above embodiment, the semi-lost state is set to reduce the frequency of lost tracking. By using the information of the historical leg trajectory ID in the historical leg ID queue, the robot can consciously resume following and achieve state transition without feeling, reducing the complexity brought by human-computer interaction.
[0097] In some embodiments, the lost track variable is also related to the point cloud data acquisition results and the bounding box acquisition results of the current frame. In the above-mentioned process of judging the lost track status, when the point cloud data cannot be obtained in the current frame, the lost track variable value is increased by a third preset value; when the bounding box cannot be obtained in the current frame, the lost track variable value is increased by a fourth preset value.
[0098] It should be noted that the first preset value, the second preset value, the third preset value and the fourth preset value mentioned above can be adjusted and set according to the actual tracking needs of the operator.
[0099] As an embodiment of the present invention, after obtaining the following state judgment result, the robot is further controlled. Preferably, the robot's driving direction can be set according to the angle between the updated first position and the robot's driving direction, and the robot's driving speed can be set to increase as the distance between the robot and the updated first position increases. By setting different angles and different speeds, the operation following is more comfortable, and a preset distance threshold can be set as a stop signal.
[0100] Specifically, when encountering an obstacle on the left side, the robot is controlled to stop, and the robot is controlled to resume following after the updated first position is at a first preset angle in the right direction of the robot; when encountering an obstacle on the right side, the robot is controlled to stop, and the robot is controlled to resume following after the updated first position is at a first preset angle in the left direction of the robot; when encountering an obstacle in the middle, the robot is controlled to stop and the following is ended.
[0101] Preferably, a single-line laser radar can be used to obtain the location information of the obstacle.
[0102] Figure 7 It is a flow chart of controlling a robot to stop an obstacle according to an embodiment of the present invention.
[0103] Among them, see Figure 7 After the single-line laser radar obtains the position information of the obstacle, that is, when encountering an obstacle, the process of controlling the robot to stop the obstacle may include:
[0104] S701, filtering noise points and tailing points from the point cloud data of the current frame.
[0105] Specifically, the distance threshold of the continuous points before and after can be used to remove the abnormal points trailing between objects, filter out the noise points and the trailing points, and solve the problem of adhesion of point clouds between different objects. Of course, this step can also be set before the above step S102 to improve the clustering effect.
[0106] S702, dividing the point cloud data of the current frame from left to right into a first area, a second area, and a third area according to a second preset angle.
[0107] S703, calculating the nearest point cloud distance of each area, and when the nearest point cloud distance is less than a preset distance threshold, determining that an obstacle exists in the area corresponding to the nearest point cloud distance, and triggering an obstacle stop.
[0108] Furthermore, the present invention provides a computer-readable storage medium.
[0109] In an embodiment of the present invention, a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned robot self-following method is implemented.
[0110] Figure 8 It is a structural block diagram of the unmanned sanitation robot according to an embodiment of the present invention.
[0111] The present invention also proposes an unmanned sanitation robot 800, including a single-line laser radar 810 and a controller 820 connected to the single-line laser radar. The controller 820 includes a memory 830, a processor 840 and a computer program stored in the memory. When the computer program is executed by the processor, the above-mentioned robot self-following method is implemented.
[0112] In summary, the robot self-following method and unmanned sanitation robot of the embodiment of the present invention improve the robustness of the robot following people, specifically including: by optimizing the target tracking algorithm, setting a dynamic GIOU threshold, solving the problem of difficulty in tracking due to small tracking targets in the actual following process; using the position of the operator to search for the position of the legs, and then using the position of the legs to update the position of the operator, reducing the probability of the robot following the wrong one; using the historical leg trajectory ID information, when following the wrong one or losing the follower, the robot can automatically resume following, so that the robot can achieve state transition without feeling, reduce the complexity brought by human-computer interaction, and achieve long-term self-following of the robot. In addition, the entire following process has a small amount of calculation and strong real-time performance, and can achieve real-time following with a high frame rate.
[0113] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0114] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0116] In the description of this specification, the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and cannot be understood as a limitation on the present invention.
[0117] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0118] In the description of this specification, unless otherwise specified, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0119] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0120] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A robot self-following method, characterized in that: The robot is provided with a single-line laser radar, and the method comprises the following steps: Performing a single-frame scan by the single-line laser radar to obtain current frame point cloud data, and obtaining a first position of the operator in the current frame point cloud data; The DBSCAN algorithm is used to cluster the point cloud data of the current frame, and n is obtained according to the clustering result. i A bounding box, wherein the parameters of the DBSCAN algorithm are set according to the first distance between the first position and the single-line laser radar, i is the frame number of the current frame point cloud data, i is an integer greater than or equal to 0, and n i is the number of bounding boxes corresponding to the i-th frame point cloud data; Use n i The bounding boxes are tracked to obtain m i Tracks According to the first position and the m i A trajectory is used to search for the leg position of the operator; Determine the tracking-and-losing state according to the first position and the leg position, and control the robot according to the determination result; The method according to the first position and the m i A trajectory is used to search for the leg position of the operator, including: According to the first position and the m i A trajectory is used to search for the second position of the first leg of the operator in the point cloud data of the current frame; when the second position is found, according to the second position and the m i A trajectory is used to search for the third position of the second leg of the operator in the current frame point cloud data.
2. The robot self-following method according to claim 1, characterized in that: When the frame number i of the current frame point cloud data is 0, the first position of the operator of the current frame point cloud data is obtained according to the current frame point cloud data, and initial m0 trajectories are newly created based on n0 bounding boxes, where m0=n0; When the frame number i of the current frame point cloud data is greater than 0, the use of the n i Track the bounding boxes and get m i Tracks include: Get the m obtained after tracking using the bounding box of the previous frame of point cloud data i-1 Tracks, For the m i-1 Each of the trajectories uses Kalman filtering to predict the box of each trajectory and obtain n' i-1 prediction boxes, Use the GIOU algorithm to calculate the n' i-1 prediction boxes and the n i The bounding boxes are subjected to GIOU operation to generate a GIOU matrix, and the prediction box and the bounding box are matched according to the GIOU matrix to obtain the trajectory of the matched prediction box, the trajectory of the unmatched prediction box, and the unmatched bounding box. For the matched track, the matched bounding box is used to update the track; for the unmatched track, when it is not matched in N consecutive frames of point cloud data, the track is deleted, where N is an integer greater than 1; for the unmatched bounding box, a new track is created.
3. The robot self-following method according to claim 2, characterized in that: The m i Each of the trajectories is correspondingly provided with an ID, and the ID is set according to the first position and the m i The method further comprises: searching the second position of the first leg of the operator in the point cloud data of the current frame using a trajectory, comprising: According to the first position and the m i A trajectory determines the trajectory ID of the first leg; Find out whether the trajectory ID of the first leg is in the m i-1 Queue of historical leg IDs in each trajectory; If so, then through the m i-1 The trajectories within the first preset distance size from the first position in the trajectories are searched from near to far for the first leg, otherwise the m i-1 Searching for the first leg from near to far for a trajectory within a second preset distance size from the first position in the trajectories, wherein the second preset distance size is smaller than the first preset distance size; The position of the first leg that is first searched and whose shape size is smaller than the first shape size threshold is used as the second position.
4. The robot self-following method according to claim 3, characterized in that: The method according to the second position and the m i The method further comprises: searching the third position of the second leg of the operator in the point cloud data of the current frame using a trajectory, comprising: According to the second position and the m i A trajectory determines the trajectory ID of the second leg; Find out whether the trajectory ID of the second leg is in the m i-1 Queue of historical leg IDs in each trajectory; If so, then through the m i-1 The second leg is searched for in the trajectories within the first preset distance size from the second position from near to far, otherwise the second leg is searched for in the m ... i-1 Searching for the second leg in the trajectories within a second preset distance from the second position from near to far; The position of the second leg whose shape size is smaller than the first shape size threshold that is searched first is used as the third position.
5. The robot self-following method according to claim 1, characterized in that: The lost-follow state includes a normal following state, a semi-lost-follow state and a completely lost-follow state, and the lost-follow state judgment according to the first position and the leg position includes: A tracking and losing variable is set, and according to the value of the tracking and losing variable of the current frame, it is determined whether the state of the robot is in a normal following state, a semi-tracking and losing state, or a completely tracking and losing state.
6. The robot self-following method according to claim 5, characterized in that: The lost track variable is related to the search results of the second position and the third position, and the determining, based on the value of the lost track variable in the current frame, whether the robot is in a normal following state, a semi-lost track state, or a completely lost track state includes: When the second position and the third position are searched, the first position of the operator in the current frame point cloud data is updated according to the second position and the third position, and the tracking-loss variable is set to zero, so as to determine that the robot is in a normal following state; When the second position is searched and the third position is not searched, the first position is updated according to the second position, and the tracking and losing variable is increased by a first preset value. When the tracking and losing variable after the increase of the first preset value is greater than a first threshold, it is determined that the robot is in a completely tracking and losing state. When the tracking and losing variable after the increase of the first preset value is greater than or equal to a second threshold and less than or equal to the first threshold, it is determined that the robot is in a semi-tracking and losing state. When the tracking and losing variable after the increase of the first preset value is less than the second threshold, it is determined that the robot is in a normal following state. When the second position and the third position are not searched, the lost-tracking variable is increased by a second preset value, and when the lost-tracking variable after the second preset value is increased is greater than the first threshold, it is determined that the robot is in a completely lost-tracking state, when the lost-tracking variable after the second preset value is increased is greater than or equal to the second threshold and less than or equal to the first threshold, it is determined that the robot is in a semi-lost-tracking state, and when the lost-tracking variable after the second preset value is increased is less than the second threshold, it is determined that the robot is in a normal following state; When the robot is in a semi-lost state, the m i-1 The historical leg ID queue in the trajectory looks up the m i whether the leg track ID in the track exists, and if so, updates the first position of the operator in the point cloud data of the current frame, otherwise, determines that the robot is in a completely lost state; The updated first position is the first position of the operator in the next frame of point cloud data.
7. The robot self-following method according to claim 5, characterized in that: The tracking-loss variable is also related to the point cloud data acquisition result of the current frame and the bounding box acquisition result, and the method further includes: When the point cloud data cannot be obtained in the current frame, the tracking loss variable is increased by a third preset value; When the boundary box cannot be obtained in the current frame, the tracking loss variable value is increased by a fourth preset value.
8. The robot self-following method according to claim 6, characterized in that: The controlling the robot according to the judgment result comprises: Setting the driving direction of the robot according to the angle between the updated first position and the driving direction of the robot, and setting the driving speed of the robot to increase as the distance between the robot and the updated first position increases; When encountering an obstacle on the left side, the robot is controlled to stop, and after the updated first position reaches a first preset angle in the right direction of the robot, the robot is controlled to resume following; When encountering an obstacle on the right side, the robot is controlled to stop, and after the updated first position is at the first preset angle in the left direction of the robot, the robot is controlled to resume following; When encountering an obstacle in the middle, control the robot to stop and end following.
9. An unmanned sanitation robot, characterized in that: include: Single-line laser radar; A controller, wherein the controller is connected to the single-line laser radar, and the controller comprises a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the robot self-following method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Robot self-following method and device based on single-line laser radar, and robot
CN112379673A
Indoor elder walking health detection method and system, storage medium and terminal
CN112684430A
Multi-target detection and tracking method and system, storage medium and application
CN112926514A
Human tracking apparatus and method thereof, andrecording media and removing electronic systemtherefor
KR1020060066975A
Human tracking apparatus and method, storage medium storing program executing the method, and mobile electronic system including the apparatus
US20060140450A1
