Method for generating robot joint space coupling constraints, electronic device and medium
Patent Information
- Application Number
- CN202610873660.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2046-06-17
AI Technical Summary
[0003]目前,关节空间的约束,特别是涉及多个关节运动耦合的约束,主要是通过技术人员基于经验进行设置,或者可基于关节运动的工作空间的形状进行简单的设置,这些约束设置方法难以在安全性与工作空间的大小之间取得良好平衡,进而难以适应复杂的多关节耦合情况
[0013]This application provides a method, electronic device, and medium for generating spatial coupling constraints for robot joints. By acquiring collision detection data from the robot, the boundary positions of the safe region are determined based on collision and non-collision sample sets. Based on these boundary positions, an initial constraint set for defining the safe region is generated. The parameters of the initial constraint set are then optimized using multi-objective methods to obtain a target constraint set. Here, determining the boundary positions of the safe region based on collision and non-collision sample sets improves the accuracy of the boundary positions, thereby improving the precision of the initial constraint set. The initial constraint set is the starting point of the optimization process, while the target constraint set is the final constraint set obtained after optimization and used for motion planning. Optimizing the initial constraint set improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and enhances the adaptability of this method to complex multi-joint coupling situations.
Smart Images

Figure CN122378768B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics technology, specifically to a method for generating spatial coupling constraints for robot joints, an electronic device, and a medium. Background Technology
[0002] In the field of robot motion planning and collision avoidance technology, ensuring the safety of robot motion while maximizing its workspace is a core objective. This requires generating effective constraints for the robot's joint movements to prevent collisions between different links during joint motion.
[0003] Currently, constraints on joint space, especially those involving the coupling of multiple joint movements, are mainly set by technicians based on experience, or simply based on the shape of the workspace for joint movement. These constraint setting methods are difficult to achieve a good balance between safety and the size of the workspace, and therefore cannot adapt to complex multi-joint coupling situations. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, electronic device, and medium for generating spatial coupling constraints of robot joints, which can improve the quality of the constraint set and achieve a good balance between safety and the size of the safety region in the optimized constraint set.
[0005] In a first aspect, embodiments of this application provide a method for generating joint space coupling constraints for a robot, comprising: acquiring collision detection data of the robot, the collision detection data including a collision sample set and a non-collision sample set in the joint space; determining the boundary position of a safe region based on the collision sample set and the non-collision sample set; generating an initial constraint set for defining the safe region based on the boundary position; and performing multi-objective optimization on the parameters of the initial constraint set to obtain a target constraint set, wherein the robot uses the target constraint set to determine the robot's motion parameters to control the robot's motion.
[0006] Secondly, embodiments of this application provide a robot control method, comprising: planning the robot's motion trajectory based on a target constraint set obtained by the robot joint spatial coupling constraint generation method described in the first aspect above, wherein the motion trajectory includes the robot's motion parameters; and controlling the robot's motion based on the motion parameters.
[0007] Thirdly, embodiments of this application provide a device for generating robot joint space coupling constraints, comprising: an acquisition module for acquiring collision detection data of the robot, the collision detection data including a collision sample set and a non-collision sample set in the joint space; a determination module for determining the boundary position of a safe region based on the collision sample set and the non-collision sample set; a generation module for generating an initial constraint set for defining the safe region based on the boundary position; and an optimization module for performing multi-objective optimization on the parameters of the initial constraint set to obtain a target constraint set, wherein the robot uses the target constraint set to determine the robot's motion parameters to control the robot's motion.
[0008] Fourthly, embodiments of this application provide a robot control device, including: a planning module for planning the robot's motion trajectory based on a set of target constraints, the motion trajectory including the robot's motion parameters; and a control module for controlling the robot's motion based on the motion parameters.
[0009] Fifthly, embodiments of this application provide an electronic device, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is used to execute the robot joint spatial coupling constraint generation method described in the first aspect or the robot control method described in the second aspect.
[0010] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program for executing the robot joint spatial coupling constraint generation method described in the first aspect or the robot control method described in the second aspect.
[0011] In a seventh aspect, embodiments of this application provide a computer program product comprising a computer program that, when executed by a processor of a computer device, enables the computer device to execute the robot joint spatial coupling constraint generation method described in the first aspect or the robot control method described in the second aspect.
[0012] Eighthly, embodiments of this application provide a chip, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is used to execute the robot joint spatial coupling constraint generation method described in the first aspect or the robot control method described in the second aspect.
[0013] This application provides a method, electronic device, and medium for generating spatial coupling constraints for robot joints. By acquiring collision detection data from the robot, the boundary positions of the safe region are determined based on collision and non-collision sample sets. Based on these boundary positions, an initial constraint set for defining the safe region is generated. The parameters of the initial constraint set are then optimized using multi-objective methods to obtain a target constraint set. Here, determining the boundary positions of the safe region based on collision and non-collision sample sets improves the accuracy of the boundary positions, thereby improving the precision of the initial constraint set. The initial constraint set is the starting point of the optimization process, while the target constraint set is the final constraint set obtained after optimization and used for motion planning. Optimizing the initial constraint set improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and enhances the adaptability of this method to complex multi-joint coupling situations. Attached Figure Description
[0014] Figure 1 The figure shown is a schematic diagram of the system architecture of a robot joint space coupling constraint generation system provided in an exemplary embodiment of this application.
[0015] Figure 2 The diagram shown is a flowchart illustrating a method for generating spatial coupling constraints of robot joints according to an exemplary embodiment of this application.
[0016] Figure 3 The diagram shown is a flowchart illustrating a method for generating spatial coupling constraints of robot joints according to another exemplary embodiment of this application.
[0017] Figure 4 The diagram shown is a schematic representation of the convex hull formed by the initial constraint set and the target constraint set provided in an exemplary embodiment of this application on a specific cross section.
[0018] Figure 5 The diagram shown is a flowchart illustrating a robot control method provided in an exemplary embodiment of this application.
[0019] Figure 6 The diagram shown is a schematic diagram of the structure of a robot joint spatial coupling constraint generation device provided in an exemplary embodiment of this application.
[0020] Figure 7 The diagram shown is a schematic representation of the structure of a robot control device provided in an exemplary embodiment of this application.
[0021] Figure 8 The diagram shown is a block diagram of an electronic device for performing a method for generating spatial coupling constraints of robot joints or a robot control method, provided in an exemplary embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] Application Overview In the field of robot motion planning technology, to enable robots to move safely and without collisions in complex environments, it is usually necessary to constrain the range of motion of the robot's joints. A common approach in related technologies is to manually set joint coupling constraints based on the geometric model of the robot's links and the working environment. For example, technicians use experience to determine which joint combinations might cause collisions between links, and manually define relevant constraints to limit these joint motion combinations by analyzing the geometric relationships between the links. However, constraints generated based on human experience are prone to being either too conservative or too lenient. Overly conservative constraints can severely compress the robot's usable workspace, while overly lenient constraints may fail to cover all collision risks, making it difficult to guarantee the robot's motion safety.
[0024] In addition, the coupling constraints of the joints can be set based on the shape of the pre-known workspace. However, this method can only handle simple constraints and is difficult to adapt to complex multi-joint coupling situations.
[0025] In summary, current constraint generation methods have the following technical problems: it is difficult to achieve a good balance between safety and workspace size, and therefore it is difficult to adapt to complex multi-joint coupling situations.
[0026] To address the aforementioned technical problems, this application provides a method for generating spatial coupling constraints for robot joints. By acquiring collision detection data from the robot, and based on collision and non-collision sample sets, the boundary positions of the safe region are determined. Based on these boundary positions, an initial constraint set for defining the safe region is generated. The parameters of the initial constraint set are then optimized using multi-objective methods to obtain a target constraint set. Here, determining the boundary positions of the safe region based on collision and non-collision sample sets improves the accuracy of the boundary positions, thereby improving the precision of the initial constraint set. The initial constraint set is the starting point of the optimization process, while the target constraint set is the final constraint set obtained after optimization and used for motion planning. Optimizing the initial constraint set improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and also enhances the adaptability of this method to complex multi-joint coupling situations.
[0027] Exemplary System Figure 1The diagram shown is a schematic representation of the system architecture for generating robot joint space coupling constraints according to an exemplary embodiment of this application. Figure 1 As shown, the generation system 100 may include a control device 110 and a robot 120.
[0028] In one example, robot 120 can be a real robot or a simulated robot. Further, robot 120 can be a humanoid robot, a wheeled robot, a tracked robot, a gripper robot, or other types of robot.
[0029] In one example, robot 120 may include a series of links connected by joints.
[0030] In one example, control device 110 may be communicatively connected to robot 120. Control device 110 is typically equipped with a processor and memory. The memory may store a computer program for performing the methods of this application.
[0031] Furthermore, in one example, the memory of the control device 110 may also store the kinematic model and the three-dimensional geometric model of the robot 120. During the offline preparation phase, the control device 110 can perform Monte Carlo or other forms of sampling in the joint space based on the kinematic model to obtain a large number of robot configuration samples. For each robot configuration sample, it calls a collision detection engine (which calculates based on the robot's three-dimensional geometric model and a preset environment model) to determine whether the robot experiences self-collision or collision with the environment under that configuration sample, thereby generating a collision sample set labeled with collision tags or a non-collision sample set labeled with non-collision tags. Then, the control device 110 can determine the boundary position of the safe area based on the collision sample set and the non-collision sample set. Based on the boundary position, it generates an initial constraint set for defining the safe area and performs multi-objective optimization on the parameters of the initial constraint set to obtain the target constraint set.
[0032] Furthermore, in one example, during the online motion planning phase, the control device 110 can adjust the state (such as joint angles) of the robot 120's kinematic model based on the target constraint set to drive the 3D geometric model to move in a specific scene, achieving motion simulation in that scene, such as collision-free motion simulation. Alternatively, the control device 110 can send the target constraint set to the robot 120. During the online motion planning phase of the robot 120, the robot 120 can determine motion parameters such as joint angles based on the target constraint set, and then control the robot 120's movement based on these parameters, such as performing tasks. Since these parameters are obtained under the constraints of the target constraint set, controlling the robot 120's movement based on these parameters can minimize collisions during the robot's movement, such as self-collision.
[0033] In one example, during the online motion planning phase, the target constraint set can be integrated into the trajectory optimization problem as either hard or soft constraints to solve for the motion parameters that satisfy the constraints, and then the motion of the 3D geometric model or robot can be controlled based on these motion parameters.
[0034] Optionally, in one example, robot 120 may store collision detection data during actual operation. This collision detection data may include a collision sample set and a non-collision sample set in the joint space. Robot 120 may send the collision sample set and the non-collision sample set to control device 110. Control device 110 may determine the boundary position of the safe area based on the collision sample set and the non-collision sample set, generate an initial constraint set for defining the safe area based on the boundary position, and perform multi-objective optimization on the parameters of the initial constraint set to obtain a target constraint set. Further, control device 110 may send the target constraint set to robot 120. During the online motion planning phase of robot 120, robot 120 may determine motion parameters such as joint angles based on the target constraint set, and then control the movement of robot 120, such as performing tasks, based on these parameters.
[0035] In one example, control device 110 may include a server, computer, mobile phone, tablet, or other electronic device. The server may be a physical server, cloud server, virtual server, or other type of server.
[0036] Optionally, in one example, the control device 110 can be deployed on the robot 120, such as a controller or other module on the robot 120. For example, the robot 120 may store collision detection data during actual operation, which may include a collision sample set and a non-collision sample set in the joint space. The control device 110 deployed on the robot 120 can determine the boundary position of the safe area based on the collision sample set and the non-collision sample set, generate an initial constraint set for defining the safe area based on the boundary position, and perform multi-objective optimization on the parameters of the initial constraint set to obtain the target constraint set. Further, in the online motion planning stage of the robot 120, the robot 120 can determine motion parameters such as joint angles based on the target constraint set, and then control the robot 120's movement based on these parameters, such as performing tasks.
[0037] It should be understood that the above application scenario examples are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited thereto. Rather, the embodiments of this application can be applied to any applicable scenario.
[0038] Exemplary methods Figure 2The diagram shown is a flowchart illustrating a method for generating spatial coupling constraints of robot joints according to an exemplary embodiment of this application. Figure 2 The method can be derived from Figure 1 The control device 110 or robot 120 performs the operation, or the control device 110 and robot 120 perform the operation together. For example... Figure 2 As shown, the method for generating the joint space coupling constraints of this robot may include the following:
[0039] 210: Acquire collision detection data for the robot, which includes a collision sample set and a non-collision sample set in the joint space.
[0040] In one example, joint space can refer to the space that describes the overall configuration (posture) of a robot using its joint variables (angles or displacements) as coordinates. Alternatively, joint space can broadly refer to the space spanned by the robot's joint variables (such as the angles of rotational joints and the displacements of translational joints) as coordinate axes; that is, joint space is essentially the configuration space of the robot's posture. For example, a specific posture (configuration) of the robot can correspond to a point in the joint space.
[0041] In one example, collision detection data may include a set of information used to distinguish whether a robot configuration is in a collision state, specifically including a collision sample set and a non-collision sample set. Here, a collision state may include self-collisions occurring between multiple links in the robot, and the multiple links may include two or more links. In some embodiments, self-collisions may not include collisions between two adjacent links.
[0042] In one example, any sample or point in the collision detection data—that is, any sample or point in the collision sample set or any sample or point in the non-collision sample set—can be used to characterize the state of a robot configuration or multiple links. For instance, the sample or point can represent the joint angles of multiple joints corresponding to the robot configuration (or the multiple links). For example, when the robot configuration includes seven joints, or the multiple links correspond to seven joints, the sample, i.e., the point located in the joint space, can represent the joint angles of these seven joints. Specifically, any point in the collision sample set can indicate that multiple joints will collide at the joint angle represented by that point, while any point in the non-collision sample set can indicate that multiple joints are safe at the joint angle represented by that point and do not collide.
[0043] In one example, collision detection data can be obtained through physical simulation, a fast collision detection algorithm based on a 3D geometric model, or actual data collection on a real robot with safety protection. For example, collision detection data can be obtained by randomly sampling the robot's joint variables within their physical limits (Monte Carlo sampling) or quasi-Monte Carlo sampling, and then performing collision detection on each sampled configuration using the robot's 3D geometric model, thereby generating a large number of labeled sample points. Here, collision detection can include self-collision, and further, it can also include collisions between the robot and environmental obstacles. It is understood that the sample data (collision detection data) can also come from the robot's historical records during actual operation, or from targeted sampling for a specific task area.
[0044] 220: Determine the boundary location of the safe zone based on the collision sample set and the non-collision sample set.
[0045] In one example, the safe region can be a non-collision region in joint space. The boundary location of the safe region (workspace) can refer to the positional information of the continuous interface or transition zone separating the collision region and the non-collision region in joint space. It does not necessarily have to be explicitly defined by a single continuous mathematical surface; it can also be implicitly characterized by a set of discrete boundary points or thresholds in a series of directions. The boundary location of the safe region can be used to indicate the contour of the safe region. The more accurate the boundary location of the safe region, the higher the accuracy of the initial constraint set subsequently constructed, which in turn improves the accuracy of the target constraint set.
[0046] In one example, step 210 serves as the starting point for a data-driven approach, providing raw materials for subsequent boundary location determination and constraint construction. Collision and non-collision sample sets together depict the distribution of safe and dangerous regions (collision regions) in the joint space.
[0047] In one example, step 220 can be used to estimate the boundary location of a continuous safe zone from discrete, potentially noisy sample points (points in the collision detection data).
[0048] 230: Based on the boundary location, generate an initial set of constraints to define the safe area.
[0049] In one example, the set of constraints used to define the safe region (such as the initial constraint set, the target constraint set, the basic constraint set, etc.) may include a set of mathematical inequalities or equality whose set of solutions (i.e., the feasible region) may approximately or strictly contain the non-collision region and exclude the collision region.
[0050] In one example, the constraint set used to define the safe region can be represented as a set of linear inequality constraints, such as A q ≤ b, where q is a vector of joint variables (such as a vector of joint angles), A is a coefficient matrix, b is a constant vector, and its feasible region is a convex polyhedron.
[0051] Alternatively, the constraint set used to define the safe region can also be represented as a nonlinear constraint, such as a quadratic constraint or a constraint represented by a neural network.
[0052] 240: Perform multi-objective optimization on the parameters of the initial constraint set to obtain the objective constraint set.
[0053] Furthermore, the robot is used to determine its motion parameters based on a set of target constraints in order to control the robot's movement.
[0054] In one example, the parameters corresponding to the initial constraint set can be obtained from the boundary positions of the aforementioned safety region. For any constraint set, obtaining the parameters yields the corresponding constraint set. Specifically, a constraint set may include multiple constraints. Parameters may include the coefficients of variables in each constraint and constant terms. For example, in the example above, the constraint set may be A q ≤ b, in which case the parameters corresponding to the constraint set may be (A, b). For example, the parameters corresponding to the initial constraint set may be expressed as (...). , The parameters corresponding to the target constraint set can be expressed as ( , ).
[0055] In one example, the boundary location may include multiple discrete points, based on which a preliminary mathematical model of the safe area can be performed to obtain an initial set of constraints. In some cases, the initial set of constraints is typically in the form of convex mathematical constraints.
[0056] In one example, after obtaining the initial constraint set, which is known, multi-objective optimization (equivalent to fine-tuning) can be performed on the parameters of the initial constraint set, such as A and b, to obtain the optimized parameters. , This yields the target constraint set. The target constraint set can be integrated into the motion planner to participate in the robot's motion planning.
[0057] In one example, multi-objective optimization can refer to considering two or more objectives that need to be traded simultaneously in an optimization problem. For example, multiple objectives may include improving safety (keeping the constraint set away from the collision point) and maintaining a safe region (preventing the constraint set from shrinking excessively).
[0058] This application provides a method for generating spatial coupling constraints for robot joints. By acquiring collision detection data from the robot, and based on collision and non-collision sample sets, the boundary positions of the safe region are determined. Based on these boundary positions, an initial constraint set for defining the safe region is generated. The parameters of the initial constraint set are then optimized using multi-objective methods to obtain a target constraint set. Here, determining the boundary positions of the safe region based on collision and non-collision sample sets improves the accuracy of the boundary positions, thereby improving the precision of the initial constraint set. The initial constraint set is the starting point of the optimization process, while the target constraint set is the final constraint set obtained after optimization and used for motion planning. Optimizing the initial constraint set improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and also enhances the adaptability of this method to complex multi-joint coupling situations.
[0059] According to an embodiment of this application, step 210 may include: calculating the adjacency degree, which characterizes the proximity relationship between links, based on the kinematic chain topology of the robot; and determining and filtering out the target collision sample set corresponding to the target link pair from the original collision sample set corresponding to multiple links based on the adjacency degree, thereby obtaining a collision sample set, wherein the adjacency degree is used to characterize the probability of the target link pair colliding.
[0060] In one example, the movement of some joints in a robot may cause some links to collide (interfere), leading to wear or restricted movement of the robot. Therefore, these collisions should be avoided as much as possible. However, collisions between adjacent links in a robot are kinematically unavoidable. Therefore, collisions between adjacent links can be ignored as a basis for generating the constraint set.
[0061] In one example, the adjacency relationship between any two links (or more links) in the kinematic chain can be determined based on the robot's kinematic chain topology to avoid false alarms of collisions between adjacent links. The adjacency relationship between two links (link pairs) can be characterized by adjacency degree. For example, if the adjacency degree is less than or equal to the adjacency degree threshold, the two links are determined to be adjacent links in the kinematic chain, and the probability of these two links colliding is high; if the adjacency degree is greater than the adjacency degree threshold, the two links are determined to be non-adjacent links in the kinematic chain, and the probability of these two links colliding is low.
[0062] In one example, the robot has multiple links involved in collision detection. The collision sample set corresponding to these links constitutes the original collision sample set. Based on adjacency, adjacent links can be identified as target link pairs. The collision sample set corresponding to the target link pairs does not need to participate in the construction of the constraint set. Therefore, the target collision sample set corresponding to the target link pairs can be filtered out from the original collision sample set, and the remaining collision sample set can participate in the construction of the constraint set.
[0063] In one example, whether two links are adjacent links (target link pair) can be determined by an adjacency judgment function, which can be expressed as follows: in, and They are connecting rods , The identifier of the rigid cluster to which it belongs; For clusters and The shortest path distance between them, i.e., the adjacency degree mentioned above; This is the adjacency distance threshold, which is the adjacency degree threshold mentioned above.
[0064] In one example, a rigid cluster merging method (union-find algorithm) can be used to merge all links connected by fixed joints into a rigid cluster. The union-find data structure enables efficient merging with a time complexity of O(nα(n)), where α is the inverse Ackerman function. After merging the rigid clusters, a cluster graph can be constructed. Specifically, an undirected graph G=(V, E) can be constructed between the rigid clusters, where vertices V are sets of rigid clusters, and edges E are defined by non-fixed joints (REVOLUTE, PRISMATIC, etc.). If there is a non-fixed joint connection between two clusters, an edge is added. Further, full-source shortest path pre-computation (BFS algorithm) can be performed. Specifically, for each cluster... Use BFS to calculate the shortest path distance to all other clusters to obtain the distance matrix. =Shortest path length The time complexity is O( ),in, The number of clusters is represented by the adjacency judgment function, which can accurately handle complex branching and parallel structures.
[0065] Optionally, the collision sample set corresponding to the link specified by the user can be retained in the original collision sample set, while the collision sample set corresponding to the link not specified by the user can be filtered out. The retained collision sample set can be used to construct the constraint set.
[0066] Optionally, the frequency of occurrence of each collision link pair in multiple links can be statistically analyzed. When the frequency is greater than or equal to a frequency threshold, the collision link pair can be identified as a high-frequency collision link pair, which can be used as the target link pair. By filtering out the target collision sample set corresponding to the target link pair from the original collision sample set corresponding to multiple links, a collision sample set for constructing the constraint set can be obtained. Here, the frequency threshold can be 0.9, 0.95, or other reasonable values. In one example, the frequency of occurrence of collision link pairs can be obtained by the following formula: in, The frequency of occurrence of collision link pairs; It can be the total number of collisions in the original collision sample set, or the total number of points in the original collision sample set, or the total number of points in the original collision sample set and the non-collision sample set. For the original collision sample set of collision link pairs The number of collisions that occurred. It should be understood that... The calculation formula can be set according to actual needs and is not limited to the formula mentioned above.
[0067] In one example, a collision sample set for constructing a constraint set can be obtained based on at least one of the three collision link filtering methods mentioned above (filtering the collision sample set corresponding to adjacent links; filtering the collision sample set corresponding to user-specified links; filtering the collision sample set corresponding to high-frequency collision link pairs).
[0068] In one example, the output format of the collision sample set used to construct the constraint set can be: including a collision identifier (0 / 1 indicates whether a collision has occurred), the number of collision link pairs (counting the total number of collision link pairs in the collision sample set), a list of collision link pairs (recording the link pairs that have collided, in the format of "link 1-link 2; link 3-link 4"), and the sampled angle values of each joint.
[0069] In this embodiment, by calculating the adjacency degree of the proximity relationship between links, the original collision sample set can be filtered or optimized based on the adjacency degree. This simplifies the sample set without reducing its quality and reduces the computational load of constructing the constraint set. For example, it avoids performing meaningless calculations on a large number of kinematically adjacent links, thereby improving computational efficiency.
[0070] According to an embodiment of this application, step 220 may include: projecting collision points in the collision sample set and non-collision points in the non-collision sample set along multiple preset search directions to obtain projection values of collision points and non-collision points; for each of the multiple preset search directions, obtaining a boundary threshold for the preset search direction based on the projection values of collision points and non-collision points; and determining the boundary position based on the boundary thresholds corresponding to the multiple preset search directions and the non-collision sample set.
[0071] In one example, the center point of the non-collision sample set can be determined first, such as the center point in joint space. This center point can be the point represented by the median of all points in the non-collision sample set, or the mean point of all points, or it can be obtained by fitting all points with a polygon or polyhedron and using the centroid of the polygon or polyhedron as the center point. Multiple preset search directions can diverge outward from the center point, and these preset search directions can be set according to actual needs. For example, the angles between multiple preset search directions can be equal or unequal, that is, the angles between adjacent search directions can be equal or unequal. Each preset search direction can be a unit vector.
[0072] Furthermore, points in the collision sample set (collision points) and points in the non-collision sample set (non-collision points) can be projected along multiple preset search directions to obtain the projected values of the collision points and non-collision points. For each preset search direction, a boundary threshold can be obtained based on the projected values of the collision points and non-collision points. Specifically, these projected values can all be orthographic projections. For each preset search direction, the minimum projected value of the collision point and the maximum projected value of the non-collision point in that direction can be determined, and the boundary threshold in that direction can be determined based on the minimum and maximum projected values. For example, the minimum of the minimum projected value corresponding to the collision point and the maximum projected value corresponding to the non-collision point can be used as the boundary threshold in that direction, or the average of the minimum projected value corresponding to the collision point and the maximum projected value corresponding to the non-collision point can be used as the boundary threshold in that direction. Furthermore, the boundary thresholds in each preset search direction can constitute multiple boundary points distributed near the boundary between the collision region and the non-collision region. When the number of preset search directions is large enough, these boundary points can constitute a threshold boundary line.
[0073] Furthermore, points in the non-collision sample set can be filtered based on boundary thresholds to identify non-collision points located near or closest to the boundary thresholds. These non-collision points near each boundary threshold can constitute the boundary locations of the safe region. That is, the boundary locations of the safe region may include multiple non-collision points located near the threshold boundary lines, and these non-collision points can be used to characterize the contour of the safe region.
[0074] Optionally, in one example, the collision sample set and non-collision sample set in the joint space can be transformed to the normalized space through a linear mapping to determine the boundary position of the safe region in the normalized space.
[0075] For example, variables in joint space can be... Mapped to the normalized space, the variables in the normalized space are .in, As a normalization center, For the dimension of space, It is a scaled diagonal matrix. It can be written as... For points in non-collision samples The median of a space (normalized space) in each dimension. This is equivalent to a reference center, or the center point of the non-collision sample set in the normalized space. Normalization improves numerical stability and avoids numerical problems caused by differences in the dimensions of different joints.
[0076] Then, in the normalized space, a projection sampling strategy for multiple preset search directions is implemented. Specifically, uniform sampling over a unit sphere can ensure that the search directions cover random directions, and the multiple preset search directions can be... ,from The data is sampled from a standard normal distribution and then normalized to a unit sphere. The coordinate axes are oriented as follows: (Ensure the integrity of the coordinate axis directions), where, For the first The unit vectors of each coordinate axis. The total number of directions is... (Typical value:) , (Corresponding to search directions of 518). Combining random sampling and coordinate axis orientation ensures the uniformity and completeness of direction coverage. For each preset search direction... Points in the collision sample set (collision points) and points in the non-collision sample set (non-collision points) can be projected along the search direction to obtain the projected values of the collision points (collision point projection set) and the projected values of the non-collision points (non-collision point projection set). The collision point projection set and the non-collision point projection set are represented as follows: in, For the non-collision sample set in the normalized space, For the collision sample set in the normalized space, For reference only. It should be understood that... The value range of can be [512, 1024], and these directions can include the coordinate axis directions.
[0077] Based on the set of projections of collision points and the set of projections of non-collision points, the orthographic subset of collision points can be obtained. and the non-collision point orthographic subset .
[0078] For each preset search direction, it can be based on Determine the minimum projection value of the collision point in that direction, and based on... The maximum projection value of the non-collision point in this direction is determined. Based on this minimum projection value and the maximum projection value, the boundary threshold in this direction can be determined. For the specific methods for determining the boundary threshold and the subsequent methods for determining the boundary position in the normalized space, please refer to the description in the joint space example above.
[0079] Furthermore, a convex hull can be constructed based on the points corresponding to the boundary positions in the normalized space to obtain the initial constraint set in the normalized space, and the initial constraint set in the normalized space can be mapped back to the joint space to obtain the initial constraint set in the joint space.
[0080] Furthermore, the boundary positions in the normalized space can also be mapped back to the joint space to obtain the boundary positions in the joint space, which can be used for the subsequent optimization process of the constraint set.
[0081] In this embodiment, projection analysis is performed on points in the collision and non-collision sample sets along multiple preset search directions. Boundary thresholds are determined based on the projection results, and boundary positions are determined according to the boundary thresholds and the non-collision sample sets. This allows for robust and conservative estimation of the boundary positions of safe regions from potentially sparse and noisy collision and non-collision sample sets, ensuring the safety of the generated constraint set. Furthermore, the collision and non-collision sample sets in the joint space can be mapped to a normalized space, and a projection sampling strategy is then performed based on the collision and non-collision sample sets in the normalized space to determine the boundary thresholds and boundary positions. Here, normalization improves numerical stability and avoids numerical problems caused by differences in the dimensions of different joints.
[0082] According to one embodiment of this application, a boundary threshold for a preset search direction is obtained based on the projection values of the collision points and the projection values of the non-collision points, including: subtracting a safety margin from the minimum orthographic projection value among the projection values of the collision points to obtain a first initial boundary threshold; obtaining a second initial boundary threshold based on a specified quantile of the orthographic projection values among the projection values of the non-collision points; and using the maximum value of the first initial boundary threshold and the second initial boundary threshold as the boundary threshold.
[0083] In one example, for each point, it can be projected according to each preset search direction. Thus, based on the actual positions of points in the collision sample set and the non-collision sample set, either the projected value of the collision point or the projected value of the non-collision point can be a positive projection value, a negative projection value, or zero. Alternatively, for each point, it can be projected according to various preset search directions, retaining non-negative projection values. In this way, both the projected values of the collision point and the projected values of the non-collision point can be non-negative projection values.
[0084] Furthermore, the minimum orthographic projection value among the projection values of the collision point can be subtracted from the safety margin to obtain the first initial boundary threshold, and the second initial boundary threshold can be obtained based on the specified quantile of the orthographic projection value among the projection values of the non-collision points.
[0085] In one example, as described in the above embodiments, points in the collision sample set (collision points) and points in the non-collision sample set (non-collision points) can be projected along multiple preset search directions in the joint space to obtain the projected values of the collision points (collision point projection set) and the projected values of the non-collision points (non-collision point projection set). Alternatively, points in the collision sample set (collision points) and points in the non-collision sample set (non-collision points) can be projected along multiple preset search directions in the normalized space to obtain the projected values of the collision points (collision point projection set). ) and the projection values of non-collision points (the set of projections of non-collision points) ).
[0086] Furthermore, based on the collision point projection set and the non-collision point projection set, a subset of orthographic projections of collision points and a subset of orthographic projections of non-collision points can be obtained. For each preset search direction, the minimum orthographic projection value of the collision point in that direction can be determined based on the subset of orthographic projections of collision points, and a specified quantile of the orthographic projection value of the non-collision point in that direction can be determined based on the minimum projection value and the specified quantile of the orthographic projection value. The boundary threshold in that direction can be determined based on the minimum projection value and the specified quantile of the orthographic projection value.
[0087] For example, taking the projection of points in a normalized space and the determination of boundary thresholds as an example, it can be based on the collision point projection set. Obtain the orthographic subset of collision points Based on the non-collision point projection set Obtain the orthographic subset of non-collision points The minimum orthographic projection value among the projection values of the collision point can be expressed as: The specified quantile of the orthographic projection value among the projection values of non-collision points ( quantiles can be represented as Based on this minimum projection value and the specified quantile of the orthographic projection value The boundary threshold in that direction can be determined.
[0088] For example, it can be based on the minimum projection value and the specified quantiles of the orthographic projection values The weighted sum determines the boundary threshold in that direction, and the weight values can be determined according to actual needs or a suitable algorithm.
[0089] For example, the minimum projection value can be... and the specified quantiles of the orthographic projection values The minimum value in the threshold is used to determine the boundary threshold in that direction, which can further improve the security of the safe zone defined by the boundary location.
[0090] For example, the minimum projection value can be... Subtract safety margin The first initial boundary threshold is obtained. ; Specified quantiles based on orthographic projection values The second initial boundary threshold is obtained. Set the first initial boundary threshold. Second initial boundary threshold The maximum value in the range is used as the boundary threshold in that direction. In this way, while ensuring the safety of the safe zone defined by the boundary position, we can try to ensure that the boundary position is closer to the actual boundary of the safe zone, that is, ensure that the safe zone is large enough and that the robot joints have enough room to move.
[0091] Specifically, the first initial boundary threshold Second initial boundary threshold and the boundary threshold in the preset search direction The expression is as follows: in, quantiles The value can be set according to actual needs. For example, it can be 0.95, 1, or any value between 0.95 and 1. For quantile operators. Safety margin. Greater than 0, The value can be set according to actual needs. For example, it can be 0.005, 0.02, or any value between 0.005 and 0.02.
[0092] Furthermore, points in the non-collision sample set can be filtered based on the boundary thresholds corresponding to each preset search direction to find non-collision points located near the boundary thresholds or the non-collision points closest to the boundary thresholds. The non-collision points near each boundary threshold can constitute the boundary positions of the safe area.
[0093] For example, the following algorithm can be used to select the non-collision point (which can be called the anchor) that is closest to the plane (or boundary line) formed by each boundary threshold in the non-collision sample set: The quantities in the above formulas can be referred to the relevant descriptions in the above embodiments.
[0094] Furthermore, anchor points in the normalized space can be mapped back to the joint space using the following formula: in, This can be the representation of the anchor point in the normalized space. It can be a representation of the anchor point in joint space. As a normalization center, .
[0095] Furthermore, the set of non-collision points near each boundary threshold can be represented as: That is, the boundary location of the safe zone can be determined by a set. (Also known as the boundary candidate point set) representation.
[0096] In this embodiment, a first initial boundary threshold is determined based on the projection value of the collision point, and a second initial boundary threshold is determined based on the projection value of the non-collision points, thus enabling the calculation of dual thresholds. Further, the first initial boundary threshold is obtained by subtracting a safety margin from the minimum orthographic projection value of the collision point projection values, and the second initial boundary threshold is obtained based on a specified quantile of the orthographic projection values of the non-collision points projection values. This allows for a conservative estimation of the dual thresholds, improving the safety of the thresholds. Furthermore, using the largest of the two conservative thresholds as the final boundary threshold ensures that the boundary position is as close as possible to the true boundary of the safe area, while maintaining the safety of the safe area defined by the boundary position. This ensures that the safe area is sufficiently large, providing the robot joints with ample room for movement.
[0097] According to an embodiment of this application, step 230 may include: generating a basic constraint set for defining a safe region based on the boundary location; simplifying the basic constraint set by at least one of the following methods to obtain an initial constraint set: detecting and removing geometrically redundant constraints; merging geometrically similar constraints; and selecting a preset number of constraints with the largest contribution based on the contribution of each constraint to the geometry of the safe region.
[0098] In one example, boundary locations may include multiple points distributed near the outline of the safe region. Based on the determined boundary locations, a basic set of constraints for defining the safe region can be generated. For example, boundary locations may include multiple discrete points, and a preliminary mathematical model of the safe region can be performed based on these discrete points to obtain the basic set of constraints. In some cases, the basic set of constraints is typically in the form of convex mathematical constraints.
[0099] In one example, a set of fundamental constraints can be used to define the shape or space of a safe region. For instance, the set of fundamental constraints may include multiple inequalities, such as multiple linear inequalities, which can define polygons or polyhedra. The space enclosed by the polygons or polyhedra is the safe region defined by the set of fundamental constraints.
[0100] In one example, the basic constraint set can be directly applied ( , The parameters of ) are used for multi-objective optimization to obtain the objective constraint set. In this example, the basic constraint set ( , That is, it is equivalent to the initial constraint set ( , ).
[0101] Optionally, the basic constraint set ( , Simplify to obtain the initial constraint set ( , ), and then for the initial constraint set ( , The parameters are used for multi-objective optimization to obtain the objective constraint set. This simplifies the optimization process and improves optimization efficiency.
[0102] In one example, a method for simplifying the basic constraint set to obtain an initial constraint set may include at least one of the following: detecting and removing geometrically redundant constraints; merging geometrically similar constraints; and selecting a preset number of constraints with the largest contribution based on the contribution of each constraint to the geometry of the safe region.
[0103] In one example, the robot joint spatial coupling constraint generation method provided in this application embodiment is mainly used for the calculation of three-dimensional space (three degrees of freedom) constraints, or the calculation of higher-dimensional space (more degrees of freedom) constraints. The calculation of three-dimensional space constraints and higher-dimensional space constraints is similar. For ease of description, the following describes the optimization process of the constraint set in detail, taking the calculation process of three-dimensional space constraints as an example.
[0104] Specifically, in one example, detecting and removing geometrically redundant constraints can include: assuming that after removing a constraint from the basic constraint set, the remaining constraints can still form a polyhedron, i.e., the remaining constraints can still form a closed space, and the polyhedron formed by the remaining constraints is the same as the polyhedron formed by the basic constraint set, or the similarity is greater than or equal to a preset similarity threshold, then the constraint can be considered a geometrically redundant constraint and can be removed. Here, the preset similarity threshold can be set according to actual needs, for example, it can be 98%, 99%, 99.5%, or other suitable values.
[0105] For example, for each constraint in the basic constraint set In the polyhedron with the constraint removed Solve the linear programming problem above: in, This means removing the first... The constraint matrix after the row, This means removing the first... The constraint vector after each element, here It can represent joint angles in normalized space (if normalization has been applied), or joint angles in joint space.
[0106] In solving the above linear programming problem, if the optimal value satisfies the following condition, then the constraint is determined to be a redundant constraint.
[0107] in, For tolerance, its specific value can be set according to actual needs. For example, it can be 0.01, 0.1, or any value between 0.01 and 0.1.
[0108] Specifically, the objective of solving the linear programming problem described above can be understood as: after removing a certain constraint, while satisfying... Under the given conditions, the values of points in the constraint direction still lie within or approximately within the original polyhedron. That is, if removing the constraint does not significantly change the shape and position of the polyhedron, then the constraint is redundant, and it should be removed to obtain the initial constraint set.
[0109] Preferably, in solving linear programming problems, normalization constraints can be used to determine numerical stability, such as the following normalization: in, It is an adjustable threshold; for example, both sides of the above inequality can be divided simultaneously by... The absolute value is used to achieve normalization, that is... It can also be a normalized quantity.
[0110] The time complexity of solving the above linear programming problem is O(n). ),in, For constraint numbers, The time for a single LP solution is denoted as .
[0111] In one example, merging geometrically similar constraints may include: calculating the similarity between the parameters of each constraint in the basic constraint set, obtaining the similarity between the parameters of any two constraints, and if the similarity meets the preset similarity condition, then the two constraints are determined to be similar, and one constraint can be retained while the other is deleted.
[0112] Specifically, constraints can be characterized by linear inequalities, such as through... The parameters representing the constraints can include the coefficient vector in the linear inequalities. and scalar For any two constraints, the similarity between two coefficient vectors and the similarity between two scalars can be calculated. When the similarity of the coefficient vectors and the similarity of the scalars satisfy a preset similarity condition, the two constraints are considered similar. Here, the similarity can be characterized by at least one of cosine similarity, Euclidean distance, Pearson correlation coefficient, or other suitable methods.
[0113] Furthermore, before calculating the similarity between parameters, the parameters can be normalized, and then the similarity can be calculated, which facilitates the similarity calculation process.
[0114] For example, for any constraint, the parameters of that constraint can be normalized, such as: Then, the following criteria are used to determine whether the two constraints are parallel: in, This can be a preset value, and its specific value can be set according to actual needs. For example, it can be set to a value of [value missing]. Or other suitable values. The left-hand side of the above conditional inequality can be considered as the similarity between the two coefficient vectors. The higher the similarity, the closer the two constraints are to being parallel.
[0115] Furthermore, if If the two vectors have the same direction, then the following condition can be used to determine whether two parallel constraints coincide: like If the two vectors are in opposite directions, then the following condition can be used to determine whether two parallel constraints coincide: in, This can be a preset value, and its specific value can be set according to actual needs. For example, it can be set to a value of [value missing]. Or other suitable values. The left-hand side of the two conditional inequalities above can characterize the similarity between the two scalars. For example, the smaller the value of the left-hand side, the higher the similarity, indicating that the two constraints are closer to coinciding.
[0116] In one example, the thresholds for parallel or overlapping can be set approximately at 10°.
[0117] If two constraints are determined to overlap, that is, if the similarity between the parameters corresponding to the two constraints meets the preset similarity condition, then the two constraints are determined to be similar, and one constraint can be retained while the other is deleted.
[0118] The time complexity of determining the geometric similarity constraints described above is O(n). ),in, For constraint numbers.
[0119] In one example, based on the contribution of each constraint to the geometry of the safe area, a preset number of constraints with the largest contribution are selected. This can include calculating the area of the face formed by the intersection of the constraint plane corresponding to each constraint and the polyhedron of the safe area, and sorting and selecting them according to the area. For example, they can be sorted in descending order of area, and the top K constraints in the sort can be selected as the preset number of constraints with the largest contribution. The value of K can be set according to actual needs.
[0120] In one example, the set of polyhedron vertices can be calculated, and then the area corresponding to the constraint, i.e., the contribution, can be calculated based on the set of polyhedron vertices.
[0121] For example, given the constraint Ax ≤ b and the internal feasible points The set of vertices of a polyhedron can be calculated using the half-space intersection algorithm: in, The number of vertices.
[0122] Furthermore, calculating the area corresponding to the constraint, i.e. the contribution, may include: identifying the vertices located on the plane corresponding to each constraint; constructing a 2D orthogonal basis for the plane; projecting the vertices onto a 2D coordinate system; and calculating the 2D convex hull area.
[0123] For example, regarding the first Constraints Identify the vertices located on the plane corresponding to the constraint: in, For tolerance, for example, it can be a typical value. .
[0124] Furthermore, normalize the normal vector to Construction and Orthogonal two-dimensional orthogonal basis ,satisfy , , .
[0125] Project the vertices onto a 2D coordinate system. Specifically, a reference point can be selected. The projected coordinates are: Calculate the area of the 2D convex hull. Specifically, if... Then the area Otherwise, calculate 2D convex hull area .
[0126] Furthermore, the samples can be sorted in descending order of area contribution to obtain... Selecting the first K constraints yields... Retention constraints , .
[0127] K can be a typical value of 20~30 (in the 3D case).
[0128] By retaining constraints that contribute significantly to the workspace, the number of constraints can be reduced while maintaining the workspace shape.
[0129] It should be understood that any two or three of the three simplification methods mentioned above can be combined (the first simplification method detects and removes geometrically redundant constraints; the second simplification method merges geometrically similar constraints; and the third simplification method selects a preset number of constraints with the largest contribution based on the contribution of each constraint to the geometry of the safe area). That is, the execution order of each simplification method can be set according to actual needs. For example, the first simplification method can be executed on the basic constraint set to obtain the first result, then the second simplification method can be executed on the first result to obtain the second result, and finally the third simplification method can be executed on the second result to obtain the third result, thus obtaining the initial constraint set.
[0130] In this embodiment, a basic constraint set is constructed based on the boundary location, and the basic constraint set is simplified to obtain an initial constraint set. This reduces the computational load of the subsequent multi-objective optimization process and improves the optimization efficiency.
[0131] According to an embodiment of this application, step 240 may include: determining points in the collision sample set that satisfy the initial constraint set to obtain a specified collision point set; calculating the function value of the optimization objective function based on the special point set and iterating thereon to achieve multi-objective optimization of the parameters of the initial constraint set to obtain the target constraint set, wherein the special point set includes points at the boundary positions and the specified collision point set.
[0132] In one example, ideally, there should be no collision points within the convex hull defined by the initial constraint set. However, errors may occur during the generation of the initial constraint set based on boundary positions, potentially causing some collision points to appear within or on the boundary of the convex hull defined by the initial constraint set. Alternatively, a simplified initial constraint set obtained by reducing the basic constraint set generated based on boundary positions may be looser than the basic constraint set, potentially leading to some collision points appearing within or on the boundary of the convex hull defined by the initial constraint set.
[0133] In one example, after obtaining the initial constraint set, points in the collision sample set that satisfy the initial constraint set are identified to obtain a specified collision point set. The collision points in the specified collision point set can include points in the collision sample set that lie within the convex hull defined by the initial constraint set and are close to the boundary of the convex hull, as well as points located on the boundary of the convex hull. Points at the boundary location can include multiple points distributed near the contour of the safe area, i.e., a set of boundary candidate points. Points at the boundary are used to determine the basic termination set or the initial constraint set. During the multi-objective optimization of the parameters of the initial constraint set, it is desirable that the points at the boundary and the collision points in the specified collision point set (i.e., the points in the special point set) are located as far outside as possible on the outside of the convex hull defined by the optimization constraint set, so as to ensure the safety of the safe region defined by the constraint set.
[0134] For example, points in the collision sample set that satisfy the initial constraint set can be determined using the following criteria: The specified set of collision points can be represented as: in, This is the collision sample set.
[0135] Special point sets can be represented as: By constructing a special point set, the computational complexity of the optimization process can be reduced to O(n log n). From reduction to O( ),in . It can refer to the number of points in the collision sample set, or it can refer to the sum of the number of points in the collision sample set and the number of points at the boundary positions. In this way, it can be used to optimize key points, improve optimization efficiency, and maintain optimization quality, because collision points outside the convex hull have been excluded by the initial constraint set.
[0136] In one example, for a set of optimization constraints in the optimization process, the value of the objective function can be determined based on the distance between a point in a specific point set and the boundary (such as a line or surface) defined by any constraint in the optimization constraint set. For example, if a point is outside the convex hull defined by the optimization constraint set, and the greater the distance between the point and the boundary defined by that constraint, the larger the function value. The optimization process aims to minimize the value of the objective function, and this can be iterated continuously, such as by narrowing the region defined by the optimization constraint set.
[0137] Furthermore, during the optimization process, the specific content of the objective function can be adjusted or constraints can be added to restrict points in the special point set to lie outside the convex hull defined by any set of optimization constraints, thus preventing points in the special point set from being included in the convex hull defined by the final objective constraint set. For example, a sub-function can be added to the objective function to minimize or reduce the difference between the optimized constraint set and the initial constraint set. It should be understood that the objective function here can include a multi-objective optimization function, i.e., it can include multiple sub-functions.
[0138] In one example, the objective function can be designed differently to maximize or minimize its value, and then iterated to obtain the objective constraint set.
[0139] In this embodiment, a special set of points consisting of points at boundary locations and collision points that are still unsafe under the initial constraint set is selected as the evaluation object of the optimization objective function. This can significantly reduce the computational overhead caused by evaluating a large number of sample points while ensuring optimization quality. For example, the evaluation of collision points located outside the convex hull defined by the initial constraint set can be omitted.
[0140] According to one embodiment of this application, multi-objective optimization is achieved through iterative calculation of a multi-objective optimization function (optimization objective function). The multi-objective optimization function includes at least two sub-functions: a safety cost sub-function, used to characterize the degree of violation of the optimization constraint set in the iteration process by points in a special point set, wherein the special point set includes points at boundary positions; an offset cost sub-function, used to characterize the difference between the optimization constraint set in the iteration process and the initial constraint set; and a penalty sub-function, used to characterize the distance between points in a preset internal feasible point set and the boundary defined by the optimization constraint set in the iteration process, wherein the smaller the distance, the greater the penalty.
[0141] In one example, during the iterative calculation of a multi-objective optimization function, the function value corresponding to a constraint set can be calculated in each iteration. This constraint set in each iteration can be called the optimization constraint set. By continuously iterating, the objective constraint set can be obtained.
[0142] In one example, a multi-objective optimization function may include the sum of multiple sub-functions, each corresponding to an optimization objective. For example, the multiple sub-functions may include at least two of the following: a safety cost sub-function, a bias cost sub-function, and a penalty sub-function.
[0143] In one example, the safety cost subfunction is used to characterize the degree of violation of the optimization constraint set during the iteration process of point pairs in the special point set. Its optimization objective is that the points in the special point set are located outside the convex hull corresponding to the optimization constraint set, thus ensuring that the region defined by the optimization constraint set is a safe region.
[0144] In one example, the special point set may include points at boundary locations. The specific details of these boundary locations can be found in the descriptions above; to avoid repetition, they will not be repeated here. Furthermore, the special point set may also include a specified collision point set. The points in the specified collision point set For details, please refer to the descriptions in the relevant content above. To avoid repetition, they will not be repeated here.
[0145] In one example, the degree of violation of the optimization constraint set by a point in a special point set can refer to the distance between that point and the boundary of the convex hull of the optimization constraint set. For example, if the point is outside the convex hull, the degree of violation is positive, and the farther the point is from the boundary, the higher the degree of violation of the constraints formed by the point on the optimization constraint set; if the point is inside the convex hull, the degree of violation is negative, and the farther the point is from the boundary, the lower the degree of violation of the constraints formed by the point on the optimization constraint set. Further, in one example, a higher degree of violation indicates that the point is located outside the convex hull corresponding to the optimization constraint set and is farther from the boundary, which satisfies the optimization objective corresponding to the safety cost subfunction.
[0146] In one example, during the optimization process, the optimization objective of the multi-objective optimization function can be to minimize the function value of the multi-objective optimization function. Therefore, the optimization objective corresponding to the safety cost sub-function can be to minimize the function value of the safety cost sub-function. For example, the higher the degree of violation of the optimization constraint set by points in the special point set, the smaller the function value of the safety cost sub-function; conversely, the lower the degree of violation of the optimization constraint set by points in the special point set, the larger the function value of the safety cost sub-function.
[0147] In one example, for each point in the special set of points, the degree of violation of the optimization constraint set by that point can be the sum or product of the degree of violation of each constraint in the optimization constraint set by that point. The value of the safety cost subfunction can be a weighted sum, such as the average, of the degree of violation of the optimization constraint set by all points in the special set of points.
[0148] For example, for each constraint in the optimization constraint set The degree of violation of this constraint by points in the special point set is: The function for calculating the degree of violation is as follows: In one example, the security cost subfunction can be a differentiable and smooth cost function. For instance, the function calculating the degree of violation can be mapped to a preset interval, such as the interval [0, 1]. For example, the Sigmoid function can be used to transform the function calculating the degree of violation, resulting in the following differentiable and smooth function: in, This is a temperature parameter used to control the smoothness. The value can be set according to actual needs, for example... It can be -0.01.
[0149] For each point It can calculate the product of the probabilities of satisfying all constraints in the optimization constraint set. , i.e., point The product of probabilities that satisfy the optimization objective of the safety cost subfunction (which can be considered as the degree of violation of the optimization constraint set at that point): Furthermore, the security cost subfunction The function value can be the average degree of violation of the optimization constraint set by all points in the special point set, and the function value of the safety cost sub-function is the average probability of satisfaction of all points in the special point set. Where F is the number of constraints, For a special set of points, the product form in the function ensures that all constraints are satisfied simultaneously. The Sigmoid function is differentiable, supports gradient-based optimization methods, and improves optimization efficiency. Furthermore, the smooth approximation of the Sigmoid function avoids the optimization difficulties caused by the step function. Moreover, the degree of smoothness can be controlled by the temperature parameter; for example, a smaller temperature parameter makes it closer to the step function but with a steeper gradient.
[0150] In one example, the offset cost subfunction is used to characterize the gap between the optimized constraint set and the initial constraint set during the iteration process. Its optimization goal is to make the optimized constraint set as close as possible to the initial constraint set, thereby reducing the gap between the two.
[0151] In one example, during the optimization process, the optimization objective of the multi-objective optimization function can be to minimize the function value of the multi-objective optimization function. Therefore, the optimization objective corresponding to the offset cost sub-function can be to minimize the function value of the offset cost sub-function. For example, the greater the difference between the optimization constraint set and the initial constraint set, the larger the function value of the offset cost sub-function; conversely, the smaller the difference between the optimization constraint set and the initial constraint set, the smaller the function value of the offset cost sub-function.
[0152] In one example, the difference between the optimized constraint set and the initial constraint set can be characterized by the difference between the parameters of the two constraint sets. For example, the parameters of the optimized constraint set include A and b, and the parameters of the initial constraint set include... and The difference between the optimization constraint set and the initial constraint set is the offset cost sub-function. It can be represented as: Among them, matrix and The difference is measured using the Frobenius norm. It should be understood that in other examples, the matrix may be computed in other ways. and The difference between them. Specifically, ,here, The square of the Frobenius norm. For matrix The elements in. For control matrix and The weight, For vectors and The weight, and The value can be set according to actual needs, for example, It can be 1. It can be 1. By using the offset cost subfunction, the parameters of the optimization constraint set can be kept close to the parameters of the initial constraint set, thus avoiding large changes in the shape of the safe region (workspace) due to over-optimization.
[0153] In one example, the penalty subfunction is used to characterize the distance between points in the preset internal feasible point set and the boundary defined by the optimization constraint set in the iteration process. The smaller the distance, the larger the penalty. Its optimization objective is to guide the points in the preset internal feasible point set away from the convex hull boundary corresponding to the optimization constraint set.
[0154] In one example, the preset internal feasible point set can be a set of points set according to actual usage needs, such as the set of points within the safe area (workspace) where the robot's joints can move during the execution of a target task. The points in the preset internal feasible point set should be located inside the optimization constraint set; therefore, optimization can be based on the points in the preset internal feasible point set. The requirement of being located inside the set of optimization constraints leads to the construction of constraints for the multi-objective optimization function.
[0155] For example, the constraints of a multi-objective optimization function are: in, To standardize safety margins and ensure points Located within the optimization constraint set, its value can be set according to actual needs, such as 0.01, 0.02, or other suitable values. This constraint can be considered a hard constraint.
[0156] In one example, the constraints can be standardized as follows: The standardized safety margin is: The constraint function corresponding to the constraint condition becomes: Furthermore, for the preset internal feasible point set For each point in the matrix, calculate the minimum margin. The constraints are This is to ensure that all internal feasible points meet the safety margin requirements.
[0157] Furthermore, during the optimization process, the optimization objective of the multi-objective optimization function can be to minimize the function value of the multi-objective optimization function. Therefore, the optimization objective corresponding to the penalty sub-function can be to minimize the function value of the penalty sub-function. For example, the smaller the distance between points in the preset internal feasible point set and the boundary defined by the optimization constraint set, the larger the function value of the penalty sub-function; conversely, the larger the distance between points in the preset internal feasible point set and the boundary defined by the optimization constraint set, the smaller the function value of the penalty sub-function.
[0158] In one example, the distance between a point in the preset set of feasible internal points and the boundary defined by the set of optimization constraints can be characterized by the minimum distance between that point and each constraint in the set of optimization constraints, i.e., by the minimum margin. Representation. For example, for each point in a predefined set of feasible internal points. If its minimum margin satisfy If so, then a linear penalty is added. Here, The value can be set according to actual needs, such as 0.03, 0.05, 0.06, or other suitable values. Specifically, the function value of the penalty sub-function can be obtained based on the minimum margin of each point in the preset internal feasible point set. For example, the penalty sub-function... It can be represented as: in, This is the penalty weight, and its value can be set according to actual needs, such as 0.05, 0.1, 0.15, 0.2, or other suitable values. The penalty sub-function can guide the optimization process to keep the internal feasible points away from the boundary, while allowing fine-tuning under the premise that hard constraints are satisfied.
[0159] In one example, the optimization process can be solved using the Sequential Least Squares Programming (SLSQP) method. The SLSQP method can handle nonlinear constraints and can efficiently optimize by utilizing the gradient information of multi-objective optimization functions and constraints.
[0160] In one example, the optimized constraint matrix and constraint vector ,satisfy Furthermore, all internal feasible points meet the safety margin requirements.
[0161] In one example, a multi-objective optimization function It can be represented as: in, The smaller the function value, the better the parameters of the optimization constraint set.
[0162] Optionally, in one example, during the optimization process, the optimization objective of the multi-objective optimization function can be to maximize the function value of the multi-objective optimization function. For example, the optimization objective corresponding to the safety cost sub-function can be to maximize the function value of the safety cost sub-function. For instance, the higher the degree of violation of the optimization constraint set by points in the special point set, the larger the function value of the safety cost sub-function; conversely, the lower the degree of violation of the optimization constraint set by points in the special point set, the smaller the function value of the safety cost sub-function. That is, whether the optimization objective of the multi-objective optimization function is to obtain the maximum or minimum value can be reasonably set while ensuring the optimization objectives of each sub-function.
[0163] In this embodiment, by setting multiple sub-functions, multi-objective optimization can be performed, thereby obtaining a set of objective constraints with high security and a large security region.
[0164] According to one embodiment of this application, the multi-objective optimization function includes a security cost sub-function and a offset cost sub-function. The multi-objective optimization function includes a security normalization factor for the security cost sub-function and an offset cost normalization factor for the offset cost sub-function.
[0165] In one example, the security normalization factor can be used to map the function value of the security cost subfunction to a specific interval. Similarly, the offset cost normalization factor can be used to map the function value of the offset cost subfunction to the same specific interval. This is equivalent to standardizing the security cost subfunction and the offset cost subfunction, which facilitates subsequent calculations.
[0166] In one example, a multi-objective optimization function It can be represented as: in, As a safety standardization factor, This is the offset cost standardization factor.
[0167] In one example, the safety normalization factor and the offset cost normalization factor can be set according to actual needs. For example, the safety cost of the initial constraint set can be used as a benchmark, and the safety normalization factor can be calculated as follows: in, The purpose is to prevent the factor from being equal to 0 (the factor as a denominator cannot be equal to 0). The value can be set according to actual needs, for example, This factor reflects the safety level of the initial constraint set.
[0168] In one example, offset parameters can be estimated based on the initial constraint set. For instance, typical offset parameters can be estimated based on a 10% change in the parameters (parameters of the initial constraint set). , Furthermore, the offset cost normalization factor can be calculated based on the offset parameters and the parameters of the initial constraint set. For example, the offset cost normalization factor can be calculated as follows: in, The purpose is to prevent the factor from being equal to 0 (the factor as a denominator cannot be equal to 0). The value can be set according to actual needs, for example, This factor reflects the typical magnitude of change in the parameters of the constraint set.
[0169] In one example, and These are the weights for the security cost subfunction and the offset cost subfunction, respectively, and these two weights can be adjusted according to actual needs.
[0170] In one example, after standardization, and All values are in the range of [0, 1], which makes the adjustment of weights more intuitive and effective.
[0171] In one example, the multi-objective optimization function may include a safety cost subfunction, a offset cost subfunction, and a penalty subfunction. Specifically, the multi-objective optimization function... It can be represented as: That is, the multi-objective optimization framework is as follows: in, To optimize variables, This means expanding matrix A into a vector by rows. The weights for the security cost sub-function, i.e., the security weights, can be set according to actual needs. For example, they can be typical values, with a range of [0.8, 10.0]. It can be any value within this range. Similarly, This represents the weight of the offset cost subfunction, i.e., the offset cost weight. Its value can be set according to actual needs, for example, a typical value such as 1.0. F is the number of constraints in the constraint set. This is a standardized safety margin. These are the feasible points within the system (which can be a single point or a set of multiple points). This is a penalty term for feasible internal points that approach the boundary.
[0172] In the example above, the constraint matrix and constraint vector Flattening into optimization variables Specifically, during the optimization process, the parameters of the initial constraint set ( , (This is) used as the starting point for optimization; based on a special point set. calculate as well as ;calculate as well as Use the SLSQP method to iteratively optimize the objective function while satisfying the constraints; from the optimization variables... The optimized constraint matrix is recovered in the middle. and constraint vector .
[0173] In this embodiment, the standardization factor can unify sub-functions of different magnitudes to the same magnitude, which facilitates weight adjustment and balanced optimization, avoids optimization bias caused by differences in magnitude, and thus improves the stability and reliability of the optimization results.
[0174] According to one embodiment of this application, the initial constraint set includes a three-degree-of-freedom constraint set expanded from a two-degree-of-freedom constraint set. The two degrees of freedom include the degrees of freedom corresponding to the first joint axis and the second joint axis. The two-degree-of-freedom constraint set includes polygonal constraints. The three degrees of freedom include the degrees of freedom corresponding to the first joint axis, the second joint axis, and the third joint axis. The three-degree-of-freedom constraint set includes cylindrical polyhedral constraints. The upper and lower surfaces defined by the cylindrical polyhedral constraints have the same shape as the regions defined by the polygonal constraints. In the process of multi-objective optimization of the parameters of the initial constraint set to obtain the target constraint set, for the side constraints of the cylindrical polyhedral constraints, the coefficient of the normal vector corresponding to the third joint axis is fixed to zero. For the upper and lower surface constraints of the cylindrical polyhedral constraints, all parameters of the upper and lower surface constraints are fixed.
[0175] In one example, coupling between two adjacent joints involves two degrees of freedom (2D). Coupling between three joints involves three degrees of freedom (3D). Data for 2D can be extended to 3D space for optimization.
[0176] For example, a constraint set with two degrees of freedom can be expanded into a constraint set with three degrees of freedom, resulting in an initial constraint set. The two degrees of freedom include the degrees of freedom corresponding to the first and second joint axes, and the constraint set for the two degrees of freedom includes polygon constraints. After expanding the constraint set to three degrees of freedom, these three degrees of freedom can include the degrees of freedom corresponding to the first and second joint axes, as well as the degree of freedom corresponding to the third joint axis. The constraint set for the three degrees of freedom includes prismatic polyhedral constraints, where the upper and lower surfaces defined by the prismatic polyhedral constraints have the same shape as the region defined by the polygon constraints.
[0177] In one example, after expanding the constraint set from two degrees of freedom to a constraint set of three degrees of freedom, the degrees of freedom corresponding to the first joint axis (first degree of freedom) and the degrees of freedom corresponding to the second joint axis (second degree of freedom) can maintain the values in the previous two-degree-of-freedom constraint set. The degree of freedom corresponding to the third joint axis (third degree of freedom) can be a constant, without affecting the expression of the first and second degrees of freedom. That is, the prismatic polyhedron constraint can define a prismatic polyhedron, and any cross-section (section) of the prismatic polyhedron is the region defined by the polygon constraint.
[0178] In one example, most joint coupling (collision) involves two degrees of freedom, i.e., coupling between adjacent joints. In a few cases, coupling between three joints may occur. Solving a three-degree-of-freedom problem in terms of two degrees of freedom is not easy, as the spatial states or formulas of two degrees of freedom cannot uniformly express the content of three degrees of freedom. However, the spatial states or formulas of three degrees of freedom can uniformly express the content of two degrees of freedom.
[0179] It should be understood that the methods and formulas provided in the embodiments of this application are adaptable to the processing of data with three degrees of freedom (such as the three coordinate axes XYZ) or more degrees of freedom (four degrees of freedom, five degrees of freedom, etc.). In order to be compatible with the processing of data with two degrees of freedom, the data with two degrees of freedom can be extended to data with three degrees of freedom, or extended to data with higher degrees of freedom, and then the extended data can be processed using the methods provided in the embodiments of this application.
[0180] In one example, the number of joints that are coupled is equal to the number of degrees of freedom corresponding to that coupling.
[0181] In one example, a set of constraints for two degrees of freedom (polygonal constraints) can be represented as a 2D convex hull, such as... q ≤ For example, in ( , Construct a 2D convex hull from the plane to obtain the side constraints: , .
[0182] Furthermore, 2D lateral constraints can be transformed into 3D lateral constraints. For example, 3D lateral constraints are as follows: Right now: , , for The zero vector.
[0183] Furthermore, top surface constraints (top surface constraints) and bottom surface constraints (bottom surface constraints) can be added to the 2D convex hull. For example, the top surface constraint is: ,Right now The lower surface constraint is: ,Right now Combining the upper and lower surface constraints yields the following top and bottom surface constraint matrices and vectors: Furthermore, by combining the lateral constraints and the upper and lower surface constraints, we can obtain the constraint matrix and constraint vector of the columnar polyhedron constraint: in, This is the side constraint matrix. Lateral constraint vector. In one example, and It can be used as a parameter for the initial constraint set.
[0184] Furthermore, in one example, based on the three-degree-of-freedom constraint set extended from the two-degree-of-freedom constraint set, i.e., the cylindrical polyhedron constraint, a 3D boundary point cloud can be generated, that is, the points at the boundary positions of the cylindrical polyhedron formed by the cylindrical polyhedron constraint. For example, the points at the 2D boundary positions of the upper and lower surfaces of the cylindrical polyhedron can be used as the boundary positions of the cylindrical polyhedron for subsequent multi-objective optimization. For example, a special point set can be determined based on the points at the boundary positions of the cylindrical polyhedron for multi-objective optimization. The specific content of multi-objective optimization can be referred to the relevant descriptions in the other embodiments above.
[0185] In one example, a point at the 2D boundary location of the upper surface of the columnar polyhedron can be represented as: A point on the 2D boundary of the lower surface of a columnar polyhedron can be represented as... .
[0186] Furthermore, in one example, during the multi-objective optimization of the parameters of the initial constraint set (a three-degree-of-freedom constraint set extended from a two-degree-of-freedom constraint set) to obtain the target constraint set, for the lateral constraint of the cylindrical polyhedron constraint, the coefficient of the normal vector corresponding to the third joint axis of the lateral constraint is fixed to zero, and for the upper and lower surface constraints of the cylindrical polyhedron constraint, all parameters of the upper and lower surface constraints are fixed.
[0187] In one example, optimizing the constraint set for two degrees of freedom can be understood as adjusting the lateral surfaces of a prism polyhedron, such as moving the lateral surfaces closer to or further away from the center of the polyhedron. Since the top and bottom surfaces of the polyhedron are parallel, no optimization is needed. For example, for the lateral constraints of a prism polyhedron, the normal vector of the lateral constraints is fixed (…). , , The coefficient corresponding to the third joint axis in ) The value is set to zero to prevent the optimization process from disrupting the geometry of the columnar polyhedron. For example, the upper (lower) surface can lie in the XY plane, and during optimization, the control... Always being zero ensures that the upper surface remains parallel to the XY plane, preventing the upper surface from intersecting with the XY plane.
[0188] Furthermore, for the upper and lower surface constraints of the cylindrical polyhedron, all parameters of the upper and lower surface constraints are fixed, such as those that can be optimized. , And b.
[0189] Specifically, control can be achieved through the following mask. Zero, and simultaneously optimized , And b.
[0190] Bounds parameter settings: For lateral constraints ( ), , And b can be optimized (bounds=( ,+ )), Fixed to zero (bounds = (0, 0)). For upper and lower surface constraints ( All parameters are completely fixed (bounds=( , )).
[0191] In SLSQP optimization, the above-mentioned columnar constraint masking mechanism can be implemented through the bounds parameter.
[0192] In this embodiment, 3D columnar constraints can be directly constructed based on 2D boundary data, which is applicable to certain specific application scenarios and improves adaptability. Furthermore, when the constraint to be optimized has a specific preset geometric structure (e.g., a three-dimensional columnar structure extended from two-dimensional polygons), the optimization process can prevent the optimization process from destroying the preset geometric structure while allowing parameter adjustment. That is, the optimization algorithm can adjust key parameters while maintaining geometric characteristics, thereby improving the constraint quality.
[0193] According to an embodiment of this application, step 220 may include: transforming the collision sample set and non-collision sample set in the joint space to a normalized space through a linear mapping, determining the boundary position of the safe region in the normalized space, and mapping the boundary position in the normalized space back to the joint space to obtain the boundary position in the joint space. Step 230 may include: constructing a convex hull based on the points corresponding to the boundary positions in the normalized space to obtain an initial constraint set in the normalized space, and mapping the initial constraint set in the normalized space back to the joint space to obtain the initial constraint set in the joint space.
[0194] In one example, the collision sample set and non-collision sample set in the joint space are transformed to the normalized space through a linear mapping. The boundary position of the safe region is determined in the normalized space, and the convex hull is constructed based on the points corresponding to the boundary positions in the normalized space. This can improve the stability of relevant numerical values such as the initial constraint set in the normalized space and avoid the accuracy loss caused by large numerical values.
[0195] For example, the normalized space can be represented as Variables in joint space can be... Mapped to the normalized space, the variables in the normalized space are The collision and non-collision sample sets in joint space are transformed to a normalized space through a linear mapping. The boundary positions of the safe region are determined in the normalized space, and a convex hull is constructed based on the points corresponding to these boundary positions to obtain the initial constraint set in the normalized space. . and These can be the constraint matrix and constraint vector of the initial constraint set in the normalized space, respectively.
[0196] Furthermore, the initial constraint set in the normalized space can be mapped back to the joint space to obtain the initial constraint set in the joint space. Specifically, the constraint matrix and constraint vector of the initial constraint set in the joint space are represented as follows: in, It is a scaled diagonal matrix. For normalization center.
[0197] Furthermore, in one example, the boundary positions in the normalized space can be mapped back to the joint space to obtain the boundary positions in the joint space, which facilitates the subsequent optimization process of the constraint set. For example, a special point set can be obtained based on the points at the boundary positions in the joint space, and a multi-objective optimization process can be performed based on the special point set.
[0198] In this embodiment, the collision sample set and non-collision sample set in the joint space are transformed to a normalized space through a linear mapping. The boundary positions of the safe region are determined in the normalized space, and a convex hull is constructed based on the points corresponding to the boundary positions in the normalized space to obtain the initial constraint set in the normalized space. Then, the initial constraint set in the normalized space is mapped back to the joint space to obtain the initial constraint set in the joint space. Thus, the linear transformation does not change the properties of the convex hull (convex polyhedron), and by determining the boundary positions and constructing the convex hull in the normalized space, and then mapping the boundary positions and convex hull back to the joint space, numerical stability can be improved, and the accuracy loss caused by large numerical values can be avoided, such as numerical problems caused by differences in the dimensions of different joints.
[0199] Figure 3 The diagram shown is a flowchart illustrating a method for generating spatial coupling constraints of robot joints according to another exemplary embodiment of this application. Figure 3 The example is Figure 2Examples of the embodiments are provided below; to avoid repetition, the similarities can be referred to the descriptions in the above embodiments, and will not be repeated here. For example... Figure 3 As shown, the method for generating the joint space coupling constraints of this robot may include the following.
[0200] 310: Obtain collision detection data for the robot, which includes a collision sample set and a non-collision sample set in the joint space.
[0201] In one example, based on the robot's kinematic chain topology, the adjacency degree, which characterizes the proximity relationship between links, is calculated. Based on the adjacency degree, the target collision sample set corresponding to the target link pair is determined and filtered out from the original collision sample set corresponding to multiple links, thus obtaining the collision sample set. Here, the adjacency degree is used to characterize the probability of the target link pair colliding.
[0202] Specifically, the contents of the original collision sample set, the target collision sample set, the collision sample set, and the non-collision sample set can be found in the relevant descriptions in the above embodiments. To avoid repetition, they will not be repeated here.
[0203] 320: Transform the collision sample set and non-collision sample set in the joint space to the normalized space through linear mapping, determine the boundary position of the safe region in the normalized space, and map the boundary position in the normalized space back to the joint space to obtain the boundary position in the joint space.
[0204] In one example, collision points in the collision sample set and non-collision points in the non-collision sample set can be projected along multiple preset search directions to obtain the projected values of the collision points and non-collision points. For example, in the normalized space, collision points in the collision sample set and non-collision points in the non-collision sample set can be projected along multiple preset search directions to obtain the projected values of the collision points and non-collision points. Further, for each of the multiple preset search directions, a boundary threshold for the preset search direction is obtained based on the projected values of the collision points and non-collision points. Further, based on the boundary thresholds corresponding to the multiple preset search directions and the non-collision sample set, the boundary position is determined. This boundary position can be a boundary position in the normalized space, and the boundary position in the normalized space can be further mapped back to the joint space to obtain the boundary position in the joint space.
[0205] Specifically, the details of the normalization space, joint space, preset search direction, boundary threshold, and boundary position can be found in the relevant descriptions in the above embodiments. To avoid repetition, they will not be repeated here.
[0206] 330: Construct a convex hull based on the points corresponding to the boundary positions in the normalized space to obtain the initial constraint set in the normalized space, and map the initial constraint set in the normalized space back to the joint space to obtain the initial constraint set in the joint space.
[0207] In one example, a basic constraint set for defining the safe region can be generated in the normalized space based on the boundary locations. This basic constraint set can then be simplified to obtain an initial constraint set. The initial constraint set in the normalized space can then be mapped back to the joint space to obtain an initial constraint set in the joint space. Alternatively, a basic constraint set for defining the safe region can be generated in the normalized space based on the boundary locations. This basic constraint set in the normalized space can then be mapped back to the joint space to obtain a basic constraint set in the joint space. The basic constraint set in the joint space can then be simplified to obtain an initial constraint set in the joint space.
[0208] Specifically, the details of the initial constraint set in the normalized space, the initial constraint set in the joint space, the basic constraint set, and the method for simplifying the basic constraint set can be found in the relevant descriptions in the above embodiments. To avoid repetition, they will not be repeated here.
[0209] 340: Determine the points in the collision sample set that satisfy the initial constraint set to obtain the specified collision point set. Based on the special point set, calculate the function value of the optimization objective function and iterate to achieve multi-objective optimization of the parameters of the initial constraint set and obtain the objective constraint set. The special point set includes points at the boundary positions and the specified collision point set.
[0210] Specifically, the details of the specified collision point set, special point set, optimization objective function, and objective constraint set can be found in the relevant descriptions in the above embodiments. To avoid repetition, they will not be repeated here.
[0211] 350: The robot is controlled to determine its motion parameters based on the target constraint set in order to control the robot's motion.
[0212] It should be understood that the execution order of the above steps can be adjusted according to actual needs.
[0213] For example, Figure 4 A schematic diagram of the convex hull formed by the initial constraint set and the target constraint set obtained based on the embodiments of this application is shown on a specific cross section. Specifically, Figure 4 A rectangular region 1 is shown. Region 2, located in the middle of the rectangular region 1, is the cross-sectional region of the convex hull formed by the initial constraint set on the cross section. Region 2 can be considered as a non-collision region, i.e. a safe region. Region 3, located at the edge of the rectangular region 1, can be considered as a collision region. Figure 4The closed region (octagon) enclosed by line 4 is the cross-sectional area of the convex hull formed by the target constraint set on this section. It should be understood that part of line 4 coincides with the boundary of rectangular region 1, that is, it falls within the background region 5, so it is not obvious. For example, Figure 4 The horizontal axis in the figure can be the pose parameters of joint J6, and the vertical axis can be the pose parameters of joint J7.
[0214] This application's embodiments introduce a data-driven automated process that automatically infers the boundary of a safe zone based on robot collision detection data, and then constructs and optimizes the set of mathematical constraints used to define this safe zone. This effectively expands the range of joint space available for motion planning without sacrificing the fundamental requirement of safety. In other words, it provides a method for learning and optimizing joint space coupling constraints from data to solve the technical problem of balancing safety and workspace in high-dimensional, complex scenarios using manual design methods, achieving the technical effects of automated constraint generation, precise safety boundaries, and maximized workspace. Specifically, the robot joint space coupling constraint generation method provided in this application has at least the following beneficial effects: 1. It can automatically generate coupling constraints without manual design, automatically learning constraint parameters from collision detection data; 2. It can balance safety and workspace, maximizing workspace while ensuring safety through multi-objective optimization; 3. It can support 2D / 3D hybrid constraint mode, processing 2D boundary data and extending it into 3D columnar constraints; 4. It can achieve multi-stage simplification to reduce the number of constraints, such as significantly reducing the number of constraints through LP redundancy detection, parallel surface merging, and Top-K selection; 5. It improves optimization efficiency through the Special Points Only strategy, optimizing only key points and greatly improving computational efficiency; 6. It can maintain the geometric characteristics of columnar constraints while optimizing through columnar constraint masks; 7. It can improve numerical stability and avoid accuracy loss caused by large values through normalized spatial calculation; 8. It can accurately handle complex branching and parallel mechanisms through kinematic adjacency relationship calculation, adapting to complex robot structures.
[0215] This application also provides a robot control method, which can be executed by a robot or by a computing device that controls the robot. The computing device can be a remote control device or other device communicatively connected to the robot. Figure 5 As shown, the robot control method may include the following:
[0216] 510: Based on the target constraint set, plan the robot's motion trajectory, which includes the robot's motion parameters.
[0217] In one example, the target constraint set can be obtained based on the robot joint space coupling constraint generation method provided in the above embodiments.
[0218] Specifically, the details of the target constraint set can be found in the relevant descriptions in the above embodiments, and will not be repeated here to avoid repetition.
[0219] 520: Controlling robot movement based on motion parameters.
[0220] This application provides a robot control method. By acquiring collision detection data of the robot, and based on collision and non-collision sample sets, the boundary positions of the safe region are determined. Based on the boundary positions, an initial constraint set for defining the safe region is generated, and the parameters of the initial constraint set are optimized using multi-objective methods to obtain a target constraint set. This improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and enhances the method's adaptability to complex multi-joint coupling situations. Furthermore, based on this target constraint set, the robot's motion trajectory is planned, improving the robot's motion safety.
[0221] Exemplary device This application also provides a device for generating robot joint spatial coupling constraints, see [link to relevant documentation]. Figure 6 The generating device 600 may include an acquisition module 610, a determination module 620, a generation module 630, and an optimization module 640.
[0222] The acquisition module 610 is used to acquire collision detection data of the robot, including a collision sample set and a non-collision sample set in the joint space; the determination module 620 is used to determine the boundary position of the safe area based on the collision sample set and the non-collision sample set; the generation module 630 is used to generate an initial constraint set for defining the safe area based on the boundary position; the optimization module 640 is used to perform multi-objective optimization on the parameters of the initial constraint set to obtain a target constraint set, wherein the robot uses the target constraint set to determine the robot's motion parameters to control the robot's motion.
[0223] This application provides a device for generating spatial coupling constraints for robot joints. By acquiring collision detection data from the robot, and based on collision and non-collision sample sets, the boundary positions of safe regions are determined. Based on these boundary positions, an initial constraint set for defining the safe regions is generated. The parameters of the initial constraint set are then optimized using multi-objective methods to obtain a target constraint set. Here, determining the boundary positions of the safe regions based on collision and non-collision sample sets improves the accuracy of the boundary positions, thereby improving the precision of the initial constraint set. The initial constraint set is the starting point of the optimization process, while the target constraint set is the final constraint set obtained after optimization and used for motion planning. Optimizing the initial constraint set improves the quality of the constraint set, achieving a good balance between safety and the size of the safe regions, and also enhances the adaptability of the device to complex multi-joint coupling situations.
[0224] According to one embodiment of this application, the acquisition module 610 is used to: calculate the adjacency degree, which characterizes the proximity relationship between links, based on the kinematic chain topology of the robot; and, based on the adjacency degree, determine and filter out the target collision sample set corresponding to the target link pair from the original collision sample set corresponding to multiple links to obtain a collision sample set, wherein the adjacency degree is used to characterize the probability of the target link pair colliding.
[0225] According to an embodiment of this application, the determining module 620 is used to: project the collision points in the collision sample set and the non-collision points in the non-collision sample set along multiple preset search directions to obtain the projection values of the collision points and the non-collision points; for each of the multiple preset search directions, obtain the boundary threshold of the preset search direction based on the projection values of the collision points and the non-collision points; and determine the boundary position based on the boundary thresholds corresponding to the multiple preset search directions and the non-collision sample set.
[0226] According to one embodiment of this application, the determining module 620 is used to: subtract a safety margin from the minimum orthographic projection value among the projection values of the collision point to obtain a first initial boundary threshold; obtain a second initial boundary threshold based on a specified quantile of the orthographic projection value among the projection values of the non-collision points; and use the maximum value of the first initial boundary threshold and the second initial boundary threshold as the boundary threshold.
[0227] According to an embodiment of this application, the generation module 630 is used to: generate a basic constraint set for defining a safe area based on the boundary location; simplify the basic constraint set to obtain an initial constraint set by at least one of the following methods: detecting and removing geometrically redundant constraints; merging geometrically similar constraints; and selecting a preset number of constraints with the largest contribution based on the contribution of each constraint to the geometry of the safe area.
[0228] According to one embodiment of this application, the optimization module 640 is used to: determine the points in the collision sample set that satisfy the initial constraint set to obtain a specified collision point set; calculate the function value of the optimization objective function based on the special point set and perform iteration to achieve multi-objective optimization of the parameters of the initial constraint set to obtain the target constraint set, wherein the special point set includes points at the boundary positions and the specified collision point set.
[0229] According to one embodiment of this application, multi-objective optimization is achieved through iterative calculation of a multi-objective optimization function, which includes at least two sub-functions: a safety cost sub-function, used to characterize the degree of violation of the optimization constraint set in the iteration process by points in a special point set, wherein the special point set includes points at boundary positions; an offset cost sub-function, used to characterize the difference between the optimization constraint set in the iteration process and the initial constraint set; and a penalty sub-function, used to characterize the distance between points in a preset internal feasible point set and the boundary defined by the optimization constraint set in the iteration process, wherein the smaller the distance, the greater the penalty.
[0230] According to one embodiment of this application, the security cost subfunction employs a differentiable and smooth cost function.
[0231] According to one embodiment of this application, the multi-objective optimization function includes a security cost sub-function and a offset cost sub-function. The multi-objective optimization function includes a security normalization factor for the security cost sub-function and an offset cost normalization factor for the offset cost sub-function.
[0232] According to one embodiment of this application, the initial constraint set includes a three-degree-of-freedom constraint set expanded from a two-degree-of-freedom constraint set. The two degrees of freedom include the degrees of freedom corresponding to the first joint axis and the second joint axis, and the two-degree-of-freedom constraint set includes polygonal constraints. The three degrees of freedom include the degrees of freedom corresponding to the first joint axis, the second joint axis, and the third joint axis. The three-degree-of-freedom constraint set includes cylindrical polyhedral constraints, and the upper and lower surfaces defined by the cylindrical polyhedral constraints have the same shape as the regions defined by the polygonal constraints. In the process of multi-objective optimization of the parameters of the initial constraint set to obtain the target constraint set, for the lateral constraints of the cylindrical polyhedral constraints, the coefficient corresponding to the third joint axis in the normal vector of the lateral constraints is fixed to zero. For the upper and lower surface constraints of the cylindrical polyhedral constraints, all parameters of the upper and lower surface constraints are fixed.
[0233] According to one embodiment of this application, the determining module 620 is used to: transform the collision sample set and non-collision sample set in the joint space to a normalized space through a linear mapping, determine the boundary position of the safe region in the normalized space, and map the boundary position in the normalized space back to the joint space to obtain the boundary position in the joint space. The generating module 630 is used to: construct a convex hull based on the points corresponding to the boundary positions in the normalized space to obtain an initial constraint set in the normalized space, and map the initial constraint set in the normalized space back to the joint space to obtain the initial constraint set in the joint space.
[0234] It should be understood that the operation and function of the acquisition module 610, determination module 620, generation module 630, and optimization module 640 in the above embodiments can be referred to the above. Figure 2 or Figure 3 The description of the robot joint spatial coupling constraint generation method provided in the embodiments will not be repeated here to avoid repetition.
[0235] This application also provides a robot control device, see [link to relevant documentation]. Figure 7 The robot control device 700 may include a planning module 710 and a control module 720.
[0236] The planning module 710 is used to plan the robot's motion trajectory based on the target constraint set, and the motion trajectory includes the robot's motion parameters; the control module 720 is used to control the robot's motion based on the motion parameters.
[0237] In one example, the planning module 710 may obtain the target constraint set based on the robot joint space coupling constraint generation method provided in the above embodiments, or based on the robot joint space coupling constraint generation device described above.
[0238] This application provides a robot control device that acquires collision detection data of the robot, determines the boundary positions of a safe region based on a collision sample set and a non-collision sample set, generates an initial constraint set for defining the safe region based on the boundary positions, and performs multi-objective optimization on the parameters of the initial constraint set to obtain a target constraint set. This improves the quality of the constraint set, achieving a good balance between safety and the size of the safe region, and enhances the device's adaptability to complex multi-joint coupling situations. Furthermore, based on this target constraint set, the robot's motion trajectory is planned, improving the robot's motion safety.
[0239] It should be understood that the operation and function of the planning module 710 and the control module 720 in the above embodiments can be referred to the above. Figure 5 The description of the robot control method provided in the embodiments will not be repeated here to avoid repetition.
[0240] Figure 8 The diagram shows a block diagram of an electronic device for executing a method for generating robot joint spatial coupling constraints or a robot control method, provided in an exemplary embodiment of this application. Specifically, the electronic device 800 may be a server, a terminal device, a robot, a control device or control module that interacts with the robot, and the control module may be mounted on the robot so that the robot executes the method for generating robot joint spatial coupling constraints or the robot control method based on the control module.
[0241] Reference Figure 8 The electronic device 800 includes a processing component 810, which further includes one or more processors, and memory resources represented by a memory 820 for storing instructions executable by the processing component 810, such as application programs. The application programs stored in the memory 820 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 810 is configured to execute instructions to perform the aforementioned method for generating robot joint spatial coupling constraints or robot control methods.
[0242] Electronic device 800 may also include a power supply component configured to perform power management of electronic device 800, a wired or wireless network interface configured to connect electronic device 800 to a network, and an input / output (I / O) interface. Electronic device 800 can be operated based on an operating system stored in memory 820, such as Windows Server. TM Mac OSX TM Unix TM Linux TM FreeBSD TM Or similar.
[0243] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the aforementioned electronic device 800, enables the electronic device 800 to execute a method for generating spatial coupling constraints of robot joints or a robot control method.
[0244] A computer program product, comprising a computer program, which, when executed by a processor of a computer device, enables the computer device to execute the robot joint spatial coupling constraint generation method or robot control method provided in any of the above embodiments.
[0245] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0246] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0247] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0248] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0249] 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 network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0250] In addition, the functional units in the various embodiments of this application 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.
[0251] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 this application. The aforementioned storage medium includes various media capable of storing program verification codes, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0252] It should be noted that in the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0253] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0254] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for generating a robot joint space coupling constraint, characterized in that, include: Acquire collision detection data of the robot, the collision detection data including a collision sample set and a non-collision sample set in the joint space; Based on the collision sample set and the non-collision sample set, the boundary position of the safe area is determined; Based on the boundary location, an initial constraint set is generated to define the safe area; The parameters of the initial constraint set are subjected to multi-objective optimization to obtain a target constraint set, wherein the robot is used to determine the robot's motion parameters based on the target constraint set to control the robot's motion. The step of determining the boundary location of the safe area based on the collision sample set and the non-collision sample set includes: The collision points in the collision sample set and the non-collision points in the non-collision sample set are projected along multiple preset search directions to obtain the projection values of the collision points and the projection values of the non-collision points. For each of the plurality of preset search directions, the boundary threshold of the preset search direction is obtained based on the projection value of the collision point and the projection value of the non-collision point; The boundary position is determined based on the boundary thresholds corresponding to the multiple preset search directions and the non-collision sample set.
2. The generation method according to claim 1, characterized in that, The acquisition of collision detection data for the robot includes: Based on the kinematic chain topology of the robot, the adjacency degree, which characterizes the proximity relationship between links, is calculated. Based on the adjacency degree, the target collision sample set corresponding to the target link pair is determined and filtered out from the original collision sample set corresponding to multiple links to obtain the collision sample set, wherein the adjacency degree is used to characterize the probability of the target link pair colliding.
3. The generation method according to claim 1, characterized in that, The step of obtaining the boundary threshold of the preset search direction based on the projection values of the collision points and the projection values of the non-collision points includes: Subtract the safety margin from the minimum orthographic projection value of the projection values of the collision point to obtain the first initial boundary threshold. A second initial boundary threshold is obtained based on the specified quantile of the orthographic projection value among the projection values of the non-collision points. The maximum value between the first initial boundary threshold and the second initial boundary threshold is used as the boundary threshold.
4. The generation method according to claim 1, characterized in that, The step of generating an initial constraint set for defining the safe area based on the boundary location includes: Based on the boundary location, a basic constraint set is generated to define the safe area; The initial constraint set is obtained by simplifying the basic constraint set using at least one of the following methods: detecting and removing geometrically redundant constraints; merging geometrically similar constraints; and selecting a preset number of constraints with the largest contribution based on the contribution of each constraint to the geometry of the safe area.
5. The generation method according to claim 1, characterized in that, The multi-objective optimization of the parameters of the initial constraint set to obtain the target constraint set includes: Determine the points in the collision sample set that satisfy the initial constraint set to obtain the specified collision point set; Based on the special point set, the function value of the optimization objective function is calculated and iterated to achieve multi-objective optimization of the parameters of the initial constraint set, thereby obtaining the objective constraint set. The special point set includes points at the boundary positions and the specified collision point set.
6. The generation method according to claim 1, characterized in that, The multi-objective optimization is achieved through iterative calculation of a multi-objective optimization function, which includes at least two sub-functions: A safety cost subfunction is used to characterize the degree of violation of the optimization constraint set during the iteration process of point pairs in a special point set, wherein the special point set includes points at the boundary positions; The offset cost sub-function is used to characterize the difference between the optimization constraint set and the initial constraint set during the iteration process; The penalty sub-function is used to characterize the distance between a point in the preset internal feasible point set and the boundary defined by the optimization constraint set in the iterative process. The smaller the distance, the greater the penalty.
7. The generation method according to claim 6, characterized in that, The security cost subfunction employs a differentiable and smooth cost function.
8. The generation method according to claim 6, characterized in that, The multi-objective optimization function includes the security cost sub-function and the offset cost sub-function, and the multi-objective optimization function includes a security normalization factor for the security cost sub-function and an offset cost normalization factor for the offset cost sub-function.
9. The generation method according to claim 1, characterized in that, The initial constraint set includes a three-degree-of-freedom constraint set expanded from a two-degree-of-freedom constraint set. The two degrees of freedom include those corresponding to the first and second joint axes, and the constraint set for the two degrees of freedom includes polygonal constraints. The three degrees of freedom include the degrees of freedom corresponding to the first and second joint axes and the degree of freedom corresponding to the third joint axis. The constraint set for the three degrees of freedom includes prismatic polyhedral constraints, where the upper and lower surfaces defined by the prismatic polyhedral constraints have the same shape as the region defined by the polygonal constraints. In the process of performing multi-objective optimization on the parameters of the initial constraint set to obtain the target constraint set, for the side constraint of the cylindrical polyhedron constraint, the coefficient of the normal vector of the side constraint corresponding to the third joint axis is fixed to zero, and for the upper and lower surface constraints of the cylindrical polyhedron constraint, all parameters of the upper and lower surface constraints are fixed.
10. The generation method according to claim 1, characterized in that, The step of projecting collision points in the collision sample set and non-collision points in the non-collision sample set along multiple preset search directions to obtain projection values of the collision points and non-collision points; for each of the multiple preset search directions, obtaining a boundary threshold for the preset search direction based on the projection values of the collision points and non-collision points; and determining the boundary position based on the boundary thresholds corresponding to the multiple preset search directions and the non-collision sample set, includes: The collision sample set and the non-collision sample set in the joint space are transformed to a normalized space through a linear mapping. The boundary position of the safe region in the normalized space is determined, and the boundary position in the normalized space is mapped back to the joint space to obtain the boundary position in the joint space. The step of generating an initial constraint set for defining the safe area based on the boundary location includes: A convex hull is constructed based on the points corresponding to the boundary positions in the normalized space to obtain the initial constraint set in the normalized space. The initial constraint set in the normalized space is then mapped back to the joint space to obtain the initial constraint set in the joint space.
11. A robot control method, characterized in that, include: Based on the target constraint set obtained by the robot joint space coupling constraint generation method according to any one of claims 1 to 10, the robot's motion trajectory is planned, and the motion trajectory includes the robot's motion parameters; The robot's movement is controlled based on the motion parameters.
12. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions. The processor is used to execute the method for generating robot joint spatial coupling constraints according to any one of claims 1 to 10 or the robot control method according to claim 11.
13. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the method for generating robot joint spatial coupling constraints as described in any one of claims 1 to 10 or the robot control method as described in claim 11.
14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by the processor of a computer device, enables the computer device to perform the robot joint spatial coupling constraint generation method according to any one of claims 1 to 10 or the robot control method according to claim 11.
Citation Information
Patent Citations
Unmanned aerial vehicle cognitive anti-collision control method based on security boundary analysis
CN108319291A
Robot trajectory under collision constraints
US20240238977A1