Robot assembly method, device, non-volatile storage medium and computer equipment
Patent Information
- Application Number
- CN202611027241.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-10-27
AI Technical Summary
[0008]本发明实施例提供了一种机器人装配方法、装置、非易失性存储介质和计算机设备,以至少解决由于传统方法依赖人工经验导致装配策略生成效率低、接触阶段缺乏实时纠偏能力导致装配成功率低的技术问题
[0019]在本发明实施例中,采用机器人装配方法的方式,通过获取装配体的CAD模型,其中,装配体包括多个零件;基于CAD模型,提取零件三维网格模型和多个零件的配合关系;根据零件三维网格模型和多个零件的配合关系,构建装配先序关系和仿真环境;基于装配先序关系,枚举可行装配序列,得到多个候选装配序列;基于多个候选装配序列和预设优化目标函数,对多个零件分别采样候选抓取姿态并进行碰撞检测,确定目标装配序列以及多个零件各自对应的目标抓取姿势,其中,预设优化目标函数以装配序列与抓取姿势在预设的多维度指标下评价最优为目标;基于目标装配序列和多个零件各自对应的目标抓取姿势,生成运动轨迹;基于仿真环境,以运动轨迹为基准,采用强化学习算法训练,得到目标强化学习网络,其中,目标强化学习网络用于基于末端位姿输出纠偏残差动作;控制机器人基于运动轨迹移动并在机器人进入装配阶段的情况下,获取机器人的当前末端位姿;将当前末端位姿输入至目标强化学习网络中,得到当前纠偏残差动作;基于当前纠偏残差动作,对机器人的末端进行控制使得机器人装配当前零件,达到了通过CAD模型自动解析生成装配先序关系与抓取姿态,并利用强化学习在接触阶段输出规划轨迹的残差纠偏量的目的,从而实现了提高装配效率和成功率的技术效果,进而解决了由于传统方法依赖人工经验导致装配策略生成效率低、接触阶段缺乏实时纠偏能力导致装配成功率低的技术问题。
Smart Images

Figure CN122975633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotics, and more specifically, to a robot assembly method, apparatus, non-volatile storage medium, and computer equipment. Background Technology
[0002] Automated assembly systems play a crucial role in high-precision manufacturing fields such as electronics, automotive, and aerospace. Traditional industrial assembly systems largely rely on manual teaching or rule-based programming, where engineers manually plan assembly paths, set gripping postures, and configure fixtures and robot motion sequences based on product design drawings. In recent years, some advanced systems have attempted to introduce offline programming (OLP) and digital twin technologies, combining them with 3D modeling software (such as CAD) for assembly simulation and path prediction to improve automation levels.
[0003] Currently, the technical solutions for automated assembly planning still have the following significant shortcomings when facing actual industrial assembly tasks involving multiple parts, dual-arm collaboration, and complex geometries:
[0004] The ability to plan long-term assembly sequences is weak: the assembly of multiple parts involves complex sequential dependencies, grip switching, and path obstacle avoidance. Traditional planning methods are difficult to solve efficiently under combinatorial explosion, especially in complex working conditions such as dual-arm collaboration and alternating grip, making it difficult to generate feasible and efficient assembly sequences within a reasonable time.
[0005] Poor robustness during the contact phase: In high-contact-force operations such as insertion and snapping, even minor geometric errors, material deformations, or positioning deviations can easily lead to assembly failure. Pure planning methods lack real-time correction capabilities, while end-to-end learning methods struggle to cover long-sequence action combinations, resulting in frequent failures due to unstable control at the moment of contact.
[0006] Limited generalization ability: Existing systems are extremely sensitive to assembly orientation, gripping posture, and changes in part geometry. Once the product is changed or the process is adjusted, it is usually necessary to redesign constraints, adjust parameters, or even retrain the model, resulting in high deployment costs and making it difficult to meet the flexible requirements of multi-variety, small-batch production.
[0007] There is currently no effective solution to the above problems. Summary of the Invention
[0008] This invention provides a robot assembly method, apparatus, non-volatile storage medium, and computer device to at least solve the technical problems of low assembly strategy generation efficiency and low assembly success rate due to the reliance on human experience in traditional methods.
[0009] According to one aspect of the present invention, a robot assembly method is provided, comprising: acquiring a CAD model of an assembly, wherein the assembly includes multiple parts; extracting a three-dimensional mesh model of the parts and the mating relationships of the multiple parts based on the CAD model; constructing an assembly priority relationship and a simulation environment based on the three-dimensional mesh model of the parts and the mating relationships of the multiple parts; enumerating feasible assembly sequences based on the assembly priority relationship to obtain multiple candidate assembly sequences; and sampling candidate grasping postures for multiple parts and performing collision detection based on the multiple candidate assembly sequences and a preset optimization objective function to determine a target assembly sequence and the target grasping postures corresponding to each of the multiple parts, wherein the preset optimization objective function is used to determine the assembly priority relationship of the multiple parts and the simulation environment. The goal is to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators. Based on the target assembly sequence and the target grasping postures corresponding to multiple parts, motion trajectories are generated. Using the motion trajectory as a benchmark, a reinforcement learning algorithm is used to train a target reinforcement learning network in a simulation environment. This network is used to output correction residual actions based on the end-effector pose. The robot is controlled to move based on the motion trajectory, and when it enters the assembly stage, the current end-effector pose is obtained. This pose is then input into the target reinforcement learning network to obtain the current correction residual action. Based on this residual action, the robot's end-effector is controlled to assemble the current part.
[0010] Optionally, based on multiple candidate assembly sequences and a preset optimization objective function, candidate grasping postures are sampled for multiple parts and collision detection is performed to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts. This includes: randomly generating multiple initial grasping posture candidate sets, wherein each initial grasping posture candidate set includes a candidate posture corresponding to each of the multiple parts; performing collision detection on the multiple initial grasping posture candidate sets and eliminating infeasible grasping postures to obtain a set of feasible grasping postures; constructing an assembly state search tree based on the set of feasible grasping postures, wherein nodes represent assembly states, and assembly states include a set of parts that have been assembled, parts to be assembled, and corresponding grasping postures; traversing the edges in the assembly state search tree, scoring each edge based on the preset optimization objective function to obtain the scores corresponding to each of the multiple branches in the assembly state search tree; selecting the branch path with the highest cumulative score based on the scores corresponding to each of the multiple branches in the assembly state search tree to determine the target assembly sequence, wherein the branch path includes multiple edges; and extracting the grasping postures corresponding to each part on the branch path corresponding to the target assembly sequence as the target grasping postures corresponding to each of the multiple parts.
[0011] Optionally, the multi-dimensional indicators include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators. The grasping stability indicator is used to evaluate the support range of the part's center of gravity and the torque margin against external forces under the grasping posture. The operational efficiency indicator is used to evaluate the switching cost between the grasping postures of adjacent parts. The assembly feasibility indicator is used to evaluate whether the grasping posture and motion trajectory interfere with environmental obstacles.
[0012] Optionally, based on the simulation environment and using the motion trajectory as a reference, a reinforcement learning algorithm is used to train the target reinforcement learning network, including: setting a normalized coordinate system with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin; obtaining the training end-effector pose and the training assembly pose based on the simulation environment and the motion trajectory; mapping the training end-effector pose and the training assembly pose to the normalized coordinate system through a spatial transformation matrix to obtain the mapped end-effector pose and the mapped assembly pose; inputting the mapped end-effector pose and the mapped assembly pose into the initial reinforcement learning network to output the initial correction residual action; combining the initial correction residual action with the mapped end-effector pose to determine the new end-effector pose; and updating the parameters of the initial reinforcement learning network by minimizing the distance between the new end-effector pose and the mapped assembly pose in the normalized coordinate system as a reward signal to obtain the target reinforcement learning network.
[0013] Optionally, controlling the robot to move based on a motion trajectory and obtaining the robot's current end-effector pose when the robot enters the assembly stage includes: real-time monitoring of the distance between the robot's end-effector and the current part; determining that the robot has entered the assembly stage when the distance is less than a preset distance threshold; and obtaining the robot's current end-effector pose.
[0014] Optionally, based on the current correction residual action, the robot's end effector is controlled to assemble the assembly, including: determining the reference action command of the motion trajectory at the current moment; superimposing the current correction residual action onto the reference action command to obtain the final control command; controlling the robot's end effector to perform pose adjustment based on the final control command; and repeatedly executing the steps of obtaining the current end effector pose, inputting the target reinforcement learning network to obtain the current correction residual action, and obtaining the above-mentioned final control command at a preset control frequency until the current part is assembled.
[0015] According to another aspect of the present invention, a robot assembly apparatus is also provided, comprising: an acquisition module for acquiring a CAD model of an assembly, wherein the assembly includes multiple parts; an extraction module for extracting a three-dimensional mesh model of the parts and the mating relationships of the multiple parts based on the CAD model; a construction module for constructing an assembly priority relationship and a simulation environment based on the three-dimensional mesh model of the parts and the mating relationships of the multiple parts; an enumeration module for enumerating feasible assembly sequences based on the assembly priority relationship to obtain multiple candidate assembly sequences; and a determination module for sampling candidate grasping postures of the multiple parts and performing collision detection based on the multiple candidate assembly sequences and a preset optimization objective function to determine a target assembly sequence and the target grasping postures corresponding to each of the multiple parts, wherein the preset optimization objective function is used to determine the assembly priority relationship and the target grasping postures corresponding to each of the multiple parts. The objective is to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators. The generation module generates motion trajectories based on the target assembly sequence and the corresponding target grasping postures for multiple parts. The training module trains a target reinforcement learning network using a reinforcement learning algorithm based on the motion trajectory in a simulation environment. This network outputs correction residual actions based on the end-effector pose. The control module controls the robot's movement based on the motion trajectory and acquires the robot's current end-effector pose when the robot enters the assembly stage. The input module inputs the current end-effector pose into the target reinforcement learning network to obtain the current correction residual action. The assembly module controls the robot's end-effector based on the current correction residual action to assemble the current part.
[0016] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located is controlled to execute any of the above-described robot assembly methods.
[0017] According to another aspect of the present invention, a computer device is also provided, the computer device including a processor for running a program, wherein the program executes any of the robot assembly methods described above when it runs.
[0018] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements any of the robot assembly methods described above.
[0019] In this embodiment of the invention, a robot assembly method is employed. This involves acquiring a CAD model of the assembly, which includes multiple parts; extracting 3D mesh models of the parts and their mating relationships based on the CAD model; constructing assembly priority relationships and a simulation environment based on the 3D mesh models and mating relationships; enumerating feasible assembly sequences based on the assembly priority relationships to obtain multiple candidate assembly sequences; sampling candidate grasping postures for multiple parts and performing collision detection based on the multiple candidate assembly sequences and a preset optimization objective function to determine the target assembly sequence and the target grasping postures corresponding to each part. The preset optimization objective function aims to optimize the assembly sequence and grasping postures under preset multi-dimensional indicators; generating motion trajectories based on the target assembly sequence and the target grasping postures corresponding to each part; and using the simulation environment to determine the motion trajectory. Based on the trajectory, a reinforcement learning algorithm is used to train a target reinforcement learning network. This network is used to output correction residual actions based on the end-effector pose. The robot is controlled to move based on the motion trajectory, and when it enters the assembly stage, the current end-effector pose is obtained. This pose is then input into the target reinforcement learning network to obtain the current correction residual action. Based on this residual action, the robot's end-effector is controlled to assemble the current part. This achieves the goal of automatically generating assembly sequence relationships and grasping postures through CAD model analysis, and using reinforcement learning to output the residual correction amount of the planned trajectory during the contact stage. This improves assembly efficiency and success rate, thus solving the technical problems of low assembly strategy generation efficiency due to reliance on human experience in traditional methods and low assembly success rate due to the lack of real-time correction capabilities during the contact stage. Attached Figure Description
[0020] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0021] Figure 1 A hardware structure block diagram of a computer terminal for implementing a robot assembly method is shown.
[0022] Figure 2 This is a flowchart illustrating a robot assembly method provided according to an embodiment of the present invention;
[0023] Figure 3 This is a structural block diagram of a robot assembly device provided according to an embodiment of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] According to an embodiment of the present invention, a method embodiment of a robot assembly method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0027] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a robot assembly method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1The different configurations shown.
[0028] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0029] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the robot assembly method in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the robot assembly method of the aforementioned application. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0030] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0031] Figure 2 This is a flowchart illustrating the robot assembly method provided according to an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following steps:
[0032] Step S202: Obtain the CAD model of the assembly, wherein the assembly includes multiple parts.
[0033] In this step, the input assembly CAD model file is first received. This model file describes the overall structure of the product to be assembled and the spatial distribution and connection relationships of its internal parts. The CAD file formats supported by this invention have broad compatibility, including but not limited to the OBJ format for importing 3D mesh models, the URDF format for describing robot kinematic models, and the STL and STEP formats indirectly supported through the trimesh conversion interface.
[0034] After acquiring the CAD model file, the system executes an automated parsing process to extract the 3D mesh models of each part that constitutes the assembly. Simultaneously, the system conducts in-depth analysis of the spatial topological relationships between the parts, extracting key geometric features, mating relationships, and surface normal information. This extracted information forms the geometric data foundation required for subsequent assembly planning, ensuring that subsequent algorithms can accurately understand the physical properties of the parts and the constraints between them.
[0035] Furthermore, during the analysis process, the system needs to construct and clarify the assembly constraint relationships between the parts in the assembly, that is, to determine which parts must be assembled before other parts. This invention uses set theory to formally represent these assembly constraint relationships. Specifically, the assembly constraint relationships are defined as follows:
[0036]
[0037] In the above formula, This represents an assembly priority relationship diagram, which is a directed graph used to describe the assembly dependency order between parts; 'o' represents the part to be assembled. This indicates that the assembly of all parts must be completed before assembling part o.
[0038] To achieve efficient assembly sequence planning, the system employs a reverse decomposition analysis algorithm to hierarchically decompose the assembly. The system divides the entire assembly into multiple "decomposable levels" and generates a directed assembly diagram with minimum necessary constraints. This reverse decomposition-based analysis method automatically identifies critical dependency paths in the assembly process and filters out redundant constraints, thus providing clear structured data support for generating feasible assembly sequences. Through these steps, the original CAD model is transformed into structured data containing geometric information, topological relationships, and assembly constraints, which can then be used by the subsequent hierarchical assembly planning module.
[0039] Step S204: Based on the CAD model, extract the 3D mesh model of the part and the mating relationship of multiple parts.
[0040] In this step, the system first analyzes the overall CAD model of the assembly, using a 3D mesh processing tool to decompose the assembly into individual part units, and extracts the 3D mesh model of each part. These 3D mesh models accurately record the surface geometry information of each part, including vertex coordinates, facet connection relationships, and surface normals, providing a high-precision geometric foundation for subsequent collision detection, grasping posture generation, and physical simulation.
[0041] Furthermore, after extracting the 3D mesh model of the parts, the system analyzes the spatial positions and contact features between the parts to extract the mating relationships between multiple parts. A mating relationship refers to the constraint, connection, or relative motion relationship between parts during assembly, such as hole-shaft mating, snap-fit connections, and screw fixing. The system automatically identifies the mating type and direction between parts by analyzing the topological proximity, normal consistency, and preset assembly semantic tags between the part meshes.
[0042] By extracting the 3D mesh model of the parts and the mating relationships of multiple parts, the system realizes the transformation from unstructured CAD design data to structured assembly knowledge data, ensuring that the assembly logic and geometric constraints of the product can be accurately understood in the subsequent planning stage.
[0043] Step S206: Based on the 3D mesh model of the parts and the mating relationships of multiple parts, construct the assembly sequence relationship and simulation environment.
[0044] In this step, the system first uses the extracted mating relationships of multiple parts to deduce the assembly dependency logic between each part through a reverse disassembly analysis algorithm, thereby constructing the assembly priority relationship. The assembly priority relationship is represented in the form of a directed graph. In this graph, nodes represent individual parts in the assembly, and directed edges represent the assembly sequence constraints. If there are parts in the graph... Pointing parts A directed edge, that is, a directed edge representing... → Its physical meaning is parts. Must be in the parts Previously completed assembly, or rather parts The assembly process depends on the parts It is already in the correct position. Through this reverse disassembly based on mate relationships, the system can automatically identify the "demountable levels" in the assembly, generate a directed assembly diagram with minimum necessary constraints, and thus clarify the global sequence constraints in long-term assembly tasks.
[0045] Furthermore, the system simultaneously constructs a simulation environment for algorithm verification and strategy training. This simulation environment construction process includes several sub-steps: First, the extracted 3D mesh model of the part is converted into a physical model recognizable by the simulation engine, and a simplified bounding box or mesh model for collision detection is generated to ensure the accuracy and computational efficiency of the physical simulation. Second, a robot kinematics description file is generated, typically in URDF format, defining in detail the robot's link parameters, joint types, extreme positions, and inertial properties, thereby reconstructing the kinematic model of the robot platform to be used (such as the JAKA dual-arm robot system) in the simulation environment. In addition, the system configures other parameters in the simulation environment according to the specific requirements of the assembly task, including physical properties such as gravity field, friction coefficient, and damping coefficient, as well as the initial placement position of the part and static obstacle models such as the worktable.
[0046] Step S208: Based on the assembly precedence relationship, enumerate feasible assembly sequences to obtain multiple candidate assembly sequences.
[0047] In this step, based on the assembly precedence graph as constraints, graph traversal or backtracking search algorithms are used to arrange and combine the assembly order of parts. Since the assembly precedence graph defines the dependencies between parts, for example, if edges exist... → Then the parts Must appear in parts Previously, any valid assembly sequence must therefore satisfy the topological sorting requirements of the directed graph.
[0048] During the enumeration process, the system starts from the initial state, where all parts are unassembled, and progressively attempts to add parts that meet the preconditions to the current assembly sequence. For each candidate part, the system checks whether all its preconditions have already been assembled in the sequence. If the conditions are met, the part is taken as the next assembly object, and the search for subsequent parts continues recursively. In this way, the system can exhaustively enumerate all sequence permutations that meet the assembly logic constraints. These permutations constitute a candidate assembly sequence set, and each candidate sequence represents a possible global assembly strategy.
[0049] To further filter out high-quality assembly sequences, the system does not directly accept all enumerated results. Instead, it performs preliminary screening and optimization of multiple candidate assembly sequences based on specific evaluation metrics. The system constructs an assembly state tree, where each state is defined as... , where t represents the robot's current task type (Assemble or Hold). Let be the set of assembled parts, 'o' be the currently operated part, and 'g' be the corresponding grasping posture. Based on this, the system sorts and optimizes candidate sequences by evaluating indicators such as grasping stability and assembly feasibility. This provides a set of highly feasible baseline assembly sequences for subsequent motion trajectory planning, effectively reducing the combinatorial explosion problem in long-term planning and ensuring that the generated assembly sequence is logically complete and has execution potential.
[0050] Step S210: Based on multiple candidate assembly sequences and a preset optimization objective function, sample candidate grasping postures for multiple parts and perform collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts. The preset optimization objective function aims to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators.
[0051] In this step, the system first samples and generates multiple candidate grasping postures within the potential operable space of each part in the assembly. For each part, the system performs assembly grasping feasibility checks and gripping grasping feasibility checks. In the assembly grasping feasibility check, the system verifies whether the candidate grasping postures will collide with assembled parts during the assembly process; in the gripping grasping feasibility check, the system verifies whether the candidate grasping postures will cause interference between parts during the execution of assembly actions. In addition, for dual-arm collaborative scenarios, the system also performs grasping pair filtering to ensure that no collision occurs when both arms perform grasping actions simultaneously. After the above collision detection and filtering, feasible grasping postures that satisfy both accessibility and collision risk are retained to form the final grasping candidate set.
[0052] Subsequently, the system introduces a preset optimization objective function to jointly evaluate the candidate assembly sequences and their corresponding grasping postures. This optimization process is modeled as a state-space search problem, and the system constructs an assembly state tree, where each state is defined as... Where t represents the robot's current task type, Let be the set of assembled parts, 'o' be the currently operated part, and 'g' be the corresponding gripping posture. The preset optimization objective function aims to maximize the comprehensive score of the assembly sequence and gripping posture under preset multi-dimensional indicators. The specific optimization objective function is expressed as follows:
[0053]
[0054] in, The optimal assembly sequence. To correspond to the optimal crawling strategy; This represents the k-th crawling quality indicator, including but not limited to crawling stability, support, torque stability, and crawling switching count; The weighting coefficients for each indicator reflect their importance in the overall evaluation. By calculating this objective function, the system can quantitatively assess the performance of different assembly sequences and gripping posture combinations.
[0055] Ultimately, while satisfying assembly priority constraints and collision detection constraints, the system searches for the state combination that maximizes the objective function value, thereby determining the target assembly sequence and the target grasping postures corresponding to each part. This process not only considers the correctness of the assembly logic but also comprehensively takes into account the stability, efficiency, and safety of the robotic arm operation, ensuring that the generated assembly strategy has high robustness and high efficiency when executed in the industrial field.
[0056] Step S212: Generate motion trajectories based on the target assembly sequence and the target grasping postures corresponding to each of the multiple parts.
[0057] In this step, given the key configurations, including the initial grasping pose, assembly contact pose, and intermediate transfer pose, the system uses a sampling-based path planning algorithm to generate the motion trajectories of each joint of the robot. Preferably, the system uses the RRT-Connect algorithm for parallel trajectory planning. This algorithm searches for feasible paths in free space by rapidly expanding a random tree, effectively handling the motion planning problem of high-DOF robots (such as 7-DOF or 14-DOF dual-arm systems) under complex constraints.
[0058] During trajectory generation, the system first determines the robot's initial pose on each part based on the target grasping posture, and then determines the transfer order between parts based on the target assembly sequence. For each pair of adjacent key poses, the system treats it as a sub-path planning task. The RRT-Connect algorithm randomly samples points in the configuration space and gradually expands towards the target point, while rigorously detecting whether the sampled path collides with the surrounding environment, including assembled parts, the worktable, fixtures, and the robot's own links. Only when the generated path is completely in free space and satisfies the robot's kinematic constraints will the path segment be retained.
[0059] In this way, the system generates a series of continuous, collision-free motion trajectory segments for the entire assembly process. These trajectory segments cover the entire process from part picking, spatial transfer, precise positioning to final assembly contact. The generated motion trajectories not only ensure the global reachability of the robot's actions but also ensure the smoothness and efficiency of the path through optimization algorithms, providing a high-quality initial trajectory benchmark for the subsequent reinforcement learning module to perform local corrections during the contact phase. Ultimately, these planned motion trajectories will serve as execution commands for non-contact phases (such as handling and positioning), directly driving the robot to perform the corresponding actions.
[0060] Step S214: Based on the simulation environment and the motion trajectory as a reference, a reinforcement learning algorithm is used to train the target reinforcement learning network, which is used to output the correction residual action based on the end pose.
[0061] In this step, the system constructs a training environment, initializes the simulation environment based on the planning results, and sets the robot's initial and target states. The system employs the Proximal Policy Optimization (PPO) algorithm for reinforcement learning training, which is a type of policy gradient reinforcement learning algorithm. The network structure uses a Multilayer Perceptron (MLP) with hidden layers configured as [256, 128, 64] and using the ELU activation function.
[0062] During training, the system introduces a path center coordinate transformation mechanism, which maps insertion actions in any direction to the standard coordinate system of "top insertion" through transformations such as SE(3), thereby simplifying the state space. Simultaneously, the system employs a planning-guided residual action mechanism. The reinforcement learning strategy does not generate actions from zero, but rather uses the planned trajectory as a reference, only outputting the correction residual. Specifically, the state space includes the end-effector position, target position, and contact state; the action space includes the end-effector pose increment. The reward function is designed in a minimalist form, calculating only the negative L2 distance between the current end-effector position and the target assembly position, as shown in the following formula:
[0063]
[0064] Where p is the current end position. For the target assembly location, This represents the L2 norm. Since the initial state is precisely aligned by the plan, no complex reward shaping is required, and this reward function can directly guide the network to learn to minimize the terminal position error.
[0065] Furthermore, to improve the transferability of the simulation strategy to the real world, the system introduces a structured domain randomization mechanism during training. For example, a pose random perturbation of approximately 3 mm is added to the initial state to adapt the strategy to the uncertainties of the real physical environment. Through multiple rounds of iterative training, the system updates the robot control strategy, ultimately obtaining the target reinforcement learning network. This network can receive the current end-effector pose information and output small correction residual actions, enabling the final executed action. ,in To plan trajectory movements, This is the correction value output by the RL network, thereby achieving high-precision contact assembly control.
[0066] Step S216: Control the robot to move based on the motion trajectory and, when the robot enters the assembly stage, obtain the current end-effector pose of the robot.
[0067] In this step, the system first sends instructions to the robot through the control interface, driving the robot to move according to the motion trajectory generated in step S212. In this non-contact phase, the robot mainly performs handling, spatial transfer, and preliminary positioning operations. Its movement is strictly driven by the planned trajectory, ensuring that the robot can safely and efficiently move the parts from the gripping position to the vicinity of the assembly target.
[0068] When the robot approaches the assembly target, and the sensors detect contact force or the system determines that the robot has entered the assembly stage (such as insertion, pressing, or other high-contact force operations), the system enters a real-time control loop. At this time, the system acquires the robot's current end-effector pose in real time through robot joint encoders, end-effector force / torque sensors (such as Robotiq force / torque sensors), and a vision positioning system (such as a hand-eye calibrated binocular vision or structured light camera). The current end-effector pose includes the robot's end-effector position coordinates and attitude angles. This data reflects the robot's actual execution state in the real physical environment and includes actual pose information introduced by manufacturing tolerances, clamping errors, or physical deviations.
[0069] After acquiring the current end-effector pose, the system passes it as input to the target reinforcement learning network. Based on the difference between the current end-effector pose and the planned target pose, and combined with contact state information, this network calculates and outputs the correction residual action. By acquiring and processing the current end-effector pose in real time, the system achieves a transition from open-loop planning to closed-loop control, ensuring that the robot can use reinforcement learning strategies to correct minor geometric errors or positioning deviations in real time, thereby guaranteeing the accuracy and success rate of assembly operations.
[0070] Step S218: Input the current end pose into the target reinforcement learning network to obtain the current correction residual action.
[0071] In this step, the system uses the acquired current end-effector pose as input data, along with other state information (such as target position, contact state, etc.), and inputs it into the target reinforcement learning network. This target reinforcement learning network adopts a multilayer perceptron (MLP) architecture, with its hidden layer configured as [256, 128, 64], and uses the ELU activation function. The network structure has been optimized to ensure real-time performance during industrial deployment.
[0072] During the input processing phase, the system first utilizes a path center coordinate transformation mechanism to uniformly map insertion tasks in any direction to the canonical coordinate system of "top insertion," enabling reinforcement learning policies to be represented in a unified state space and thus improving the generalization ability of the policies. Subsequently, the network calculates the output layer values through forward propagation based on the difference between the current end-effector pose and the target assembly position, as well as the current contact state.
[0073] The network output is the current correction residual action. The residual action represents a tiny correction to the planned trajectory, with its range strictly limited: approximately ±2mm for position correction and ±2° for attitude correction. This planning-guided residual action mechanism eliminates the need for reinforcement learning strategies to generate actions from scratch, focusing instead on correcting local errors. This significantly reduces learning complexity and improves control stability. Ultimately, the current correction residual action obtained by the system is used to generate the final robot control commands, enabling real-time, high-precision correction of minute deviations during assembly.
[0074] Step S220: Based on the current correction residual action, control the robot's end effector to assemble the current part.
[0075] In this step, the system will perform the current correction residual action. Compared with the baseline motion trajectory generated during the planning phase By superimposing the data, the final control action 'a' of the robot's end effector is calculated. The formula for this action synthesis is:
[0076]
[0077] in, This represents the target pose or velocity command corresponding to the collision-free motion trajectory generated by path planning algorithms such as RRT-Connect. This represents the small, residual actions output by the target reinforcement learning network. Through this residual action mechanism, the robot can compensate for local errors caused by geometric errors, material deformation, or positioning deviations in real time, while maintaining the rationality of the global motion path.
[0078] During control execution, the robot controller receives the final action. The system drives the robotic arm's end effector (such as the Robotiq two-finger gripper) to fine-tune during the current contact phase. If the system detects that the contact force exceeds a preset threshold or the end effector position has not reached the target position, the reinforcement learning strategy will continuously output correction residuals until the assembly task is completed or the contact state is released. Furthermore, to suppress error accumulation during the transition from simulation to reality, the system also introduces a PLAI (Path-integrated Learning with Action Integration) mechanism at the control level, integrating actions to the desired state rather than the current state, thereby further improving the stability and robustness of the assembly process. Through these control strategies, the robot can overcome minor deviations and achieve high-precision insertion, snap-fit, and other contact assembly operations, ensuring a high assembly success rate.
[0079] Through the above steps, a fully automated and robust generation process can be achieved, from the product's 3D CAD model to the robot's executable strategy, ultimately completing the automated assembly task of complex multi-part components.
[0080] As an optional embodiment, this can be achieved through the following steps: Based on multiple candidate assembly sequences and a preset optimization objective function, sample candidate grasping postures for multiple parts and perform collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, including: randomly generating multiple initial grasping posture candidate sets, wherein each initial grasping posture candidate set includes a candidate posture corresponding to each of the multiple parts; performing collision detection on the multiple initial grasping posture candidate sets and eliminating infeasible grasping postures to obtain a set of feasible grasping postures; constructing an assembly state search tree based on the set of feasible grasping postures, wherein nodes represent assembly states, and assembly states include a set of parts that have been assembled, parts to be assembled, and corresponding grasping postures; traversing the edges in the assembly state search tree, scoring each edge based on the preset optimization objective function to obtain the scores corresponding to each of the multiple branches in the assembly state search tree; selecting the branch path with the highest cumulative score based on the scores corresponding to each of the multiple branches in the assembly state search tree to determine the target assembly sequence, wherein the branch path includes multiple edges; extracting the grasping posture corresponding to each part on the branch path corresponding to the target assembly sequence as the target grasping posture corresponding to each of the multiple parts.
[0081] Optionally, the system first randomly generates multiple initial grasping posture candidate sets, each containing one candidate posture corresponding to multiple parts. Then, collision detection is performed on these candidate sets, and infeasible grasping postures are eliminated to obtain a set of feasible grasping postures. During collision detection, the system performs assembly grasping feasibility checks and gripping grasping feasibility checks to ensure that candidate grasping postures do not collide with assembled parts during assembly and do not cause interference between parts during assembly actions. Furthermore, for dual-arm collaborative scenarios, the system also performs grasping pair filtering to ensure that both arms do not collide when performing grasping actions simultaneously, thus retaining feasible grasping postures that meet accessibility requirements and have no collision risk.
[0082] Next, the system constructs an assembly state search tree based on the set of feasible grasping postures. Each node represents an assembly state, which includes the set of assembled parts, the parts to be assembled, and the corresponding grasping posture. In this search tree, each state is defined as... ,in Indicates the robot's current task type. A collection of parts that have been assembled. For the currently operating part, To correspond to the grasping posture, the system traverses the edges in the assembly state search tree, scores each edge based on a preset optimization objective function, and obtains the scores corresponding to multiple branches in the assembly state search tree. The preset optimization objective function aims to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators, and its specific form is as follows:
[0083]
[0084] in, The optimal assembly sequence. To correspond to the optimal crawling strategy; This represents the k-th crawling quality indicator, including but not limited to crawling stability, support, torque stability, and crawling switching count; The weighting coefficients for each indicator reflect their importance in the overall evaluation. By calculating this objective function, the system can quantitatively assess the performance of different assembly sequences and gripping posture combinations.
[0085] Finally, based on the scores corresponding to multiple branches in the assembly state search tree, the system selects the branch path with the highest cumulative score to determine the target assembly sequence, where each branch path includes multiple edges. This branch path represents the optimal execution order under the conditions of satisfying assembly constraints and optimization objectives. Subsequently, the system extracts the grasping posture corresponding to each part on the branch path corresponding to the target assembly sequence as the target grasping posture for each part. Through this search tree-based joint optimization method, the system can comprehensively consider the interaction between assembly order and grasping posture on a global scale, thereby determining an assembly strategy that satisfies both logical constraints and high execution quality.
[0086] As an optional embodiment, it can be achieved through the following steps: multi-dimensional indicators include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators. Among them, the grasping stability indicator is used to evaluate the support range of the center of gravity of the part and the torque margin to resist external forces under the grasping posture; the operational efficiency indicator is used to evaluate the switching cost between the grasping postures of adjacent parts; and the assembly feasibility indicator is used to evaluate whether the grasping posture and motion trajectory interfere with environmental obstacles.
[0087] Optionally, the multi-dimensional indicators in the preset optimization objective function specifically include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators. The grasping stability indicator is used to evaluate the support range of the part's center of gravity and the torque margin when resisting external forces under a specific grasping posture, ensuring that the part will not slip or overturn during handling and assembly. The operational efficiency indicator is used to evaluate the switching cost between two adjacent parts in the grasping posture, aiming to reduce the robot arm's idle travel time and posture adjustment time, thereby improving the overall assembly cycle time. The assembly feasibility indicator is used to evaluate whether the robot's end effector and linkage interfere with obstacles in the surrounding environment during the selected grasping posture and corresponding motion trajectory, ensuring the global accessibility and safety of the assembly action.
[0088] When scoring the edges in the assembly state search tree based on a preset optimization objective function, the system calculates the values of the three indicators mentioned above on the corresponding edges. The grasping stability indicator is quantified by calculating the projection position of the part's center of gravity within the convex hull formed by the grasping point and the ratio of external torque to maximum resistive torque. The operational efficiency indicator is quantified by calculating the distance and time consumption between the current grasping posture and the previous part grasping posture in joint space or Cartesian space. The assembly feasibility indicator is determined by detecting collisions between trajectory segments and obstacle sets using a path planning algorithm; a high score is awarded if there are no collisions, and a low score or penalty value is awarded otherwise. The system integrates these three indicators into a comprehensive score based on the weighting coefficients of each indicator. This comprehensive score guides the traversal of the assembly state search tree and the selection of the optimal branch path, thereby ensuring that the generated target assembly sequence and target grasping posture achieve global optimization in terms of stability, efficiency, and feasibility.
[0089] As an optional embodiment, this can be achieved through the following steps: Based on a simulation environment and using the motion trajectory as a reference, a reinforcement learning algorithm is used to train and obtain the target reinforcement learning network, including: setting a normalized coordinate system with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin; based on the simulation environment and using the motion trajectory as a reference, obtaining the training end-effector pose and the training assembly pose; mapping the training end-effector pose and the training assembly pose to the normalized coordinate system through a spatial transformation matrix to obtain the mapped end-effector pose and the mapped assembly pose; inputting the mapped end-effector pose and the mapped assembly pose into the initial reinforcement learning network to output the initial correction residual action; combining the initial correction residual action with the mapped end-effector pose to determine the new end-effector pose; updating the parameters of the initial reinforcement learning network by minimizing the distance between the new end-effector pose and the mapped assembly pose in the normalized coordinate system as a reward signal to obtain the target reinforcement learning network.
[0090] Optionally, the system first establishes a standardized coordinate system with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin, thus providing a unified spatial reference for assembly tasks in different directions. Subsequently, based on the simulation environment and the motion trajectory, the system acquires the current end-effector pose and the target assembly pose during the training process. To eliminate the influence of assembly direction differences on the reinforcement learning strategy, the system uses a spatial transformation matrix to map the acquired training end-effector pose and training assembly pose to the aforementioned standardized coordinate system, obtaining the mapped end-effector pose and the mapped assembly pose.
[0091] Next, the system inputs the mapped end-effector pose and the mapped assembly pose as state inputs to the initial reinforcement learning network. The network outputs initial correction residual actions after forward propagation. The system combines the initial correction residual actions with the mapped end-effector pose to determine a new end-effector pose, which represents the actual desired position of the robot's end effector after correction. To train the network to minimize position error, the system calculates the distance between the new end-effector pose and the mapped assembly pose in the normalized coordinate system, and uses the negative value of this distance as a reward signal. Specifically, the reward function is defined as:
[0092]
[0093] Where p represents the new end-effector pose. This represents the mapped assembly pose. Based on this reward signal, the system updates the parameters of the initial reinforcement learning network using the Proximal Policy Optimization (PPO) algorithm. By iteratively executing the above process, the network gradually learns how to output effective correction residual actions in a normalized coordinate system. This enables the robot to perform high-precision local correction based on the planned trajectory during actual assembly, ultimately resulting in a stable target reinforcement learning network.
[0094] As an optional embodiment, this can be achieved through the following steps: controlling the robot to move based on a motion trajectory and obtaining the robot's current end-effector pose when the robot enters the assembly stage, including: real-time monitoring of the distance between the robot's end-effector and the current part; determining that the robot has entered the assembly stage when the distance is less than a preset distance threshold; and obtaining the robot's current end-effector pose.
[0095] Optionally, during the non-contact handling and positioning process where the robot executes the motion trajectory generated by the planning module, the system monitors the distance between the robot's end effector and the part to be assembled in real time. This distance monitoring can be calculated using visual sensor data, LiDAR data, or predicted position based on a kinematic model. The system compares the real-time monitored distance with a preset distance threshold, which is typically set as a small safety distance to define the boundary between the non-contact motion phase and the contact assembly phase.
[0096] When the real-time monitored distance is less than a preset distance threshold, the system determines that the robot has approached the target assembly position and enters the assembly stage. At this point, the system stops pure open-loop trajectory tracking control and activates a closed-loop correction control mechanism. Simultaneously with determining entry into the assembly stage, the system immediately acquires the robot's current end-effector pose, which includes the precise position and orientation angle of the robot's end-effector in three-dimensional space. Data sources for acquiring the current end-effector pose can include feedback from the robot's joint encoders, data from the force / torque sensors mounted on the end-effector, and visual pose estimation after hand-eye calibration. In this way, the system can accurately capture the robot's actual physical state at the moment of contact, providing accurate state input for subsequently inputting the current end-effector pose into the target reinforcement learning network to calculate the correction residual action, ensuring that the initial state of the assembly operation conforms to the expected input range of the reinforcement learning strategy.
[0097] As an optional embodiment, this can be achieved through the following steps: controlling the robot's end effector to assemble the assembly based on the current correction residual action, including: determining the reference action command of the motion trajectory at the current moment; superimposing the current correction residual action onto the reference action command to obtain the final control command; controlling the robot's end effector to perform pose adjustment based on the final control command; and repeatedly executing the steps of obtaining the current end effector pose, inputting the target reinforcement learning network to obtain the current correction residual action, and obtaining the above-mentioned final control command at a preset control frequency until the current part is assembled.
[0098] Optionally, the system first determines the reference motion command for the motion trajectory at the current moment. This reference motion command corresponds to the target pose or velocity command at the current time step in the collision-free motion trajectory generated during the planning phase. Subsequently, the system superimposes the current correction residual motion onto the reference motion command to obtain the final control command. This superposition process is achieved through a formula... This is achieved. Through this residual superposition mechanism, the robot can compensate for local deviations in real time while following the global planning path, using reinforcement learning strategies.
[0099] Next, based on the final control command, the system controls the robot's end effector to adjust its pose. The robot controller receives the final control command and drives the robotic arm's end effector (such as a gripper) to make corresponding displacements or posture changes to approach the target assembly position. To ensure continuous correction, the system repeatedly executes the steps of acquiring the current end effector pose, inputting the current end effector pose into the target reinforcement learning network to obtain the current correction residual action, and calculating the aforementioned final control command at a preset control frequency (e.g., 100Hz, matching the force sensor sampling frequency). This closed-loop control process continues until the sensor detects an assembly completion signal (such as position detection, force control stabilization, or disappearance of contact force) or the preset maximum number of iterations is reached, thereby ensuring that the current part is accurately and stably assembled into position.
[0100] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that the robot assembly method according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0102] According to an embodiment of the present invention, a robot assembly apparatus for implementing the above-described robot assembly method is also provided. Figure 3 This is a structural block diagram of a robot assembly device provided according to an embodiment of the present invention, such as... Figure 3 As shown, the robot assembly device includes: an acquisition module 302, an extraction module 304, a construction module 306, an enumeration module 308, a determination module 310, a generation module 312, a training module 314, a control module 316, an input module 318, and an assembly module 320. The robot assembly device will be described below.
[0103] The acquisition module 302 is used to acquire the CAD model of the assembly, which includes multiple parts.
[0104] Extraction module 304 is used to extract the 3D mesh model of a part and the mating relationships of multiple parts based on the CAD model.
[0105] Module 306 is used to build assembly sequence relationships and simulation environment based on the 3D mesh model of the parts and the mating relationships of multiple parts.
[0106] Enumeration module 308 is used to enumerate feasible assembly sequences based on assembly precedence relationships to obtain multiple candidate assembly sequences.
[0107] The determination module 310 is used to sample candidate grasping postures for multiple parts and perform collision detection based on multiple candidate assembly sequences and a preset optimization objective function, and determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts. The preset optimization objective function aims to evaluate the assembly sequence and grasping posture as optimal under preset multi-dimensional indicators.
[0108] The generation module 312 is used to generate motion trajectories based on the target assembly sequence and the target grasping postures of multiple parts.
[0109] Training module 314 is used to train a target reinforcement learning network based on a simulation environment and a motion trajectory, using a reinforcement learning algorithm. The target reinforcement learning network is used to output correction residual actions based on the end pose.
[0110] The control module 316 is used to control the robot to move based on the motion trajectory and to obtain the current end-effector pose of the robot when the robot enters the assembly stage.
[0111] The input module 318 is used to input the current end pose into the target reinforcement learning network to obtain the current correction residual action.
[0112] Assembly module 320 is used to control the robot's end effector based on the current correction residual action, so that the robot assembles the current part.
[0113] It should be noted that the aforementioned acquisition module 302, extraction module 304, construction module 306, enumeration module 308, determination module 310, generation module 312, training module 314, control module 316, input module 318, and assembly module 320 correspond to steps S202 to S220 in the embodiments. Multiple modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of the device, can run on the computer terminal 10 provided in the embodiments.
[0114] Embodiments of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one of a plurality of network devices in a computer network. The computer device includes a memory and a processor.
[0115] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the robot assembly method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned robot assembly method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0116] The processor can access information and applications stored in memory via a transmission device to perform the following steps: acquiring a CAD model of an assembly, wherein the assembly includes multiple parts; extracting 3D mesh models of the parts and the mating relationships of the multiple parts based on the CAD model; constructing assembly priority relationships and a simulation environment based on the 3D mesh models of the parts and the mating relationships of the multiple parts; enumerating feasible assembly sequences based on the assembly priority relationships to obtain multiple candidate assembly sequences; sampling candidate grasping postures for multiple parts and performing collision detection based on the multiple candidate assembly sequences and a preset optimization objective function, determining the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, wherein the preset optimization objective function... The objective is to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators. Motion trajectories are generated based on the target assembly sequence and the target grasping postures corresponding to multiple parts. A reinforcement learning algorithm is used to train a target reinforcement learning network based on the motion trajectory in a simulation environment. This network is used to output correction residual actions based on the end-effector pose. The robot is controlled to move based on the motion trajectory, and when it enters the assembly stage, the current end-effector pose is obtained. The current end-effector pose is input into the target reinforcement learning network to obtain the current correction residual action. Based on the current correction residual action, the robot's end-effector is controlled to assemble the current part.
[0117] Optionally, the processor may also execute program code for the following steps: based on multiple candidate assembly sequences and a preset optimization objective function, sample candidate grasping postures for multiple parts and perform collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, including: randomly generating multiple initial grasping posture candidate sets, wherein each initial grasping posture candidate set includes a candidate posture corresponding to each of the multiple parts; performing collision detection on the multiple initial grasping posture candidate sets and eliminating infeasible grasping postures to obtain a set of feasible grasping postures; constructing an assembly state search tree based on the set of feasible grasping postures, wherein nodes represent assembly states, and assembly states include a set of parts that have been assembled, parts to be assembled, and corresponding grasping postures; traversing the edges in the assembly state search tree, scoring each edge based on the preset optimization objective function to obtain the scores corresponding to each of the multiple branches in the assembly state search tree; selecting the branch path with the highest cumulative score based on the scores corresponding to each of the multiple branches in the assembly state search tree to determine the target assembly sequence, wherein the branch path includes multiple edges; extracting the grasping postures corresponding to each part on the branch path corresponding to the target assembly sequence as the target grasping postures corresponding to each of the multiple parts.
[0118] Optionally, the processor may also execute program code for the following steps: multi-dimensional indicators include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators. The grasping stability indicator is used to evaluate the support range of the part's center of gravity and the torque margin against external forces under the grasping posture. The operational efficiency indicator is used to evaluate the switching cost between the grasping postures of adjacent parts. The assembly feasibility indicator is used to evaluate whether the grasping posture and motion trajectory interfere with environmental obstacles.
[0119] Optionally, the processor can also execute program code for the following steps: Based on the simulation environment and using the motion trajectory as a reference, a reinforcement learning algorithm is used to train and obtain the target reinforcement learning network, including: setting a normalized coordinate system with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin; based on the simulation environment and using the motion trajectory as a reference, obtaining the training end-effector pose and the training assembly pose; mapping the training end-effector pose and the training assembly pose to the normalized coordinate system through a spatial transformation matrix to obtain the mapped end-effector pose and the mapped assembly pose; inputting the mapped end-effector pose and the mapped assembly pose into the initial reinforcement learning network and outputting the initial correction residual action; combining the initial correction residual action with the mapped end-effector pose to determine a new end-effector pose; updating the parameters of the initial reinforcement learning network by minimizing the distance between the new end-effector pose and the mapped assembly pose in the normalized coordinate system as a reward signal to obtain the target reinforcement learning network.
[0120] Optionally, the processor may also execute program code for the following steps: controlling the robot to move based on a motion trajectory and, when the robot enters the assembly stage, obtaining the current end-effector pose of the robot, including: real-time monitoring of the distance between the robot end-effector and the current part; determining that the robot has entered the assembly stage when the distance is less than a preset distance threshold; and obtaining the current end-effector pose of the robot.
[0121] Optionally, the processor may also execute program code with the following steps: controlling the robot's end effector to assemble the assembly based on the current correction residual action, including: determining the reference action command of the motion trajectory at the current moment; superimposing the current correction residual action onto the reference action command to obtain the final control command; controlling the robot's end effector to perform pose adjustment based on the final control command; and repeatedly executing the steps of obtaining the current end effector pose, inputting the target reinforcement learning network to obtain the current correction residual action, and obtaining the above-mentioned final control command at a preset control frequency until the current part is assembled.
[0122] This invention provides a scheme for an automated assembly system and method based on CAD-driven hierarchical planning and reinforcement learning collaboration. The system obtains a CAD model of an assembly, which includes multiple parts. Based on the CAD model, it extracts 3D mesh models of the parts and the mating relationships of the multiple parts. Based on the 3D mesh models of the parts and the mating relationships of the multiple parts, it constructs assembly priority relationships and a simulation environment. Based on the assembly priority relationships, it enumerates feasible assembly sequences to obtain multiple candidate assembly sequences. Based on the multiple candidate assembly sequences and a preset optimization objective function, it samples candidate grasping postures for each of the multiple parts and performs collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts. The preset optimization objective function aims to optimize the assembly sequence and grasping postures under preset multi-dimensional indicators. Based on the target assembly sequence and the mating relationships of each of the multiple parts... The system generates a motion trajectory based on the target grasping posture. Using the motion trajectory as a baseline, a reinforcement learning algorithm is employed to train a target reinforcement learning network. This network is used to output correction residual actions based on the end-effector pose. The robot is controlled to move based on the motion trajectory, and its current end-effector pose is acquired when it enters the assembly stage. This current end-effector pose is input into the target reinforcement learning network to obtain the current correction residual action. Based on this correction residual action, the robot's end-effector is controlled to assemble the current part. This solves the technical problems of low assembly strategy generation efficiency due to reliance on human experience in traditional methods and low assembly success rate due to the lack of real-time correction capabilities during the contact stage.
[0123] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0124] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the robot assembly method provided in the above embodiments.
[0125] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0126] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a CAD model of an assembly, wherein the assembly includes multiple parts; extracting a 3D mesh model of the parts and the mating relationships of the multiple parts based on the CAD model; constructing an assembly priority relationship and a simulation environment based on the 3D mesh model of the parts and the mating relationships of the multiple parts; enumerating feasible assembly sequences based on the assembly priority relationship to obtain multiple candidate assembly sequences; sampling candidate grasping postures for multiple parts and performing collision detection based on the multiple candidate assembly sequences and a preset optimization objective function, determining the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, wherein the preset optimization objective function... The function aims to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators. Based on the target assembly sequence and the target grasping postures corresponding to multiple parts, a motion trajectory is generated. Using the motion trajectory as a baseline, a reinforcement learning algorithm is used to train a target reinforcement learning network in a simulation environment. This network is used to output correction residual actions based on the end-effector pose. The robot is controlled to move based on the motion trajectory, and when it enters the assembly stage, the current end-effector pose is obtained. This pose is then input into the target reinforcement learning network to obtain the current correction residual action. Based on this residual action, the robot's end-effector is controlled to assemble the current part.
[0127] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: based on multiple candidate assembly sequences and a preset optimization objective function, sampling candidate grasping postures for multiple parts and performing collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, including: randomly generating multiple initial grasping posture candidate sets, wherein each initial grasping posture candidate set includes a candidate posture corresponding to each of the multiple parts; performing collision detection on the multiple initial grasping posture candidate sets and eliminating infeasible grasping postures to obtain a set of feasible grasping postures; and constructing a system based on the set of feasible grasping postures. Construct an assembly state search tree, where nodes represent assembly states, including the set of assembled parts, parts to be assembled, and their corresponding grasping postures. Traverse the edges in the assembly state search tree and score each edge based on a preset optimization objective function to obtain the scores corresponding to each of the multiple branches in the assembly state search tree. Based on the scores corresponding to each of the multiple branches in the assembly state search tree, select the branch path with the highest cumulative score to determine the target assembly sequence, where each branch path includes multiple edges. Extract the grasping posture corresponding to each part on the branch path corresponding to the target assembly sequence as the target grasping posture for each of the multiple parts.
[0128] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: multi-dimensional indicators include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators, wherein the grasping stability indicator is used to evaluate the support range of the part's center of gravity and the torque margin against external forces under the grasping posture; the operational efficiency indicator is used to evaluate the switching cost between the grasping postures of adjacent parts; and the assembly feasibility indicator is used to evaluate whether the grasping posture and motion trajectory interfere with environmental obstacles.
[0129] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: Based on a simulation environment and using the motion trajectory as a reference, a reinforcement learning algorithm is used to train and obtain a target reinforcement learning network, including: setting a normalized coordinate system with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin; based on the simulation environment and using the motion trajectory as a reference, obtaining the training end-effector pose and the training assembly pose; mapping the training end-effector pose and the training assembly pose to the normalized coordinate system using a spatial transformation matrix to obtain the mapped end-effector pose and the mapped assembly pose; inputting the mapped end-effector pose and the mapped assembly pose to the initial reinforcement learning network and outputting initial correction residual actions; combining the initial correction residual actions with the mapped end-effector pose to determine a new end-effector pose; updating the parameters of the initial reinforcement learning network by minimizing the distance between the new end-effector pose and the mapped assembly pose in the normalized coordinate system as a reward signal to obtain the target reinforcement learning network.
[0130] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: controlling the robot to move based on a motion trajectory and, when the robot enters the assembly stage, obtaining the current end-effector pose of the robot, including: real-time monitoring of the distance between the robot end-effector and the current part; determining that the robot has entered the assembly stage when the distance is less than a preset distance threshold; and obtaining the current end-effector pose of the robot.
[0131] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: controlling the robot's end effector to assemble the assembly based on the current correction residual action, including: determining the reference action command of the motion trajectory at the current moment; superimposing the current correction residual action onto the reference action command to obtain the final control command; controlling the robot's end effector to perform pose adjustment based on the final control command; and repeatedly executing the steps of obtaining the current end effector pose, inputting the target reinforcement learning network to obtain the current correction residual action, and obtaining the above-mentioned final control command at a preset control frequency until the current part is assembled.
[0132] Embodiments of the present invention also provide a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can: acquire a CAD model of an assembly, wherein the assembly includes multiple parts; based on the CAD model, extract three-dimensional mesh models of the parts and the mating relationships of the multiple parts; construct assembly priority relationships and a simulation environment based on the three-dimensional mesh models of the parts and the mating relationships of the multiple parts; based on the assembly priority relationships, enumerate feasible assembly sequences to obtain multiple candidate assembly sequences; based on the multiple candidate assembly sequences and a preset optimization objective function, sample candidate grasping postures for multiple parts and perform collision detection to determine the target assembly sequence and the target grasping postures corresponding to each of the multiple parts. The process involves several steps: First, a pre-defined optimization objective function aims to optimize the assembly sequence and grasping posture under pre-defined multi-dimensional indicators. Second, a motion trajectory is generated based on the target assembly sequence and the corresponding grasping postures of multiple parts. Third, a target reinforcement learning network is trained using a reinforcement learning algorithm within a simulation environment, with the motion trajectory as the baseline. This network is used to output correction residual actions based on the end-effector pose. Fourth, the robot is controlled to move based on the motion trajectory, and its current end-effector pose is obtained when it enters the assembly stage. Fifth, the current end-effector pose is input into the target reinforcement learning network to obtain the current correction residual action. Sixth, based on the current correction residual action, the robot's end-effector is controlled to assemble the current part.
[0133] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0134] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0137] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0138] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0139] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A robot assembly method, characterized in that, include: Obtain a CAD model of the assembly, wherein the assembly includes multiple parts; Based on the CAD model, extract the 3D mesh model of the parts and the mating relationships of the multiple parts; Based on the 3D mesh model of the parts and the mating relationships of the multiple parts, an assembly sequence relationship and simulation environment are constructed; Based on the assembly priority relationship, feasible assembly sequences are enumerated to obtain multiple candidate assembly sequences; Based on the multiple candidate assembly sequences and the preset optimization objective function, candidate grasping postures are sampled for the multiple parts and collision detection is performed to determine the target assembly sequence and the target grasping posture corresponding to each of the multiple parts. The preset optimization objective function aims to optimize the assembly sequence and grasping posture under preset multi-dimensional indicators. Based on the target assembly sequence and the target grasping postures corresponding to each of the multiple parts, a motion trajectory is generated; Based on the simulation environment and the motion trajectory, a reinforcement learning algorithm is used to train a target reinforcement learning network, wherein the target reinforcement learning network is used to output correction residual actions based on the end pose. The robot is controlled to move based on the motion trajectory, and when the robot enters the assembly stage, the current end-effector pose of the robot is obtained; The current end pose is input into the target reinforcement learning network to obtain the current correction residual action; Based on the current correction residual action, the end effector of the robot is controlled to assemble the current part.
2. The method according to claim 1, characterized in that, The step of sampling candidate grasping postures and performing collision detection on the multiple parts based on the multiple candidate assembly sequences and a preset optimization objective function, and determining the target assembly sequence and the target grasping posture corresponding to each of the multiple parts, includes: Multiple initial grasping posture candidate sets are randomly generated, wherein each initial grasping posture candidate set includes a candidate posture corresponding to each of the multiple parts; Collision detection is performed on the multiple initial candidate grasping postures, and infeasible grasping postures are eliminated to obtain a set of feasible grasping postures. Based on the set of feasible grasping postures, an assembly state search tree is constructed, wherein nodes represent assembly states, and the assembly states include the set of parts that have been assembled, the parts to be assembled, and the corresponding grasping postures. Traverse the edges in the assembly state search tree, score each edge based on the preset optimization objective function, and obtain the scores corresponding to each of the multiple branches in the assembly state search tree; Based on the scores corresponding to each of the multiple branches in the assembly state search tree, the branch path with the highest cumulative score is selected to determine the target assembly sequence, wherein the branch path includes multiple edges; Extract the gripping posture corresponding to each part on the branch path corresponding to the target assembly sequence as the target gripping posture corresponding to each of the multiple parts.
3. The method according to claim 1, characterized in that, The multi-dimensional indicators include grasping stability indicators, operational efficiency indicators, and assembly feasibility indicators. The grasping stability indicator is used to evaluate the support range of the part's center of gravity and the torque margin against external forces under the grasping posture. The operational efficiency indicator is used to evaluate the switching cost between grasping postures of adjacent parts. The assembly feasibility indicator is used to evaluate whether the grasping posture and motion trajectory interfere with environmental obstacles.
4. The method according to claim 1, characterized in that, The process of training a target reinforcement learning network based on the simulation environment and the motion trajectory using a reinforcement learning algorithm includes: A standard coordinate system is established with the insertion direction of the assembly hole as the positive Z-axis and the center of the assembly hole as the origin. Based on the simulation environment, and using the motion trajectory as a reference, the training end pose and the training assembly pose are obtained. By using a spatial transformation matrix, the training end pose and the training assembly pose are mapped to the normal coordinate system to obtain the mapped end pose and the mapped assembly pose. The mapped end pose and the mapped assembly pose are input into the initial reinforcement learning network to output the initial correction residual action; The initial correction residual action is combined with the mapped end pose to determine a new end pose; The target reinforcement learning network is obtained by updating the parameters of the initial reinforcement learning network by minimizing the distance between the new end pose and the mapped assembly pose in the canonical coordinate system as a reward signal.
5. The method according to claim 1, characterized in that, The controlled robot moves based on the motion trajectory and, when the robot enters the assembly stage, acquires the current end-effector pose of the robot, including: Real-time monitoring of the distance between the robot's end effector and the current part; If the distance is less than a preset distance threshold, the robot is determined to enter the assembly stage; Obtain the current end-effector pose of the robot.
6. The method according to any one of claims 1 to 5, characterized in that, The step of controlling the robot's end effector based on the current correction residual action to enable the robot to assemble the assembly includes: Determine the reference action command for the motion trajectory at the current moment; The current correction residual action is superimposed on the reference action command to obtain the final control command; Based on the final control command, the robot's end effector is controlled to perform pose adjustment; At a preset control frequency, the steps of obtaining the current end pose, inputting the target reinforcement learning network to obtain the current correction residual action, and obtaining the above-mentioned final control command are repeatedly executed until the current part is assembled.
7. A robot assembly device, characterized in that, include: An acquisition module is used to acquire the CAD model of an assembly, wherein the assembly includes multiple parts; The extraction module is used to extract the three-dimensional mesh model of the parts and the mating relationships of the multiple parts based on the CAD model; The construction module is used to construct the assembly sequence relationship and simulation environment based on the three-dimensional mesh model of the part and the mating relationship of the multiple parts; The enumeration module is used to enumerate feasible assembly sequences based on the assembly precedence relationship to obtain multiple candidate assembly sequences. The determination module is used to sample candidate grasping postures for the multiple parts and perform collision detection based on the multiple candidate assembly sequences and a preset optimization objective function, and determine the target assembly sequence and the target grasping posture corresponding to each of the multiple parts. The preset optimization objective function aims to evaluate the assembly sequence and grasping posture as optimal under preset multi-dimensional indicators. The generation module is used to generate motion trajectories based on the target assembly sequence and the target grasping postures corresponding to the multiple parts; The training module is used to train a target reinforcement learning network based on the simulation environment and the motion trajectory, using a reinforcement learning algorithm. The target reinforcement learning network is used to output correction residual actions based on the end pose. The control module is used to control the robot to move based on the motion trajectory and to obtain the current end-effector pose of the robot when the robot enters the assembly stage; The input module is used to input the current end pose into the target reinforcement learning network to obtain the current correction residual action; An assembly module is used to control the end effector of the robot based on the current correction residual action, so that the robot assembles the current part.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, the device containing the non-volatile storage medium is controlled to perform the robot assembly method according to any one of claims 1 to 6.
9. A computer device, characterized in that, include: Memory and processor The memory stores computer programs; The processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, the processor performs the robot assembly method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the robot assembly method according to any one of claims 1 to 6.