A method for grabbing aeroengine blades
By calibrating the camera and training the Posecnn model and DQN grabbing model, the problem of insufficient image acquisition and processing efficiency and accuracy of aero engine blades is solved, and efficient and accurate blade grabbing is achieved, reducing labor costs.
Patent Information
- Application Number
- CN202411798043.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art cannot meet the requirements in image acquisition and processing of aircraft engine blades, resulting in low operating efficiency, poor adaptability, and relying on manual measurement and sorting, which is cost-effective, low efficiency and error-prone.
The calibration camera is used to obtain the camera's internal parameters, external parameters and distortion coefficients, and a data set containing blade 2D images, point clouds and 6D postures. The Posecnn model and DQN grabbing model are trained. The blade images and point clouds are collected through the camera, and efficient and accurate blade grabbing is combined with the robotic arm jaws.
The efficiency and accuracy of blade 6D posture recognition is improved, and the efficient, accurate and robust grasp of aircraft engine blades is achieved, labor costs are reduced, and image acquisition and processing efficiency is improved.
Smart Images

Figure CN119761178A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of blade grabbing, and in particular relates to a method for grabbing an aero-engine blade. Background Art
[0002] As a key component of the engine, the manufacturing quality and precision of aircraft engine blades are crucial to the overall performance of the engine. During their production and maintenance, aircraft engine blades need to be weighed and sorted, and both weighing and sorting require the aircraft engine blades to be grabbed and moved.
[0003] Since the robot needs to spend a lot of time and energy to collect and process data during the process of identifying the blades, the cost is increased, the difficulty of data collection and processing is increased, and the weight, size, posture, etc. of the blades cannot be accurately identified. In the actual grasping process, the manipulator is only suitable for grasping specific types of blades and blades in specific environments. The operation efficiency of the manipulator is low and the adaptability is poor. Before the manipulator grasps the blades, it is necessary to manually measure the blades and place the blades in a specific posture to a specific position, that is, sorting, which leads to the inversion of the target operation.
[0004] Therefore, the existing weighing and sorting of aircraft engine blades mainly rely on manual work, which has high labor costs, low efficiency, and high labor intensity. Different measurement methods and equipment may be required for blades of different types or in different environments, which increases the complexity and difficulty of measurement. Moreover, it is greatly affected by human and environmental factors, is prone to errors, and has objective error problems, which cannot meet the needs of high-precision design and manufacturing. Summary of the invention
[0005] The invention provides an aero-engine blade grabbing method, which is used to solve the problem that the efficiency and accuracy of blade image acquisition and processing cannot meet the requirements.
[0006] In order to solve the above technical problems, the technical solution of the present invention is:
[0007] A method for grabbing an aeroengine blade comprises the following steps:
[0008] S1: Calibrate the camera to obtain the camera's internal parameters, external parameters and distortion coefficients;
[0009] S2: Create a data set, which includes 2D images, point clouds and 6D postures corresponding to leaves of various sizes;
[0010] S3: Use the dataset in S2 to train the Posecnn model;
[0011] S4: Build a DQN grasping model and train the DQN grasping model;
[0012] S5: Use the calibrated camera to collect the 2D image and point cloud of the blade to be grasped, input the 2D image and point cloud of the blade to be grasped into the Posecnn model in S3, obtain the 6D posture of the blade to be measured, input the 6D posture of the blade to be measured and the environmental data into the DQN grasping model, and the DQN grasping model calculates and outputs the execution parameters. The end of the gripper of the robot arm grasps the blade according to the execution parameters.
[0013] Specifically, in S1, the camera is calibrated using the Zhang Zhengyou calibration method to obtain the camera's intrinsic parameters, extrinsic parameters, and distortion coefficients;
[0014] Among them, the camera intrinsic parameter matrix:
[0015]
[0016] In formula (1-1), f is the focal length of the camera, dx and dy represent the physical length of a pixel on the camera photosensitive plate in the X and Y directions respectively, u0 and v0 represent the coordinates of the center of the camera photosensitive plate in the pixel coordinate system respectively, and θ represents the angle between the horizontal and vertical sides of the camera photosensitive plate;
[0017] The camera's extrinsic matrix:
[0018]
[0019] In formula (1-2), R is the rotation matrix and T is the translation vector;
[0020] The distortion coefficient includes radial distortion coefficient and tangential distortion coefficient:
[0021] Radial distortion formula:
[0022]
[0023]
[0024] Tangential distortion formula:
[0025]
[0026] r 2 =x 2 +y 2 Formula (1-8)
[0027] In formulas (1-4)-(1-8), k1, k2, k3 are radial distortion coefficients, p1 and p2 are tangential distortion coefficients, r is the distance from the pixel coordinate (x, y) to the origin of the pixel coordinate system, is the pixel coordinate of any point in the calibrated image, and (x, y) is the pixel coordinate of any point in the ideal image without distortion.
[0028] Specifically, S2 includes the following steps:
[0029] S21: Collect 3D models of blades of different sizes, and use the camera calibrated in S1 to shoot the 3D models to obtain point clouds;
[0030] S22: Building scenes for 3D models of blades of different sizes;
[0031] S23: Use the camera calibrated in S1 to shoot videos of different scenes, each video consists of i frames of 2D images;
[0032] S24: Using the Perspective-n-Point (PnP) method, the 6D posture of the 3D model relative to the camera in each frame of the video is calculated;
[0033] S25: Repeat S24, collect point clouds, several 2D images and 6D postures corresponding to each 2D image for each 3D model of blades of different sizes, and generate a data set by collecting the collected data.
[0034] Specifically, constructing the scene in S22 refers to marking n feature points P on the blade 3D model and placing a circle of ArUco recording boards around the 3D model.
[0035] Specifically, S23 corrects the 2D image afterwards, specifically by substituting the coordinates (U, V, W) of any point in the 2D image in the world coordinate system and the camera's intrinsic parameter matrix (1-1) and extrinsic parameter matrix (1-2) into formula (1-3), and calculating the coordinates (u, v) of any point in the 2D image in the pixel coordinate system;
[0036]
[0037] Then substitute the coordinates (u, v) of any point in the 2D image in the pixel coordinate system and the distortion coefficient into formulas (1-4)-(1-8), and after calculation, obtain the distortion-corrected 2D image.
[0038] Specifically, S24 includes the following steps:
[0039] S241: Obtain the posture of the 3D model relative to the camera in the first frame of the video
[0040] Extract the first frame of the video and manually mark the feature point p corresponding to the feature point P in the first frame;
[0041] Select a feature point P, and set the coordinates of the feature point P in the world coordinate system to be (x P ,y P , z P), the coordinates of the feature point p corresponding to P in the pixel coordinate system are (u p , v p ), and x P ,y P , z P 、u p and v p And the camera's intrinsic parameter matrix (1-1) is substituted into formula (2-1) to obtain an equation;
[0042]
[0043] In formula (2-1), Z is the scale factor, R is the rotation matrix of the 3D model relative to the camera in the first frame, and T is the translation matrix of the center point o of the 3D model relative to the center point c of the camera in the first frame;
[0044] Repeatedly select feature points P until 8 different feature points P are selected to obtain 8 equations. The simultaneous equations are used to calculate the rotation matrix R and translation matrix T. Substitute the rotation matrix R and translation matrix T into formula (2-2) to obtain the posture
[0045]
[0046] S242: Calculate and obtain the posture of the 3D model relative to the camera in the remaining frames of the video
[0047] Similar to S241, the Perspective-n-Point (PnP) method is used to calculate the posture of the ArUco recording board relative to the camera in the first frame.
[0048] The known posture and posture Substitute into formula (2-3) to obtain the posture M of the ArUco recording board relative to the 3D model do ;
[0049]
[0050] In a video, the M in the first frame of the video do Compared with M in the rest of the frames do Equal, that is, M do remains unchanged; then, in the remaining frames of the video, the pose of the ArUco board relative to the camera is recorded Substituting into formula (2-4), we can calculate that the posture of the 3D model relative to the camera is
[0051]
[0052] Known posture M co According to formula (2-2), we can know the translation matrix T and the rotation matrix R. From the translation matrix T, we can know x, y, z, and from the rotation matrix R, we can know (R x , R y , R z ), the 6D pose is (x, y, z, R x , R y , R z ).
[0053] Specifically, the Posecnn model includes a feature extraction network, a matching module, a loss calculation module, and a posture recovery module; S3 specifically includes the following steps:
[0054] S31: extracting the corresponding point cloud from the data set of S2, and the 2D image of the blade 3D model corresponding to the point cloud;
[0055] S32: input the point cloud and the 2D image into the Posecnn model, process the point cloud and the 2D image using the feature extraction network, and obtain a point cloud feature map and a 3D model feature map;
[0056] S33: using a matching module to calculate the similarity between the 3D model feature map and the point cloud feature map, i.e., a similarity matrix;
[0057] S34: Calculate the difference between the predicted value and the true value, that is, the loss value, using the loss function in the loss calculation module;
[0058] Use Focal_loss function as the loss function. The expression of Focal_loss function is as shown in formula (3-2);
[0059] FL(pt)=-a t (1-pt) γ log(pt) Formula (3-2)
[0060] In formula (3-2), pt represents the probability of the model predicting a certain category, that is, the confidence level; a is the weight factor used to balance the number of positive and negative samples, and the number of samples is inversely proportional to the value of a; γ is the adjustment factor used to adjust the uneven distribution of difficult and easy samples;
[0061] The similarity matrix in S33 is used as the prediction value
[0062] Flatten the 3D model feature map in S31 into a vector, obtain the feature matrix, and extract M from the data set in S2. co , where the feature matrix and M co For the same blade 3D model, multiply the feature matrix by M co, and then mapped back to the point cloud feature map, and then through image rendering, the matching relationship between the points on the point cloud feature map and the points on the 3D model feature map can be calculated, and the matching relationship is taken as the true value y, y∈{-1,1};
[0063] When y=1, When y≠1, The loss value FL(pt) is obtained;
[0064] S35: In the posture recovery module, the best k key points are selected from the similarity matrix in S33, and the posture RT is solved using the least squares method;
[0065] Specifically, the center of mass AA of the point cloud and the center of mass BB of the 3D model in the 2D image are calculated, and then the point sets of the point cloud and the 3D model are translated to normalize all the point sets into one coordinate system;
[0066] Calculate the covariance matrix H of the point cloud and 3D model, the formula is:
[0067] H=AA T *BB formula (3-3)
[0068] Perform SVD decomposition on the covariance matrix, and the decomposition formula is:
[0069] H = U, S, V T Formula (3-4)
[0070] Calculate the rotation matrix R, the formula is:
[0071] R=V * U T Formula (3-5)
[0072] Calculate the translation matrix T, the formula is:
[0073] T=BB T -R*AA T Formula (3-6)
[0074] Then the translation vector t = centerBB T -R*centerAA T ;
[0075] Knowing the rotation matrix R and translation matrix T, we can get the posture RT.
[0076] After multiplying the posture RT obtained in S34 by the point cloud, a new point cloud is generated, and the new point cloud is used as the point cloud in S32 to input the Posecnn model. S32-S35 are repeated to iteratively train the Posecnn model until the loss function converges, and the posture RT obtained in S34 is converted into a 6D posture (x, y, z, R x , Ry , R z ) output to complete the training of the Posecnn model.
[0077] Specifically, the feature extraction network includes a PointNet network, a self-attention module and a cross-attention module; S32 specifically includes the following steps:
[0078] S321: Select a point cloud in the data set, use the PointNet network to process the point cloud to obtain a first point cloud feature map, use the self-attention module to calculate the feature value of any point in the first point cloud feature map, extract features in the first point cloud feature map according to the feature value, and generate a second point cloud feature map;
[0079] S322: Selecting a 3D model of a blade corresponding to the point cloud in the data set, extracting features of the 3D model to generate a first 3D model feature map, calculating a feature value of any point in the first 3D model feature map using a self-attention module, extracting features in the first 3D model feature map based on the feature values, and generating a second 3D model feature map;
[0080] Take the self-attention module as an example to calculate the feature value of any point in the first point cloud feature map;
[0081] Specifically, a "qkv" key-value pair is constructed in the first point cloud feature map, and the point cloud information (x, y, z, n) of any point P0 in the first point cloud feature map is extracted. x , n y , n z , R, G, B) are extracted through a fully connected layer to obtain q, k, v feature points, and the eigenvalue F0 is calculated based on the q, k, v feature points. The calculation formula is:
[0082]
[0083] For any point P0 in the first point cloud feature map, the self-attention module outputs an eigenvalue F0 after calculation. The regions with similar features have closer corresponding eigenvalues. Similarly, after calculation by the self-attention module, any point in the first 3D model feature map also has a corresponding eigenvalue.
[0084] S323: using a cross-attention module to fuse the second point cloud feature map and the second 3D model feature map to generate a point cloud feature map and a 3D model feature map;
[0085] Specifically, a "qkv" key-value pair is constructed in the second point cloud feature map, and any point P1 in the second point cloud feature map is extracted, where the point P1 has corresponding feature points q1, k1, and v1, wherein the feature points q1, k1, and v1 have corresponding matrices q1, k1, and v1, respectively;
[0086] Similarly, a "qkv" key-value pair is constructed in the second 3D model feature map, and any point P2 in the second 3D model feature map is extracted. Point P2 has corresponding feature points q2, k2, v2; wherein the feature points q2, k2, v2 have corresponding matrices q2, k2, and v2, respectively;
[0087] Multiply the matrix q1 by the matrix k2, calculate the matching degree between the point P1 in the second point cloud feature map and the point P2 in the second 3D model feature map, multiply the matching degree by the matrix v1 to obtain the point cloud feature map, and multiply the matching degree by the matrix v2 to obtain the 3D model feature map.
[0088] Specifically, constructing the DQN grasping model in S4 includes the following steps:
[0089] S411: Determine the state function according to the posture parameters of the end of the gripper, the speed of the end of the gripper, the opening and closing state of the gripper and the posture parameters of the target object. The state function is: Where X r t , Y r t , Z r t Expressed as the Cartesian coordinates of the end of the gripper in the base coordinate system, q1t r ,qt 2r ,q3t r ,q t 4r is the rotation quaternion of the gripper end attitude;
[0090] S412: Determine the action function according to the speed of the end of the gripper, the rotation angle of the end of the gripper, and the opening and closing state of the gripper. The action function is (V r t ,θ,g), where V r t represents the speed of the end of the gripper, θ represents the rotation angle of the end of the gripper, and g represents the opening and closing state of the gripper;
[0091] S413: determining a reward function according to the gripping result of the gripper, the distance between the gripper and the target object, and the movement direction of the gripper, where the reward function is r;
[0092] S414: According to the state function, action function and reward function, a DQN grasping model is constructed using a multi-perspective based reinforcement learning grasping algorithm.
[0093] Specifically, training the DQN grasping model in S4 includes the following steps:
[0094] S421: Input the 6D posture and environmental data of the blade to be tested into Memory_replay, wherein the 6D posture of the blade to be tested is randomly extracted from the data set of S2, and the 6D posture of the blade to be tested can be converted to obtain the target parameters, that is, the posture parameters required when the end of the gripper finally grasps the blade;
[0095] The environmental data includes the action parameter a and the position parameter s of the end of the gripper at time t. The action parameter is the action that the gripper needs to complete, and the reward parameter r is obtained when the gripper completes the action.
[0096] Input the action parameter a, the position parameter s of the end of the gripper at time t, the position parameter s' of the end of the gripper at time t+1, and the reward parameter r into Memory_replay;
[0097] S422: Output the position parameters of the end of the gripper at time t by Memory_replay The reward parameter r at time t and all actions of the gripper at time t To Online_q_net, Online_q_net outputs the Q value (s, a, θ) corresponding to each action. During the prediction process, the last layer of the Online_q_net network structure outputs the maximum Q value, which is the execution parameter output to the end of the gripper;
[0098] S423: Memory_replay outputs the pose parameter s' of the end of the gripper at time t+1 to Target_q_net, and the maximum Q value max(Q)(s', a', θ - );
[0099] Set the reward function to obtain the target Target_Q value. The reward function here is formula (4-2);
[0100] Target_Q=Q+γ*max(Q) Formula (4-2)
[0101] In formula (4-2), γ represents the degree of exploration of the environment by the DQN grasping model;
[0102] S424: Calculate the relative loss between Online_q_net and Target_q_net using the loss function, where the loss function is formula (4-3);
[0103] Loss=smooth_l1(Online_q_net, Target_q_net) Formula (4-3)
[0104] S425: According to the loss function, the action parameter a corresponding to the maximum Q value output by Online_q_net is updated to Memory_replay as the next action parameter a;
[0105] S426: Repeat the above S421-S425 to iteratively train the DQN grasping model until the loss function converges, completing the training of the DQN grasping model.
[0106] The technical solution provided by the present invention has the following advantages compared with the prior art:
[0107] 1. The blade image is collected with a calibrated camera, and then the trained Posecnn model is used to process the image to improve the efficiency of blade 6D posture recognition and meet the accuracy requirements of blade 6D posture recognition. In combination with the DQN grasping model, efficient, accurate and robust grasping of blades can be achieved during the weighing and sorting of aircraft engine blades.
[0108] 2. Use the ArUco recording board to build the scene and record the scene in the form of video. It can not only quickly collect the 2D image of the blade, but also eliminate the need for manual labeling, saving labor costs, improving the efficiency of image acquisition and processing, and reducing the difficulty of image acquisition and processing.
[0109] 3. Integrate the self-attention module and the cross-attention module into the feature extraction network of the Posecnn model to further improve the efficiency and accuracy of image processing and achieve the purpose of accurate and fast leaf posture recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] Figure 1 is an overall flow chart of the method for grabbing an aero-engine blade in this embodiment;
[0111] Figure 2 is a flowchart of calibrating a camera in S1 of this embodiment;
[0112] Figure 3 is a flow chart of making a data set in S2 of this embodiment;
[0113] Figure 4 is the Posecnn model training flow chart in S3 of this embodiment;
[0114] Figure 5 is a flow chart of DQN grasping model training in S4 of this embodiment;
[0115] Figure 6is a confusion matrix diagram generated by the DQN grasping model training in S4 of this embodiment;
[0116] Figure 7 It is the verification set accuracy test graph in S4 of this embodiment;
[0117] Figure 8 This is a flow chart of blade grabbing in S5 of this embodiment. DETAILED DESCRIPTION
[0118] For ease of understanding, the aircraft engine blade grabbing method is described below in conjunction with embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0119] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation and positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0120] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" 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, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0121] like Figure 1 and Figure 2 As shown, the method for grabbing an aircraft engine blade in this embodiment includes the following steps:
[0122] S1: Calibrate the camera using the Zhang Zhengyou calibration method to obtain the camera's intrinsic parameters, extrinsic parameters, and distortion coefficients. S1 specifically includes the following steps:
[0123] S11: making a chessboard, and taking a photo of the made chessboard with a camera;
[0124] S12: Use Zhang Zhengyou calibration method to calibrate and obtain the camera's intrinsic parameter matrix and extrinsic parameter matrix;
[0125] Among them, the camera intrinsic parameter matrix:
[0126]
[0127] The intrinsic parameter matrix is the process of converting the coordinates in the camera coordinate system to the coordinates in the pixel coordinate system. In formula (1-1), f is the focal length of the camera, dx and dy represent the physical length of a pixel on the camera photosensitive plate in the X and Y directions, u0 and v0 represent the coordinates of the center of the camera photosensitive plate in the pixel coordinate system, and θ represents the angle between the horizontal and vertical sides of the camera photosensitive plate.
[0128] The camera's extrinsic matrix:
[0129]
[0130] The external parameter matrix is the process of converting the coordinates in the world coordinate system to the coordinates in the camera coordinate system, that is, converting the target point in the world coordinate system to the camera coordinate system through rotation and translation. In formula (1-2), R is the rotation matrix and T is the translation vector;
[0131] S13: Calculate the calibrated image through the intrinsic parameter matrix and the extrinsic parameter matrix;
[0132] Specifically, substitute the internal parameter matrix and the external parameter matrix into formula (1-3);
[0133]
[0134] In the formula, f is the focal length of the camera, (U, V, W) is the coordinate of any point D in the world coordinate system, (u, v) is the coordinate of point D in the pixel coordinate system, and Z is the scale factor;
[0135] S14: Calculate the camera distortion coefficient based on the image calibrated in S13;
[0136] Specifically, the pixel coordinates of any point in the calibrated image And the pixel coordinates (x, y) when there is no distortion in the ideal case are substituted into the radial distortion formula and the tangential distortion formula, and the distortion coefficient is obtained after calculation;
[0137] Radial distortion formula:
[0138]
[0139] Tangential distortion formula:
[0140]
[0141] r 2 =x 2 +y 2 Formula (1-8)
[0142] In formulas (1-4)-(1-8), k1, k2, k3 are radial distortion coefficients, p1 and p2 are tangential distortion coefficients, and r is the distance from the pixel coordinate (x, y) to the origin of the pixel coordinate system.
[0143] like Figure 1 and Figure 3 As shown, S2: Create a data set, wherein the data set includes 2D images, point clouds and 6D postures corresponding to leaves of various sizes; S2 specifically includes the following steps:
[0144] S21: Collect j 3D models of blades of different sizes, use the camera calibrated in S1 to shoot the 3D models to obtain depth images, and directly generate point clouds from the depth images;
[0145] S22: constructing a scene for j blade 3D models of different sizes. Constructing a scene means marking 8 feature points P on each blade 3D model and placing a circle of ArUco recording boards around the 3D model.
[0146] S23: Use the camera calibrated by S1 to shoot videos of j different scenes to obtain j videos, each of which consists of i frames of 2D images, where the 2D images are RGB images;
[0147] Correct the RGB image in S23 using the intrinsic parameters, extrinsic parameters and distortion coefficients of the camera in S1 to obtain j corrected videos;
[0148] Specifically, the coordinates (U, V, W) of any point in the RGB image in the world coordinate system and the camera's intrinsic parameter matrix (1-1) and extrinsic parameter matrix (1-2) are substituted into formula (1-3) to calculate the coordinates (u, v) of any point in the RGB image in the pixel coordinate system;
[0149] Then substitute the coordinates (u, v) of any point in the RGB image in the pixel coordinate system and the radial distortion coefficient obtained in S1 into formulas (1-4) and (1-5) to obtain the RGB image after radial distortion correction;
[0150] Finally, substitute the coordinates (u, v) of any point in the RGB image after radial distortion correction in S222 in the pixel coordinate system and the tangential distortion coefficient obtained in S1 into formulas (1-6)-(1-8) to obtain the RGB image after tangential distortion correction;
[0151] S24: Using the Perspective-n-Point (PnP) method, the 6D posture M of the 3D model relative to the camera in each frame of the video is calculated. co ; S24 specifically includes the following steps:
[0152] S241: Obtain the posture of the 3D model relative to the camera in the first frame of the video
[0153] Extract the first frame of the video and manually mark the feature point p corresponding to the feature point P in the first frame;
[0154] Select a feature point P, and set the coordinates of the feature point P in the world coordinate system to be (x P ,y P , z P ), the coordinates of the feature point p corresponding to P in the pixel coordinate system are (u p , v p ), and x P ,y P , z P 、u p and v p And the camera's intrinsic parameter matrix (1-1) is substituted into formula (2-1) to obtain an equation;
[0155]
[0156] In formula (2-1), Z is the scale factor, R is the rotation matrix of the 3D model relative to the camera in the first frame, and T is the translation matrix of the center point o of the 3D model relative to the center point c of the camera in the first frame;
[0157] Repeatedly select feature points P until 8 different feature points P are selected to obtain 8 equations. The simultaneous equations are used to calculate the rotation matrix R and translation matrix T. Substitute the rotation matrix R and translation matrix T into formula (2-2) to obtain the posture
[0158]
[0159] S242: Calculate and obtain the posture of the 3D model relative to the camera in the remaining frames of the video
[0160] Similar to S241, the Perspective-n-Point (PnP) method is used to calculate the posture of the ArUco recording board relative to the camera in the first frame.
[0161] The known posture and posture Substitute into formula (2-3) to obtain the posture M of the ArUco recording board relative to the 3D model do ;
[0162]
[0163] In a video, the M in the first frame of the videodo Compared with M in the rest of the frames do Equal, that is, M do remains unchanged; then, in the remaining frames of the video, the pose of the ArUco board relative to the camera is recorded Substituting into formula (2-4), we can calculate that the posture of the 3D model relative to the camera is
[0164]
[0165] Each frame of 2D image and the 6D posture M corresponding to the frame of 2D image co Recorded as a column of data, a video has n columns of data, and the n columns of data are combined into a list;
[0166] Among them, the 6D posture is (x, y, z, R x , R y , R z ), in the Cartesian coordinate system established with the camera center point c as the coordinate origin, x represents the value of the 3D model center point on the x-axis of the Cartesian coordinate system, y represents the value of the 3D model center point on the y-axis of the Cartesian coordinate system, and z represents the value of the 3D model center point on the z-axis of the Cartesian coordinate system; R x Indicates the rotation angle of the 3D model around the x-axis, R y Indicates the rotation angle of the 3D model around the y-axis, R z Indicates the rotation angle of the 3D model around the z-axis.
[0167] Known posture M co According to formula (2-2), we can know the translation matrix T and the rotation matrix R. From the translation matrix T, we can know x, y, z, and from the rotation matrix R, we can know (R x , R y , R z ).
[0168] S25: Repeat S24, obtain j lists corresponding to j videos, collect the blade 3D model data of one size and the list and point cloud corresponding to the 3D model into a sub-dataset, j blade 3D models of different sizes correspond to j sub-datasets, and the j sub-datasets are collected to generate a data set.
[0169] like Figure 1 and Figure 4 As shown, S3: train the Posecnn model using the data set in S2; the Posecnn model includes a feature extraction network, a matching module, a loss calculation module and a pose recovery module; S3 specifically includes the following steps:
[0170] S31: extracting the corresponding point cloud from the data set of S2, and the 2D image of the blade 3D model corresponding to the point cloud;
[0171] S32: Input the point cloud and 2D image into the Posecnn model, use the feature extraction network to process the point cloud and 2D image, and obtain the point cloud feature map and the 3D model feature map; wherein the feature extraction network includes the PointNet network, the self-attention module and the cross-attention module; the PointNet network is composed of 2 MLPs and 1 maximum pooling layer; S32 specifically includes the following steps:
[0172] S321: Select a point cloud in the data set, use the PointNet network to process the point cloud to obtain a first point cloud feature map, use the self-attention module to calculate the feature value of any point in the first point cloud feature map, extract features in the first point cloud feature map according to the feature value, and generate a second point cloud feature map;
[0173] S322: Selecting a 3D model of a blade corresponding to the point cloud in the data set, extracting features of the 3D model to generate a first 3D model feature map, calculating a feature value of any point in the first 3D model feature map using a self-attention module, extracting features in the first 3D model feature map based on the feature values, and generating a second 3D model feature map;
[0174] Take the self-attention module as an example to calculate the feature value of any point in the first point cloud feature map;
[0175] Specifically, a "qkv" key-value pair is constructed in the first point cloud feature map, and the point cloud information (x, y, z, n) of any point P0 in the first point cloud feature map is extracted. x , n y , n z , R, G, B) are extracted through a fully connected layer to obtain q, k, v feature points, and the eigenvalue F0 is calculated based on the q, k, v feature points. The calculation formula is:
[0176]
[0177] For any point P0 in the first point cloud feature map, the self-attention module outputs an eigenvalue F0 after calculation. The regions with similar features have closer corresponding eigenvalues. Similarly, after calculation by the self-attention module, any point in the first 3D model feature map also has a corresponding eigenvalue.
[0178] S323: using a cross-attention module to fuse the second point cloud feature map and the second 3D model feature map to generate a point cloud feature map and a 3D model feature map;
[0179] Specifically, a "qkv" key-value pair is constructed in the second point cloud feature map, and any point P1 in the second point cloud feature map is extracted, where the point P1 has corresponding feature points q1, k1, and v1, wherein the feature points q1, k1, and v1 have corresponding matrices q1, k1, and v1, respectively;
[0180] Similarly, a "qkv" key-value pair is constructed in the second 3D model feature map, and any point P2 in the second 3D model feature map is extracted. Point P2 has corresponding feature points q2, k2, v2; wherein the feature points q2, k2, v2 have corresponding matrices q2, k2, and v2, respectively;
[0181] Multiply the matrix q1 by the matrix k2, calculate the matching degree between the point P1 in the second point cloud feature map and the point P2 in the second 3D model feature map, multiply the matching degree by the matrix v1 to obtain the point cloud feature map, and multiply the matching degree by the matrix v2 to obtain the 3D model feature map.
[0182] S33: using a matching module to calculate the similarity between the 3D model feature map and the point cloud feature map, i.e., a similarity matrix; wherein, the higher the similarity, the higher the possibility of coincidence between the points in the 3D model feature map and the points in the point cloud feature map;
[0183] Specifically, the calculation is to flatten the 3D model feature map in S31 to obtain a feature matrix, and also to flatten the point cloud feature map in S31 to obtain another feature matrix, and then multiply the two feature matrices to obtain a similarity matrix.
[0184] S34: Calculate the difference between the predicted value and the true value, that is, the loss value, using the loss function in the loss calculation module;
[0185] Use Focal_loss function as the loss function. The expression of Focal_loss function is as shown in formula (3-2);
[0186] FL(pt)=-a t (1-pt) γ log(pt) Formula (3-2)
[0187] In formula (3-2), pt represents the probability of the model predicting a certain category, that is, the confidence level; a is the weight factor used to balance the number of positive and negative samples, and the number of samples is inversely proportional to the value of a; γ is the adjustment factor used to adjust the uneven distribution of difficult and easy samples;
[0188] The similarity matrix in S33 is used as the prediction value
[0189] Flatten the 3D model feature map in S31 into a vector, obtain the feature matrix, and extract M from the data set in S2. co, where the feature matrix and M co For the same blade 3D model, multiply the feature matrix by M co , and then mapped back to the point cloud feature map, and then through image rendering, the matching relationship between the points on the point cloud feature map and the points on the 3D model feature map can be calculated, and the matching relationship is taken as the true value y, y∈{-1,1};
[0190] When y=1, When y≠1, The loss value FL(pt) is obtained;
[0191] S35: In the posture recovery module, the best k key points are selected from the similarity matrix in S33, and the posture RT is solved using the least squares method;
[0192] Specifically, the center of mass AA of the point cloud and the center of mass BB of the 3D model in the 2D image are calculated, and then the point sets of the point cloud and the 3D model are translated to normalize all the point sets into one coordinate system;
[0193] Calculate the covariance matrix H of the point cloud and 3D model, the formula is:
[0194] H=AA T *BB formula (3-3)
[0195] Perform SVD decomposition on the covariance matrix, and the decomposition formula is:
[0196] H = U, S, V T Formula (3-4)
[0197] Calculate the rotation matrix R, the formula is:
[0198] R=V * U T Formula (3-5)
[0199] If the determinant of the rotation matrix R is less than 0, a reflection condition is processed to ensure that the rotation matrix in S35 of this embodiment is a rotation matrix rather than a reflection matrix;
[0200] Calculate the translation matrix T, the formula is:
[0201] T=BB T -R*AA T Formula (3-6)
[0202] Then the translation vector t = centerBB T -R*centerAA T ;
[0203] Knowing the rotation matrix R and translation matrix T, we can get the posture RT.
[0204] After multiplying the posture RT obtained in S34 by the point cloud, a new point cloud is generated, and the new point cloud is used as the point cloud in S32 to input the Posecnn model, and S32-S35 are repeated to iteratively train the Posecnn model; until the loss value decreases step by step and the loss function converges, the posture RT obtained in S34 is converted into a 6D posture (x, y, z, R x , R y , R z ) output to complete the training of the Posecnn model.
[0205] like Figure 1 and Figure 5 As shown, S4: construct a DQN grasping model and train the DQN grasping model;
[0206] S41: Build a DQN grasping model;
[0207] S411: Determine the state function according to the posture parameters of the end of the gripper, the speed of the end of the gripper, the opening and closing state of the gripper and the posture parameters of the target object. The state function is (X r , Y r , Z r ,q 1r ,q 2r ,q 3r ,q 4r ), where X r , Y r , Z r Expressed as the Cartesian coordinates of the end of the gripper in the base coordinate system, q 1r ,q 2r ,q 3r ,q 4r is the rotation quaternion of the gripper end attitude;
[0208] S412: Determine the action function according to the speed of the end of the gripper, the rotation angle of the end of the gripper, and the opening and closing state of the gripper. The action function is (V r ,θ,g), where V r represents the speed of the end of the gripper, θ represents the rotation angle of the end of the gripper, and g represents the opening and closing state of the gripper;
[0209] S413: Determine a reward function according to the grasping result of the gripper, the distance between the gripper and the target object, and the movement direction of the gripper. The reward function is r=R1+αR2+βR3, where R1 is a binary reward function, R1={0,1}, 0 indicates that the leaf grasping fails, 1 indicates that the leaf grasping succeeds, R2 indicates the opposite of the distance d between the gripper and the leaf to be grasped, and α and β are the weights of the corresponding reward items;
[0210]
[0211] Among them, R3 represents the reward of the gripper moving on the line from the camera to the leaf to be grasped, and dist represents the distance from the camera to the leaf to be grasped on this line;
[0212] S414: Based on the state function, action function and reward function, a DQN grasping model is constructed using a multi-perspective reinforcement learning grasping algorithm;
[0213] The DQN capture model includes Memory_replay, Online_q_net and Target_q_net.
[0214] S42: training the DQN grasping model, that is, using the Adam optimizer to optimize the model and perform back propagation to obtain the trained DQN grasping model after the network converges;
[0215] S421: Input the 6D posture and environmental data of the blade to be tested into Memory_replay, wherein the 6D posture of the blade to be tested is randomly extracted from the data set of S2, and the 6D posture of the blade to be tested can be converted to obtain the target parameters, that is, the posture parameters required when the end of the gripper finally grasps the blade;
[0216] The environmental data includes the action parameter a and the position parameter s of the end of the gripper at time t. The action parameter is the action that the gripper needs to complete, and the reward parameter r is obtained when the gripper completes the action.
[0217] Input the action parameter a, the position parameter s of the end of the gripper at time t, the position parameter s' of the end of the gripper at time t+1, and the reward parameter r into Memory_replay;
[0218] S422: Output the position parameters of the end of the gripper at time t by Memory_replay The reward parameter r at time t and all actions of the gripper at time t To Online_q_net, Online_q_net outputs the Q value (s, a, θ) corresponding to each action. During the prediction process, the last layer of the Online_q_net network structure outputs the maximum Q value, which is the execution parameter output to the end of the gripper;
[0219] S423: Memory_replay outputs the pose parameter s' of the end of the gripper at time t+1 to Target_q_net, and the maximum Q value max(Q)(s', a', θ - );
[0220] Set the reward function to obtain the target Target_Q value. The reward function here is formula (4-2);
[0221] Target_Q=Q+γ*max(Q) Formula (4-2)
[0222] In formula (4-2), γ represents the degree of exploration of the environment by the DQN grasping model;
[0223] S424: Calculate the relative loss between Online_q_net and Target_q_net using the loss function, where the loss function is formula (4-3);
[0224] Loss=smooth_l1(Online_q_net, Target_q_net) Formula (4-3)
[0225] S425: According to the loss function, the action parameter a corresponding to the maximum Q value output by Online_q_net is updated to Memory_replay as the next action parameter a;
[0226] S426: Repeat the above S421-S425 to iteratively train the DQN grasping model until the loss function converges, completing the training of the DQN grasping model.
[0227] like Figure 6 As shown, during the DQN grasping model training process, each training result is recorded to obtain the following Figure 6 The confusion matrix shown in the figure is an N×N matrix, where N represents the number of classification labels. Assuming that the number of leaves is 10, the confusion matrix is a 10×10 matrix. The darker the color of the matrix diagonal elements, the better the self-attention training effect and the more accurate the classification of the data.
[0228] After 100 rounds of training, the loss of the DQN model converged and the loss value decreased, indicating that the training effect was good.
[0229] like Figure 7 As shown, part of the leaf data in the data set S2 is set as a validation set, and the validation set is extracted for testing. The accuracy of the validation set reaches 0.992. The method in this implementation achieves accurate grasping in actual leaf grasping.
[0230] like Figure 1 and Figure 8As shown, S5: use the calibrated camera to collect the 2D image and point cloud of the blade to be grasped, input the 2D image and point cloud of the blade to be grasped into the Posecnn model trained in S3, obtain the 6D posture of the blade to be measured, input the 6D posture of the blade to be measured and the environmental data into the DQN grasping model, the DQN grasping model calculates and outputs the execution parameters, and the gripper end of the robot arm grasps the blade according to the execution parameters.
[0231] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents, and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for grabbing an aero-engine blade, characterized in that: The steps include: S1: Calibrate the camera to obtain the camera's intrinsic parameters, extrinsic parameters and distortion coefficients; S2: Create a data set, which includes 2D images, point clouds and 6D postures corresponding to leaves of various sizes; S3: Use the dataset in S2 to train the Posecnn model; S4: Build a DQN grasping model and train the DQN grasping model; S5: Use the calibrated camera to collect the 2D image and point cloud of the blade to be grasped, input the 2D image and point cloud of the blade to be grasped into the Posecnn model in S3, obtain the 6D posture of the blade to be measured, input the 6D posture of the blade to be measured and the environmental data into the DQN grasping model, and the DQN grasping model calculates and outputs the execution parameters. The end of the gripper of the robot arm grasps the blade according to the execution parameters.
2. The method for grabbing an aeroengine blade according to claim 1, characterized in that: In S1, the camera is calibrated using the Zhang Zhengyou calibration method to obtain the camera's internal parameters, external parameters, and distortion coefficients; Among them, the camera intrinsic parameter matrix: In formula (1-1), f is the focal length of the camera, dx and dy represent the physical length of a pixel on the camera photosensitive plate in the X and Y directions respectively, u0 and v0 represent the coordinates of the center of the camera photosensitive plate in the pixel coordinate system respectively, and θ represents the angle between the horizontal and vertical sides of the camera photosensitive plate; The camera's extrinsic matrix: In formula (1-2), R is the rotation matrix and T is the translation vector; The distortion coefficient includes radial distortion coefficient and tangential distortion coefficient: Radial distortion formula: Tangential distortion formula: r 2 = x 2 +y 2 Formula(1-8) In formulas (1-4)-(1-8), k1, k2, k3 are radial distortion coefficients, p1 and p2 are tangential distortion coefficients, r is the distance from the pixel coordinate (x, y) to the origin of the pixel coordinate system, is the pixel coordinate of any point in the calibrated image, and (x, y) is the pixel coordinate of any point in the ideal image without distortion.
3. The method for grabbing an aeroengine blade according to claim 2, characterized in that: S2 specifically includes the following steps: S21: Collect 3D models of blades of different sizes, and use the camera calibrated in S1 to shoot the 3D models to obtain point clouds; S22: Building scenes for 3D models of blades of different sizes; S23: Use the camera calibrated in S1 to shoot videos of different scenes, each video consists of i frames of 2D images; S24: Using the Perspective-n-Point (PnP) method, the 6D posture of the 3D model relative to the camera in each frame of the video is calculated; S25: Repeat S24, collect point clouds, several 2D images and 6D postures corresponding to each 2D image for each 3D model of blades of different sizes, and generate a data set by collecting the collected data.
4. The method for grabbing an aeroengine blade according to claim 3, characterized in that: Building the scene in S22 refers to marking n feature points P on the blade 3D model and placing a circle of ArUco recording boards around the 3D model.
5. The method for grabbing an aeroengine blade according to claim 3, characterized in that: S23 corrects the 2D image afterwards, specifically, the coordinates (U, V, W) of any point in the 2D image in the world coordinate system and the camera's intrinsic parameter matrix (1-1) and extrinsic parameter matrix (1-2) are substituted into formula (1-3), and the coordinates (u, v) of any point in the 2D image in the pixel coordinate system are calculated; Then substitute the coordinates (u, v) of any point in the 2D image in the pixel coordinate system and the distortion coefficient into formulas (1-4)-(1-8), and after calculation, obtain the distortion-corrected 2D image.
6. The method for grabbing an aeroengine blade according to claim 3, characterized in that: S24 specifically includes the following steps: S241: Obtain the posture of the 3D model relative to the camera in the first frame of the video Extract the first frame of the video and manually mark the feature point p corresponding to the feature point P in the first frame; Select a feature point P, and set the coordinates of the feature point P in the world coordinate system to be (x P ,y P , z P ), the coordinates of the feature point p corresponding to P in the pixel coordinate system are (u p , v p ), and x P ,y P , z P 、u p and v p And the camera's intrinsic parameter matrix (1-1) is substituted into formula (2-1) to obtain an equation; In formula (2-1), Z is the scale factor, R is the rotation matrix of the 3D model relative to the camera in the first frame, and T is the translation matrix of the center point o of the 3D model relative to the center point c of the camera in the first frame; Repeatedly select feature points P until 8 different feature points P are selected to obtain 8 equations. The simultaneous equations are used to calculate the rotation matrix R and translation matrix T. Substitute the rotation matrix R and translation matrix T into formula (2-2) to obtain the posture S242: Calculate and obtain the posture of the 3D model relative to the camera in the remaining frames of the video Similar to S241, the Perspective-n-Point (PnP) method is used to calculate the posture of the ArUco recording board relative to the camera in the first frame. The known posture and posture Substitute into formula (2-3) to obtain the posture M of the ArUco recording board relative to the 3D model do ; In a video, the M in the first frame of the video do Compared with M in the rest of the frames do Equal, that is, M do remains unchanged; then, in the remaining frames of the video, the pose of the ArUco board relative to the camera is recorded Substituting into formula (2-4), we can calculate that the posture of the 3D model relative to the camera is Known posture M co According to formula (2-2), we can know the translation matrix T and the rotation matrix R. From the translation matrix T, we can know x, y, z, and from the rotation matrix R, we can know (Rx, Ry, Rz). The 6D posture is (x, y, z, R x , R y , R z ).
7. The method for grabbing an aircraft engine blade according to claim 3, characterized in that: The Posecnn model includes a feature extraction network, a matching module, a loss calculation module, and a pose recovery module; S3 specifically includes the following steps: S31: extracting the corresponding point cloud from the data set of S2, and the 2D image of the blade 3D model corresponding to the point cloud; S32: input the point cloud and the 2D image into the Posecnn model, process the point cloud and the 2D image using the feature extraction network, and obtain a point cloud feature map and a 3D model feature map; S33: using a matching module to calculate the similarity between the 3D model feature map and the point cloud feature map, i.e., a similarity matrix; S34: Calculate the difference between the predicted value and the true value, that is, the loss value, using the loss function in the loss calculation module; Use Focal_loss function as the loss function. The expression of Focal_loss function is as shown in formula (3-2); FL(pt)=-a t (1-pt) γ log(pt) Formula (3-2) In formula (3-2), pt represents the probability of the model predicting a certain category, that is, the confidence level; a is the weight factor used to balance the number of positive and negative samples, and the number of samples is inversely proportional to the value of a; γ is the adjustment factor used to adjust the uneven distribution of difficult and easy samples; The similarity matrix in S33 is used as the prediction value Flatten the 3D model feature map in S31 into a vector, obtain the feature matrix, and extract M from the data set in S2 co , where the feature matrix and M co For the same blade 3D model, multiply the feature matrix by M co , and then mapped back to the point cloud feature map, and then through image rendering, the matching relationship between the points on the point cloud feature map and the points on the 3D model feature map can be calculated, and the matching relationship is taken as the true value y, y∈{-1,1}; When y=1, When y≠1, The loss value FL(pt) is obtained; S35: In the posture recovery module, the best k key points are selected from the similarity matrix in S33, and the posture RT is solved using the least squares method; Specifically, the center of mass AA of the point cloud and the center of mass BB of the 3D model in the 2D image are calculated, and then the point sets of the point cloud and the 3D model are translated to normalize all the point sets into one coordinate system; Calculate the covariance matrix H of the point cloud and 3D model, the formula is: H = AA T *BB Official (3-3) Perform SVD decomposition on the covariance matrix, and the decomposition formula is: H = U, S, V T Formula (3-4) Calculate the rotation matrix R, the formula is: R=V * U T Formula (3-5) Calculate the translation matrix T, the formula is: T=BB T - R*AA T Formula(3-6) Then the translation vector t = centerBB T -R*centerAA T ; Knowing the rotation matrix R and translation matrix T, we can get the posture RT. After multiplying the posture RT obtained in S34 by the point cloud, a new point cloud is generated, and the new point cloud is used as the point cloud in S32 to input the Posecnn model. S32-S35 are repeated to iteratively train the Posecnn model until the loss function converges, and the posture RT obtained in S34 is converted into a 6D posture (x, y, z, R x , R y , R z ) output to complete the training of the Posecnn model.
8. The method for grabbing an aircraft engine blade according to claim 7, characterized in that: The feature extraction network includes a PointNet network, a self-attention module, and a cross-attention module; S32 specifically includes the following steps: S321: Select a point cloud in the data set, use the PointNet network to process the point cloud to obtain a first point cloud feature map, use the self-attention module to calculate the feature value of any point in the first point cloud feature map, extract features in the first point cloud feature map according to the feature value, and generate a second point cloud feature map; S322: Selecting a 3D model of a blade corresponding to the point cloud in the data set, extracting features of the 3D model to generate a first 3D model feature map, calculating a feature value of any point in the first 3D model feature map using a self-attention module, extracting features in the first 3D model feature map based on the feature values, and generating a second 3D model feature map; Take the self-attention module as an example to calculate the feature value of any point in the first point cloud feature map; Specifically, a "qkv" key-value pair is constructed in the first point cloud feature map, and the point cloud information (x, y, z, n) of any point P0 in the first point cloud feature map is extracted. x , n y , n z , R, G, B) are extracted through a fully connected layer to obtain q, k, v feature points, and the eigenvalue F0 is calculated based on the q, k, v feature points. The calculation formula is: For any point P0 in the first point cloud feature map, the self-attention module outputs an eigenvalue F0 after calculation. The regions with similar features have closer corresponding eigenvalues. Similarly, after calculation by the self-attention module, any point in the first 3D model feature map also has a corresponding eigenvalue. S323: using a cross-attention module to fuse the second point cloud feature map and the second 3D model feature map to generate a point cloud feature map and a 3D model feature map; Specifically, a "qkv" key-value pair is constructed in the second point cloud feature map, and any point P1 in the second point cloud feature map is extracted. Point P1 has corresponding feature points q1, k1 and v1, wherein the feature points q1, k1 and v1 have corresponding matrices q1, k1 and v1, respectively; Similarly, a "qkv" key-value pair is constructed in the second 3D model feature map, and any point P2 in the second 3D model feature map is extracted. Point P2 has corresponding feature points q2, k2, and v2; wherein the feature points q2, k2, and v2 have corresponding matrices q2, k2, and v2, respectively; Multiply the matrix q1 by the matrix k2, calculate the matching degree between the point P1 in the second point cloud feature map and the point P2 in the second 3D model feature map, multiply the matching degree by the matrix v1 to obtain the point cloud feature map, and multiply the matching degree by the matrix v2 to obtain the 3D model feature map.
9. The method for grasping an aircraft engine blade according to claim 7, characterized in that: Building the DQN grasping model in S4 includes the following steps: S411: Determine the state function according to the posture parameters of the end of the gripper, the speed of the end of the gripper, the opening and closing state of the gripper and the posture parameters of the target object. The state function is: in Expressed as the Cartesian coordinates of the end of the gripper in the base coordinate system, is the rotation quaternion of the gripper end attitude; S412: Determine the action function according to the speed of the end of the gripper, the rotation angle of the end of the gripper, and the opening and closing state of the gripper. The action function is: in represents the speed of the end of the gripper, θ represents the rotation angle of the end of the gripper, and g represents the opening and closing state of the gripper; S413: determining a reward function according to the gripping result of the gripper, the distance between the gripper and the target object, and the movement direction of the gripper, where the reward function is r; S414: According to the state function, action function and reward function, a DQN grasping model is constructed using a multi-perspective based reinforcement learning grasping algorithm.
10. The method for grasping an aircraft engine blade according to claim 9, characterized in that: Training the DQN grasping model in S4 includes the following steps: S421: Input the 6D posture and environmental data of the blade to be tested into Memory_replay, wherein the 6D posture of the blade to be tested is randomly extracted from the data set of S2, and the 6D posture of the blade to be tested can be converted to obtain the target parameters, that is, the posture parameters required when the end of the gripper finally grasps the blade; The environmental data includes the action parameter a and the position parameter s of the end of the gripper at time t. The action parameter is the action that the gripper needs to complete, and the reward parameter r is obtained when the gripper completes the action. Input the action parameter a, the position parameter s of the end of the gripper at time t, the position parameter s' of the end of the gripper at time t+1, and the reward parameter r into Memory_replay; S422: Output the position parameters of the end of the gripper at time t by Memory_replay The reward parameter r at time t and all actions of the gripper at time t To Online_q_net, Online_q_net outputs the Q value (s, a, θ) corresponding to each action. During the prediction process, the last layer of the Online_q_net network structure outputs the maximum Q value, which is the execution parameter output to the end of the gripper; S423: Memory_replay outputs the pose parameter s' of the end of the gripper at time t+1 to Target_q_net, and the maximum Q value max(Q)(s', a', θ - ); Set the reward function to obtain the target Target_Q value. The reward function here is formula (4-2); Target_Q=Q+γ*max(Q) Formula (4-2) In formula (4-2), γ represents the degree of exploration of the environment by the DQN grasping model; S424: Calculate the relative loss between Online_q_net and Target_q_net using the loss function, where the loss function is formula (4-3); Loss=smooth_l1(Online_q_net, Target_q_net) Formula (4-3) S425: According to the loss function, the action parameter a corresponding to the maximum Q value output by Online_q_net is updated to Memory_replay as the next action parameter a; S426: Repeat the above S421-S425 to iteratively train the DQN grasping model until the loss function converges, completing the training of the DQN grasping model.