Trajectory planning method and device
By planning the pause position trajectory when the robot receives a pause command, making it consistent with the original position trajectory, and using uniform deceleration or uniform acceleration motion, the problem of inconsistent trajectories when the robot pauses is solved, and the smoothness and safety of operation are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
- Filing Date
- 2023-09-12
- Publication Date
- 2026-07-24
Smart Images

Figure CN117124323B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics, and more specifically, to a trajectory planning method and apparatus. Background Technology
[0002] During normal robot operation, certain requirements necessitate pausing the current movement. If pausing is achieved by reducing the speed to zero at each joint through maximum acceleration, and each joint is controlled individually, it is impossible to guarantee the consistency between the Cartesian trajectory (i.e., the actual position trajectory during the pause) and the original position trajectory during the corresponding normal movement (i.e., the trajectory segment within the original position trajectory corresponding to the current movement that corresponds to the pause time range). This leads to changes in the robot's position trajectory, which can easily cause accidents such as end-effector collisions (especially when the end-effector contacts the workpiece) and robot collisions (especially when the robot is operating in a confined space or when there are objects around the robot). Summary of the Invention
[0003] This application provides a trajectory planning method, device, electronic device, and readable storage medium, which can ensure the consistency between the trajectory at the paused position and the original trajectory segment corresponding to the pause period while achieving a pause, without any change in the motion trajectory. This can effectively avoid accidents such as end-effector collisions and robot collisions, and greatly improve the stability and safety of robot operation.
[0004] The embodiments of this application can be implemented as follows:
[0005] In a first aspect, embodiments of this application provide a trajectory planning method, the method comprising:
[0006] When a pause command is received during robot movement, a first target position, the current position speed of the robot end effector, and the current position are determined. The first target position is the position of the first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point.
[0007] With the requirement that the velocity at the first target position of the first target trajectory point is 0, the pause position trajectory planning information corresponding to the pause process is planned based on the current motion, current position velocity, current position and first target position. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position.
[0008] Secondly, embodiments of this application provide a trajectory planning device, the device comprising:
[0009] The information acquisition module is used to determine the first target position, the current position speed and current position of the robot end effector when a pause command is received during robot movement. The first target position is the position of the first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point.
[0010] The planning module is used to plan the pause position trajectory planning information corresponding to the pause process based on the current motion, current position velocity, current position and the first target position, with the first target position velocity of the first target trajectory point being 0. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position.
[0011] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the trajectory planning method described in the foregoing embodiments.
[0012] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the trajectory planning method as described in the foregoing embodiments.
[0013] The trajectory planning method, apparatus, electronic device, and readable storage medium provided in this application, when receiving a pause command during robot movement, determine a first target position, the current position velocity of the robot's end effector, and the current position. The first target position is the position of a first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point. With the first target position velocity of the first target trajectory point being 0 as a requirement, based on the current movement, current position velocity, current position, and first target position, pause position trajectory planning information corresponding to the pause process is planned. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position, and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position. Thus, while achieving pause, the consistency between the pause position trajectory and the original position trajectory segment corresponding to the pause period is ensured, preventing changes in the movement trajectory and effectively avoiding accidents such as end effector collisions and robot collisions, greatly improving the stability and safety of robot operation. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic diagram of the original position trajectory segment and the paused position trajectory segment;
[0016] Figure 2 A block diagram illustrating an electronic device provided in an embodiment of this application;
[0017] Figure 3 One of the flowcharts of the trajectory planning method provided in the embodiments of this application;
[0018] Figure 4 for Figure 3 One of the flowcharts illustrating the sub-steps included in step S120;
[0019] Figure 5 for Figure 4 A flowchart illustrating the sub-steps included in the neutron step S122;
[0020] Figure 6 A schematic diagram of the location planning curve provided in the embodiments of this application;
[0021] Figure 7 A schematic diagram of the speed planning curve provided for an embodiment of this application;
[0022] Figure 8 for Figure 3 The second flowchart of the sub-steps included in step S120;
[0023] Figure 9 for Figure 8 A flowchart illustrating the sub-steps included in neutron step S126;
[0024] Figure 10 A second schematic flowchart illustrating the trajectory planning method provided in this application embodiment;
[0025] Figure 11 The third flowchart illustrating the trajectory planning method provided in this application embodiment;
[0026] Figure 12 The fourth flowchart illustrating the trajectory planning method provided in this application embodiment;
[0027] Figure 13 One of the block diagrams of the trajectory planning device provided in the embodiments of this application;
[0028] Figure 14 This is a second block diagram of the trajectory planning device provided in the embodiments of this application.
[0029] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication unit; 200 - Trajectory planning device; 210 - Information acquisition module; 220 - Planning module; 230 - Control module. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0031] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0032] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0033] During normal robot operation, when a temporary stop is required, a pause operation is typically triggered. Currently, this is achieved by reducing the speed to zero through maximum acceleration of each joint. However, because each joint is controlled individually, this method cannot guarantee the consistency between the Cartesian trajectory (i.e., the actual position trajectory during the pause) and the original position trajectory segment (i.e., the trajectory segment in the original position trajectory corresponding to the pause time range). This can lead to changes in the robot's motion trajectory, easily causing accidents such as end-effector collisions (especially when the end-effector contacts the workpiece) and robot collisions (especially when the robot is operating in a confined space or when there are objects around the robot).
[0034] like Figure 1 As shown, position trajectory segment 1 and position trajectory segment 2 are the original position trajectories. Assuming the robot receives a pause operation at point M, trajectory segment 3 needs to be planned as the pause position trajectory segment to achieve the pause. Since the consistency between the path corresponding to pause position trajectory segment 3 and the path corresponding to position trajectory segment 2 cannot be guaranteed—that is, if the path corresponding to pause position trajectory segment 3 is different from the path corresponding to position trajectory segment 2—collisions or other accidents may occur. Figure 2 The trajectory segments 1, 2, and 3 shown are only used to represent different trajectory segments and are not used to represent specific path shapes. For example, trajectory segment 3 is only used to represent the pause position trajectory segment and is not used to restrict the path corresponding to the trajectory segment to a straight line.
[0035] To address the above issues, this application provides a trajectory planning method, apparatus, readable storage medium, and electronic device. While achieving a pause, it ensures the consistency between the paused position trajectory and the original position trajectory segment corresponding to the pause period, preventing trajectory changes and effectively avoiding accidents such as end-effector collisions and robot collisions, thus greatly improving the robot's operational stability and safety.
[0036] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0037] Please refer to Figure 2 , Figure 2 This is a block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may be, but is not limited to, a computer, a robot control unit, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, processor 120, and communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0038] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0039] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a trajectory planning device 200, which includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running the software programs and modules stored in the memory 110, such as the trajectory planning device 200 in this embodiment, thereby implementing the trajectory planning method in this embodiment.
[0040] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0041] It should be understood that, Figure 2 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0042] Please refer to Figure 3 , Figure 3 This is one of the flowcharts illustrating the trajectory planning method provided in this application embodiment. The method can be applied to the aforementioned electronic device 100. The specific flow of the trajectory planning method is described in detail below. In this embodiment, the method may include steps S110 to S120.
[0043] Step S110: If a pause command is received during robot movement, determine the first target position, the current position speed of the robot end effector, and the current position.
[0044] In this embodiment, the robot receives a pause command during its current motion. Optionally, this pause command can be triggered manually by the user through an interface (e.g., an app interface), or by the user through a teach pendant or host computer; it can also be automatically generated and sent to the electronic device by other devices. The specific generation method of the pause command is not limited here. Upon receiving the pause command, the planned motion command can be paused, and the first target position, the current position velocity V0 of the robot's end effector, and the current position can be obtained.
[0045] Wherein, the first target position is the position of the first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point, that is, the current trajectory point is reached first, and the first target trajectory point is reached later.
[0046] The first target position can be determined based on a pause command. For example, the pause command may directly include the first target position. Alternatively, it may include a user-specified time N1. The sum of the current time N and time N1 can be used as the first target time, and the position corresponding to the first target time in the original position trajectory can be used as the first target position. Time N1 can be configured by the user through an interface, teach pendant, or host computer, and carried in the pause command. The original position trajectory planning information corresponding to the original position trajectory may include a correspondence between time and position. After determining the first target time, the position corresponding to the first target time in the original position trajectory can be determined based on this correspondence.
[0047] The first target position can also be determined automatically. For example, a pre-set correspondence between different position speed ranges and the required pause duration can be established. It is understood that the higher the position speed, the longer the required pause duration. Based on the current position speed, the correspondence between different position speed ranges and the required pause duration, the required duration corresponding to the current position speed can be determined. Then, based on the current time and the determined required duration, the first target time can be calculated, and the position corresponding to the first target time in the original position trajectory can be used as the first target position. Alternatively, a pause duration can be pre-set. Upon receiving a pause command, the first target time can be directly calculated based on this pause duration and the current time, and the position corresponding to this first target time in the original position trajectory can be used as the first target position. The specific method for determining the first target position based on the first target time can be the same as the aforementioned method and will not be elaborated further here.
[0048] It is worth noting that the specific method for determining the first target position described above is only an example, and the actual method can be determined based on specific needs. Specifically, the robot supports reaching the first target position from the current position, and its position velocity at the first target position is 0; that is, the robot's acceleration performance supports the robot reaching the first target position from the current position, and its position velocity at the first target position is 0. In other words, for example, when setting the value of N1, N1 can be based on the maximum speed and maximum acceleration of the robot's end effector, and the value of N1 will not cause the position velocity at the first target position to be non-zero.
[0049] Step S120: With the first target position velocity of the first target trajectory point being 0 as a requirement, the pause position trajectory planning information corresponding to the pause process is planned based on the current motion, current position velocity, current position and first target position.
[0050] Next, with the requirement that the velocity V1 of the first target trajectory point be 0, and based on the first target position, the current velocity V0 of the robot's end effector, and the current position, combined with the current motion, the pause position trajectory planning information corresponding to the pause process is planned. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position, and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position. That is, the pause position trajectory and the trajectory segment already executed when the pause command is received belong to the same motion, and the starting point of the pause position trajectory is the ending point of the trajectory segment already executed when the pause command is received, and the ending point of the pause position trajectory is the point in the original position trajectory that has not yet been reached when the pause command is received.
[0051] It is understandable that the correspondence between time and location in the paused location trajectory planning information may differ from the correspondence between time and location within the pause period (i.e., the time period used to achieve the pause) in the original location trajectory planning information, but the corresponding location trajectories are the same.
[0052] Thus, by performing trajectory consistency planning during the pause segment, the consistency between the trajectory at the pause position and the original trajectory segment corresponding to the pause period can be guaranteed while achieving the pause. There will be no change in the motion trajectory, which can effectively avoid accidents such as end-effector collisions and robot collisions, and greatly improve the stability and safety of robot operation.
[0053] Optionally, when planning the pause, the length of the pause path can be calculated by combining the current motion, current position, and first target position. Then, combined with the current position velocity V0, the corresponding pause position trajectory planning information can be obtained. Optionally, the pause can be achieved by uniformly decelerated motion, motion that accelerates then decelerates, or other motion methods; no specific limitations are imposed here.
[0054] Optionally, the current motion is linear motion, in which case it can be achieved through... Figure 4 The method shown obtains the trajectory planning information for the pause location. Please refer to... Figure 4 , Figure 4 for Figure 3 One of the flowcharts for the sub-steps included in step S120. In this embodiment, step S120 may include sub-steps S121 to S122.
[0055] Sub-step S121: Calculate the pause distance based on the current motion, current position, and first target position.
[0056] When the current motion is linear, the pause distance can be calculated using the following formula:
[0057]
[0058] Where (x0,y0,z0) represents the current position p0, (x1,y1,z1) represents the first target position p1, and d1 represents the pause distance.
[0059] Sub-step S122: With the first target position velocity being 0 as a requirement, the trajectory planning information of the pause position is obtained based on the current motion, pause distance, and current position velocity.
[0060] Given the pause distance, the trajectory planning information for the pause position can be obtained by using uniform deceleration or acceleration followed by deceleration, based on the pause distance, current movement, and current position speed, to achieve a speed of 0 at the first target position.
[0061] Alternatively, since uniformly decelerated motion is easy to calculate, it can be used as a possible implementation method, such as... Figure 5 As shown, uniform deceleration is used during the pause. Please refer to... Figure 5 , Figure 5 for Figure 4 A flowchart illustrating the sub-steps included in neutron step S122. In this embodiment, sub-step S122 may include sub-steps S1221 to S1223.
[0062] Sub-step S1221: Calculate the target deceleration under uniform deceleration motion based on the pause distance and the current position velocity.
[0063] Sub-step S1222: Calculate the first pause time based on the target deceleration and the current position velocity.
[0064] Sub-step S1223: Within the first pause time range, obtain the pause position trajectory planning information based on the target deceleration and the current position.
[0065] The target deceleration, first pause time, and current distance traveled can be calculated based on the pause distance using the following method:
[0066]
[0067]
[0068]
[0069] Among them, a 11 T represents the target deceleration. 11 Indicates the first pause time (i.e., deceleration time), s 11 This indicates the current distance traveled during the pause. Therefore, the trajectory planning information for the paused position is as follows:
[0070]
[0071]
[0072]
[0073] When the current motion is linear motion, the pause position trajectory corresponding to the pause position trajectory planning information is:
[0074] The trajectory segments corresponding to the above sub-steps S1221 to S1223 can be as follows: Figure 6 As shown, after receiving the pause command at p0, a pause position trajectory that is still linear motion is planned, with p0 as the starting point of the trajectory, p1 (a point in the original position trajectory) as the ending point, and the velocity at p1 being 0. This is achieved through uniform deceleration, reaching p1. The velocity situation in the deceleration planning is as follows: Figure 7 As shown, the position velocity V0 becomes 0 through uniformly decelerated motion.
[0075] Optionally, the current motion is a full circle motion or a circular arc motion. In this case, it can be achieved through... Figure 8 The method shown obtains the trajectory planning information for the pause location. Please refer to... Figure 8 , Figure 8 for Figure 3 The second flowchart illustrates the sub-steps included in step S120. In this embodiment, step S120 may include sub-steps S124 to S126.
[0076] Sub-step S124: Obtain a first vector based on the center position of the circle corresponding to the current movement and the current position, and obtain a second vector based on the center position of the circle and the first target position.
[0077] Sub-step S125: Calculate the center angle of the pause circle based on the first vector and the second vector.
[0078] In this embodiment, when the current motion is a full circle or an arc, the angle of the pause center can be calculated in the following way:
[0079]
[0080]
[0081]
[0082] Where (x0, y0, z0) represents the current position p0, o represents the center of the circle, and (x r ,y r ,z r () indicates the position of the center of the circle. Let (x1, y1, z1) represent the first vector, and (x1, y1, z1) represent the first target position p1. Let θ1 represent the second vector, and let θ1 represent the angle of the center of the pause circle.
[0083] Sub-step S125: With the first target position velocity being 0 as a requirement, the trajectory planning information for the pause position is obtained based on the current motion, the pause center angle, and the current position velocity.
[0084] Given the center angle of the pause circle, the current motion and current position velocity can be used to achieve a velocity of 0 at the first target position by employing uniformly decelerated motion or other motion methods based on the center angle, thereby obtaining the trajectory planning information for the pause position.
[0085] Alternatively, due to the calculation method for uniformly decelerated motion, as a possible implementation method, it can be achieved through... Figure 9 The method described obtains the pause position trajectory planning information when the current motion is a full circle or an arc motion. Please refer to... Figure 9 , Figure 9 for Figure 8 A flowchart illustrating the sub-steps included in neutron step S126. In this embodiment, sub-step S126 may include sub-steps S1261 to S1263.
[0086] Sub-step S1261: Calculate the target angular deceleration under uniform deceleration motion based on the radius corresponding to the current motion, the angle of the pause center, and the current position velocity.
[0087] Sub-step S1262: Calculate the second pause time based on the target angular deceleration, radius, and current position velocity.
[0088] Sub-step S1263: Within the second pause time range, obtain the pause position trajectory planning information based on the radius corresponding to the current motion, the current position velocity, and the target angular deceleration.
[0089] The target angular deceleration, the second pause time, and the current motion center angle can be calculated based on the pause center angle using the following method:
[0090]
[0091]
[0092]
[0093] Where R represents the radius, a 12 T represents the target angular deceleration. 12 Indicates the second pause time, s 12 This indicates the angle of the current center of the moving circle.
[0094] Optionally, to facilitate the rapid acquisition of pause position trajectory planning information, the pause position trajectory planning information can be obtained by rotating a three-dimensional vector around an arbitrary axis within the second pause time range, based on the plane normal vector corresponding to the current motion, the first vector, the radius corresponding to the current motion, the current position velocity, and the target angular deceleration. The pause position trajectory planning information is as follows:
[0095]
[0096] in, This represents the normal vector of the arc plane or the normal vector of the circular plane.
[0097] The trajectory segments corresponding to the above sub-steps S1261 to S1263 can be as follows: Figure 6 As shown, the position and velocity situation is as follows: Figure 7 As shown, it will not be elaborated further here.
[0098] Upon receiving a pause command, pause attitude trajectory planning information corresponding to the pause position trajectory planning information can also be planned to complete the attitude pause, thereby ensuring safety. Please refer to [link / reference]. Figure 10 , Figure 10 This is a second schematic flowchart illustrating the trajectory planning method provided in this application embodiment. In this embodiment, the method may further include steps S130 to S140.
[0099] Step S130: Upon receiving the pause command, determine the first target posture, the current posture speed of the robot end effector, and the current posture.
[0100] In this embodiment, upon receiving a pause command, the current attitude velocity V of the robot's end effector can be recorded simultaneously. r0 The current pose refers to the position and pose of the robot's end effector. The original trajectory planning information corresponding to the current motion includes original position trajectory planning information and original pose trajectory planning information. The original trajectory corresponding to the original trajectory planning information includes the original position trajectory and the original pose trajectory. The position trajectory corresponding to the original position trajectory planning information is the original position trajectory, and the pose trajectory corresponding to the original pose trajectory planning information is the original pose trajectory. The first target pose is the pose corresponding to the first target trajectory point in the original pose trajectory corresponding to the original position trajectory. That is, based on the original trajectory planning information, the pose of the robot's end effector at the first target trajectory point in the original plan is determined, and this pose is taken as the first target pose.
[0101] Step S140: With the first target attitude velocity of the first target trajectory point being 0 as a requirement, the pause attitude trajectory planning information corresponding to the pause process is planned based on the current attitude velocity, current attitude, and first target attitude.
[0102] In this embodiment, the first target attitude velocity V of the first target trajectory point can be... r1 With a requirement of 0, attitude planning is performed based on the current attitude velocity, the current attitude, and the first target attitude velocity to obtain the paused attitude trajectory planning information corresponding to the pause process. The starting attitude of the paused attitude trajectory corresponding to the paused attitude trajectory planning information is the current attitude, and the ending attitude is the first target attitude. The paused attitude trajectory planning information includes the correspondence between time and attitude.
[0103] Optionally, the pause time T1 in the planning can be paused based on the location (i.e., the first pause time T mentioned above). 11 Or the second pause time T 12 The paused attitude trajectory planning information is obtained through quaternion programming. That is, the time corresponding to the paused attitude trajectory planning is within the pause time range used in the paused position trajectory planning. Thus, the relationship between position, attitude, and time within the pause time T1 can be obtained. Based on this paused attitude trajectory planning information and the paused position trajectory planning information, paused trajectory planning information is obtained. The starting trajectory point in the paused trajectory corresponding to the paused trajectory planning information is the current point (position is the current position, position velocity is the current position velocity V0, attitude is the current attitude, and attitude velocity is V). r1The endpoint trajectory point is the first target trajectory point (position is the first target position, position velocity is 0, attitude is the first target attitude, attitude velocity is 0).
[0104] Optionally, if pause trajectory planning information is obtained, a Cartesian spatial pose command can be obtained. Then, through inverse kinematics calculations, the interpolation command for each control cycle is obtained and sent to the driver for execution, thereby achieving pause. Among these, Indicates location, To express a gesture.
[0105] Please refer to Figure 11 , Figure 11 This is the third flowchart illustrating the trajectory planning method provided in this application embodiment. In this embodiment, after execution is paused, the method may further include steps S210 to S230.
[0106] Step S210: Upon receiving a recovery command, determine the second target location.
[0107] In this embodiment, when the robot needs to continue moving, the electronic device can receive a recovery command. The recovery command can be used to determine time N2. Based on the received times N, N1, and N2 of the stop command, a second target time (i.e., the time N + time N1 + time N2 of the pause command) can be calculated. Then, combined with the correspondence between time and position in the original position trajectory planning information, the position corresponding to the second target time is determined, and this position is taken as the second target position. The second target position is the position of the second target trajectory point in the original position trajectory, where the execution time of the first target trajectory point is earlier than the execution time of the second target trajectory point.
[0108] Optionally, time N2 can be input by the user when triggering the recovery command, such as through an interface, teach pendant, or host computer configuration; or it can be a pre-set fixed value, meaning that as soon as a recovery command is received, time N2 is used to determine the second target position. It is understood that when setting the value of N2, it is necessary to ensure that the robot's maximum end-effector acceleration supports the robot in achieving the corresponding position and velocity requirements at the second target time.
[0109] Step S220: Based on the original position trajectory planning information corresponding to the original position trajectory, obtain the second target position velocity of the second target trajectory point.
[0110] In this embodiment, the original position trajectory planning information includes the correspondence between position and time. The second target position velocity of the second target trajectory point can be obtained by analyzing the original position trajectory planning information, that is, the position velocity at the second target position in the original plan can be obtained by analyzing the original plan.
[0111] Optionally, as a possible implementation, one or more locations near the second target location and the corresponding time of each location can be determined based on the original location trajectory planning information, and then the velocity of the second target location can be calculated.
[0112] Optionally, the position of the third target (the current time N0 + time N1 + time N2-1 when the pause command is received, i.e., the time before the second target time) can be determined based on the original position trajectory planning information. Then, the velocity of the second target position can be calculated based on the distance between the second and third target positions and the specific duration represented by one time. The length of one time can be defined differently by different manufacturers; for example, it can be 1ms or 8ms.
[0113] Step S230: Based on the second target position velocity, current motion, first target position and second target position, the recovery position trajectory planning information corresponding to the recovery process is planned.
[0114] Next, taking the position velocity of the second target trajectory point as a requirement of the second target position velocity V2, and based on the current motion, the first target position, and the second target position, a recovery position trajectory planning information corresponding to the recovery process is planned. The starting point of the recovery position trajectory corresponding to the recovery position trajectory planning information is the first target position, and the ending point is the second target position. The recovery position trajectory planning information includes the correspondence between time and position. That is, the recovery position trajectory and the original position trajectory segment to be executed after recovery belong to the same motion, and the starting point of the recovery position trajectory is the ending point of the previously paused position trajectory, and the ending point of the recovery position trajectory is the point in the original position trajectory that has not yet been reached.
[0115] It is understandable that the correspondence between time and location in the restored location trajectory planning information may differ from the correspondence between time and location within the restoration period (i.e., the time period used to achieve restoration) in the original location trajectory planning information, but the corresponding location trajectories are the same. This method allows the restored trajectory to be directly connected to the original trajectory without the need for replanning.
[0116] Thus, by employing the aforementioned pause-and-resume trajectory consistency control method, consistency planning is performed separately in the pause and resume segments, ensuring the consistency between the original position trajectory segments corresponding to the pause and resume segments and the newly planned position trajectory segments. This prevents trajectory changes and effectively avoids accidents such as end-effector collisions and robot collisions, significantly improving the robot's operational stability and safety. Furthermore, after the robot receives pause and resume commands sequentially, it can continue moving from the previously unfinished trajectory without starting from the beginning.
[0117] In this embodiment, the process of obtaining the restored location trajectory planning information is similar to the process of obtaining the paused location trajectory planning information described above. For details, please refer to the previous description. Here, only two specific methods are introduced for illustrative purposes.
[0118] When the current motion is linear motion, the recovery distance can be calculated using the following formula based on the current motion, the first target position, and the second target position:
[0119]
[0120] Where (x1,y1,z1) represents the first target position p1, (x2,y2,z2) represents the second target position p2, and d2 represents the recovery distance.
[0121] When the current motion is linear and recovery is achieved using uniform acceleration, the target acceleration, the first recovery time, and the current distance traveled can be calculated as follows:
[0122]
[0123]
[0124]
[0125] Where V2 represents the position and velocity of the second target, a 21 T represents the target acceleration. 21 Indicates the first recovery time (i.e., acceleration time), s 21 This indicates the current movement distance during recovery. Therefore, the recovered location trajectory planning information is as follows:
[0126]
[0127]
[0128]
[0129] When the current motion is linear motion, the recovered position trajectory corresponding to the recovered position trajectory planning information is:
[0130] When the current motion is a full circle or a circular arc, the angle of the restored center can be calculated in the following way:
[0131]
[0132]
[0133]
[0134] Where (x1, y1, z1) represents the first target position p1, o represents the center of the circle, and (x2, y2, z2) represents the second target position. r ,y r ,z r () indicates the position of the center of the circle. Let (x2, y2, z2) represent the second vector, and (x2, y2, z2) represent the second target position p2. Let θ represent the third vector, and θ2 represent the angle of the restored center.
[0135] When using a uniformly decelerated motion with a center angle of angular velocity, the target angular acceleration, the second recovery time, and the current center angle of motion can be calculated using the following formulas:
[0136]
[0137]
[0138]
[0139] Where R represents the radius, a 22 T represents the target angular acceleration. 22 Indicates the second recovery time, s 22 This indicates the angle of the current center of the moving circle.
[0140] Optionally, to facilitate the rapid acquisition of the restored position trajectory planning information, the restored position trajectory planning information can be obtained within the second recovery time range by rotating a three-dimensional vector around an arbitrary axis, based on the plane normal vector corresponding to the current motion, the second vector, the radius corresponding to the current motion, the second target position velocity, and the target angular acceleration. The restored position trajectory planning information is as follows:
[0141]
[0142] in, This represents the normal vector of the arc plane or the normal vector of the circular plane.
[0143] The above recovery process trajectory segment can be described as follows: Figure 6As shown, the position and velocity situation is as follows: Figure 7 As shown, this will not be elaborated further. That is, during linear motion, when p1 receives a recovery command, using p1 as the starting point of the trajectory, p2 (a point in the original position trajectory) as the ending point, and a velocity of V2 at p2, uniform acceleration is used to plan a recovery position trajectory that is still linear motion, i.e., reaching p2 through acceleration planning. The velocity situation in acceleration planning is as follows... Figure 7 As shown, the position velocity changes from 0 to V2 through uniformly accelerated motion. The recovery process for circular or full-circle motion is similar.
[0144] Similarly, upon receiving a recovery command, recovery attitude trajectory planning information corresponding to the recovery position trajectory planning information can be planned to complete the attitude update, facilitating direct connection to the original trajectory. Please refer to... Figure 12 , Figure 12 This is a fourth flowchart illustrating the trajectory planning method provided in this embodiment. In this embodiment, the method may further include steps S240 to S260.
[0145] Step S240: Upon receiving the recovery command, determine the second target attitude.
[0146] Wherein, the second target posture is the posture corresponding to the second target trajectory point in the original posture trajectory corresponding to the original position trajectory; that is, the posture of the robot's end effector at the second target trajectory point in the original plan is the second target posture. The second target posture can be determined by determining the first target posture, that is, the posture corresponding to the third target time (the time N + time N1 + time N2 when the pause command is received) in the original posture trajectory planning information is taken as the second target posture.
[0147] Step S250: Based on the original position trajectory planning information, obtain the second target attitude velocity corresponding to the second target trajectory point.
[0148] Optionally, the second target attitude velocity can be calculated using the same method as the second target position velocity. In this method, the third target time (the time when the pause command is received, N + time N1 + time N2-1) can be calculated first. Then, the attitude corresponding to the third target time can be determined based on the original trajectory planning information. Finally, the second target attitude velocity can be calculated based on the second target attitude velocity, the attitude corresponding to the third target time, and the specific duration of each time.
[0149] Step S260: Based on the second target attitude, the second target attitude velocity, and the first target attitude, the recovery attitude trajectory planning information corresponding to the recovery process is planned.
[0150] In this embodiment, the attitude velocity of the second target trajectory point can be defined as the second target attitude velocity V. r2 As required, recovery attitude trajectory planning information corresponding to the recovery process is planned based on the second target attitude and the first target attitude. The starting pose of the recovery attitude trajectory corresponding to the recovery attitude trajectory planning information is the first target attitude, and the ending pose is the second target attitude. The recovery attitude trajectory planning information includes the correspondence between time and attitude.
[0151] Optionally, the recovery time T2 in the location recovery plan (i.e., the first recovery time T mentioned above) can be used as a reference. 21 Or the second recovery time T 22 The recovered attitude trajectory planning information is obtained through quaternion programming. That is, the time corresponding to the recovered attitude trajectory planning is within the recovery time range used in the recovered position trajectory planning. Thus, the relationship between position, attitude, and time within recovery time T2 can be obtained. Based on this recovered attitude trajectory planning information and the recovered position trajectory planning information, the recovered trajectory planning information is obtained. The starting trajectory point in the recovered trajectory corresponding to the recovered trajectory planning information is the first target trajectory point (position is the first target position, position velocity is 0, attitude is the first target attitude, attitude velocity is 0), and the ending trajectory point is the second target trajectory point (position is the second target position, position velocity is the second target position velocity V2, attitude is the second target attitude, attitude velocity is the second target attitude velocity V). r2 ).
[0152] Optionally, if the trajectory planning information is obtained, a Cartesian space pose command can be obtained. Then, through inverse kinematics calculations, the interpolation command for each control cycle is obtained and sent to the driver for execution, thereby achieving recovery. Indicates location, To express a gesture.
[0153] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a trajectory planning device 200 is given below. Optionally, the trajectory planning device 200 can adopt the above-described... Figure 2 The device structure of the electronic device 100 shown. Further, please refer to... Figure 13 , Figure 13 This is one of the block diagrams of the trajectory planning device 200 provided in this application embodiment. It should be noted that the trajectory planning device 200 provided in this embodiment has the same basic principle and technical effects as the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. In this embodiment, the trajectory planning device 200 may include: an information acquisition module 210 and a planning module 220.
[0154] In this embodiment, the information acquisition module 210 is used to determine a first target position, the current position speed of the robot's end effector, and the current position when a pause command is received during robot movement. The first target position is the position of a first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot, where the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point in the original position trajectory.
[0155] The planning module 220 is used to plan pause position trajectory planning information corresponding to the pause process, based on the requirement that the first target position velocity of the first target trajectory point is 0, and according to the current motion, current position velocity, current position, and first target position. The pause position trajectory planning information includes the correspondence between time and position, with the starting point being the current position and the ending point being the first target position.
[0156] Optionally, in this embodiment, upon receiving the pause command, the information acquisition module 210 is further configured to determine the first target posture, the current posture velocity of the robot end effector, and the current posture, wherein the first target posture is the posture corresponding to the first target trajectory point in the original posture trajectory corresponding to the original position trajectory; the planning module 220 is further configured to plan pause posture trajectory planning information corresponding to the pause process based on the current posture velocity, the current posture, and the first target posture, with the first target posture velocity of the first target trajectory point being 0 as a requirement, wherein the starting posture of the pause posture trajectory corresponding to the pause posture trajectory planning information is the current posture, the ending posture is the first target posture, and the pause posture trajectory planning information includes the correspondence between time and posture.
[0157] Optionally, in this embodiment, the information acquisition module 210 is further configured to, upon receiving a recovery instruction, determine a second target position, wherein the second target position is the position of a second target trajectory point in the original position trajectory, and the execution time of the first target trajectory point is earlier than the execution time of the second target trajectory point in the original position trajectory; and obtain the second target position velocity of the second target trajectory point according to the original position trajectory planning information corresponding to the original position trajectory. The planning module 220 is further configured to, based on the second target position velocity, current motion, first target position, and second target position, plan recovery position trajectory planning information corresponding to the recovery process. The recovery position trajectory corresponding to the recovery position trajectory planning information has the first target position as its starting point and the second target position as its ending point, and the recovery position trajectory planning information includes a correspondence between time and position.
[0158] In this embodiment, the information acquisition module 210 is further configured to: upon receiving the recovery instruction, determine a second target attitude, wherein the second target attitude is the attitude corresponding to the second target trajectory point in the original attitude trajectory corresponding to the original position trajectory; and obtain the second target attitude velocity corresponding to the second target trajectory point according to the original position trajectory planning information. The planning module 220 is further configured to: plan recovery attitude trajectory planning information corresponding to the recovery process according to the second target attitude, the second target attitude velocity, and the first target attitude, wherein the starting pose of the recovery attitude trajectory corresponding to the recovery attitude trajectory planning information is the first target pose, the ending pose is the second target pose, and the recovery attitude trajectory planning information includes the correspondence between time and attitude.
[0159] Please refer to Figure 14 , Figure 14 This is a second block diagram of the trajectory planning device 200 provided in an embodiment of this application. In this embodiment, the trajectory planning device 200 may further include a control module 230.
[0160] The control module 230 is used to perform pause control based on the pause position trajectory planning information or the pause position trajectory planning information and the pause attitude trajectory planning information, so as to achieve pause.
[0161] The control module 230 is further configured to perform recovery control based on the recovery position trajectory planning information or the recovery position trajectory planning information and recovery attitude trajectory planning information, so as to achieve recovery.
[0162] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory 110 shown is either stored in or embedded in the operating system (OS) of the electronic device 100, and can be used by... Figure 2 The processor 120 executes the program. Meanwhile, the data and program code required to execute the above modules can be stored in the memory 110.
[0163] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the trajectory planning method described above.
[0164] In summary, this application provides a trajectory planning method, apparatus, electronic device, and readable storage medium. When a pause command is received during robot movement, a first target position, the current position velocity of the robot's end effector, and the current position are determined. The first target position is the position of a first target trajectory point in the original position trajectory corresponding to the robot's current movement. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point. With the first target position velocity of the first target trajectory point being 0 as a requirement, based on the current movement, current position velocity, current position, and first target position, pause position trajectory planning information corresponding to the pause process is planned. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position, and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position. Thus, while achieving pause, the consistency between the pause position trajectory and the original position trajectory segment corresponding to the pause period is ensured, preventing changes in the movement trajectory and effectively avoiding accidents such as end effector collisions and robot collisions, greatly improving the stability and safety of robot operation.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0166] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0167] If the aforementioned functions are implemented as software functional modules 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 code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] The above description is merely an optional embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A trajectory planning method, characterized in that, The method includes: When a pause command is received during robot movement, a first target position, the current position speed of the robot end effector, and the current position are determined. The first target position is the position of the first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point. With the requirement that the velocity at the first target position of the first target trajectory point is 0, the pause position trajectory planning information corresponding to the pause process is planned based on the current motion, current position velocity, current position and first target position. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position, and the pause position trajectory is consistent with the original position trajectory. When the current motion is a circular motion, the step of planning the pause position trajectory planning information corresponding to the pause process based on the current motion, current position velocity, current position, and first target position, with the requirement that the first target position velocity of the first target trajectory point be 0, includes: obtaining a first vector based on the center position of the circle corresponding to the current motion and the current position, and obtaining a second vector based on the center position of the circle and the first target position; calculating the pause center angle based on the first vector and the second vector; and obtaining the pause position trajectory planning information based on the current motion, pause center angle, and current position velocity, with the requirement that the first target position velocity be 0. The step of obtaining the pause position trajectory planning information based on the current motion, the pause center angle, and the current position velocity, with the first target position velocity being 0, includes: calculating the target angular deceleration under uniformly decelerated motion based on the radius corresponding to the current motion, the pause center angle, and the current position velocity; calculating the second pause time based on the target angular deceleration, the radius, and the current position velocity; and obtaining the pause position trajectory planning information within the second pause time range based on the radius corresponding to the current motion, the current position velocity, and the target angular deceleration.
2. The method according to claim 1, characterized in that, When the current motion is linear motion, the step of planning the pause position trajectory planning information corresponding to the pause process based on the requirement that the first target position velocity of the first target trajectory point is 0, according to the current motion, current position velocity, current position, and first target position, includes: The pause distance is calculated based on the current movement, current position, and first target position. With the first target position velocity being 0 as a requirement, the trajectory planning information for the pause position is obtained based on the current movement, pause distance, and current position velocity.
3. The method according to claim 2, characterized in that, The step of obtaining the trajectory planning information for the paused position based on the current motion, pause distance, and current position velocity, with the first target position velocity being 0, includes: Based on the pause distance and the current position velocity, the target deceleration under uniform deceleration motion is calculated; The first pause time is calculated based on the target deceleration and the current position velocity; Within the first pause time range, the trajectory planning information for the pause position is obtained based on the target deceleration and the current position.
4. The method according to claim 1, characterized in that, Within the second pause time range, the pause position trajectory planning information is obtained based on the radius corresponding to the current motion, the current position velocity, and the target angular deceleration, including: By rotating a three-dimensional vector around an arbitrary axis, within the second pause time range, the trajectory planning information for the pause position is obtained based on the plane normal vector corresponding to the current motion, the first vector, the radius corresponding to the current motion, the current position velocity, and the target angular deceleration.
5. The method according to claim 1, characterized in that, The method further includes: Upon receiving the pause command, a first target posture, the current posture speed of the robot end effector, and the current posture are determined, wherein the first target posture is the posture corresponding to the first target trajectory point in the original posture trajectory corresponding to the original position trajectory; With the requirement that the first target attitude velocity of the first target trajectory point is 0, the pause attitude trajectory planning information corresponding to the pause process is planned according to the current attitude velocity, the current attitude, and the first target attitude. The starting attitude of the pause attitude trajectory corresponding to the pause attitude trajectory planning information is the current attitude, and the ending attitude is the first target attitude. The pause attitude trajectory planning information includes the correspondence between time and attitude.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Upon receiving a recovery command, a second target location is determined, wherein the second target location is the location of a second target trajectory point in the original location trajectory, and in the original location trajectory, the execution time of the first target trajectory point is earlier than the execution time of the second target trajectory point; Based on the original position trajectory planning information corresponding to the original position trajectory, the second target position velocity of the second target trajectory point is obtained; Based on the second target position velocity, current motion, first target position, and second target position, recovery position trajectory planning information corresponding to the recovery process is planned. The starting point of the recovery position trajectory corresponding to the recovery position trajectory planning information is the first target position, and the ending point is the second target position. The recovery position trajectory planning information includes the correspondence between time and position.
7. The method according to claim 6, characterized in that, The method further includes: Upon receiving the recovery command, a second target attitude is determined, wherein the second target attitude is the attitude corresponding to the second target trajectory point in the original attitude trajectory corresponding to the original position trajectory; Based on the original position trajectory planning information, the second target attitude velocity corresponding to the second target trajectory point is obtained; Based on the second target attitude, the second target attitude velocity, and the first target attitude, recovery attitude trajectory planning information corresponding to the recovery process is planned. The starting pose of the recovery attitude trajectory corresponding to the recovery attitude trajectory planning information is the first target attitude, and the ending pose is the second target attitude. The recovery attitude trajectory planning information includes the correspondence between time and attitude.
8. A trajectory planning device, characterized in that, The device includes: The information acquisition module is used to determine the first target position, the current position speed and current position of the robot end effector when a pause command is received during robot movement. The first target position is the position of the first target trajectory point in the original position trajectory corresponding to the current movement performed by the robot. In the original position trajectory, the execution time of the current trajectory point is earlier than the execution time of the first target trajectory point. The planning module is used to plan the pause position trajectory planning information corresponding to the pause process based on the current motion, current position velocity, current position and the first target position, with the first target position velocity of the first target trajectory point being 0. The starting point of the pause position trajectory corresponding to the pause position trajectory planning information is the current position and the ending point is the first target position. The pause position trajectory planning information includes the correspondence between time and position, and the pause position trajectory is consistent with the original position trajectory. Wherein, when the current motion is a circular motion, the step of planning the pause position trajectory planning information corresponding to the pause process based on the current motion, current position velocity, current position, and first target position, with the requirement that the first target position velocity of the first target trajectory point be 0, includes: obtaining a first vector based on the center position of the circle corresponding to the current motion and the current position, and obtaining a second vector based on the center position of the circle and the first target position; calculating the pause center angle based on the first vector and the second vector; and obtaining the pause position trajectory planning information based on the current motion, pause center angle, and current position velocity, with the requirement that the first target position velocity be 0. The step of obtaining the pause position trajectory planning information based on the current motion, the pause center angle, and the current position velocity, with the first target position velocity being 0, includes: calculating the target angular deceleration under uniformly decelerated motion based on the radius corresponding to the current motion, the pause center angle, and the current position velocity; calculating the second pause time based on the target angular deceleration, the radius, and the current position velocity; and obtaining the pause position trajectory planning information within the second pause time range based on the radius corresponding to the current motion, the current position velocity, and the target angular deceleration.