Machine arm path planning method and device based on machine recognition
Through the robot arm path planning method based on machine identification, the three-dimensional model and task list are used to generate and optimize the welding trajectory, the frequent rewinding and collision risks of robots caused by unreasonable welding task planning is solved, and more efficient and reliable path planning is achieved.
Patent Information
- Application Number
- CN202510233876.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-13
AI Technical Summary
Unreasonable welding task planning leads to frequent reversal of robots. There is a risk of collision in welding robots and is prone to hardware damage. Incoherent joint movements during task planning, abnormal noise or vibration may occur.
A robot arm path planning method based on machine recognition is proposed. By obtaining three-dimensional model files, a preset three-dimensional environment is constructed, the target model and task list of objects to be processed is obtained, the target trajectory is generated and simulated. If a collision occurs, the trajectory is optimized.
It significantly improves the accuracy and adaptability of the path planning of welding robots, reduces collision risks, improves the efficiency and reliability of path planning, ensures the rationality of the path through feasibility verification, and enhances the stability of the system.
Smart Images

Figure CN119973995A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of path planning, and in particular relates to a robot arm path planning method and device based on machine recognition. Background Art
[0002] With the rapid development of science and technology, robotic arm technology has been widely used in many fields such as medical, aerospace, and food inspection. Among them, welding robotic arms provide significant advantages for complex industrial production due to their high flexibility and strong obstacle avoidance capabilities. By increasing the degrees of freedom of the joints, it can adapt to different working conditions and perform multiple tasks. However, when faced with a large number or large processing objects, the working space of the robotic arm may be limited, resulting in the inability to access all preset task points. Therefore, anti-collision trajectory planning has become a key prerequisite for the application of robotic arms in automated production lines.
[0003] Patent No.: CN118438446A, discloses a method for planning the trajectory of a welding robot, which uses visual sensors, laser scanning and force feedback sensors to collect data on welding joints, and applies a data fusion algorithm including a Kalman filter or a deep learning model to integrate multi-sensor information to achieve an accurate description of the weld geometry and spatial position; secondly, based on the acquired weld information, an adaptive path planning algorithm combining graph search including an A* algorithm and machine learning such as reinforcement learning is introduced to adapt to weld changes caused by material deformation or thermal diffusion in real time and adjust the welding path; finally, a simulation model of the welding process is established to predict the impact of different welding parameters on weld quality, and machine learning methods such as support vector machines or neural networks are used to dynamically adjust welding speed, power and pressure parameters based on real-time data to optimize parameter settings during the welding process.
[0004] Although the above content has solved some problems, there are still some problems. For example, unreasonable welding task planning causes the robot to frequently turn back, the welding robot is at risk of collision and hardware damage is prone to occur, and the joint movement is incoherent during task planning, resulting in abnormal noise or vibration. Summary of the invention
[0005] The purpose of the present invention is to solve the problems of frequent turning back of the robot due to unreasonable welding task planning, collision risk and hardware damage of the welding robot, and abnormal noise or vibration caused by discontinuous joint movement during task planning, and to propose a robot arm path planning method and device based on machine recognition.
[0006] In a first aspect of the present invention, a robot arm path planning method based on machine recognition is first proposed, the method comprising:
[0007] Obtain a three-dimensional model file, and construct a preset three-dimensional environment according to the three-dimensional model file; the three-dimensional file includes: a three-dimensional model of a gantry structure, a three-dimensional model of a lifting and traversing mechanism, and a three-dimensional model of a welding robot;
[0008] Acquire a target model and a task list of the object to be processed, and add the target model to a preset three-dimensional environment to obtain a target three-dimensional environment;
[0009] The gantry structure three-dimensional model and the target model are used as obstacle points, and a target trajectory is generated according to the task list and the obstacle points;
[0010] A simulation is performed according to the target trajectory, and if a collision occurs in the target trajectory, the target trajectory is optimized.
[0011] Optionally, generating a target trajectory according to the task list and the obstacle points includes:
[0012] Acquire a set of key points of a three-dimensional model of a welding robot and obstacle points, and add feature labels to the key points according to the key point attributes to obtain a target key point set; the key point set includes multiple key point sets;
[0013] Determine a transformation matrix of any key point in a key point set according to the target key point set; the key point set includes a plurality of key points;
[0014] Extracting the transformation matrix according to a preset length to obtain a position vector, extracting the transformation matrix according to a preset size to obtain a target matrix, and concatenating the rows in the target matrix to obtain a direction vector;
[0015] Classifying the position vectors and the direction vectors according to the feature labels to obtain a robot vector set and an obstacle point vector set;
[0016] The position vectors and direction vectors corresponding to each key point in the robot vector set are spliced to obtain a first position vector and a first direction vector, and the position vectors and direction vectors corresponding to each key point in the obstacle point vector set are spliced to obtain a second position vector and a second direction vector.
[0017] Optionally, encoding the first position vector and the first direction vector includes:
[0018] Encoding the first position vector and the first direction vector respectively by an encoder to obtain a first position code and a first direction code;
[0019] Determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code, and the first direction code to obtain a spatial information code;
[0020] generating a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and converting the joint motion trajectory into a trajectory code;
[0021] The spatial information code and the trajectory code are connected to obtain a target code, and a genetic operation is performed on the target code to obtain a target trajectory.
[0022] Optionally, performing a genetic operation on the target code to obtain a target trajectory includes:
[0023] The target code is region-marked according to the spatial information code and the trajectory code to obtain a first region and a second region; the first region corresponds to the spatial information code, and the second region corresponds to the trajectory code;
[0024] Initialize the target code as a population, calculate the fitness of the target code using a fitness formula, and use the chromosome with the highest fitness as the target chromosome;
[0025] Iterating the regions in the target chromosome respectively through genetic operations according to the regional markers; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism;
[0026] If the fitness change is less than the preset threshold or reaches the maximum number of iterations, the target trajectory is output.
[0027] Optionally, if a collision occurs in the target trajectory, optimizing the target trajectory includes:
[0028] If a collision occurs in the simulation trajectory, a collision point is obtained and used as an obstacle point, and the target trajectory is optimized according to the obstacle point.
[0029] In a second aspect of the present invention, a robot arm path planning device based on machine recognition is proposed, comprising: an environment generation module, an environment update module, a trajectory generation module and a trajectory simulation module:
[0030] The environment generation module is used to obtain a three-dimensional model file and construct a preset three-dimensional environment according to the three-dimensional model file; the three-dimensional file includes: a three-dimensional model of a gantry structure, a three-dimensional model of a lifting and traversing mechanism, and a three-dimensional model of a welding robot;
[0031] The environment updating module is used to obtain a target model and a task list of the object to be processed, and add the target model to a preset three-dimensional environment to obtain a target three-dimensional environment;
[0032] The trajectory generation module is used to use the gantry structure three-dimensional model and the target model as obstacle points, and generate a target trajectory according to the task list and the obstacle points;
[0033] The trajectory simulation module is used to perform simulation operation according to the target trajectory, and optimize the target trajectory if a collision occurs in the target trajectory.
[0034] Optionally, the trajectory generation module includes: a key point integration module, a matrix generation module, a vector acquisition module, a vector classification module and a vector splicing module:
[0035] The key point integration module is used to obtain a key point set of the three-dimensional model of the welding robot and the obstacle points, and add feature tags to the key points according to the key point attributes to obtain a target key point set; the key point set includes multiple key point sets;
[0036] The matrix generation module is used to determine the transformation matrix of any key point in the key point set according to the target key point set; the key point set includes multiple key points;
[0037] The vector acquisition module is used to extract the transformation matrix according to a preset length to obtain a position vector, extract the transformation matrix according to a preset size to obtain a target matrix, and splice the rows in the target matrix to obtain a direction vector;
[0038] The vector classification module is used to classify the position vector and the direction vector according to the feature label to obtain a robot vector set and an obstacle point vector set;
[0039] The vector splicing module is used to splice the position vectors and direction vectors corresponding to each key point in the robot vector set to obtain a first position vector and a first direction vector, and to splice the position vectors and direction vectors corresponding to each key point in the obstacle point vector set to obtain a second position vector and a second direction vector.
[0040] Optionally, the device further includes: a vector encoding module, a space encoding acquisition module, a trajectory encoding acquisition module and a target trajectory acquisition module:
[0041] The vector encoding module is used to encode the first position vector and the first direction vector through an encoder to obtain a first position code and a first direction code respectively;
[0042] The spatial coding acquisition module is used to determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code and the first direction code to obtain a spatial information code;
[0043] The trajectory code acquisition module is used to generate a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and convert the joint motion trajectory into a trajectory code;
[0044] The target trajectory acquisition module is used to connect the spatial information code and the trajectory code to obtain a target code, and perform genetic operation on the target code to obtain a target trajectory.
[0045] Optionally, the target trajectory acquisition module includes: a region marking module, a population initialization module, a genetic update module and a trajectory output module:
[0046] The region marking module is used to perform region marking on the target code according to the spatial information code and the trajectory code to obtain a first region and a second region; the first region corresponds to the spatial information code, and the second region corresponds to the trajectory code;
[0047] The population initialization module is used to initialize the target code as a population, calculate the fitness of the target code by a fitness formula, and use the chromosome with the highest fitness as the target chromosome;
[0048] The genetic update module is used to iterate the regions in the target chromosome through genetic operations according to the region tags; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism;
[0049] The trajectory output module is used to output the target trajectory if the fitness change is less than a preset threshold or reaches a maximum number of iterations.
[0050] Optionally, the trajectory simulation module is further used to obtain a collision point if a collision occurs in the simulated trajectory, and use the collision point as an obstacle point to optimize the target trajectory according to the obstacle point.
[0051] Beneficial effects of the present invention:
[0052] The present invention proposes a robot arm path planning method based on machine recognition, which obtains a three-dimensional model file, and constructs a preset three-dimensional environment according to the three-dimensional model file; obtains the target model and task list of the object to be processed, and adds the target model to the preset three-dimensional environment to obtain the target three-dimensional environment; uses the gantry structure three-dimensional model and the target model as obstacle points, and generates a target trajectory according to the task list and obstacle points; performs simulation operation according to the target trajectory, and optimizes the target trajectory if a collision occurs in the target trajectory. Constructing an accurate three-dimensional environment and dynamic path planning significantly improves the accuracy and adaptability of the welding robot path planning. Detecting collisions and optimizing trajectories in the simulation stage effectively reduces the risk of collisions, improves the efficiency and reliability of path planning, ensures the rationality of the path through feasibility verification, and enhances the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention will be further described below in conjunction with the accompanying drawings.
[0054] Figure 1 A flowchart of a robot arm path planning method based on machine recognition provided by an embodiment of the present invention;
[0055] Figure 2 A welding sequence diagram of a robot arm path planning method based on machine recognition provided by an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of the structure of a robot arm path planning device based on machine recognition provided by an embodiment of the present invention;
[0057] Figure 4 A schematic structural diagram of another robot arm path planning device based on machine recognition provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the present invention, the description of "first", "second", etc. is only used for descriptive purposes, and cannot be understood as indicating or implying its relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0059] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.
[0060] The embodiment of the present invention provides a robot arm path planning method based on machine recognition. Figure 1 , Figure 1 A flow chart of a robot arm path planning method based on machine recognition provided by an embodiment of the present invention. The method comprises the following steps:
[0061] S101, obtaining a 3D model file, and constructing a preset 3D environment according to the 3D model file;
[0062] S102, obtaining a target model and a task list of the object to be processed, and adding the target model to a preset three-dimensional environment to obtain a target three-dimensional environment;
[0063] S103, using the gantry structure three-dimensional model and the target model as obstacle points, and generating a target trajectory according to the task list and the obstacle points;
[0064] S104, performing simulation according to the target trajectory, and optimizing the target trajectory if a collision occurs in the target trajectory.
[0065] The 3D files include: 3D model of gantry structure, 3D model of lifting and traversing mechanism, and 3D model of welding robot;
[0066] A robot arm path planning method based on machine recognition provided by an embodiment of the present invention significantly improves the accuracy and adaptability of welding robot path planning by constructing an accurate three-dimensional environment and dynamic path planning. Detecting collisions and optimizing trajectories during the simulation phase effectively reduces the risk of collisions, improves the efficiency and reliability of path planning, ensures the rationality of the path through feasibility verification, and enhances the stability of the system.
[0067] In one implementation, in the robot arm path planning based on machine recognition, "machine recognition" mainly refers to the use of sensors and algorithms to automatically identify and locate objects, obstacles and task targets in the environment. Object recognition: The shape, position and characteristics of the object to be processed are identified through visual sensors (such as monocular cameras, laser ranging modules, etc.). For example, in a handling robot, a monocular camera can be used to identify the color and spatial position of an object. Environmental perception and obstacle recognition: Machine recognition also includes the perception of the surrounding environment, especially the detection of obstacles. Sensors such as laser ranging modules can be used to detect the position and shape of obstacles in real time, providing dynamic environmental information for path planning. Posture calculation and path verification: In path planning, machine recognition technology is used to calculate the posture (position and posture) of a welding robot or a robotic arm and verify the feasibility of the path. For example, the grasping posture of the robotic arm is calculated through an inverse kinematics model, and the feasibility of the path is verified by point selection. Dynamic path planning: Based on the results of machine recognition, path planning algorithms (such as RRT algorithms, A* algorithms, etc.) can generate obstacle avoidance paths in real time. These algorithms combine sensor data to dynamically adjust the path to avoid obstacles and ensure the safe movement of the robot arm in complex environments. The role of machine recognition in robot arm path planning is to automatically identify and locate objects and obstacles in the environment through sensors and algorithms, and provide real-time data support for path planning. This technology makes path planning more intelligent and dynamic, significantly improving the efficiency and reliability of the robot arm in complex environments.
[0068] In one implementation, a 3D model file is obtained, and a preset 3D environment is constructed based on the 3D model file. For example, a 3D model diagram of a teaching-free welding robot system is established, and the 3D model diagram includes a 3D model of a gantry structure, a 3D model of a lifting and lateral movement mechanism, and a 3D model of a welding robot, and an external invariant environment for path planning is built. By constructing a preset 3D environment including a gantry structure, a lifting and lateral movement mechanism, and a 3D model of a welding robot, and adding the target model of the object to be processed to the environment, accurate modeling of the welding task scene is achieved. This modeling method can accurately reflect the complex environment of the welding task, making the path planning more in line with actual production needs, and significantly improving the accuracy and adaptability of the path planning.
[0069] In one implementation, the target model and task list of the object to be processed are obtained, and the target model is added to the preset three-dimensional environment to obtain the target three-dimensional environment: the three-dimensional model of the object to be welded by the teaching-free welding robot system is obtained, and the position information of all welds to be welded by the system is obtained according to the welding process and weld identification, and the external variable environment for path planning is built; the weld position information is classified and stored, and the storage requirements include the type of weld (upper surface weld, horizontal weld in frame hole, longitudinal weld in frame hole, vertical weld in frame hole), weld start point coordinates, and weld end point coordinates. The frame hole size is classified, and the corresponding frame hole rules are formulated according to the working range of the welding robot, that is, how many frame holes and how many welds can be welded after the welding robot fixes the world coordinate system each time. According to the three-dimensional structural part model and the teaching-free welding robot system, the origin position of the world coordinate system of the entire system is specified. The gantry structure and the target model are used as obstacle points, and the target trajectory is generated in combination with the task list, so that the path planning can dynamically consider the fixed obstacles in the environment and the geometric characteristics of the object to be processed. This dynamic path planning method can flexibly adjust the trajectory according to task requirements and environmental changes, ensuring that the welding robot's motion path in complex environments always remains optimal, enhancing the flexibility and dynamics of the system.
[0070] In one implementation, see Figure 2 , Figure 2 A welding sequence diagram of a robot arm path planning method based on machine recognition is provided for an embodiment of the present invention; according to the welding process requirements, global rules about the welding sequence are formulated for all weld entities; 1. According to the welding process requirements, welding rules for upper surface welds are formulated; 2. According to the welding process requirements, welding rules for transverse welds in frame holes are formulated; 3. According to the welding process requirements, welding rules for longitudinal welds in frame holes are formulated; 4. According to the welding process requirements, welding rules for vertical welds in frame holes are formulated.
[0071] In one implementation, according to the welding process requirements, the pose calculation is performed for the weld entity in the frame hole entity, and the start pose and the end pose are assigned according to the start and end points of the weld entity, and the feasibility of the final path of the weld is verified; according to the different frame hole sizes in the three-dimensional model, the welding robot pointing to the center point under different frame hole sizes is selected, that is, the intersection of the extension line of all welding robot poses from the welding gun to the robot body. Combined with the welding process requirements and the three-dimensional structural part model, the welding robot poses in different orientations in the frame hole (X positive Y positive Z positive, X negative Y positive Z positive, X negative Y negative Z positive, X positive Y negative Z positive, X positive Y positive Z negative, X negative Y positive Z negative, X negative Y negative Z negative, X positive Y negative Z negative) are calculated. According to the calculation results, the weld start pose and the weld end pose are assigned to all welds in the weld set. The feasibility verification is performed for each weld, that is, the welding robot is inversely solved by point selection under variable step length to achieve the effect of feasibility verification.
[0072] In one implementation, the obtained in-frame welding rules are combined with the global welding sequence to obtain the final global welding path. By running the simulation to detect whether the target trajectory has a collision, and optimizing the trajectory when a collision occurs, the risk of collision can be effectively reduced. This optimization mechanism based on collision detection not only improves the safety of the path, but also reduces the number of path replanning caused by collisions, significantly improving the efficiency and reliability of path planning.
[0073] In one embodiment, generating a target trajectory according to the task list and the obstacle points includes:
[0074] Obtain a set of key points of the three-dimensional model of the welding robot and obstacle points, and add feature labels to the key points according to the key point attributes to obtain a target key point set; the key point set contains multiple key point sets;
[0075] Determine the transformation matrix of any key point in the key point set according to the target key point set; the key point set contains multiple key points;
[0076] Extract the transformation matrix according to a preset length to obtain a position vector, extract the transformation matrix according to a preset size to obtain a target matrix, and concatenate the rows in the target matrix to obtain a direction vector;
[0077] The position vector and the direction vector are classified according to the feature labels to obtain the robot vector set and the obstacle point vector set;
[0078] The position vectors and direction vectors corresponding to each key point in the robot vector set are spliced to obtain a first position vector and a first direction vector, and the position vectors and direction vectors corresponding to each key point in the obstacle point vector set are spliced to obtain a second position vector and a second direction vector.
[0079] In one implementation method, the position and direction of each joint of the robotic arm (welding robot three-dimensional model) are key points, and the obstacle points, that is, the coordinates of the gantry structure three-dimensional model and the target model, are key points (since the gantry structure three-dimensional model and the target model are fixed, the robotic arm is prone to touch the gantry structure during operation); according to the key point attributes, feature labels are added to the key points to obtain a target key point set, and the key point attributes are related to the welding robot three-dimensional model and the obstacle points (the role of the key point attributes is to distinguish the welding robot from the obstacle points), that is, the key points are divided into key points related to the welding robot and key points related to the obstacle points.
[0080] In one implementation, the transformation matrix of any key point in the key point set is determined based on the target key point set. In a D-dimensional environment, the transformation matrix of the robot arm is obtained based on forward kinematics, the transformation matrix is extracted according to a preset length to obtain a position vector (that is, the first three elements of the last column in the transformation matrix are used as direction vectors), the transformation matrix is extracted according to a preset size to obtain a target matrix (that is, the target matrix is extracted at the upper left corner of the transformation matrix according to the size of D×D), and the rows in the target matrix are spliced to obtain a direction vector (that is, the rows in the target matrix are spliced row by row, for example: the end of the first row is spliced to the beginning of the second row).
[0081] In one implementation, the position vectors and direction vectors are classified according to feature labels to obtain a robot vector set and an obstacle point vector set. The feature labels are used to distinguish between the position vectors and direction vectors belonging to the robot vector set and the obstacle point vector set. The position vectors and direction vectors corresponding to the key points in the robot vector set are respectively concatenated to obtain a first position vector and a first direction vector, that is, and Where W rob represents the position vector, F rob represents the direction vector, Concat represents connection (connecting the vectors end to end), Represents multiple position vectors, Represents multiple direction vectors. Similarly, the position vectors and direction vectors corresponding to each key point in the obstacle point vector set are concatenated to obtain a second position vector and a second direction vector.
[0082] In one embodiment, encoding the first position vector and the first direction vector comprises:
[0083] The first position vector and the first direction vector are respectively encoded by an encoder to obtain a first position code and a first direction code;
[0084] Determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code, and the first direction code to obtain a spatial information code;
[0085] generating a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and converting the joint motion trajectory into a trajectory code;
[0086] The spatial information code and the trajectory code are connected to obtain the target code, and the target trajectory is obtained by performing genetic operations on the target code.
[0087] In one implementation, the encoders include: absolute position encoding, relative position encoding, rotational position encoding, unit vector encoding, angle encoding, etc. The task list is the welding task and welding sequence, the joint configuration encoding is to encode the angles, angular velocities and angular accelerations of each joint of the robot, the joint configuration encoding, the first position encoding and the first direction encoding are connected to obtain the spatial information encoding, which reflects the operating parameters of the robot; a joint motion trajectory is generated according to the task execution sequence, the second position vector and the second direction vector, and the joint motion trajectory is converted into a trajectory encoding, which is the encoding of the robot avoiding obstacles, and the trajectory needs to ensure sufficient smoothness and flexibility to avoid impact and vibration.
[0088] In one implementation, the spatial information coding and the trajectory coding are combined to obtain the initial path planning, and the target trajectory is obtained by performing genetic operations on the target coding, that is, the target trajectory is obtained by iteratively optimizing the target coding through a genetic algorithm.
[0089] In one implementation, the position vector and direction vector are encoded as position code and direction code respectively, and the spatial information code is generated by combining the task execution sequence and joint configuration code to accurately reflect the operation parameters of the robot arm. This encoding method makes the motion planning of the robot arm in complex environments more flexible and adaptable, and can dynamically adjust the path according to task requirements and environmental changes.
[0090] In one implementation, a joint motion trajectory is generated based on the task execution sequence, position vector and direction vector, and converted into trajectory coding to ensure that the robot avoids obstacles during movement. The design of trajectory coding ensures the smoothness and flexibility of the path, avoids shock and vibration caused by sudden changes in the path, and thus significantly improves the obstacle avoidance ability and motion stability of the robot in complex environments.
[0091] In one implementation, spatial information coding and trajectory coding are combined to form target coding, and iterative optimization is performed through a genetic algorithm to quickly generate high-quality target trajectories. The global search capability and optimization efficiency of the genetic algorithm make the path planning process more efficient, and it can find the optimal or approximately optimal path within limited computing resources, reducing computing time and resource consumption.
[0092] In one embodiment, performing genetic operations on the target code to obtain the target trajectory includes:
[0093] According to the spatial information code and the trajectory code, the target code is region-marked to obtain a first region and a second region; the first region corresponds to the spatial information code, and the second region corresponds to the trajectory code;
[0094] Initialize the target code as a population, calculate the target code using the fitness formula to get the fitness, and use the chromosome with the highest fitness as the target chromosome;
[0095] Iterate the regions in the target chromosome respectively through genetic operations according to the regional markers; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism;
[0096] If the fitness change is less than the preset threshold or reaches the maximum number of iterations, the target trajectory is output.
[0097] In one implementation, the target code is marked according to the spatial information code and the trajectory code to obtain the first region and the second region; the region corresponding to the spatial information code in the target code is used as the first region, and the region corresponding to the trajectory code in the target code is used as the second region; the target code is optimized by a genetic algorithm, such as a hierarchical genetic algorithm, an adaptive genetic algorithm, a hybrid genetic algorithm, etc. The fitness of the target code is calculated by a fitness formula, such as: S represents fitness (value), f 1 represents the path length, f 2 Represents the change angle of each joint, f 3 represents the collision probability, α and β represent constant proportional coefficients; where, θ represents the joint angle.
[0098] In one implementation, the selection mechanism is as follows: at the initial stage of each generation of chromosomes, a certain number of individuals are pre-selected. A roulette wheel mechanism is used in the selection process. Individuals corresponding to chromosomes with high fitness (better solutions) will be selected first. A single-point crossover mechanism is used for target coding, for example: for each sub-part of the parent generations P1 and P2, a cutting point is randomly selected at the same position of P1 and P2, and the genes of P1 and P2 are exchanged by mapping from the cutting point to the last point; for example: P1: 11011…000, P2: 11010…101, the first three bits remain unchanged, and each pair of genes behind are exchanged with each other to obtain the replaced P1: 11010…101 and the replaced P2: 11011…000.
[0099] In one implementation, different mutation mechanism schemes are executed according to the target coding region. For example, in the first region of the chromosome, two genes are randomly selected for exchange, for example, P3: 101100, the third and sixth positions are randomly selected and exchanged to obtain the exchanged P3: 100101; in the second region, two genes are randomly selected to change them from 0 to 1, and vice versa; for example, P4: 100011, the third and fifth positions in P4 are mutated to obtain the mutated P4: 101001.
[0100] In one embodiment, if a collision occurs in the target trajectory, the target trajectory is optimized, including:
[0101] If a collision occurs in the simulation trajectory, the collision point is obtained and used as the obstacle point, and the target trajectory is optimized according to the obstacle point.
[0102] In one implementation, by detecting the collision points in the trajectory during the simulation phase and incorporating the collision points as obstacle points into the optimization process, collision information can be fed back in real time and the path planning can be adjusted. The dynamic collision detection mechanism makes the path planning process no longer static, but can be dynamically adjusted according to the real-time collision detection results, significantly improving the flexibility and adaptability of path planning. By dynamically optimizing the path to avoid collisions, the risk of collision of the robot arm when performing tasks is reduced, thereby reducing the possibility of equipment damage and maintenance costs. At the same time, this optimization mechanism reduces the frequency of task interruptions and re-planning due to collisions, improves the operating efficiency and stability of the system, and reduces the difficulty of system maintenance.
[0103] In one implementation, the collision point is included in the optimization as an obstacle point, so that the path planning can actively avoid potential collision areas, rather than simply relying on the initial planning results. This optimization method can effectively reduce the risk of collision, enhance the robustness of path planning in complex dynamic environments, and ensure the safety and reliability of the robot arm when performing tasks. By re-optimizing the target trajectory using the collision point as an obstacle point, the path can be adjusted more accurately to avoid collision problems caused by imperfect initial planning. This optimization method based on collision points not only improves the accuracy of path planning, but also reduces repeated optimization caused by collision detection failures, thereby improving the overall optimization efficiency.
[0104] Based on the same inventive concept, the embodiment of the present invention also provides a robot arm path planning device based on machine recognition. Figure 3-4 , Figure 3 A schematic diagram of a robot arm path planning device based on machine recognition provided by an embodiment of the present invention. Figure 4 In the figure, 401 is a gantry structure, 402 is a robotic arm, and the end of the robotic arm is used to perform welding operations; the device includes: an environment generation module, an environment update module, a trajectory generation module and a trajectory simulation module:
[0105] The environment generation module is used to obtain the 3D model file and construct a preset 3D environment according to the 3D model file; the 3D file includes: the 3D model of the gantry structure, the 3D model of the lifting and traversing mechanism, and the 3D model of the welding robot;
[0106] The environment update module is used to obtain the target model and task list of the object to be processed, and add the target model to the preset three-dimensional environment to obtain the target three-dimensional environment;
[0107] A trajectory generation module is used to use the gantry structure three-dimensional model and the target model as obstacle points, and generate a target trajectory according to the task list and obstacle points;
[0108] The trajectory simulation module is used to perform simulation according to the target trajectory and optimize the target trajectory if a collision occurs.
[0109] A robot arm path planning device based on machine recognition provided by an embodiment of the present invention significantly improves the accuracy and adaptability of welding robot path planning by constructing an accurate three-dimensional environment and dynamic path planning. Collisions are detected and trajectories are optimized during the simulation phase, effectively reducing collision risks, improving the efficiency and reliability of path planning, ensuring the rationality of the path through feasibility verification, and enhancing the stability of the system.
[0110] In one embodiment, the trajectory generation module includes: a key point integration module, a matrix generation module, a vector acquisition module, a vector classification module and a vector splicing module:
[0111] The key point integration module is used to obtain the key point set of the three-dimensional model of the welding robot and the obstacle points, and add feature labels to the key points according to the key point attributes to obtain the target key point set; the key point set contains multiple key point sets;
[0112] A matrix generation module is used to determine the transformation matrix of any key point in the key point set according to the target key point set; the key point set contains multiple key points;
[0113] A vector acquisition module is used to extract the transformation matrix according to a preset length to obtain a position vector, extract the transformation matrix according to a preset size to obtain a target matrix, and concatenate the rows in the target matrix to obtain a direction vector;
[0114] A vector classification module is used to classify the position vector and the direction vector according to the feature labels to obtain a robot vector set and an obstacle point vector set;
[0115] The vector splicing module is used to splice the position vectors and direction vectors corresponding to each key point in the robot vector set to obtain a first position vector and a first direction vector, and to splice the position vectors and direction vectors corresponding to each key point in the obstacle point vector set to obtain a second position vector and a second direction vector.
[0116] In one embodiment, the device further includes: a vector encoding module, a space encoding acquisition module, a trajectory encoding acquisition module and a target trajectory acquisition module:
[0117] A vector encoding module, used for respectively encoding the first position vector and the first direction vector through an encoder to obtain a first position code and a first direction code;
[0118] A spatial coding acquisition module is used to determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code and the first direction code to obtain a spatial information code;
[0119] A trajectory code acquisition module, used for generating a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and converting the joint motion trajectory into a trajectory code;
[0120] The target trajectory acquisition module is used to connect the spatial information code and the trajectory code to obtain the target code, and perform genetic operations on the target code to obtain the target trajectory.
[0121] In one embodiment, the target trajectory acquisition module includes: a region marking module, a population initialization module, a genetic update module and a trajectory output module:
[0122] A region marking module, used for performing region marking on the target code according to the spatial information code and the trajectory code to obtain a first region and a second region; the first region corresponds to the spatial information code, and the second region corresponds to the trajectory code;
[0123] The population initialization module is used to initialize the target code as a population, calculate the fitness of the target code through the fitness formula, and use the chromosome with the highest fitness as the target chromosome;
[0124] The genetic update module is used to iterate the regions in the target chromosome through genetic operations according to the regional tags; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism;
[0125] The trajectory output module is used to output the target trajectory if the fitness change is less than a preset threshold or reaches the maximum number of iterations.
[0126] In one embodiment, the trajectory simulation module is further used to obtain a collision point if a collision occurs in the simulated trajectory, and use the collision point as an obstacle point to optimize the target trajectory according to the obstacle point.
[0127] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A robot arm path planning method based on machine recognition, characterized in that: The method comprises: Acquire a three-dimensional model file, and construct a preset three-dimensional environment according to the three-dimensional model file; the three-dimensional file includes: a three-dimensional model of a gantry structure, a three-dimensional model of a lifting and traversing mechanism, and a three-dimensional model of a welding robot; Acquire a target model and a task list of the object to be processed, and add the target model to a preset three-dimensional environment to obtain a target three-dimensional environment; The gantry structure three-dimensional model and the target model are used as obstacle points, and a target trajectory is generated according to the task list and the obstacle points; A simulation is performed according to the target trajectory, and if a collision occurs in the target trajectory, the target trajectory is optimized.
2. A robot arm path planning method based on machine recognition according to claim 1, characterized in that: Generating a target trajectory according to the task list and the obstacle points includes: Acquire a set of key points of a three-dimensional model of a welding robot and obstacle points, and add feature labels to the key points according to key point attributes to obtain a target key point set; the key point set includes multiple key point sets; Determine a transformation matrix of any key point in a key point set according to the target key point set; the key point set includes a plurality of key points; Extracting the transformation matrix according to a preset length to obtain a position vector, extracting the transformation matrix according to a preset size to obtain a target matrix, and concatenating the rows in the target matrix to obtain a direction vector; Classifying the position vectors and the direction vectors according to the feature labels to obtain a robot vector set and an obstacle point vector set; The position vectors and direction vectors corresponding to each key point in the robot vector set are spliced to obtain a first position vector and a first direction vector, and the position vectors and direction vectors corresponding to each key point in the obstacle point vector set are spliced to obtain a second position vector and a second direction vector.
3. The robot arm path planning method based on machine recognition according to claim 2, characterized in that: Encoding the first position vector and the first direction vector includes: Encoding the first position vector and the first direction vector respectively by an encoder to obtain a first position code and a first direction code; Determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code, and the first direction code to obtain a spatial information code; generating a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and converting the joint motion trajectory into a trajectory code; The spatial information code and the trajectory code are connected to obtain a target code, and a genetic operation is performed on the target code to obtain a target trajectory.
4. The robot arm path planning method based on machine recognition according to claim 3, characterized in that: Performing genetic operations on the target code to obtain a target trajectory includes: According to the spatial information code and the trajectory code, the target code is region-marked to obtain a first region and a second region; the first region corresponds to the spatial information code, and the second region corresponds to the trajectory code; Initialize the target code as a population, calculate the fitness of the target code using a fitness formula, and use the chromosome with the highest fitness as the target chromosome; Iterating the regions in the target chromosome respectively through genetic operations according to the regional markers; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism; If the fitness change is less than the preset threshold or reaches the maximum number of iterations, the target trajectory is output.
5. The robot arm path planning method based on machine recognition according to claim 1, characterized in that: If the target trajectory collides, the target trajectory is optimized, including: If a collision occurs in the simulation trajectory, a collision point is obtained and used as an obstacle point, and the target trajectory is optimized according to the obstacle point.
6. A robot arm path planning device based on machine recognition, characterized in that: The device comprises: an environment generation module, an environment update module, a trajectory generation module and a trajectory simulation module: The environment generation module is used to obtain a three-dimensional model file and construct a preset three-dimensional environment according to the three-dimensional model file; the three-dimensional file includes: a three-dimensional model of a gantry structure, a three-dimensional model of a lifting and traversing mechanism, and a three-dimensional model of a welding robot; The environment updating module is used to obtain a target model and a task list of the object to be processed, and add the target model to a preset three-dimensional environment to obtain a target three-dimensional environment; The trajectory generation module is used to use the gantry structure three-dimensional model and the target model as obstacle points, and generate a target trajectory according to the task list and the obstacle points; The trajectory simulation module is used to perform simulation operation according to the target trajectory, and optimize the target trajectory if a collision occurs in the target trajectory.
7. The robot arm path planning device based on machine recognition according to claim 6, characterized in that: The trajectory generation module includes: a key point integration module, a matrix generation module, a vector acquisition module, a vector classification module and a vector splicing module: The key point integration module is used to obtain a key point set of the three-dimensional model of the welding robot and the obstacle points, and add feature tags to the key points according to the key point attributes to obtain a target key point set; the key point set includes multiple key point sets; The matrix generation module is used to determine the transformation matrix of any key point in the key point set according to the target key point set; the key point set includes multiple key points; The vector acquisition module is used to extract the transformation matrix according to a preset length to obtain a position vector, extract the transformation matrix according to a preset size to obtain a target matrix, and splice the rows in the target matrix to obtain a direction vector; The vector classification module is used to classify the position vector and the direction vector according to the feature label to obtain a robot vector set and an obstacle point vector set; The vector splicing module is used to splice the position vectors and direction vectors corresponding to each key point in the robot vector set to obtain a first position vector and a first direction vector, and to splice the position vectors and direction vectors corresponding to each key point in the obstacle point vector set to obtain a second position vector and a second direction vector.
8. The robot arm path planning device based on machine recognition according to claim 7, characterized in that: The device also includes: a vector encoding module, a space encoding acquisition module, a trajectory encoding acquisition module and a target trajectory acquisition module: The vector encoding module is used to encode the first position vector and the first direction vector through an encoder to obtain a first position code and a first direction code respectively; The spatial coding acquisition module is used to determine a task execution sequence according to the task list, determine a joint configuration code according to the task execution sequence, and connect the joint configuration code, the first position code and the first direction code to obtain a spatial information code; The trajectory code acquisition module is used to generate a joint motion trajectory according to the task execution sequence, the second position vector and the second direction vector, and convert the joint motion trajectory into a trajectory code; The target trajectory acquisition module is used to connect the spatial information code and the trajectory code to obtain a target code, and perform genetic operation on the target code to obtain a target trajectory.
9. The robot arm path planning device based on machine recognition according to claim 8, characterized in that: The target trajectory acquisition module includes: an area marking module, a population initialization module, a genetic update module and a trajectory output module: The region marking module is used to perform region marking on the target code according to the spatial information code and the trajectory code to obtain a first region and a second region; the first region corresponds to the spatial information code, and the first region corresponds to the trajectory code; The population initialization module is used to initialize the target code as a population, calculate the fitness of the target code by a fitness formula, and use the chromosome with the highest fitness as the target chromosome; The genetic update module is used to iterate the regions in the target chromosome respectively through genetic operations according to the region tags; the genetic operations include: selection mechanism, crossover mechanism and mutation mechanism; The trajectory output module is used to output the target trajectory if the fitness change is less than a preset threshold or reaches a maximum number of iterations.
10. The robot arm path planning device based on machine recognition according to claim 6, characterized in that: The trajectory simulation module is also used to obtain a collision point if a collision occurs in the simulation trajectory, and use the collision point as an obstacle point to optimize the target trajectory according to the obstacle point.
Citation Information
Patent Citations
Welding robot track planning method
CN118438446A