Intelligent robot control method for recycling garbage
By combining voice processing, computer vision and path planning technology with voice-controlled robots, the problem of waste recycling efficiency and accuracy in construction factories is solved, efficient waste management and recycling is achieved, and labor costs are reduced.
Patent Information
- Application Number
- CN202410670640.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology makes it difficult to efficiently and intelligently manage and recycle waste generated in construction factories, leading to environmental and public health problems.
Using voice-controlled robots combined with voice processing, computer vision and robot path planning technology, through voice command processing, camera calibration, hand-eye calibration, garbage target recognition and path planning, the robot can accurately capture and recycle construction factory waste.
It improves the efficiency and accuracy of garbage recycling, reduces labor costs, reduces workers' labor intensity, and realizes intelligent management of construction site garbage.
Smart Images

Figure CN118528258A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of artificial intelligence, and in particular relates to a control method of an intelligent robot for recycling garbage. Background Art
[0002] With the intelligent development of construction factories and the continuous expansion of construction scale, more and more garbage is generated in construction factories. These garbage include waste materials, packaging materials, waste equipment, etc. generated during the construction process, which have a certain impact on the environment and public health. In order to effectively manage and deal with these garbage, an efficient and intelligent method is needed to capture and recycle garbage.
[0003] As an emerging intelligent technology, voice control technology has been widely used in the control of intelligent robots. Workers can directly use voice commands to control robots to go to designated locations, grab and recycle various types of garbage generated at construction sites. This can not only improve the overall management efficiency of the construction site, but also reduce labor costs and reduce the labor intensity of workers. Therefore, voice-controlled robots have broad application prospects in garbage grabbing and recycling in construction factories.
[0004] To realize voice-controlled robots to grab and recycle garbage generated in construction factories, it is necessary to combine multiple technologies, such as voice processing, computer vision, and robot path planning. Voice processing mainly converts workers' voice commands into executable operation commands to realize remote control of robots. The implementation of technology in the field of computer vision requires robots to be equipped with visual perception systems. Through corresponding recognition algorithms, they can identify various types of garbage in construction factories in real time, including waste, packaging materials, and waste equipment, so as to accurately grab and recycle them. The robots need to be equipped with corresponding grabbing devices and handling equipment, and set up reasonable driving routes through path planning so that they can effectively grab and carry various types of garbage, ensuring the efficiency and accuracy of garbage recycling. For this reason, we propose an intelligent robot control method for recycling garbage, which brings new solutions and opportunities for garbage management in construction factories. Summary of the invention
[0005] The purpose of the present invention is to provide a control method for an intelligent robot for recycling garbage, so as to solve the problems existing in the background technology.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is as follows:
[0007] A method for controlling an intelligent robot for recycling garbage comprises the following steps:
[0008] Step S1: Processing user voice commands, converting the voice commands into text commands, and then preprocessing the text commands;
[0009] Step S2: Introduce four coordinate systems: world coordinate system, camera coordinate system, image coordinate system and pixel coordinate system, perform camera calibration, and establish a geometric model of camera imaging;
[0010] Step S3: hand-eye calibration step, adopting the eye-on-hand system architecture, the camera (eye) is arranged at the end of the robotic arm (hand), and the coordinate relationship between the hand (end of the robotic arm) and the eye (camera) is established to perform hand-eye calibration;
[0011] Step S4: garbage target recognition, transmitting the preprocessed text command signal to the robot, and the robot performs garbage target recognition and coordinate acquisition tasks based on YOLOv5 and D435i camera according to the received text command. YOLOv5 obtains the pixel coordinate position information of the object in the image, and the D435i camera obtains the coordinate position information of the object in the camera coordinate system. Through the coordinate acquisition and conversion of the two, the spatial position information of the garbage target is obtained;
[0012] Step S5: According to the spatial position information of the garbage target, the robot's running path and grasping trajectory are planned to grasp and recycle the garbage target.
[0013] The camera calibration in step S2 specifically includes the following sub-steps:
[0014] Step S2.1: using camera imaging to obtain an environmental image of the target, and identifying and calculating the pixel coordinate position of the target in the image from the image;
[0015] Step S2.2: According to the pixel coordinate system position of the target, a geometric model of camera imaging is established, and a distortion model is introduced to correct lens distortion. After the geometric model of camera imaging is established, unknown parameters in the geometric model of camera imaging are determined through training.
[0016] In step S2.2, Zhang's calibration method is used for training and calibration to determine unknown parameters in the geometric model of camera imaging.
[0017] The step S3 specifically includes the following sub-steps:
[0018] Step S3.1: Introduce two coordinate systems: a base coordinate system and a robot end coordinate system, wherein the base coordinate system is a coordinate system established with the base of the robot as the origin, and the robot end coordinate system is a coordinate system established with the end of the robot as the origin;
[0019] Step S3.2: The robot controller is used to control the robot to change its posture multiple times, and the matrix X is obtained to determine the transformation relationship between the end of the robot arm and the camera.
[0020] In step S3.2, Zhang's calibration method is used for calibration to determine the transformation relationship between the end of the robotic arm and the camera.
[0021] The step S4 comprises the following sub-steps:
[0022] Step S4.1: Generate a point cloud, obtain a depth image through the D435i camera, and generate point cloud data by the depth sensor inside the D435i camera;
[0023] Step S4.2: object detection, using the YOLOv5 object detection algorithm to identify, analyze and process the images captured by the D435i camera, and define a corresponding bounding box for each identified object;
[0024] Step S4.3: Object positioning, we map the bounding box position of the object in the image to the corresponding point cloud data to obtain the approximate position of the object in the camera coordinate system;
[0025] Step S4.4: After obtaining the approximate position of the object in the camera coordinate system, based on the triangulation mechanism of the D435i camera, multiple points in the point cloud and their pixel positions in the color image are used, combined with the camera's internal parameters (such as focal length, optical center position) and external parameters (such as the camera's position relative to the robot, etc.), to calculate the three-dimensional position coordinates of the object in the camera coordinate system;
[0026] Step S4.5: Convert the coordinates of the object in the camera coordinate system into the coordinates in the robot's workspace coordinate system. The workspace coordinate system includes the robot base coordinate system, world coordinate system, and robot arm end coordinate system in the previous steps to obtain the spatial position information of the object.
[0027] The step S5 comprises the following sub-steps:
[0028] Step S5.1: data conversion;
[0029] Step S5.2: planning the robot's running path;
[0030] Step S5.3: Plan the robot's running trajectory for grabbing garbage targets.
[0031] In step S5.2, the RRT*-Smart algorithm is used to plan the robot's operation path.
[0032] The present invention combines technical algorithms such as voice processing, computer vision, robot path planning, and operation trajectory planning of a grabbing robot arm. First, voice processing is used to convert the worker's voice instructions into executable operation commands to achieve remote control of the robot. Computer vision is then used to realize that the robot needs to be equipped with a visual perception system to identify various types of garbage in the construction factory through corresponding recognition algorithms. Then, robot path planning is used to enable the robot to effectively and quickly reach the target garbage location. Finally, the operation trajectory planning of the grabbing robot arm is used to enable the robot's robot arm to operate to grab the garbage target, thereby realizing intelligent management of construction site garbage. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention is further illustrated by means of the non-limiting examples given in the accompanying drawings.
[0034] Figure 1 It is a schematic diagram of the main process of the present invention;
[0035] Figure 2 A schematic diagram of establishing a camera imaging geometric model for the present invention;
[0036] Figure 3 This is a schematic diagram of the process of the present invention using Zhang's calibration method to calibrate a camera;
[0037] Figure 4 This is a schematic diagram of the process of the present invention using Zhang's calibration method to perform hand-eye calibration;
[0038] Figure 5 This is an example diagram of planning the robot's running path in step S5.2 of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0040] Embodiment 1, a control method of an intelligent robot for recycling garbage of the present invention comprises the following steps:
[0041] Step S1: Processing user voice commands, converting voice commands into text commands, and then preprocessing the text commands, including the following sub-steps:
[0042] Step S1.1: The speech recognition technology of iFLYTEK is introduced to convert speech to text. In this task, the speech file is uploaded through APIKey, and the corresponding interface is called for recognition. Finally, the converted text is obtained according to the returned result.
[0043] Step S1.2: Text segmentation, which splits the Chinese text into words, is one of the basic steps in Chinese text processing. In this task, jieba segmentation is selected to segment the text after speech conversion. Jieba segmentation is a Chinese word segmentation tool based on dictionaries and rules, mainly using the forward maximum matching algorithm and the bidirectional maximum matching algorithm;
[0044] Step S1.3: Removing stop words. Stop words refer to words that frequently appear in the text but do not carry much information, such as "de", "shi", "zai", etc. Removing stop words can reduce the size of the text data, thereby improving the efficiency and speed of text processing. At the same time, it can also delete words that contribute less to text analysis, thereby improving the accuracy and robustness of text information. After removing stop words, the feature representation of the text is more concentrated on those words with actual meanings and semantic information, which helps to improve the representation ability and expression effect of the text. In this task, first, a common stop word list is constructed, and then the segmented text is filtered according to the stop word list, simplifying the structure of the stop word model and reducing the processing logic, thereby improving the simplicity and efficiency of the model;
[0045] Step S1.4: Part-of-speech tagging, which tags each word in the text with the corresponding part of speech to help understand the grammatical structure and meaning of the text. Common Chinese parts of speech include nouns, verbs, adjectives, adverbs, prepositions, conjunctions, etc. In this task, two methods are adopted for part-of-speech tagging. First, since our instructions for the robot belong to the instructions within the common range, we use dictionary-based part-of-speech tagging. Using a pre-constructed part-of-speech dictionary, the part-of-speech information of the word in the dictionary is used for tagging. Second, if there is no part-of-speech information for a certain word in the dictionary, we use a statistics-based method to infer the part of speech;
[0046] The specific method of dictionary-based part-of-speech tagging is as follows: First, construct a dictionary containing a large number of words and their corresponding parts of speech. The words in the dictionary can be single characters, words, or word fragments. Each entry contains the word and the corresponding part-of-speech information. The dictionary can be represented as:
[0047] D = {(w i , t i )};
[0048] where w i represents the i-th word, and t i represents the part of speech of the i-th word;
[0049] We represent the text to be tagged after segmentation as:
[0050] T = {w1, w2, …, w n};
[0051] where wi It represents the i-th word in the text after word segmentation, and n is the total number of texts after word segmentation;
[0052] For the text after word segmentation, we traverse each word in the text one by one, find the entry matching the word in the dictionary, and tag the word with the corresponding part of speech to get the tagging result:
[0053] P={t1,t2,…,t n};
[0054] where t i Represents the i-th word w in the text i The corresponding part of speech;
[0055] If the corresponding word is not found in the dictionary, we use a statistical part-of-speech tagging method to tag it. This method learns the collocation rules between words and parts of speech by counting a large amount of text data, and then predicts the part of speech based on the context of the word. We use the maximum entropy model as the probability model for this task. The basic idea of the maximum entropy model is to select the probability distribution with the largest entropy as the output under given constraints. In the part-of-speech tagging task, for words that are not in the vocabulary, we hope to find the part-of-speech sequence corresponding to the words. We can understand it as a classification problem. The maximum entropy model can predict the part of speech corresponding to each word based on context and other information. Given an input x and an output y, the model output P(y|x) represents the probability of outputting y given an input x. The maximum entropy model uses the following formula to calculate the output probability:
[0056]
[0057] Where Z(x) is a normalization factor that ensures that the sum of all output powers is 1, i.e.:
[0058]
[0059] Where y′ represents the predicted part-of-speech tag sequence, λ i It is a parameter of the model, which is used to adjust the importance of each feature in the model. i The value of is obtained through training data, usually estimated using the maximum likelihood estimation method of the maximum entropy model. Suppose there are m feature functions, h i (x, y) represents the number of the i-th feature function. In the maximum entropy model, the feature function is used to describe the relationship between the input and the output, that is, the association between a certain characteristic of the input and the output. Common feature functions include indicator functions (with values of 0 or 1) and weighted functions. Since this task uses many feature functions, we select some of them for introduction.
[0060] First, we introduce the context feature function. The context feature function is a feature function used in the maximum entropy model to capture the information of the vocabulary context in the part-of-speech tagging task. They usually consider the words around the current word and their corresponding parts of speech, as well as the relationship between them. These feature functions help the model understand the context of the word in the sentence and improve the accuracy of the model for part-of-speech tagging. Take the part-of-speech combination of the current word and its previous and subsequent words as an example: This feature function considers the part-of-speech combination of the current word and its previous and subsequent words. In this task, we consider the relationship between the current word and the previous and subsequent words to obtain the feature function:
[0061]
[0062] Where x represents the input word sequence, y represents the corresponding part-of-speech sequence, i represents the position of the current word in the sequence, and y i-1 ,y i ,y i+1 The feature function h(x, y, i) represents the parts of speech of the previous word, the current word, and the next word of the current word respectively. The value of 1 in the feature function h(x, y, i) indicates that the combination of the parts of speech of the current word and the words before and after it meets the specific condition, and 0 indicates that it does not meet the condition. Such a feature function helps to capture the linguistic features and relationships between words.
[0063] Secondly, we introduce the part-of-speech conversion pattern feature function. This method represents some predefined part-of-speech conversion patterns by designing a specific part-of-speech conversion pattern feature function. The specific formula can be expressed as:
[0064]
[0065] Where x represents the input vocabulary sequence, y represents the corresponding part-of-speech sequence, i represents the position of the current vocabulary in the sequence, and a specific part-of-speech conversion mode: represents a predefined part-of-speech conversion mode, such as noun to verb, adjective to adverb and other common part-of-speech conversion modes. The value of the feature function h(x, y, i) is 1, indicating that the part-of-speech conversion of the current vocabulary meets the specific predefined mode, and 0 indicates that it does not meet the specific predefined mode. Such a feature function helps the model learn the conversion rules between parts of speech, thereby improving the accuracy of part-of-speech tagging;
[0066] After processing the user's input instructions, we pass the pre-processed text into the robot. The robot will use a pre-designed matching mechanism to match the text, thereby identifying the user's instructions or operations and making corresponding responses.
[0067] Step S2: Introduce four coordinate systems:
[0068] World coordinate system (x w ,y w , zw ), in millimeters;
[0069] Camera coordinate system (x c ,y c , z c ), in millimeters;
[0070] Image coordinate system (x, y), in millimeters;
[0071] Pixel coordinate system (u, v), the unit is pixel;
[0072] Perform camera calibration to ensure the accuracy of the camera's internal and external parameters, accurately map the target points detected in the image to the camera coordinate system, and establish a geometric model of camera imaging, as follows:
[0073] Step S2.1: using camera imaging to obtain an environmental image of the target, and identifying and calculating the pixel coordinate position of the target in the image from the image;
[0074] Step S2.2: According to the pixel coordinate system position of the target, a geometric model of camera imaging is established, and a distortion model is introduced to correct lens distortion. After the geometric model of camera imaging is established, unknown parameters in the geometric model of camera imaging are determined through training. The training process is as follows:
[0075] Step S2.2.1: For a large number of target points (x w ,y w , z w ), using camera imaging to obtain the positions (u, v) of the pixel coordinate system corresponding to these target object points;
[0076] Step S2.2.2: The target object point (x w ,y w , z w ) and the positions (u, v) of the pixel coordinate system corresponding to these target object points are used as training samples to train and find out the unknown parameters in the geometric model of camera imaging, and complete the geometric model modeling of camera imaging.
[0077] In step S2, the coordinates (x w ,y w , z w ) and the coordinates in the camera coordinate system (x c ,y c , z c )The relationship is as follows:
[0078] Where R is a 3*3 rotation matrix, and t is a 3*1 translation vector;
[0079] The coordinates in the camera coordinate system (x c ,y c , z c ) and the ideal image coordinate system (x p ,y p )The relationship is as follows:
[0080] Where Z c is the scale factor;
[0081] At the same time, when the lens distortion is corrected in step S2.2, a distortion model is introduced. During the imaging process, the distance r from the point (x, y) on the image plane to the center of the image plane satisfies the following formula:
[0082]
[0083] The imaging distortion includes radial distortion and tangential distortion. The coordinates after distortion elimination (x crt, y crt ) satisfies the following formula:
[0084]
[0085] Among them, x rcrt and rcrt is the radial distortion term, satisfying the following formula:
[0086]
[0087] x tcrt and tcrt is the tangential distortion term, satisfying the following formula:
[0088]
[0089] In the above two equations, k1, k2, k3, p1, and p2 are all distortion parameters;
[0090] The coordinates in the actual image coordinate system and the coordinates in the pixel coordinate system (u, v) satisfy the following formula:
[0091] Among them, (u0, v0) is the coordinate of the image center in the pixel coordinate system;
[0092] In summary, the geometric model of camera imaging is established:
[0093]
[0094] Among them, J(k1, k2, k3, p1, p2) represents the transformation between the distorted image and the undistorted image, is the camera’s intrinsic parameter matrix, is the camera's external parameter matrix (rotation and translation matrix).
[0095] In this embodiment, when training the geometric model of camera imaging, Zhang's calibration method is used for calibration. Zhang's calibration method uses a plane chessboard as a calibration plate, and calculates the internal and external parameters of the camera by taking chessboard pictures from different unknown directions. The specific training steps are:
[0096] Step A: Detect the pixel coordinates of corner points from multiple chessboard images taken at different angles.
[0097] Step B: Using the pixel coordinates of the checkerboard corners and the known world coordinates, calculate the homography matrix from the world coordinate system to the pixel coordinate system.
[0098] Step C: Obtain the intrinsic parameter matrix of the camera (including information such as focal length, principal point coordinates, and pixel size) through the properties of the homography matrix and the rotation matrix;
[0099] Step D: For each chessboard picture taken, obtain the external parameter matrix (rotation and translation matrix) to reflect the position and posture of the chessboard relative to the camera;
[0100] Step E: Estimate the distortion parameters, use the distortion model, and dedistort the image;
[0101] Step F: Use the Levenberg-Marquardt algorithm to optimize all parameters to improve the calibration accuracy and complete the training of the geometric model of camera imaging.
[0102] Step S3: hand-eye calibration step, using the eye-on-hand system architecture, the camera (eye) is placed at the end of the robotic arm (hand), and the coordinate relationship between the hand (end of the robotic arm) and the eye (camera) is established, as follows:
[0103] Step S3.1: Introduce two coordinate systems: a base coordinate system and a robot end coordinate system, wherein the base coordinate system is a coordinate system established with the base of the robot as the origin, and the robot end coordinate system is a coordinate system established with the end of the robot as the origin;
[0104] In this step, combining the camera (cam) coordinate system and the world (world) coordinate system mentioned above, we define the following representation:
[0105] Represents the transformation matrix from coordinate system 1 to coordinate system 2;
[0106] From the properties of matrix multiplication, we know that:
[0107]
[0108] The transformation relationship between the target object and the robot base can be expressed by matrix multiplication;
[0109] When performing hand-eye calibration, keep the relative position relationship between the calibration plate and the basic coordinate system unchanged, move the end of the robotic arm, and shoot the calibration plate in different postures. In this process, since the relative position between the robot base and the calibration plate remains unchanged, unchanged, and since the camera is arranged at the end of the robotic arm, the relative position of the camera and the end of the robotic arm remains unchanged, that is, The transformation relationship between the calibration plate and the robot base under any two different postures remains unchanged, and the following relationship is satisfied:
[0110] Formula ①:
[0111] Formula ①:
[0112] Formula ③:
[0113] From equation ① to equation ③, we can get:
[0114]
[0115] Right now:
[0116]
[0117] Simplified to:
[0118] A*X=X**BB;
[0119]
[0120] in, Represents the transformation relationship between the calibration plate and the camera, which can be obtained by camera calibration. It represents the transformation relationship between the end of the robot arm and the robot base, which can be obtained by obtaining the motion parameters of the robot arm connecting rod through the robot controller;
[0121] Step S3.2: Based on step S3.1, the robot controller is used to control the robot to change its posture multiple times, and the matrix X is obtained to determine the transformation relationship between the end of the robot arm and the camera. In this step, Zhang's calibration method is still used for hand-eye calibration, as follows:
[0122] Step A: Fix the calibration plate within the camera field of view;
[0123] Step B: Turn on the robotic arm and camera;
[0124] Step C: Take photos of the calibration plate at different distances and angles, taking a total of 50 photos;
[0125] Step D: Save the photo and the motion parameters of the robot arm link obtained from the robot controller;
[0126] Step E: Solve the matrix to obtain the transformation matrix between the end of the robot and the camera
[0127] Step S4: garbage target recognition, transmitting the preprocessed text command signal to the robot, and the robot performs garbage target recognition and coordinate acquisition tasks based on YOLOv5 and D435i camera according to the received text command. YOLOv5 obtains the pixel coordinate position information of the object in the image, and the D435i camera obtains the coordinate position information of the object in the camera coordinate system. Through the coordinate acquisition and conversion of the two, the spatial position information of the garbage target is obtained;
[0128] Specifically, the D435i camera is a device equipped with an infrared depth sensor and an RGB camera, and the principle of obtaining position information is based on triangulation. The left and right infrared cameras obtain the distance of the object from the camera by measuring the depth, and the infrared dot matrix projector in the middle is used to project infrared light to provide a better working environment for the depth sensor. The RGB camera is used to collect color images. By aligning the color image and the depth image, we can map the depth information to the color image, thereby realizing the spatial positioning of the object; YOLOv5 is a target detection model based on deep learning.
[0129] The step S4 comprises the following sub-steps:
[0130] Step S4.1: Generate a point cloud. The depth image is acquired by the D435i camera. The depth sensor inside the D435i camera generates point cloud data. The point cloud is a collection of a series of points in a three-dimensional space. Each point has three-dimensional coordinate information and represents the surface of an object within the camera's field of view.
[0131] Step S4.2: Target detection: The images captured by the D435i camera are analyzed and processed by the YOLOv5 target detection algorithm to identify possible objects in the image and define a corresponding bounding box for each object. The position and size of the bounding box of each object represent the approximate position and size of the object in the image.
[0132] Step S4.3: Object positioning, we map the bounding box position of the object in the image to the corresponding point cloud data to obtain the approximate position of the object in the camera coordinate system;
[0133] Step S4.4: After obtaining the approximate position of the object in the camera coordinate system, based on the triangulation mechanism of the D435i camera, multiple points in the point cloud and their pixel positions in the color image are used, combined with the camera's internal parameters (such as focal length, optical center position) and external parameters (such as the camera's relative position to the robot), to calculate the three-dimensional position coordinates of the object in the camera coordinate system;
[0134] Step S4.5: Convert the coordinates of the object in the camera coordinate system into the coordinates in the robot's workspace coordinate system. The workspace coordinate system includes the robot base coordinate system, world coordinate system, and robot arm end coordinate system in the previous steps to obtain the spatial position information of the object.
[0135] Step S5: According to the spatial position information of the garbage target, the robot's running path and grasping trajectory planning are planned to grasp and recycle the garbage target, which specifically includes the following sub-steps:
[0136] Step S5.1: Data conversion; after obtaining the target position, operate the robot to grab the object. First, the Cartesian space position of the robot can be represented by Ppos (x, y, z) and quaternion Oorient (q1, q2, q3, q4). Ppos (x, y, z) represents the position of the actuator at the end of the robot's mechanical arm in three-dimensional space. The actuator is the manipulator that grabs garbage; quaternion is a way to represent three-dimensional rotation. Oorient (q1, q2, q3, q4) represents the posture of the actuator at the end of the robot's mechanical arm. When the robot grabs the object, it needs to recognize and parse the data output from the camera and convert it into workpiece coordinates (x, y, θ), where x and y are coordinate values and θ is the angle value. The conversion formula is written according to the following formula:
[0137]
[0138] From the above formula, we can get the conversion formula from quaternion to ZYX Euler angle (α, β, γ):
[0139]
[0140] Step S5.2: Plan the robot's running path. In this step, the RRT*-Smart algorithm is used, where the configuration space is X and the target space is X goal , the obstacle space is X obstacle , free space is X free , where X free For X obstacleWith respect to the complement of X, the goal of the RRT*-Smart algorithm is to find a control input u: [0:T]∈U that produces a feasible path x(t)∈X while satisfying the system constraints. free , the path from x(0) = x initial The algorithm maintains a random tree T = (V, E), where the node set V contains nodes from the free space X free The nodes are sampled from the edge set E, and the edges in the edge set E connect the nodes through the free space X free The random tree structure is expanded by random sampling in order to obtain a feasible path from the starting point to the end point, and then the path is optimized, which specifically includes the following sub-steps:
[0141] Step S5.2.1: Initialize the random tree and insert the starting node;
[0142] Step S5.2.2: Enter the random sampling phase, in the free space X free Find a feasible path from the starting point to the end point. In this step, the following sub-steps are included:
[0143] Step S5.2.2.1: In free space X free A target point is randomly selected from the rand ;
[0144] Step S5.2.2.2: Find the distance from the random sampling point z in the random tree rand The nearest node, called z nearest ;
[0145] Step S5.2.2.3: From node z nearest Set out to node z rand Expand one step in the direction of new ;
[0146] Step S5.2.2.4: Check the slave node z through the collision detection function nearest To node z new Will there be a collision with an obstacle?
[0147] ① If yes, return to step S5.2.2.1;
[0148] ②If not, proceed to step S5.2.2.5;
[0149] In this step, the input of the collision detection function is a node or path, and the output is a Boolean variable, which is used to indicate whether the input point or path will collide with an obstacle. The specific principle is as follows:
[0150] In addition to storing the random tree T = (V, E), this embodiment also maintains two additional sets of nodes: a set C representing all known nodes in free space free , and the set C representing all known nodes in the obstacle space obstacle , are initially empty sets. In addition, define a mapping Dist: Respectively represent C free The minimum distance between the node in the obstacle space and C obstacle The minimum distance between the nodes in and the free space;
[0151] At each check, we determine whether a given node x is located in the free space X. free When , the algorithm performs the following steps:
[0152] Step A: Direct judgment step:
[0153] For a given node x∈X, first directly determine whether the node x belongs to the known set C free or C obstacle :
[0154] ①If node x belongs to the known set C free , then output true, proving that node x is a known node located in free space and will not collide with obstacles;
[0155] ②If node x belongs to the known set C obstacle , then output false, proving that node x is a known node located in the obstacle space and will collide with the obstacle;
[0156] Step B: Quick judgment step:
[0157] If the direct judgment of step A fails to give a result, the node x does not belong to the known set C free , nor does it belong to the known set C obstacle ,Right now and Then try to use the known information to quickly judge the node x; after finding the known set C free The node v that is closest to the node x near , make the following judgment:
[0158] ① If node x and node v near The distance between them is less than Dist(v near ), that is, node x and node v near The distance between nodes is less than that between nodes v near The distance to the obstacle boundary proves that node x is in the free space X free Inside;
[0159] ② If the above steps still fail to give a result, find the known set C obstacle The node o that is closest to the node x near , if node x and node v near The distance between them is less than Dist(v near ), that is, node x and node o near The distance between them is less than node o near The distance to the obstacle boundary proves that node x is in the obstacle space X obstacle Inside;
[0160] Step C: Distance calculation:
[0161] If the direct judgment in step A and the quick judgment in step B fail to give a result, the set distance calculation is performed on node x:
[0162] ① Calculate the minimum distance d from node x to the obstacle space obstacle and the minimum distance d from node x to free space free ;
[0163] ②If d obstacle >0, it means that node x is in free space, add node x to C free , and Dist(x)=d obstacle ;
[0164] ③If d free >0, it means that node x is in the obstacle space, add node x to C obstacle , and Dist(x)=d free
[0165] ④Output collision detection results.
[0166] Step S5.2.2.5: Set node z new The set of all random tree nodes within the surrounding search radius k is recorded as Z near , and the node is recorded as z near-i , define the robot's initial position as the starting point z init , calculate from the starting point z init Start, pass through different nodes z near-i Arrival at node z new The path cost of the node z corresponding to the path with the smallest cost near-i Denoted as z min , and z min As node z new The parent node of node z min Insert into random tree;
[0167] Step S5.2.2.6: For node z newThe random tree nodes within the search radius k are reconnected. If a node is changed to node z new As the parent node, it will make the starting point z init The total cost to reach the node is reduced, so the parent node of the node is changed to node z new ;
[0168] Step S5.2.2.7: If the termination condition is met, the termination condition is to find a feasible path from the starting point to the end point, then the process ends; if not, return to step S5.2.2.1 and iterate again;
[0169] In the above steps S5.2.2.5 and S5.2.2.6, node z new The search radius k of adjacent nodes around is expressed as:
[0170] Among them, γ is a constant parameter, d is the dimension, and n is the number of iterations.
[0171] The path cost is based on the Euclidean distance between nodes, which satisfies the following formula:
[0172] Euclidean_distance(P1,P2)=sqrt[(x1-x2) 2 +(y1-y2) 2 +(z1-z2) 2 ];
[0173] Among them, P1 and P2 are two points in space, and their coordinates are (x1, y1, z1) and (x2, y2, z2) respectively.
[0174] Step S5.2.3: After finding the initial path, use path optimization technology to reduce the path length. The optimized path node is called a beacon, which specifically includes the following sub-steps:
[0175] Step S5.2.3.1: In the initial path, from the target node z goal Start by traversing the entire path in reverse order to the starting point z init ;
[0176] Step S5.2.3.2: Apply the triangle inequality principle. If a given node can be directly connected to the parent node of its parent node and the collision detection is satisfied, it means that the cost of directly connecting to the parent node of the parent node is less than the original path cost. In this case, the parent node will be skipped and a connection will be established directly to the parent node of the parent node to reduce the number of nodes in the path.
[0177] Step S5.2.3.3: Update the path cost and update the beacon set.
[0178] Step S5.2.4: Enter the intelligent sampling stage, adopt the same sub-steps as step S5.2.2, perform biased sampling around the beacon, and use the pre-set deviation radius R beacons and the Biasing ratio, so that when the algorithm samples a new node, it follows the set ratio Biasing ratio and the deviation radius R around the beacon node beacons Random sampling is performed within the range instead of random sampling in the entire free space to find a path close to the optimal solution to accelerate the convergence to the optimal solution;
[0179] Step S5.2.5: Repeat steps S5.2.3 and S5.2.4 to find the optimal or approximately final path.
[0180] Step S5.3: Planning the robot's trajectory for grabbing garbage targets, specifically including the following sub-steps:
[0181] Step S5.3.1: placing the robot arm and the gripper in an initial position, and before starting to execute trajectory planning, placing the robot arm and the gripper in an initial position, and opening the gripper;
[0182] Step S5.3.2: Control the robotic arm to reach the first target point, i.e., the coordinate point of the location of the garbage to be grabbed. The specific workflow is as follows:
[0183] Process 1: Determine the location of the target point P where the garbage is located in the robot's workspace target1 (x1, y1, z1);
[0184] Process 2: Using the inverse kinematics solution algorithm, according to the position of the target point P target1 Calculate the joint angles of the end effector of the robot arm and determine the angle of each joint so that the end effector reaches the target point;
[0185] In this process, an analytical method is used to solve the inverse kinematics problem, as follows:
[0186] ① Assume that the robot arm has n joints, and the position of each joint is q i Represents, where i=1, 2, ..., n.
[0187] According to the structure and geometric relationship of the robot arm, a DH parameter table is established to describe the connection and transformation relationship between the joints of the robot arm. The DH parameters usually include the following parameters:
[0188] a i : Along z i-1 The distance from the x axis i-1 Axis to x i The distance between the axes;
[0189] α i : Around x i-1 The angle of rotation of the axis, from z i-1 Axis to z i The angle of the axis;
[0190] d i : Along x i-1 The distance from the z axis i-1 Axis to z i The distance between the axes;
[0191] θ i : Around z i-1 The angle of rotation of the axis from x i-1 Axis to x i The angle of the axis;
[0192] ② Use DH parameters to calculate the forward kinematics equation of the robot arm, and express the position and posture of the end effector as a function of the joint angle. The forward kinematics equation is usually expressed as the product of homogeneous transformation matrices:
[0193] T 0n =T 01 T 02 ...T (n-1)n ;
[0194] Among them, T ij Represents the transformation matrix from the i-th coordinate system to the j-th coordinate system;
[0195] ③ According to the forward kinematics equation, the inverse kinematics equation is obtained by reverse deduction, and the target position and posture are expressed as a function of the joint angle. The inverse kinematics equation is in the form of:
[0196] q=f -1 (x, y, z, φ, θ, ψ);
[0197] Among them, x, y, z represent the Cartesian coordinates of the target position, φ, θ, ψ represent the Euler angles of the target posture, and the joint angles can be solved using the inverse kinematics formula;
[0198] Process 3: Use the trajectory planning algorithm to calculate the motion trajectory of the robot end effector from the current position to the target point, as follows:
[0199] ① Cartesian coordinates (X d ,y d , z d ) represents the target position, and the Euler angle (φ d ,θ d , ψ d ) represents the target posture;
[0200] ② The trajectory is generated by using the cubic spline interpolation method to ensure the smoothness and continuity of the trajectory. The specific formula is:
[0201] P(t)=α(t)P start +b(t)P goal +c(t)T start +d(t)T goal ;
[0202] Among them, α(t), b(t), c(t), d(t) are cubic polynomial functions with respect to parameter t, T start and T goal are the tangent vectors of the starting point and the target point respectively;
[0203] ③ Speed planning and acceleration planning are used to ensure that the robot avoids collisions and maintains smooth speed during movement. Speed planning is used to determine the speed of the robot's end effector during movement, and acceleration planning is used to determine the acceleration of the robot's end effector during movement;
[0204] ④ Use motion control algorithm to realize motion control of the robot's end effector;
[0205] Process 4: Perform path interpolation, further refine the planned path to generate a smoother and continuous motion trajectory. Generally speaking, the path generated by path planning may be composed of a series of path points. Through path planning, a series of continuous trajectory points can be generated from these discrete path points, making the robot's movement smoother and more precise. In this task, we use Bezier curve interpolation for path interpolation. The specific steps are as follows:
[0206] ① Determine the control points and determine the path to be interpolated based on the discrete path points in the generated trajectory.
[0207] ② Calculate the Bezier curve parameters. We use the quadratic Bezier curve for path interpolation, and its parameter equation can be expressed as:
[0208] B(t)=(1-t) 2 P0+2t(1-t)P1+t 2 P2;
[0209] Where P0, P1, P2 are control points, and t is a parameter with a value range of [0, 1].
[0210] ③ Generate path interpolation. According to the parametric equation of the Bezier curve, uniformly sample t values within the parameter range to calculate the corresponding curve points. The generated curve point sequence is the result of path interpolation.
[0211] Process 5: According to the calculated motion trajectory, the actuators of each joint of the robot arm are controlled so that the end effector of the robot arm moves along the planned path and gradually approaches the target point;
[0212] Process 6: When the end effector of the robot arm reaches the target point position P target1 When the robot arm stops moving.
[0213] Step S5.3.3: Control the robot arm to reach the first target point, and here the position of the second target point is obtained by performing an offset calculation based on the position of the first target point. The position of the second target point is directly above the grabbed garbage, thereby ensuring that the end of the robot arm is directly above the garbage. The specific control step principle is the same as that of step S5.3.2;
[0214] Step S5.3.4: the gripper closes to clamp the garbage;
[0215] Step S5.3.5: Return to the first target point. The specific control steps and principles are the same as those of step S5.3.2.
[0216] Step S5.3.6: Determine the target point for garbage collection, and control the robot arm to reach the target point for garbage collection. The specific control steps and principles are the same as those of step S5.3.2;
[0217] Step S5.3.7: Release the garbage, open the gripper to release the garbage, and complete the recycling;
[0218] Step S5.3.8: After the recovery is completed, the robot arm is controlled to return to the initial state in order to carry out the next task.
[0219] Embodiment 2 is an example of step S5.2, such as Figure 5 As shown, the general steps are as follows:
[0220] Example Step 1: Initialize the random tree and insert the starting node.
[0221] Example Step 2: Enter the random sampling phase, in the free space X free In this example, when it reaches the 650th iteration, the program finds a feasible path from the starting point to the end point, as shown in the figure at (a);
[0222] Example step 3: After finding the initial path, use path optimization technology to reduce the path length, as shown in the figure at (b). The optimized path nodes are called beacons. In this example, the initial path contains multiple nodes, forming a tortuous route. By traversing backward from the end point, the mutually visible nodes are directly connected, and most of the turns in the middle are omitted, making the path as straight as possible. The optimized path only contains 4 beacons;
[0223] Example step 4: Entering the intelligent sampling stage, as shown in the figure at (c), biased sampling is performed around the beacon to accelerate the convergence to the optimal solution. After 2500 iterations, due to the biased sampling strategy, the beacons in the path gradually fit the edge of the obstacle;
[0224] Example step 5: Repeat example steps 3 and 4, as shown in the figure at (d), to find the optimal or approximately optimal path. After 4200 iterations, the program obtains an approximately optimal path in which the robot turns as close to the edge of the obstacle as possible when encountering an obstacle and keeps moving in a straight line when there is no obstacle.
[0225] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A method for controlling an intelligent robot for recycling garbage, characterized in that: The following steps are involved: Step S1: Processing user voice commands, converting the voice commands into text commands, and then preprocessing the text commands; Step S2: Introduce four coordinate systems: world coordinate system, camera coordinate system, image coordinate system and pixel coordinate system, perform camera calibration, and establish a geometric model of camera imaging; Step S3: hand-eye calibration step, adopting the eye-on-hand system architecture, the camera (eye) is arranged at the end of the robotic arm (hand), and the coordinate relationship between the hand (end of the robotic arm) and the eye (camera) is established to perform hand-eye calibration; Step S4: garbage target recognition, transmitting the preprocessed text command signal to the robot, and the robot performs garbage target recognition and coordinate acquisition tasks based on YOLOv5 and D435i camera according to the received text command. YOLOv5 obtains the pixel coordinate position information of the object in the image, and the D435i camera obtains the coordinate position information of the object in the camera coordinate system. Through the coordinate acquisition and conversion of the two, the spatial position information of the garbage target is obtained; Step S5: According to the spatial position information of the garbage target, the robot's running path and grasping trajectory are planned to grasp and recycle the garbage target.
2. The intelligent robot control method for recycling garbage according to claim 1, characterized in that: The camera calibration in step S2 specifically includes the following sub-steps: Step S2.1: using camera imaging to obtain an environmental image of the target, and identifying and calculating the pixel coordinate position of the target in the image from the image; Step S2.2: According to the pixel coordinate system position of the target, a geometric model of camera imaging is established, and a distortion model is introduced to correct lens distortion. After the geometric model of camera imaging is established, unknown parameters in the geometric model of camera imaging are determined through training.
3. The intelligent robot control method for recycling garbage according to claim 2, characterized in that: In step S2.2, Zhang's calibration method is used for training and calibration to determine unknown parameters in the geometric model of camera imaging.
4. The intelligent robot control method for recycling garbage according to claim 1, characterized in that: The step S3 specifically includes the following sub-steps: Step S3.1: Enter two coordinate systems: a base coordinate system and a robot end coordinate system, wherein the base coordinate system is a coordinate system established with the base of the robot as the origin, and the robot end coordinate system is a coordinate system established with the end of the robot as the origin; Step S3.2: The robot controller is used to control the robot to change its posture multiple times, and the matrix X is obtained to determine the transformation relationship between the end of the robot arm and the camera.
5. The intelligent robot control method for recycling garbage according to claim 4, characterized in that: In step S3.2, Zhang's calibration method is used for calibration to determine the transformation relationship between the end of the robotic arm and the camera.
6. The intelligent robot control method for recycling garbage according to claim 1, characterized in that: The step S4 comprises the following sub-steps: Step S4.1: Generate a point cloud, obtain a depth image through the D435i camera, and generate point cloud data by the depth sensor inside the D435i camera; Step S4.2: object detection, using the YOLOv5 object detection algorithm to identify, analyze and process the images captured by the D435i camera, and define a corresponding bounding box for each identified object; Step S4.3: Object positioning, we map the bounding box position of the object in the image to the corresponding point cloud data to obtain the approximate position of the object in the camera coordinate system; Step S4.4: After obtaining the approximate position of the object in the camera coordinate system, based on the triangulation mechanism of the D435i camera, multiple points in the point cloud and their pixel positions in the color image are used, combined with the camera's internal parameters (such as focal length, optical center position) and external parameters (such as the camera's position relative to the robot, etc.), to calculate the three-dimensional position coordinates of the object in the camera coordinate system; Step S4.5: Convert the coordinates of the object in the camera coordinate system into the coordinates in the robot's workspace coordinate system. The workspace coordinate system includes the robot base coordinate system, world coordinate system, and robot arm end coordinate system in the previous steps to obtain the spatial position information of the object.
7. The intelligent robot control method for recycling garbage according to claim 1, characterized in that: The step S5 comprises the following sub-steps: Step S5.1: data conversion; Step S5.2: planning the robot's running path; Step S5.3: Plan the robot's running trajectory for grabbing garbage targets.
8. The intelligent robot control method for recycling garbage according to claim 7, characterized in that: In step S5.2, the RRT*-Smart algorithm is used to plan the robot's running path.
Citation Information
Patent Citations
Robot picking system and method of manufacturing a workpiece
CN104057456A
Intelligent sorting method of modular mechanical arm
CN105931218A
Industrial robot visual recognition positioning grabbing method, computer device and computer readable storage medium
CN110660104A
Method, system and equipment for intelligently recycling garbage
CN111003380A
Robot autonomous recognition intelligent grabbing method and system based on depth camera
CN113379849A
