Distance measurement and obstacle avoidance method for nursing robot based on pose adaptive inverse perspective transformation

By introducing the posture-adaptive inverse perspective transformation algorithm into the monocular visual ranging system, the problem of monocular visual ranging accuracy being affected by posture changes in traditional technology is solved, and high-precision anti-collision of robots in complex environments is achieved. Navigation and obstacle avoidance capabilities.

CN117621103BActive Publication Date: 2024-08-23SHENYANG UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311776206.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2024-08-23
Estimated Expiration
2043-12-22

AI Technical Summary

Technical Problem

The traditional monocular visual ranging system is difficult to adapt in real time due to changes in the posture of the visual sensor when the robot is running, resulting in reduced ranging accuracy and unable to guarantee the high-precision anti-collision navigation of the robot in an indoor environment.

Method used

Using the attitude-adaptive inverse perspective transformation algorithm (AIPM), through the lightweight Pytorch target detector and the attitude-adaptive inverse perspective transformation algorithm, the three-dimensional information of the indoor scene is detected, a dynamic collision risk assessment model is established, and real-time evaluation and formulation are carried out Anti-collision navigation decisions and obstacle avoidance planning decisions, optimizing the pitch angle of the monocular vision sensor to improve ranging accuracy.

Benefits of technology

It achieves high-precision anti-collision navigation control during real-time movement of the robot, improves the adaptability of visual sensor pose changes to ranging accuracy, and ensures the safe operation of the robot in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117621103B
    Figure CN117621103B
Patent Text Reader

Abstract

The present invention designs a nursing robot ranging and obstacle avoidance method based on posture adaptive inverse perspective transformation. Based on the fact that there is no rigid body relationship between a robot head-mounted monocular vision sensor and the ground, a posture adaptive inverse perspective transformation algorithm AIPM is designed. A posture voter is introduced to estimate the posture change of the monocular vision sensor in real time, and then a posture adaptive inverse perspective transformation is performed on the monocular vision image taken during the movement of the robot, so as to more accurately restore the three-dimensional information of the indoor scene in the monocular vision sensor, predict the dynamic collision risk and realize the anti-collision navigation task; the real-time posture information of the monocular vision sensor is obtained, and high-precision monocular vision ranging can be realized even when the posture of the robot monocular vision sensor changes in real time; according to the obtained object depth data, the possible dynamic collision risk is predicted and used as a feedback signal of the robot control algorithm to improve the safety of the robot in the anti-collision navigation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of robot control, and in particular relates to a nursing robot ranging and obstacle avoidance method based on posture adaptive inverse perspective transformation. Background Art

[0002] Population aging is a major development trend in modern society. In addition, the frequent occurrence of diseases and traffic accidents has also led to an increase in the number of disabled people. Since the elderly and patients with motor dysfunction lack the ability to take care of themselves, they need necessary assistance from others in their daily lives. Studies have shown that robots can provide nursing services such as feeding, fall detection, tracking and companionship for the elderly and patients with motor dysfunction, which can not only improve the quality of life, but also prevent accidents. Therefore, more and more robots are widely used.

[0003] The robot can move in all directions in indoor spaces, and can also complete complex dual-arm collaborative tasks in narrow spaces. Safety is very important when robots provide services. In indoor environments, robots must have high-precision visual ranging and anti-collision navigation capabilities to avoid collisions with people and objects around them during operation. According to the type of visual sensor, common methods of robot visual ranging include: monocular, binocular and depth ranging. However, the depth sensor (RealSense D435) cannot accurately obtain the depth data of distant objects. Although the binocular vision sensor has a larger measurement range than the depth sensor, it is easily affected by the surface texture of the object. Among them, the monocular visual ranging system has been widely used in robot navigation systems due to its low cost, high accuracy, low computational complexity, portability and rapid acquisition of depth data.

[0004] The traditional inverse perspective transformation (IPM) technology in the monocular vision ranging system requires a rigid body relationship between the monocular vision sensor and the ground, that is, the change in the monocular vision sensor posture affects the ranging accuracy of the inverse perspective transformation (IPM) technology. When the robot is running indoors, the posture of the robot's head changes frequently due to the change of the robot's posture, and the posture of the monocular vision sensor is time-varying and uncertain. The traditional IPM algorithm only considers the case of obtaining video data from a fixed monocular vision sensor. Therefore, the ranging accuracy of IPM depends on the initial alignment accuracy, that is, when the monocular vision sensor posture changes in real time, the IPM control parameters need to be adjusted in real time, otherwise the ranging accuracy of the traditional IPM algorithm cannot be guaranteed.

[0005] Therefore, when the robot uses IPM ranging technology to implement monocular vision ranging, it is difficult to adapt to the frequent changes in the position and posture of the monocular vision sensor in real time. Summary of the invention

[0006] In view of the shortcomings of the existing inverse perspective transformation (IPM) technology, the present invention proposes a ranging and obstacle avoidance method for a nursing robot based on posture adaptive inverse perspective transformation. Firstly, the three-dimensional information of the indoor scene is detected by a posture adaptive inverse perspective transformation algorithm. Then, a mathematical model of dynamic collision risk assessment is established to evaluate the collision risk in real time. Finally, according to the risk assessment results, anti-collision navigation decisions and obstacle avoidance planning decisions are made to avoid obstacles, thereby realizing the safe anti-collision navigation control task of the nursing robot.

[0007] The method for measuring distance and avoiding obstacles of a nursing robot based on posture adaptive inverse perspective transformation comprises the following steps:

[0008] Step 1: Detect whether there is an object in the indoor environment and locate it, and obtain the distance between the nursing robot and the object;

[0009] The nursing robot obtains real-time video data of the indoor environment through a head-mounted monocular vision sensor and uses it as visual input data for the monocular 3D object detection model;

[0010] The monocular 3D object detection model includes: a lightweight Pytorch target detector and an attitude-adaptive inverse perspective transformation algorithm AIPM;

[0011] The AIPM is improved based on the IPM;

[0012] First, the visual input data is passed through a lightweight Pytorch object detector, i.e., a 2D detector, to predict the position and class label of the object. Then, the geometric relationship between the monocular vision sensor coordinates, i.e., the robot coordinates, and the object's 3D world coordinates is calculated using the pose-adaptive inverse perspective transformation, i.e., the AIPM algorithm, to obtain the 3D distance between a given robot and an object in the real world.

[0013] The method of using AIPM to obtain the 3D distance between a given robot and an object in the real world is as follows:

[0014] Assume that the ground in the indoor environment is flat; based on this assumption, IPM technology uses the internal and external parameters of the monocular vision sensor to generate a Bird-eye view (BEV) image that eliminates the perspective effect; mathematically, IPM technology is described as: the 2D pixel points (x, y) in the video image obtained by the monocular vision sensor on the robot head are reversely projected onto the BEV space through the homography matrix H to eliminate the perspective effect. The homography matrix H is defined as:

[0015]

[0016] where [x,y] TIt is a 2D pixel point captured by a monocular vision sensor; IPM maps it to the corresponding world coordinate point [u,v,w] through the homography matrix H T :

[0017] H=KTR (2)

[0018]

[0019] The matrix K represents the intrinsic parameters of the monocular vision sensor, f is the focal length of the monocular vision sensor, s is the skew parameter, and the pixel point (x o ,y o ) is the center pixel of the corresponding image size, and the transformation matrix T is expressed as:

[0020]

[0021] Where h represents the height of the monocular vision sensor, θ refers to the pitch angle of the monocular vision sensor, which is defined as the rotation angle between the axis of the monocular vision sensor and the axis parallel to the robot; the rotation matrix R is defined as:

[0022]

[0023] Compared with the outdoor environment, the indoor ground is flat; substituting the ground plane v = 0 into equation 1 simplifies it to equation 6:

[0024]

[0025] By adopting IPM technology, the pixel point (x, y) is projected to the world coordinate point (u, w, v), and the relationship between the corresponding pixel points in the pixel space (x, y) and the measurement space (u, w) is found. That is, the image of the monocular vision sensor is converted into a bird's-eye view BEV by IPM to eliminate the perspective distortion in the image; after converting the image space into BEV space, the Euclidean mathematical formula is used to directly obtain an unbiased estimate of the distance between objects, which is expressed as:

[0026]

[0027] Where P i =(x i ,y i ) and P j =(x j ,y j ) is the object P i and P j The center point of the predicted box; in the "bird's eye view" BEV, every Δx and Δy pixels are regarded as a constant, which is equivalent to 1 meter in the real world; in this way, the relationship between pixels and distance is established;

[0028] The attitude-adaptive inverse perspective mapping algorithm AIPM uses an attitude-adaptive voting mechanism to adapt to the posture changes of the monocular vision sensor on the robot head, and optimizes the unbiased estimate of the distance between the robot and the object obtained by IPM. First, the monocular vision distance measurement is used, that is, the estimated distance L is obtained by using a 2D detector. e ; The posture adaptive voting mechanism compares the measured distance D ξ and the estimated distance L e The difference between them generates the voter output; finally, the pitch angle θ of the monocular vision sensor is adaptively compensated according to the voter output to obtain a more accurate BEV image when the monocular vision sensor posture changes using AIPM, that is, to obtain a more accurate distance between the robot and the object;

[0029] The method of adaptively compensating the pitch angle θ of the monocular vision sensor according to the output of the voter is specifically:

[0030] Each object detected by the 2D detector can act as a voter, consisting of two inputs and one output; the two inputs are the measured distance D ξ and the estimated distance L e ; The output of the voting machine is defined as L e -D ξ , when the monocular vision sensor has a stable posture, the difference is close to zero, and when the monocular vision sensor has a posture change, the difference deviates significantly from zero;

[0031] The output of the vote is one of the following categories:

[0032] (1) When D ξi >L ei When N i =N i-1 +1;

[0033] (2) When D ξi <L ei When the negative vote is output, that is, N i =N i-1 -1;

[0034] (3) When D ξi =L ei When N i =N i-1 ;

[0035] Among them, D ξi is the measured distance of the i-th target obtained by AIPM in each frame of image; L ei N is the estimated distance of the i-th target obtained by the 2D detector in each frame; iThe voting result after voting for the i-th target in each frame image; AIPM adaptively compensates the pitch angle to θ = θ + N i *Δθ; Δθ is the minimum unit for adjusting the pitch angle θ of the monocular vision sensor; AIPM estimates the attitude change of the current monocular vision sensor in real time with the attitude voter, and adaptively adjusts the pitch angle θ of the monocular vision sensor;

[0036] Step 2: Based on the distance between the robot and the object obtained in step 1, a mathematical model for dynamic collision risk assessment is established, and the robot assesses the collision risk in real time based on the collision risk assessment model;

[0037] The mathematical model of the dynamic collision risk assessment is specifically:

[0038] (1) When the distance between objects is less than a given distance of 1 meter, the objects are diagnosed as having a high collision risk;

[0039] (2) When the distance between objects is within the range [l, L], the objects are diagnosed as having low collision risk;

[0040] (3) When the distance between objects exceeds L meters, the objects are diagnosed as safe;

[0041] Among them, l represents the dangerous distance and L represents the safe distance, which is used to evaluate the relative collision risk and serves as the basis and feedback signal for the robot's obstacle avoidance and navigation decisions;

[0042] Step 3: Make anti-collision navigation decisions and obstacle avoidance planning decisions based on the robot collision risk assessment results, where the obstacle avoidance planning decision takes precedence over the navigation decision; enable the robot to start from a certain point and reach the target point through a cluttered indoor environment full of obstacles;

[0043] The robot flexibly switches between anti-collision navigation decisions and obstacle avoidance planning decisions: when the robot is at risk of colliding with an obstacle, it executes the obstacle avoidance planning decision; after the robot avoids the obstacle or there is no risk of collision with the obstacle, it executes the anti-collision navigation decision;

[0044] First, the robot P is calculated based on the AIPM algorithm. r =(x r ,y r ) and obstacle P o =(x o ,y o ) between ξ (P r ,P o ); then, and the robot P r =(x r ,y r ) with a given object P t =(x t ,yt ) the 3D distance D between ξ (P r , P t ); then, based on D ξ (P r , P o ), D ξ (P r , P t ) and the collision risk assessment model to evaluate the collision risk; finally, switch between the anti-collision navigation decision and the obstacle avoidance planning decision according to the collision risk level;

[0045] The anti-collision navigation decision is specifically as follows:

[0046] Use to represent the heading angle of the robot's translational motion. If the target is directly in front of the robot, the robot maintains the heading angle and moves forward; if the target is in the front right of the robot, the robot changes the heading angle to and turns right; if the target is in the front left of the robot, the robot changes the heading angle to and turns left; if there is no target in front of the robot, it maintains rotational motion to search for the target;

[0047] (1) When D ξ (P r , P t ) ≥ L, it is diagnosed as safe and poses no threat to the robot; the robot gradually increases its translational speed and moves towards the target;

[0048] (2) When l < D ξ (P r , P t ) < L, it is diagnosed as having a low collision risk. The robot gradually reduces its translational speed until it has the same translational speed as the target. If the target is stationary, the robot's translational speed drops to zero;

[0049] (3) When D ξ (P r , P t ) ≤ l, it is diagnosed as having a high collision risk. The robot gradually increases its translational speed and moves away from the target;

[0050] Among them, l represents the dangerous distance and L represents the safe distance.

[0051] The obstacle avoidance planning decision is specifically as follows:

[0052] (1) When D ξ (P r , P o) When l ≥ L, the obstacle is diagnosed as safe because it poses no threat to the robot; in this case, the robot continues to execute the anti-collision navigation decision and moves towards the given target;

[0053] (2) When l < D ξ (P r , P o ) < L and 0 < x o ≤ W / 2, the obstacle is diagnosed as having a low collision risk, so the robot changes its heading angle in the clockwise direction to avoid the obstacle;

[0054] (3) When l < D ξ (P r , P o ) < L and W / 2 < x o ≤ W, the obstacle is diagnosed as having a low collision risk, so the robot changes its heading angle in the counterclockwise direction to avoid the obstacle;

[0055] (4) When D ξ (P r , P o ) ≤ l and 0 < x o ≤ W / 2, the obstacle is diagnosed as having a high collision risk, so the robot changes its heading angle to change its heading in the counterclockwise direction and move away from the obstacle;

[0056] (5) When D ξ (P r , P o ) ≤ l and W / 2 < x o ≤ W, the obstacle is diagnosed as having a high collision risk, so the robot changes its heading angle to change its heading in the clockwise direction and move away from the obstacle;

[0057] where W is the number of pixels in the field of view width direction of the monocular vision sensor. After avoiding the obstacle, the robot continues to execute the anti-collision navigation decision and moves directly towards the target.

[0058] Advantageous technical effects of the present invention:

[0059] The present invention focuses on the fields of robot obstacle avoidance, tracking and navigation. Aiming at the problems existing in the traditional inverse perspective transformation technology, the present invention designs an attitude-adaptive inverse perspective transformation algorithm and a collision risk analysis method, estimates the change of the monocular vision sensor posture in real time and predicts the collision risk, so as to realize the robot anti-collision navigation method based on collision risk analysis control. The designed attitude-adaptive inverse perspective transformation algorithm can cope with the interference of the frequent changes of the monocular vision sensor posture in the real-time motion process of the robot. When the robot posture changes in real time, the influence of the change of the monocular vision sensor posture on the IMP ranging accuracy can be alleviated. Therefore, the real-time anti-collision navigation control of the robot can be realized more safely based on the attitude-adaptive inverse perspective transformation algorithm.

[0060] In summary, the accuracy of the robot in predicting the depth information of an object is further improved. It is easy to realize the real-time control of the robot, and can also realize high-precision prediction of the depth information of an object when the position and posture of the visual sensor change in real time during the operation of the robot, and has good robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is a structural block diagram of a nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to an embodiment of the present invention;

[0062] Figure 2 A block diagram of an inverse perspective transformation algorithm for robot posture adaptation according to an embodiment of the present invention;

[0063] Figure 3 is a schematic diagram of a robot collision risk assessment model according to an embodiment of the present invention;

[0064] Figure 4 The projection and transformation principle diagram of the AIPM of the embodiment of the present invention;

[0065] Figure 5 This is a schematic diagram of the posture adaptive voting mechanism of the robot monocular vision sensor according to an embodiment of the present invention;

[0066] Figure 6 The distance measurement error of the inverse perspective transformation algorithm of the robot posture adaptation of the embodiment of the present invention at different pitch angles θ; wherein, Figure a is the distance detection error in the latitude direction, and Figure b is the distance detection error in the longitude direction;

[0067] Figure 7 This is a diagram showing the trajectory experiment results of a robot tracking a dynamic object according to an embodiment of the present invention;

[0068] Figure 8 This is a diagram of experimental results of the robot avoiding ten static obstacles according to an embodiment of the present invention. DETAILED DESCRIPTION

[0069] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0070] Aiming at the shortcomings of traditional inverse perspective transformation (IPM) technology, the present invention provides a robot monocular vision ranging and anti-collision navigation method based on a pose adaptive inverse perspective transformation algorithm. First, the monocular vision ranging algorithm is used to obtain the estimated distance Le. Secondly, AIPM obtains the measured distance Lm, which is the optimized D ξ The voting algorithm then generates the output of the pose voter by comparing the difference between the measured distance Lm and the estimated distance Le (see Figure 5 ). Finally, the pitch angle θ is adaptively compensated according to the voter output, and the AIPM obtains a more accurate BEV image when the monocular vision sensor posture changes frequently. In addition, a collision risk assessment method is proposed to ensure that the robot plans the safest path when passing through a cluttered indoor environment. In the process of evaluating dynamic collision risk, this method obtains real-time dynamic collision risk by analyzing the spatial distance between objects in real time, and divides objects into different risk levels.

[0071] The distance measurement and obstacle avoidance method of nursing robot based on posture adaptive inverse perspective transformation is shown in the attached figure. Figure 1 As shown, the following steps are included:

[0072] Step 1: The nursing robot uses a head-mounted monocular vision sensor to detect whether there is an object in the indoor environment and locate it, and obtain the distance between the robot and the object;

[0073] The nursing robot obtains real-time video data of the indoor environment through a head-mounted monocular vision sensor and uses it as visual input data for a monocular 3D object detection model; the monocular 3D object detection model includes: a lightweight Pytorch target detector and an attitude-adaptive inverse perspective transformation algorithm AIPM; the AIPM is improved based on IPM, as shown in the attached figure. Figure 2 As shown;

[0074] First, the visual input data is passed through a lightweight Pytorch target detector, i.e., a 2D detector, to predict the position and class label of the object; then the geometric relationship between the monocular vision sensor coordinates, i.e., the robot coordinates, and the object's 3D world coordinates is calculated using the posture-adaptive inverse perspective transformation, i.e., the AIPM algorithm, to obtain the 3D distance between a given robot and an object in the real world; the basic principle of a monocular vision sensor is to collect images of three-dimensional world coordinate points and project them onto a two-dimensional perspective image. Therefore, in the images taken by the monocular vision sensor, the depth information is not available, and perspective distortion occurs. In such a low-dimensional space, the robot cannot perceive the uniform distribution of depth information in the collected images using a monocular vision sensor, i.e., it is wrong to directly use the Euclidean mathematical formula to predict the spatial distance between objects.

[0075] The lightweight Pytorch object detector detects the visual input data collected by the monocular vision sensor, i.e., the 2D detector predicts the position and class label of the object, and then uses the posture-adaptive inverse perspective transformation, i.e., the AIPM algorithm, to restore the 3D information of the indoor scene from the monocular vision and predict the dynamic collision risk, thus realizing the robot's anti-collision navigation.

[0076] The method of using AIPM to obtain the 3D distance between a given robot and an object in the real world is as follows:

[0077] Assume that the ground in the indoor environment is flat; based on this assumption, the IPM technology uses the internal and external parameters of the monocular vision sensor (such as the height h and focal length f of the monocular vision sensor, the angle θ between the axis of the monocular vision sensor and the line parallel to the robot, and the optical specifications) to generate a Bird-eye view or BEV image that eliminates the perspective effect; mathematically, the IPM technology is described as: the 2D pixel points (x, y) in the video image obtained by the monocular vision sensor on the robot head are reversely projected onto the BEV space through the homography matrix H to eliminate the perspective effect. The homography matrix H is defined as:

[0078]

[0079] where [x,y] T It is a 2D pixel point captured by a monocular vision sensor; IPM maps it to the corresponding world coordinate point [u,v,w] through the homography matrix H T :

[0080] H=KTR (2)

[0081]

[0082] The matrix K represents the intrinsic parameters of the monocular vision sensor, f is the focal length of the monocular vision sensor, s is the skew parameter, and the pixel point (x o ,y o ) is the center pixel of the corresponding image size, and the transformation matrix T is expressed as:

[0083]

[0084] Where h represents the height of the monocular vision sensor, θ refers to the pitch angle of the monocular vision sensor, which is defined as the rotation angle between the axis of the monocular vision sensor and the axis parallel to the robot; the rotation matrix R is defined as:

[0085]

[0086] Compared with the outdoor environment, the indoor ground is flat, such as the ground of hospitals and nursing homes. Substituting the ground plane v = 0 into equation 1 simplifies it to equation 6:

[0087]

[0088] By adopting IPM technology, the pixel point (x, y) is projected to the world coordinate point (u, w, v), and the relationship between the corresponding pixel points in the pixel space (x, y) and the measurement space (u, w) is found. That is, this paper uses IPM to convert the image of the monocular vision sensor into a bird's-eye view (BEV) to eliminate the perspective distortion in the image; after converting the image space to BEV space, the Euclidean mathematical formula is used to directly obtain an unbiased estimate of the distance between objects, which is expressed as:

[0089]

[0090] Where P i =(x i ,y i ) and P j =(x j ,y j ) is the object P i and P j The center point of the predicted box; in the "bird's eye view" view (BEV), every Δx and Δy pixels are regarded as a constant, which is equivalent to 1 meter in the real world; in this way, the relationship between pixels and distance is established;

[0091] Although IPM is direct and effective in converting pixel space to BEV space, it requires accurate intrinsic and extrinsic parameters of the monocular vision sensor and provides real-time monocular vision sensor pose estimation;

[0092] The accuracy of depth information detected by the traditional inverse perspective transformation IPM technology is affected by the change in the position and posture of the monocular vision sensor. The monocular vision sensor is installed on the head of the robot, and the neck of the robot has one degree of freedom, which will change the position and posture of the monocular vision sensor in real time.

[0093] When using IPM technology to calculate the depth information of an object, the real-time change of the monocular vision sensor posture must be considered. However, this is a challenging problem. To alleviate this problem, a posture adaptive inverse perspective mapping (AIPM) algorithm is designed to obtain more accurate BEV images from a head-mounted monocular vision sensor when the robot posture changes frequently. The algorithm uses a voting mechanism to deal with the problem of monocular vision sensor posture deviation during robot movement.

[0094] The attitude-adaptive inverse perspective mapping algorithm AIPM uses an attitude-adaptive voting mechanism to adapt to the posture changes of the monocular vision sensor on the robot head, and optimizes the unbiased estimate of the distance between the robot and the object obtained by IPM. First, the monocular vision distance measurement is used, that is, the estimated distance L is obtained by using a 2D detector. e ; The posture adaptive voting mechanism compares the measured distance D ξ and the estimated distance L e The difference between the two generates the voter output (see Figure 5 ); finally, the pitch angle θ of the monocular vision sensor is adaptively compensated according to the output of the voter, so as to obtain a more accurate BEV image and a more accurate distance between the robot and the object when the posture of the monocular vision sensor changes using AIPM;

[0095] The method of adaptively compensating the pitch angle θ of the monocular vision sensor according to the output of the voter is specifically:

[0096] Each object detected by the 2D detector can act as a voter, consisting of two inputs and one output; the two inputs are the measured distance D ξ and the estimated distance L e ; The output of the voting machine is defined as L e -D ξ , when the monocular vision sensor has a stable posture, the difference is close to zero, and when the monocular vision sensor has a posture change, the difference deviates significantly from zero;

[0097] The output of the vote is one of the following categories:

[0098] (1) When D ξi >L ei When N i =N i-1 +1;

[0099] (2) When D ξi <L ei When the negative vote is output, that is, N i =N i-1 -1;

[0100] (3) When D ξi =L ei When N i =N i-1 ;

[0101] Among them, D ξi is the measured distance of the i-th target obtained by AIPM in each frame of image; L ei N is the estimated distance of the i-th target obtained by the 2D detector in each frame; iThe voting result after voting for the i-th target in each frame image; AIPM adaptively compensates the pitch angle to θ = θ + N i *Δθ; Δθ is the minimum unit for adjusting the pitch angle θ of the monocular vision sensor; AIPM estimates the attitude change of the current monocular vision sensor in real time with the attitude voter, and adaptively adjusts the pitch angle θ of the monocular vision sensor; the projection and transformation principle diagram of AIPM is shown in the attached figure. Figure 4 As shown;

[0102] Step 2: Based on the distance between the robot and the object obtained in step 1, establish a mathematical model for dynamic collision risk assessment, as shown in the attached figure. Figure 3 As shown, the robot evaluates the collision risk in real time based on the collision risk assessment model;

[0103] The mathematical model of the dynamic collision risk assessment is specifically:

[0104] (1) When the distance between objects is less than a given distance of 1 meter, the objects are diagnosed as having a high collision risk;

[0105] (2) When the distance between objects is within the range [l, L], the objects are diagnosed as having low collision risk;

[0106] (3) When the distance between objects exceeds L meters, the objects are diagnosed as safe;

[0107] Among them, l represents the danger distance and L represents the safety distance, which are used to evaluate the relative collision risk and serve as the basis and feedback signal for the robot's obstacle avoidance and navigation decisions. According to experience, the danger distance is set to l = 2.4m and the safety distance is set to L = 3.2m.

[0108] Step 3: Make anti-collision navigation decisions and obstacle avoidance planning decisions based on the robot collision risk assessment results, where obstacle avoidance planning decisions take precedence over navigation decisions; enable the robot to start from a certain point and reach the target point through a cluttered indoor environment full of obstacles, reducing the risk of collision;

[0109] The robot flexibly switches between anti-collision navigation decisions and obstacle avoidance navigation decisions: when the robot is at risk of colliding with an obstacle, it executes obstacle avoidance planning decisions; after the robot avoids the obstacle or there is no risk of collision with the obstacle, it executes anti-collision navigation decisions;

[0110] The posture adaptive inverse perspective mapping AIPM algorithm obtained in step 1 enables the robot to obtain the depth information of the object and construct the geometric relationship between the robot and the object, that is, the distance, and then predicts the risk and possibility of collision based on step 2;

[0111] First, the robot P is calculated based on the AIPM algorithm. r =(x r ,y r) and obstacle P o =(x o , y o ) and the 3D distance D ξ (P r , P o ); then, and robot P r =(x r , y r ) and the given object P t =(x t , y t ) and the 3D distance D ξ (P r , P t ); then, according to D ξ (P r , P o ), D ξ (P r , P t ) and the collision risk assessment model to evaluate the collision risk; finally, switch between the anti-collision navigation decision and the obstacle avoidance planning decision according to the collision risk level;

[0112] The anti-collision navigation decision is specifically as follows:

[0113] Use to represent the heading angle of the robot's translational motion. If the target is directly in front of the robot, the robot maintains the heading angle and moves forward; if the target is in the front right of the robot, the robot changes the heading angle to and turns right; if the target is in the front left of the robot, the robot changes the heading angle to and turns left; if there is no target in front of the robot, it maintains rotational motion to search for the target.

[0114] (1) When D ξ (P r , P t )≥L, it is diagnosed as safe and poses no threat to the robot; the robot gradually increases its translational speed and moves towards the target;

[0115] (2) When l < D ξ (P r , P t ) < L, it is diagnosed as having a low collision risk. The robot gradually reduces its translational speed until it maintains the same translational speed as the target. If the target is stationary, the robot's translational speed drops to zero;

[0116] (3) When D ξ (P r , P t) When it is ≤ l, it is diagnosed as having a high collision risk, and the robot gradually increases the translational speed and moves away from the target;

[0117] Among them, l represents the dangerous distance, and L represents the safe distance.

[0118] The obstacle avoidance planning decision is specifically as follows:

[0119] (1) When D ξ (P r , P o ) ≥ L, the obstacle is diagnosed as safe because it poses no threat to the robot; in this case, the robot continues to execute the anti-collision navigation decision and moves towards the given target;

[0120] (2) When l < D ξ (P r , P o ) < L and 0 < x o ≤ W / 2, the obstacle is diagnosed as having a low collision risk, so the robot will change the heading angle in the clockwise direction to avoid the obstacle;

[0121] (3) When l < D ξ (P r , P o ) < L and W / 2 < x o ≤ W, the obstacle is diagnosed as having a low collision risk, so the robot will change the heading angle in the counterclockwise direction to avoid the obstacle;

[0122] (4) When D ξ (P r , P o ) ≤ l and 0 < x o ≤ W / 2, the obstacle is diagnosed as having a high collision risk, so the robot changes the heading angle to change its heading in the counterclockwise direction and moves away from the obstacle;

[0123] (5) When D ξ (P r , P o ) ≤ l and W / 2 < x o ≤ W, the obstacle is diagnosed as having a high collision risk, so the robot changes the heading angle to change its heading in the clockwise direction and moves away from the obstacle;

[0124] Among them, W is the number of pixels in the field of view width direction of the monocular vision sensor. After avoiding the obstacle, the robot continues to execute the anti-collision navigation decision and moves directly towards the target. Figure 6 Figure 3 is the ranging results of the attitude adaptive inverse perspective mapping (AIPM) algorithm and the traditional inverse perspective mapping (IPM) algorithm under different pitch angles θ. It can be seen that the attitude adaptive inverse perspective mapping (AIPM) algorithm has higher ranging accuracy than the traditional inverse perspective mapping (IPM) algorithm.

[0125] Figure 7 This is the experimental result of tracking dynamic targets. Figure 8 Experimental results of the robot avoiding ten static obstacles.

Claims

1. A nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation, characterized in that: The following steps are involved: Step 1: Detect whether there is an object in the indoor environment and locate it, and obtain the distance between the nursing robot and the object; Step 2: Based on the distance between the robot and the object obtained in step 1, a mathematical model for dynamic collision risk assessment is established, and the robot assesses the collision risk in real time based on the collision risk assessment model; Step 3: Make anti-collision navigation decisions and obstacle avoidance planning decisions based on the robot collision risk assessment results, where the obstacle avoidance planning decision takes precedence over the navigation decision; enable the robot to start from a certain point and reach the target point through a cluttered indoor environment full of obstacles; Step 1 is as follows: The nursing robot obtains real-time video data of the indoor environment through a head-mounted monocular vision sensor and uses it as visual input data for the monocular 3D object detection model; The monocular 3D object detection model includes: a lightweight Pytorch target detector and an attitude-adaptive inverse perspective transformation algorithm AIPM; The AIPM is improved based on the IPM; First, the visual input data is passed through a lightweight Pytorch object detector, i.e., a 2D detector, to predict the position and class label of the object. Then, the geometric relationship between the monocular vision sensor coordinates, i.e., the robot coordinates, and the object's 3D world coordinates is calculated using the pose-adaptive inverse perspective transformation, i.e., the AIPM algorithm, to obtain the 3D distance between a given robot and an object in the real world. The method of using AIPM to obtain the 3D distance between a given robot and an object in the real world is as follows: Assume that the ground in the indoor environment is flat; based on this assumption, IPM technology uses the internal and external parameters of the monocular vision sensor to generate a Bird-eye view (BEV) image that eliminates the perspective effect; mathematically, IPM technology is described as: the 2D pixel points (x, y) in the video image obtained by the monocular vision sensor on the robot head are reversely projected onto the BEV space through the homography matrix H to eliminate the perspective effect. The homography matrix H is defined as: where [x,y] T It is a 2D pixel point captured by a monocular vision sensor; IPM maps it to the corresponding world coordinate point [u,v,w] through the homography matrix H. T : H=KTR (2) The matrix K represents the intrinsic parameters of the monocular vision sensor, f is the focal length of the monocular vision sensor, s is the skew parameter, and the pixel point (x o ,y o ) is the center pixel of the corresponding image size, and the transformation matrix T is expressed as: Where h represents the height of the monocular vision sensor, θ refers to the pitch angle of the monocular vision sensor, which is defined as the rotation angle between the axis of the monocular vision sensor and the axis parallel to the robot. The rotation matrix R is defined as: Compared with the outdoor environment, the indoor ground is flat; substituting the ground plane v = 0 into equation 1 simplifies it to equation 6: By adopting IPM technology, the pixel point (x, y) is projected to the world coordinate point (u, w, v), and the relationship between the corresponding pixel points in the pixel space (x, y) and the measurement space (u, w) is found. That is, the image of the monocular vision sensor is converted into a bird's-eye view BEV by IPM to eliminate the perspective distortion in the image; after converting the image space into BEV space, the Euclidean mathematical formula is used to directly obtain an unbiased estimate of the distance between objects, which is expressed as: Where P i =(x i ,y i ) and P j =(x j ,y j ) is the object P i and P j The center point of the predicted box; in the "bird's eye view" BEV, every Δx and Δy pixels are regarded as a constant, which is equivalent to 1 meter in the real world; in this way, the relationship between pixels and distance is established; The attitude-adaptive inverse perspective mapping algorithm AIPM uses an attitude-adaptive voting mechanism to adapt to the posture changes of the monocular vision sensor on the robot head, and optimizes the unbiased estimate of the distance between the robot and the object obtained by IPM. First, the monocular vision distance measurement is used, that is, the estimated distance L is obtained by using a 2D detector. e ; The posture adaptive voting mechanism compares the measured distance D ξ and the estimated distance L e The difference between them generates the voter output; finally, the pitch angle θ of the monocular vision sensor is adaptively compensated according to the voter output to obtain a more accurate BEV image when the monocular vision sensor posture changes using AIPM, that is, to obtain a more accurate distance between the robot and the object.

2. The nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to claim 1 is characterized in that: The pitch angle θ of the monocular vision sensor is adaptively compensated according to the output of the voter, specifically: Each object detected by the 2D detector can act as a voter, consisting of two inputs and one output; the two inputs are the measured distance D ξ and the estimated distance L e ; The output of the voting machine is defined as L e -D ξ , when the monocular vision sensor has a stable posture, the difference is close to zero, and when the monocular vision sensor has a posture change, the difference deviates significantly from zero; The output of the vote is one of the following categories: (1) When D ξi >L ei When N i =N i-1 +1; (2) When D ξi <L ei When N i =N i-1 -1; (3) When D ξi =L ei When N i =N i-1 ; Among them, D ξi is the measured distance of the i-th target obtained by AIPM in each frame of image; L ei N is the estimated distance of the i-th target obtained by the 2D detector in each frame; i The voting result after voting for the i-th target in each frame image; AIPM adaptively compensates the pitch angle to θ = θ + N i *Δθ; Δθ is the minimum unit for adjusting the pitch angle θ of the monocular vision sensor; AIPM uses the attitude voter to estimate the attitude change of the current monocular vision sensor in real time and adaptively adjust the pitch angle θ of the monocular vision sensor.

3. The nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to claim 1 is characterized in that: The mathematical model of dynamic collision risk assessment in step 2 is specifically: (1) When the distance between objects is less than a given distance of 1 meter, the objects are diagnosed as having a high collision risk; (2) When the distance between objects is within the range [l, L], the objects are diagnosed as having low collision risk; (3) When the distance between objects exceeds L meters, the objects are diagnosed as safe; Among them, l represents the dangerous distance and L represents the safe distance, which is used to evaluate the relative collision risk and serves as the basis and feedback signal for the robot's obstacle avoidance and navigation decisions.

4. The nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to claim 1 is characterized in that: Step 3 is as follows: The robot flexibly switches between anti-collision navigation decisions and obstacle avoidance planning decisions: when the robot is at risk of colliding with an obstacle, it executes the obstacle avoidance planning decision; after the robot avoids the obstacle or there is no risk of collision with the obstacle, it executes the anti-collision navigation decision; First, the robot P is calculated based on the AIPM algorithm. r =(x r ,y r ) and obstacle P o =(x o ,y o ) between ξ (P r ,P o ); then, and the robot P r =(x r ,y r ) with a given object P t =(x t ,y t ) between ξ (P r ,P t ); then, according to D ξ (P r ,P o )、D ξ (P r ,P t ) and the collision risk assessment model to evaluate the collision risk; finally, the switching between the anti-collision navigation decision and the obstacle avoidance planning decision is implemented according to the collision risk level.

5. The nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to claim 4 is characterized in that: The anti-collision navigation decision is specifically: use Indicates the heading angle of the robot's translational motion. If the target is directly in front of the robot, the robot maintains the heading angle Move forward; if the target is in front of the right side of the robot, the robot changes its heading angle to Turn right; If the target is in front of the left side of the robot, the robot changes its heading angle to Turn left; if there is no target in front of the robot, it keeps rotating to find the target; (1) When D ξ (P r ,P t )≥L, it is diagnosed as safe and poses no threat to the robot; the robot gradually increases its translation speed and moves toward the target; (2) When l < D ξ (P r , P t ) < L, it is diagnosed as having a low collision risk, and the robot gradually reduces the translational speed until it maintains the same translational speed as the target. If the target is stationary, the translational speed of the robot drops to zero; (3) When D ξ (P r ,P t )≤l, it is diagnosed as having a high collision risk, and the robot gradually increases the translation speed and moves away from the target; Among them, l represents the dangerous distance and L represents the safe distance.

6. The nursing robot distance measurement and obstacle avoidance method based on posture adaptive inverse perspective transformation according to claim 5 is characterized in that: The obstacle avoidance planning decision is specifically: (1) When D ξ (P r ,P o )≥L, the obstacle is diagnosed as safe because it poses no threat to the robot; in this case, the robot continues to execute the collision avoidance navigation decision and moves towards the given target; (2) When l < D ξ (P r , P o ) < L and 0 < x o ≤ W / 2, the obstacle is diagnosed as a low collision risk, so the robot will change the heading angle in the clockwise direction to avoid the obstacle; (3) When l < D ξ (P r , P o ) < L and W / 2 < x o ≤ W, the obstacle is diagnosed as having a low collision risk, so the robot will change its heading angle in the counterclockwise direction to avoid the obstacle; (4) When D ξ (P r ,P o )≤l and 0 <x o When ≤W / 2, the obstacle is diagnosed as having a high collision risk, so the robot changes its heading angle Change its course in a counterclockwise direction and stay away from obstacles; (5) When D ξ (P r ,P o )≤l and W / 2 <x o When ≤W, the obstacle is diagnosed as having a high collision risk, so the robot changes its heading angle Change its course in a clockwise direction and stay away from obstacles; Where W is the number of pixels in the width direction of the monocular vision sensor's field of view; after avoiding the obstacle, the robot continues to execute the anti-collision navigation decision and moves directly to the target.