Robot trajectory processing methods and systems, robots
By acquiring the timestamps and joint angles of the robot trajectory frame sequence, determining the time interval, and performing amplitude-limiting interpolation, the problem of non-smooth motion in robot trajectory processing is solved, and the smoothness and continuity of robot motion are achieved.
Patent Information
- Application Number
- CN202611600871.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-15
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the timing of timestamps during robot trajectory processing is inconsistent with the timing requirements of the robot controller, leading to problems such as pauses, jitters, or unevenness in robot movements.
By acquiring the timestamps and joint angles in the trajectory frame sequence, the time interval between adjacent trajectory frames is determined, and the joint angle changes are limited based on the preset speed limit of the target robot. Intermediate frames are then inserted to generate a control frame sequence.
This improves the smoothness of robot motion, avoids mechanical impacts and uneven movements, and ensures the continuity and smoothness of trajectory playback.
Smart Images

Figure CN123103698A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of robotics, and in particular to a robot trajectory processing method, a robot trajectory processing system, and a robot. Background Technology
[0002] With the rapid development of trajectory acquisition methods such as robot teaching, motion choreography, and remote sampling, reliably converting the acquired trajectories into robot-executable trajectories has become a key step for industrial robots, collaborative robots, and service robots to achieve motion reproduction and automated operations.
[0003] Currently, robot trajectories typically consist of a series of trajectory frames with timestamps and joint angles. These trajectories can be directly provided to the robot controller by the acquisition side, or the acquisition side can interpolate and complete the joint angles between the trajectory frames before providing them to the robot controller.
[0004] However, the above methods have certain technical problems in practical applications. The order of timestamps and time units in the trajectory directly provided by the acquisition side may not be consistent with the timing requirements of the robot controller, and the number of joint angles in each trajectory frame may also differ. Furthermore, the interpolation performed by the acquisition side is usually only used to increase the temporal density of the trajectory frames. These situations can cause pauses, jitters, or unevenness in the robot's movements when replaying the trajectory. Therefore, there is an urgent need for a robot trajectory processing method that can control robot movement more smoothly. Summary of the Invention
[0005] In view of this, embodiments of this specification provide a robot trajectory processing method. One or more embodiments of this specification also relate to a robot trajectory processing system, a robot, a computer-readable storage medium, and a computer program product, to solve the aforementioned technical problems.
[0006] According to a first aspect of the embodiments of this specification, a robot trajectory processing method is provided, comprising: Obtain a sequence of trajectory frames for the target robot, where each trajectory frame includes a timestamp and joint angles; For adjacent trajectory frames in the trajectory frame sequence, the time interval between adjacent trajectory frames is determined based on the timestamps of the adjacent trajectory frames; Based on the time interval and the preset speed limit of the target robot, the change in joint angle in the adjacent trajectory frames is limited to obtain a trajectory frame sequence including the target joint angle, wherein the preset speed limit is used to limit the maximum change in the joint angle within a unit time interval. Intermediate frames are inserted into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
[0007] According to a second aspect of the embodiments of this specification, a robot trajectory processing system is provided, comprising: The trajectory acquisition module is used to acquire a sequence of trajectory frames for the target robot, wherein each trajectory frame includes a timestamp and joint angles; The time interval determination module is used to determine the time interval between adjacent trajectory frames based on the timestamps of the adjacent trajectory frames in the trajectory frame sequence. The joint angle limiting module is used to limit the change of joint angle in adjacent trajectory frames based on the time interval and the preset speed limit of the target robot, so as to obtain a trajectory frame sequence including the target joint angle, wherein the preset speed limit is used to limit the maximum change of the joint angle within a unit time interval. A frame interpolation module is used to insert intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
[0008] According to a third aspect of the embodiments of this specification, a robot is provided, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, wherein when the computer-executable instructions are executed by the processor, the steps of the robot trajectory processing method described above are implemented.
[0009] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the robot trajectory processing method described above.
[0010] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including computer-executable instructions that, when executed by a processor, implement the steps of the robot trajectory processing method described above.
[0011] One embodiment of this specification implements a robot trajectory processing method, comprising: acquiring a trajectory frame sequence for a target robot, wherein each trajectory frame includes a timestamp and a joint angle; determining a time interval between adjacent trajectory frames based on the timestamps of the adjacent trajectory frames for adjacent trajectory frames in the trajectory frame sequence; limiting the change in joint angles in the adjacent trajectory frames based on the time interval and a preset speed limit of the target robot to obtain a trajectory frame sequence including target joint angles, wherein the preset speed limit is used to limit the maximum change in joint angles within a unit time interval; and inserting intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
[0012] By acquiring a trajectory frame sequence for the target robot, a unified data object is provided for subsequent processing, enabling the processing of time information and joint angle information in the trajectory on the same data basis. By determining the time interval between adjacent trajectory frames based on their timestamps, a basis is provided for constraining joint angle changes according to the time scale, unifying the order of timestamps and time units in the trajectory. By limiting the changes in joint angles in adjacent trajectory frames based on the time interval and the target robot's preset speed limit, a trajectory frame sequence including the target joint angles is obtained. This ensures that the changes in joint angles between adjacent trajectory frames are constrained by the target robot's own speed capabilities, avoiding mechanical shocks and motion unevenness caused by joint angle changes exceeding the target robot's speed capabilities. By inserting intermediate frames into the trajectory frame sequence, a control frame sequence for controlling the target robot is obtained. This supplements the transitional joint angles between adjacent trajectory frames, improving the continuity of joint angle changes during playback. This makes the target robot's movements smoother when played back according to the control frame sequence, thereby improving the smoothness of robot trajectory playback. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a robot trajectory processing method according to one embodiment of this specification; Figure 2 This is a flowchart illustrating the processing procedure of a robot trajectory processing method according to one embodiment of this specification; Figure 3 This is a schematic diagram of the structure of a robot trajectory processing system provided in one embodiment of this specification; Figure 4 This is a structural block diagram of a robot provided in one embodiment of this specification. Detailed Implementation
[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0017] Furthermore, 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 one or more embodiments of this specification are obtained through open-source datasets or public datasets that comply with their license agreements, or are obtained with full authorization from the relevant parties. Moreover, 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.
[0018] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0019] A robot is an automated mechanical device that can perform actions through programming or teaching. It typically consists of a mechanical body, a drive unit, a sensor unit, and a controller.
[0020] Degrees of freedom (DoF) is a measure of a robot's ability to move independently, referring to the number of joints or coordinate directions in which a robot can move independently.
[0021] A joint angle is a quantity that characterizes the position of each joint of a robot at a certain moment, usually expressed in radians or degrees.
[0022] A timestamp is a marker that records the exact moment an event occurred, used to determine the chronological order of data.
[0023] Teaching is a method of operation in which a robot moves along a desired path and configuration through manual guidance or operation, and the system records the movement process.
[0024] Interpolation is a method for estimating unknown location data based on known discrete data points, used to supplement transitional data between data points.
[0025] The control cycle is a parameter that characterizes the fixed time interval between two consecutive control operations of a control device. The control device periodically reads and executes data according to the control cycle.
[0026] Joint velocity is a physical quantity that characterizes how quickly a robot's joint angle changes over time; it is the derivative of the joint angle with respect to time.
[0027] A radian is a unit of angle measurement, which refers to the central angle of a circle when the arc length equals the radius.
[0028] An encoder is a sensing device that converts the displacement or rotation of a moving part into an electrical signal output, used to measure the angle or position of a robot joint.
[0029] Cyclic Redundancy Check (CRC) is an error detection method that uses polynomial division to calculate data and append a check code to verify whether data has changed during transmission or storage.
[0030] Trajectory playback is a process that enables a robot to re-execute corresponding actions based on previously recorded or generated trajectory data.
[0031] A runtime is a software system that provides an execution environment for a program and is responsible for managing the resources and execution flow required by the program during its execution.
[0032] With the rapid development of trajectory acquisition methods such as robot teaching, motion choreography, and remote sampling, reliably converting the acquired trajectories into robot-executable trajectories has become a key step for industrial robots, collaborative robots, and service robots to achieve motion reproduction and automated operations.
[0033] Currently, robot trajectories typically consist of a series of trajectory frames with timestamps and joint angles. These trajectories can be directly provided to the robot controller by the acquisition side, or the acquisition side can interpolate and complete the joint angles between the trajectory frames before providing them to the robot controller.
[0034] However, the above methods have certain technical problems in practical applications. The order of timestamps and time units in the trajectory directly provided by the acquisition side may not be consistent with the timing requirements of the robot controller, and the number of joint angles in each trajectory frame may also differ. Furthermore, the interpolation performed by the acquisition side is usually only used to increase the temporal density of the trajectory frames. These situations can cause pauses, jitters, or unevenness in the robot's movements when replaying the trajectory. Therefore, there is an urgent need for a robot trajectory processing method that can control robot movement more smoothly.
[0035] In view of this, this specification provides a robot trajectory processing method, and also relates to a robot trajectory processing system, a robot, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0036] Specifically, see Figure 1 , Figure 1 A flowchart of a robot trajectory processing method according to an embodiment of this specification is shown, such as... Figure 1 As shown, the method specifically includes the following steps.
[0037] Step 102: Obtain the trajectory frame sequence for the target robot, where each trajectory frame includes a timestamp and joint angles.
[0038] The robot trajectory processing method provided in one or more embodiments of this specification can be applied to various scenarios where robot trajectories need to be preprocessed before being played back by the robot. Specifically, this can include scenarios requiring unified trajectory processing before playback, such as the reproduction of teaching actions for industrial robots and collaborative robots, the playback execution of robot motion choreography results, the local playback of remotely sampled trajectories, and simulation verification and safety assessment of robot actions. The specific application can be a trajectory processing task deployed on a robot's computing unit, an edge controller communicating with the target robot, or a terminal communicating with the target robot. This task can receive a sequence of trajectory frames for the target robot and output a sequence of control frames that meets the playback requirements of the target robot.
[0039] The target robot is the robot whose trajectory processing results ultimately serve and which performs trajectory playback. Specifically, the target robot can be an industrial robot, collaborative robot, or service robot with multiple joints. It is equipped with a controller that receives and executes trajectory data according to its own control cycle to drive the movement of each joint. The target robot has a defined number of joints, and each joint has its own range of motion capabilities, such as the maximum angular velocity of each joint. The target robot can provide the trajectory processing process with information related to control capabilities, such as the number of joints and the upper limit of velocity. Furthermore, the type and control capabilities of the target robot determine the constraints that the time unit, joint angle unit, and the change in joint angles must satisfy during the trajectory processing. Based on these constraints, the trajectory processing process converts the acquired trajectory into a trajectory that the target robot can directly play back.
[0040] A trajectory frame sequence is a sequence of multiple trajectory frames arranged chronologically according to their acquisition time. Specifically, the trajectory frame sequence can originate from trajectory acquisition methods such as manual teaching, motion choreography, or remote sampling. Each trajectory frame in the sequence corresponds to an acquisition time. The trajectory frame sequence can be an array-like data set or a data set described by other data formats. It can contain one or more trajectory frames, and the order of the trajectory frames in the sequence corresponds to the chronological order of their acquisition times. The trajectory frame sequence provides the raw data to be processed in the trajectory processing process, enabling the process to sequentially complete time information normalization, joint structure normalization, joint angle variation constraints, and trajectory frame supplementation based on the same data. Furthermore, the acquisition times and joint angles of each trajectory frame in the trajectory frame sequence may not be completely regular due to factors such as sampling scheduling, communication transmission, and data format conversion during the acquisition process. Therefore, the trajectory frame sequence needs to be uniformly processed in subsequent processing to adapt to the playback requirements of the target robot.
[0041] A timestamp is an identifier for the acquisition time corresponding to a trajectory frame. Specifically, a timestamp records the time information when a trajectory frame was acquired; it can be an absolute time or a relative time relative to the start time of the trajectory. Timestamps can use milliseconds as the time unit, for example, a timestamp of 101ms for one trajectory frame and 105ms for adjacent trajectory frames, or other agreed-upon time units. Timestamps can be used to determine the temporal sequence of trajectory frames and to determine the time interval between adjacent trajectory frames.
[0042] Joint angles are the angle values of each joint of the target robot recorded in the trajectory frame. Specifically, joint angles can be recorded in the form of an array, recording the angle values of all or some joints of the target robot. The elements in the array are arranged in the joint order of the target robot and correspond one-to-one with each joint. Joint angles can be measured in radians, degrees, or other conventional units, such as 0.1 degrees. Joint angles characterize the configuration of the target robot at the corresponding moment in the trajectory frame. The difference in joint angles of the same joint between adjacent trajectory frames is the angle change of that joint. Furthermore, the number of joint angles should correspond to the number of joints of the target robot, and the unit of the joint angles should be consistent across trajectory frames to facilitate determining the angle change of each joint individually and applying constraints to it.
[0043] In practical applications, obtaining the trajectory frame sequence for a target robot can be achieved through various methods.
[0044] One alternative method is to directly obtain the trajectory frame sequence from the teaching process of the target robot. Specifically, for example, during the process of the operator dragging the target robot or teaching it point by point through the teach pendant, the joint encoder of the target robot collects the angle values of each joint according to a preset sampling period, and combines the collection time with the angle values of each joint to form a trajectory frame. Multiple trajectory frames are arranged sequentially to form a trajectory frame sequence, which can be read by the controller of the target robot or a computing device communicating with the controller.
[0045] Another alternative method is to obtain the trajectory frame sequence from the motion choreography results. Specifically, for example, after the motion sequence is choreographed in the motion choreography software, the motion choreography software generates the trajectory frame sequence according to the duration of each motion and the target configuration. The timestamp of each trajectory frame is determined according to the sequence and duration of the motion, and the joint angle of each trajectory frame is determined according to the choreographed target configuration. This trajectory frame sequence can be sent to the computing device that communicates with the target robot through an interface.
[0046] In addition, trajectory frame sequences can be obtained from pre-stored trajectory files. For example, a pre-saved trajectory file can be read, and the timestamps and joint angles of each trajectory frame can be parsed according to the data format used in the trajectory file. The sequence of trajectory frames can then be formed by arranging the parsed frames in the correct order.
[0047] In this step, by acquiring the trajectory frame sequence for the target robot and determining that each trajectory frame includes a timestamp and joint angles, a unified data object is provided for subsequent processing, enabling time information and joint angle information to be processed on the same data basis. Since the trajectory frame sequence can come from various sources such as teaching, programming, remote sampling, or pre-storage, the trajectory processing process does not need to design processing logic for different sources, thereby improving the adaptability of trajectory processing.
[0048] Step 104: For adjacent trajectory frames in the trajectory frame sequence, determine the time interval between adjacent trajectory frames based on the timestamps of the adjacent trajectory frames.
[0049] Adjacent trajectory frames are two trajectory frames that are sequentially adjacent in a trajectory frame sequence. Specifically, adjacent trajectory frames can include a preceding trajectory frame and a following trajectory frame that are adjacent in position within the sequence, directly connected sequentially without any other trajectory frames in between; the timestamps of adjacent trajectory frames can be the same or different. Adjacent trajectory frames provide a comparison object for determining time intervals, allowing time intervals to be determined pairwise within the sequence. Furthermore, trajectory frames in the trajectory frame sequence can be sequentially arranged into multiple pairs of adjacent trajectory frames according to the chronological relationship represented by their timestamps, with each pair of adjacent trajectory frames corresponding to a time interval, thus providing a basis for subsequently constraining the changes in joint angles pairwise.
[0050] The time interval is the time span represented by the timestamps of adjacent trajectory frames. Specifically, the time interval can be determined by the difference between the timestamp of the later trajectory frame and the timestamp of the earlier trajectory frame in an adjacent trajectory frame. Its value can be zero or positive. The time interval can use the same time unit as the timestamp; for example, if the timestamp of the earlier trajectory frame is 102 ms and the timestamp of the later trajectory frame is 106 ms, the time interval between adjacent trajectory frames is 4 ms. The time interval can represent the span between the two acquisition times corresponding to adjacent trajectory frames and can serve as a time scale for subsequently determining the maximum change in joint angles.
[0051] In practical applications, determining the time interval between adjacent trajectory frames in a trajectory frame sequence can be achieved through various methods.
[0052] One possible method is to read the timestamps of adjacent trajectory frames one by one according to the arrangement order of the trajectory frames in the trajectory frame sequence, and subtract the timestamp of the later trajectory frame in the adjacent trajectory frames from the timestamp of the earlier trajectory frame to obtain the time interval between the pair of adjacent trajectory frames; specifically, when the trajectory frame sequence includes multiple trajectory frames, each pair of adjacent trajectory frames can be traversed in the arrangement order. For example, after determining the time interval of the first pair of adjacent trajectory frames, the time interval of the next pair of adjacent trajectory frames can be determined, until the time interval of all adjacent trajectory frames in the sequence is determined.
[0053] Another alternative approach is to establish a correspondence between the timestamps of each trajectory frame and their positions in the sequence while reading the trajectory frame sequence, and then extract the timestamps corresponding to two adjacent positions one by one according to the correspondence, and subtract the two to obtain the time interval. Specifically, in this method, the timestamps of each trajectory frame can be cached in a storage structure indexed by the sequence position, so that when it is necessary to determine the time interval of a pair of adjacent trajectory frames, the corresponding timestamps can be read directly.
[0054] In addition, the timestamps of each trajectory frame can be compared with the control cycle of the target robot. For example, while determining the time interval, the multiple relationship between the time interval and the control cycle of the target robot can be recorded so that trajectory frames can be added between adjacent trajectory frames later.
[0055] In an optional embodiment, the timestamps of adjacent trajectory frames can also be checked during the determination of the time interval. For example, it can be checked whether the timestamp of the later trajectory frame is not less than the timestamp of the earlier trajectory frame. For adjacent trajectory frames with the same timestamp, the time interval is zero. For adjacent trajectory frames with timestamps less than the earlier trajectory frame, the time interval is negative. Both of these cases can be uniformly processed in subsequent processing based on the timestamps of the trajectory frames, so that the adjacent trajectory frames participating in subsequent processing have a positive time interval.
[0056] In an optional embodiment, after determining the time interval, the time interval of each pair of adjacent trajectory frames and their corresponding trajectory frame positions can be recorded together. For example, the time interval of each pair of adjacent trajectory frames can be recorded in the form of an array, with each element in the array arranged in the order of the adjacent trajectory frames in the trajectory frame sequence. Through this record, subsequent processing can directly read the corresponding time interval according to the position of the trajectory frame without having to perform the subtraction operation on the timestamps again.
[0057] In this step, by determining the time interval between adjacent trajectory frames in the trajectory frame sequence, the time span between adjacent trajectory frames is converted into a calculable value, providing a basis for subsequent constraints on the change in joint angles based on the time scale. Since the time interval is determined pairwise for adjacent trajectory frames, each pair of adjacent trajectory frames in the trajectory frame sequence has its own corresponding time scale, thus enabling the subsequent constraint process to adapt to the differences in the time span of each segment in the trajectory frame sequence.
[0058] Step 106: Based on the time interval and the preset speed limit of the target robot, limit the change of joint angle in adjacent trajectory frames to obtain a trajectory frame sequence including the target joint angle. The preset speed limit is used to limit the maximum change of joint angle within a unit time interval.
[0059] The preset speed limit is the maximum allowable angular change of each joint of the target robot per unit time. Specifically, the preset speed limit can be given individually for each joint of the target robot; that is, each joint corresponds to a separate preset speed limit. The preset speed limits for different joints can be the same or different. The preset speed limit can be determined based on the target robot's overall motion capabilities, such as its specifications, joint actuation capabilities, or motion safety requirements. Its unit can match the unit of joint angle and the unit of time interval. For example, if joint angles are in radians and time intervals are in seconds, the unit of the preset speed limit is radians per second. The preset speed limit can be used to limit the maximum change in joint angle within a unit time interval; that is, after multiplying by a certain time interval, it yields the maximum allowable angular change of that joint within that time interval.
[0060] The change in joint angle is the difference in angle values between the same joint in adjacent trajectory frames. Specifically, the change in joint angle can be determined one by one for each joint. That is, for the earlier and later trajectory frames in adjacent trajectory frames, the angle values corresponding to the same joint in the two trajectory frames are taken, and the difference between the two is determined as the change in joint angle. The change in joint angle can be positive or negative, and its sign indicates the different rotation directions of the joint between the pair of adjacent trajectory frames. The change in joint angle can represent the expected angular change of the joint between the pair of adjacent trajectory frames and can be used as input for amplitude limiting operations.
[0061] Clipping is a process that restricts changes in joint angles to within the maximum permissible range. Specifically, clipping can be performed joint-by-joint. For each joint, the angle change is compared to the maximum permissible change within the corresponding time interval. If the angle change exceeds the permissible range, it is replaced with the boundary value of that range; otherwise, it is retained. Clipping can be applied to joint angles in subsequent trajectory frames, adjusting them to the clipped values. Furthermore, clipping only changes the portion exceeding the permissible range, while the portion within the range remains unchanged. Therefore, clipping achieves motion constraints while preserving as much of the original trajectory's joint angle values as possible.
[0062] The target joint angle is the angle value obtained by limiting the joint angle of the subsequent trajectory frame in an adjacent trajectory frame. Specifically, the target joint angle can be determined one by one for each joint, that is, by superimposing the joint angle of the subsequent trajectory frame with the change of the joint angle after limiting; the difference between the target joint angle and the joint angle of the subsequent trajectory frame before limiting does not exceed the maximum allowable change of that joint within the corresponding time interval. The target joint angle can serve as a substitute angle value for the subsequent trajectory frame in the trajectory frame sequence, and can also provide endpoint values for subsequent supplementary trajectory frames between adjacent trajectory frames.
[0063] In practical applications, limiting the change in joint angles in adjacent trajectory frames based on time intervals and preset speed limits can be achieved through various methods.
[0064] One alternative method is to determine the angle change of the same joint in adjacent trajectory frames one by one, compare this angle change with the product of the preset upper limit of the joint's velocity and the time interval between the pair of adjacent trajectory frames, and limit the angle change to the boundary value corresponding to the product if the value of the angle change exceeds the product. Specifically, for the j-th joint, its expected angle change between adjacent trajectory frames can be determined according to the following formula:
[0065] in, For the first The expected angle change of each joint, For adjacent trajectory frames, the first in the later trajectory frame The angle values of each joint. The first trajectory frame in adjacent trajectory frames The angle values of each joint.
[0066] The maximum allowable angle change of the joint between the pair of adjacent trajectory frames can be determined by the following formula:
[0067] in, This represents the maximum allowable angle change for the j-th joint. The preset speed limit for the j-th joint is... This is the time interval between adjacent trajectory frames, and the time interval uses a time unit that matches the preset speed limit. For example, if the time interval is in milliseconds and the preset speed limit is in radians per second, the time interval in milliseconds can be converted to the time interval in seconds. For example, for a time interval of 4ms, the conversion result is 0.004s.
[0068] The limit for the desired angle change can be determined by the following formula:
[0069] in, For the angle change of the j-th joint after amplitude limiting, This means that the value of the first parameter is restricted to the closed interval defined by the second and third parameters. This formula represents: when the desired angle change is greater than the maximum positive value, the maximum positive value is taken; when the desired angle change is less than the maximum negative value, the maximum negative value is taken; when the desired angle change is between the maximum positive and maximum negative values, the desired angle change is retained.
[0070] The target joint angle obtained after limiting the amplitude can be determined according to the following formula:
[0071] in, Let be the target joint angle of the j-th joint. This formula represents that the target joint angle is obtained by superimposing the joint angles of the previous trajectory frame with the angle changes after amplitude limiting.
[0072] For example, if the timestamps of adjacent trajectory frames are 101ms and 105ms, and after standardizing the time unit to 102ms and 106ms, the time interval is 4ms, or 0.004s. At this time, the maximum allowable angle change of each joint can be determined according to the above formula. The target angle of the joint (such as the shoulder joint) whose change exceeds the maximum value within the time interval is limited so that its angle change is equal to the maximum allowable value of the joint. The angle changes of the other joints that do not exceed the maximum value remain unchanged. The target joint angle obtained after limiting can participate in the subsequent processing of inserting intermediate frames between adjacent trajectory frames, so that the final output trajectory satisfies the joint-by-joint velocity constraint while maintaining the same dimension.
[0073] Another alternative method is to determine the angle change of the same joint in adjacent trajectory frames one by one, and if the angle change exceeds the allowable range, the angle value of the joint in the subsequent trajectory frame is corrected proportionally so that the corrected angle change is equal to the maximum allowable change of the joint in the corresponding time interval; specifically, in this method, the corrected angle value is the target joint angle of the joint.
[0074] In addition, the joint identifiers where amplitude limiting occurs and the numerical values of angle changes before and after amplitude limiting can be recorded while determining the target joint angle, so as to facilitate the subsequent verification of the trajectory processing.
[0075] In an optional embodiment, when the preset speed limit is zero, the angle change of the corresponding joint can be determined to be zero, so that the angle value of the joint remains unchanged between adjacent trajectory frames. This situation can correspond to the joints in the target robot that are in a locked state or temporarily not involved in the movement. By determining the angle change of the joint to be zero, it is possible to avoid the joint from generating unexpected movements during the trajectory playback process.
[0076] In this step, the changes in joint angles in adjacent trajectory frames are limited based on time intervals and preset speed limits, and a sequence of trajectory frames including the target joint angles is obtained. This ensures that the changes in joint angles between adjacent trajectory frames are constrained by the target robot's own motion capabilities. Since the limiting is based on the maximum allowable change of each joint within the time interval, the angle changes of joints that do not exceed this limit are preserved. Thus, while ensuring that the angular velocities of each joint of the target robot do not exceed its motion capabilities, the trend of joint angle changes in the original trajectory is preserved.
[0077] Step 108: Insert intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
[0078] Intermediate frames are trajectory frames that supplement the sequence of adjacent trajectory frames. Specifically, an intermediate frame can carry the joint angle value at its current time position, which can be within the range formed by the joint angles of adjacent trajectory frames. One or more intermediate frames can be added between adjacent trajectory frames, and the number of intermediate frames can be related to the time interval between adjacent trajectory frames and the control capability of the target robot. For example, a larger number of intermediate frames can be added when the time interval is long. Intermediate frames can fill in the time transition points in the trajectory frame sequence, thus filling in the originally sparse time positions between adjacent trajectory frames.
[0079] A control frame sequence is a sequence of trajectory frames arranged according to the playback requirements of the target robot, used to control the robot. Specifically, the control frame sequence may include each trajectory frame from the trajectory frame sequence and supplementary intermediate frames, where the frames can be arranged in chronological order according to their timestamps. The time intervals between frames in the control frame sequence can be equal, for example, all equal to the control cycle of the target robot, thus ensuring a uniform temporal distribution of the frames in the control frame sequence. The control frame sequence can be provided to the target robot's controller, which reads and executes them frame by frame according to its control cycle.
[0080] In practical applications, inserting intermediate frames into a trajectory frame sequence can be achieved through various methods.
[0081] One possible approach is to sequentially determine the time positions that need to be supplemented between adjacent trajectory frames according to the control cycle of the target robot, and generate an intermediate frame at each time position. The timestamp of each intermediate frame can be determined by the timestamp of the previous trajectory frame and the offset of the time position relative to the previous trajectory frame. Specifically, the joint angle of each intermediate frame can be determined based on the joint angle of the adjacent trajectory frames, so that the frames in the control frame sequence are evenly distributed in time.
[0082] Another alternative approach is to determine the joint angles of each intermediate frame between adjacent trajectory frames after determining the time positions that need to be supplemented, based on the ratio of the time offset of each time position relative to the previous trajectory frame to the time interval between the two adjacent trajectory frames, so that the joint angles of each intermediate frame smoothly transition between adjacent trajectory frames according to the time ratio; specifically, in this method, the joint angles of each intermediate frame can be determined separately for each joint.
[0083] In addition, after inserting intermediate frames, the timestamps of each frame in the resulting control frame sequence can be checked. For example, check whether the timestamps of each frame in the control frame sequence increase with time, and check whether the timestamp at the last frame of the control frame sequence corresponds to the end time of the trajectory frame sequence.
[0084] In an optional embodiment, the control cycle of the target robot can be configured according to the control frequency of the target robot, the playback frequency of the network environment in which the target robot is located, or the risk level of the trajectory action; for example, when the action risk is high, the control cycle can be configured to a smaller value, so that the time interval between adjacent frames in the control frame sequence is shorter and the transition of joint angles is smoother.
[0085] In an optional embodiment, different joint angle transition methods can be used when inserting intermediate frames. For example, a curved transition method can be used instead of a time-proportional transition method. When using a curved transition method, the joint angles of the resulting intermediate frames are checked to ensure that the joint angles of each intermediate frame are within the range formed by the joint angles of adjacent trajectory frames, so as to avoid the joint angles of the intermediate frames from exceeding the range.
[0086] In this step, by inserting intermediate frames into the trajectory frame sequence and obtaining the control frame sequence for controlling the target robot, transitional joint angles are added between adjacent trajectory frames, thus filling the originally sparse trajectory frame sequence in time. Since the time interval between each frame in the control frame sequence can match the control cycle of the target robot, the target robot does not need to manually add joint angles between frames during playback, thereby improving the continuity of the target robot's playback actions.
[0087] In the embodiments of this specification, by acquiring the trajectory frame sequence for the target robot, a unified data object is provided for subsequent processing, enabling the time information and joint angle information in the trajectory to be processed on the same data basis. By inserting intermediate frames into the trajectory frame sequence, a control frame sequence for controlling the target robot is obtained, and transitional joint angles are added between adjacent trajectory frames, improving the continuity of joint angle changes during playback. This makes the target robot's movements smoother when played back according to the control frame sequence, thereby improving the smoothness of robot trajectory playback.
[0088] In one optional embodiment of this specification, obtaining a trajectory frame sequence for a target robot includes: Obtain the teaching trajectory for the target robot; The teaching trajectory is analyzed to obtain a sequence of trajectory frames for the target robot.
[0089] A teach trajectory is trajectory data that records the desired motion process of a target robot and includes time information. Specifically, the teach trajectory is generated by an operator dragging the target robot, teaching it point-by-point via a teach pendant, or choreographing motions using motion choreography software. Its data format is a collection of multiple trajectory frames, each recording the acquisition time and angle values of each joint. The order of the trajectory frames corresponds to the chronological order of their acquisition times. For example, the teach trajectory can record the timestamps and joint angles of each trajectory frame in an array format, or in other data formats. Furthermore, during the acquisition, choreography, and transmission process, the teach trajectory may contain trajectory frames with odd timestamps, non-incrementing timestamps, or insufficient joint angles. Its data format may also be inconsistent with the format required by the target robot's controller. Therefore, the teach trajectory needs to be parsed and subsequently normalized and verified before it can be directly played back by the target robot.
[0090] Parsing involves reading the data from the taught trajectory according to its data format and extracting the timestamps and joint angles for each trajectory frame. Specifically, parsing includes reading the trajectory array and extracting timestamps and joint angles frame by frame. It also includes validating the data structure during the reading process, such as verifying whether the root object of the trajectory is an array, whether each trajectory frame contains necessary fields, and whether the field types are correct. The content read by parsing can be in JSON format, Protobuf format, or other agreed-upon data formats. Under different data formats, timestamps and joint angles are read according to their respective agreed-upon fields. Furthermore, the result of parsing is a sequence of trajectory frames. The completeness of this sequence determines whether subsequent processing can continue. Therefore, if the root object of the trajectory is not an array, a trajectory frame is missing necessary fields, or the field types are incorrect, the generation process terminates and a trajectory format error is returned, thus avoiding sending incomplete data to the target robot's controller.
[0091] In practical applications, the teaching trajectory for a target robot can be obtained through various methods.
[0092] One alternative method is to collect the teaching trajectory during the teaching process of the target robot. Specifically, for example, during the process of an operator dragging the target robot or teaching it point-by-point via a teach pendant, the joint encoder of the target robot collects the angle values of each joint according to a preset sampling period. The collection time and the angle values of each joint are combined into a trajectory frame, and multiple trajectory frames are arranged sequentially to form the teaching trajectory. The collected teaching trajectory can be saved as a trajectory file by the target robot's controller, or it can be directly read by a computing device communicating with the controller. In this method, the timestamp of the teaching trajectory is taken from the collection time, and its time unit and the unit of the joint angle are determined by the configuration used in the collection process.
[0093] Another alternative method is to obtain the teaching trajectory from a pre-stored trajectory file. Specifically, for example, the trajectory file exported by the target robot's controller or motion choreography software is read according to a pre-agreed storage path, and a data set containing timestamps and joint angles is obtained from this file. This data set is then used as the teaching trajectory, where the order of the trajectory frames is determined according to the order recorded in the file. In this method, the teaching trajectory can originate from the teaching process of other similar robots or from the target robot's previous historical playback process, and its timestamps and joint angles retain their original values at the time of export.
[0094] In addition, the joint angles of the target robot can be collected by a remote device and uploaded with the collection time attached. The local computing device receives the uploaded data and restores it to the teaching trajectory.
[0095] In practical applications, the teaching trajectory can be analyzed to obtain a sequence of trajectory frames for the target robot, which can be achieved through various methods.
[0096] One alternative method is to read the content of the taught trajectory according to its data format, extract the timestamp and joint angle of each trajectory frame frame by frame, and arrange the extracted trajectory frames in the order represented by the timestamps to obtain a trajectory frame sequence for the target robot. Specifically, for example, if the taught trajectory is recorded in array form, each element in the array is read sequentially, with each element corresponding to a trajectory frame, and the timestamp and joint angle are extracted from its timestamp field and joint angle field, respectively; if the taught trajectory is recorded in other data formats, the timestamp and joint angle of each trajectory frame are read according to the field conventions of that data format.
[0097] Another alternative approach is to validate the data structure of the teaching trajectory during the parsing process and output a sequence of trajectory frames after successful validation. Specifically, this involves verifying, for example, whether the root object of the trajectory is an array, whether each trajectory frame contains the necessary fields of timestamp and joint angle, and whether the types of these fields are correct. If validation fails, the current generation is terminated and a trajectory format error is returned. In this method, validation is performed field by field, and the current generation is terminated if any field fails. The returned trajectory format error message carries the identifiers of the fields that failed validation, facilitating verification of the teaching trajectory acquisition process.
[0098] In addition, the parsing results of each trajectory frame can be recorded during the parsing process, such as recording the position of the trajectory frame that failed to be parsed in the teaching trajectory.
[0099] In the embodiments of this specification, by acquiring the teaching trajectory for the target robot and parsing the teaching trajectory, the trajectory frame sequence can be obtained from trajectory data from sources such as the teaching process, action choreography, or remote sampling, providing a unified data object for subsequent processing; thereby improving the adaptability of trajectory processing when the sources and formats of trajectory data differ, and enabling subsequent processing to be performed on the same data object.
[0100] In an optional embodiment of this specification, after acquiring the trajectory frame sequence for the target robot, the method further includes: The timestamp of each trajectory frame in the unified trajectory frame sequence is the target time unit, where the target time unit is an integer multiple of the preset control period; Based on the unified timestamp, the trajectory frame sequence is filtered to obtain the filtered trajectory frame sequence.
[0101] The target time unit is the time unit adopted after unifying the timestamps of each trajectory frame in the trajectory frame sequence. Specifically, the timestamp can use milliseconds as the time unit. For example, the timestamp of a certain trajectory frame is 101ms and the timestamp of the adjacent trajectory frames is 105ms. After unification, an even-numbered time unit required by the controller can be adopted, such as unifying 101ms to 102ms and 105ms to 106ms. The target time unit is an integer multiple of the preset control period. For example, if the preset control period is 2ms, the target time unit is 2ms, and the unified timestamps are all integer multiples of 2ms, that is, all are even-numbered milliseconds.
[0102] The preset control period is a fixed time interval between two adjacent control moments used by the target robot's controller when replaying the trajectory. Specifically, the preset control period is determined by the target robot's controller configuration; for example, it can be 2ms. The target robot's controller reads and executes trajectory data frame by frame according to the preset control period to drive the movement of each joint of the target robot. The preset control period and the target time unit must be integer multiples of each other, ensuring that the unified timestamps fall on the time grid defined by the preset control period. Furthermore, when the timestamps need to be unified to an even-numbered time unit, the preset control period itself must also meet the requirement of an even-numbered unit. For example, if the preset control period is 2ms, all unified timestamps will be even-numbered milliseconds, and the timestamps of intermediate frames added between trajectory frames will also fall on this time grid and strictly increase.
[0103] Filtering involves selecting and discarding trajectory frames from the trajectory frame sequence based on a unified timestamp to obtain a sequence of trajectory frames whose temporal relationships meet the playback requirements. Specifically, filtering includes reading the timestamps of each trajectory frame sequentially in ascending order, retaining trajectory frames whose timestamps are strictly greater than the timestamp of the trajectory frame preceding them (the trajectory frame preceding them is the last one in the sequence that has already been retained during the traversal), and discarding or marking trajectory frames whose timestamps are not ascending, for example, marking trajectory frames whose timestamps are the same as the trajectory frame preceding them.
[0104] In practical applications, the timestamp of each trajectory frame in a unified trajectory frame sequence is used as the target time unit, which can be achieved through various methods.
[0105] One alternative method is to normalize the timestamps of each trajectory frame according to the target time unit, ensuring that the normalized timestamps are integer multiples of the target time unit. Specifically, for example, by rounding up to an integer multiple of the target time unit, if the target time unit is 2ms, the timestamp of a certain trajectory frame is 101ms, and the timestamps of adjacent trajectory frames are 105ms, the normalized timestamps would be 102ms and 106ms respectively. The timestamps of each trajectory frame are processed according to the same rule, maintaining their original chronological order. In this method, normalization is performed on each trajectory frame in the trajectory frame sequence one by one, without changing the values of the joint angles in each trajectory frame.
[0106] Another alternative method is to establish a time grid on the time axis according to a preset control period, and map the timestamps of each trajectory frame to a grid point on that time grid that is closest to its time position. The time corresponding to the grid point is then used as the unified timestamp. Specifically, for example, the interval between grid points can be a preset control period. After the timestamps of each trajectory frame are mapped to grid points, their values are all integer multiples of the preset control period, thus ensuring that the timestamps of each trajectory frame fall on the same time scale. In this method, the interval between grid points can also be a target time unit, and the timestamps of each trajectory frame still maintain their original sequential order.
[0107] In addition, it can also check whether the unified timestamp falls on the time grid defined by the preset control period, and reprocess timestamps that do not fall on the time grid.
[0108] After unifying the timestamps, the trajectory frame sequence can be selected based on the unified timestamps. In practical applications, filtering the trajectory frame sequence based on the unified timestamps to obtain the filtered trajectory frame sequence can be achieved through various methods.
[0109] One alternative method is to traverse the trajectory frames in the trajectory frame sequence in ascending order of timestamps, retaining trajectory frames whose timestamps are strictly greater than the timestamp of the preceding trajectory frame in the filtering results, while discarding or marking trajectory frames, which are not used as the basis for comparison with subsequent trajectory frames. Specifically, for example, for multiple trajectory frames with the same timestamp, the first one is retained, and subsequent trajectory frames are discarded or marked; for trajectory frames whose timestamps are less than the timestamp of the preceding trajectory frame, they are discarded or marked, ensuring that the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive. In this method, trajectory frames discarded or marked during the traversal are not included in the arrangement of the filtering results.
[0110] Another alternative method is to compare the timestamp of each trajectory frame with the timestamp of the preceding trajectory frame one by one, and to handle trajectory frames whose timestamps overlap with the preceding trajectory frame. Specifically, in this method, trajectory frames whose timestamps overlap with the preceding trajectory frame are not used as new interpolation endpoints, do not increase the number of output trajectory frames, and do not generate new interpolation intervals for them. The output trajectory frames here are the trajectory frames to be provided to the controller and arranged according to a preset control cycle, including intermediate frames generated by interpolation between adjacent trajectory frames. Trajectory frames with overlapping timestamps can be discarded, merged, or marked as duplicate frames to keep the time interval between adjacent trajectory frames positive.
[0111] In addition, the filtered trajectory frame sequence can be checked, such as checking whether the timestamps of each trajectory frame are strictly increasing, and counting the number of trajectory frames that are discarded or marked.
[0112] In an optional embodiment, the impact of trajectory frames with repeated timestamps can also be checked. For example, if a trajectory frame whose timestamp repeats the previous trajectory frame is used as a new interpolation endpoint, the time interval between adjacent trajectory frames is zero. Within this time interval, there are no available time positions, the interpolation interval cannot be determined, and the allowable angle variation of each joint within this time interval is also uncertain. Furthermore, two different joint angle values may occur at the same time. Therefore, by not using trajectory frames with repeated timestamps as new interpolation endpoints, the interpolation interval between adjacent trajectory frames in the filtered trajectory frame sequence remains positive, and the output trajectory frames maintain a fixed time interval arrangement.
[0113] In an optional embodiment, trajectory frames in the trajectory frame sequence that do not conform to the playback requirements can be isolated as abnormal frames, and subsequent processing can be performed only between adjacent trajectory frames. For example, if a trajectory frame in the trajectory frame sequence has an insufficient number of joint angles, the trajectory frame is isolated so that it does not participate in subsequent angle limiting and intermediate frame interpolation; if the remaining trajectory frames after isolation are insufficient to form a trajectory, playback is rejected and a trajectory format error is returned. The isolated abnormal frames can be handled by discarding, repairing adjacent frames, partial resampling, or rejecting the entire segment, and the handling results of each abnormal frame are recorded.
[0114] In an optional embodiment, the target time unit can also be an even-numbered time unit that is an integer multiple of the preset control period. Specifically, when the target time unit is an even-numbered time unit, the timestamps of each trajectory frame in the trajectory frame sequence are all even-numbered time units. For example, when the preset control period is 2ms, the unified timestamps are all integer multiples of 2ms, i.e., all are even-numbered milliseconds, and the timestamps of the intermediate frames supplemented between adjacent trajectory frames are also even-numbered milliseconds. Furthermore, since the target robot's controller requires the timestamps of the trajectory frames to be even-numbered time units, setting the target time unit to an even-numbered time unit ensures that the unified timestamps and the timestamps of the supplemented intermediate frames both fall on the time scale required by the controller.
[0115] In an optional embodiment, the timestamps of each trajectory frame in the trajectory frame sequence can be unified to a target time unit. Specifically, this can include: normalizing the timestamps of each trajectory frame in the trajectory frame sequence to an even time unit that is an integer multiple of a preset control period to obtain a unified timestamp; and filtering the trajectory frame sequence based on the unified timestamp to obtain a filtered trajectory frame sequence, wherein the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive.
[0116] In the embodiments of this specification, the timestamps of each trajectory frame in the unified trajectory frame sequence are used as the target time unit, so that the timestamps of each trajectory frame fall on the time grid defined by the preset control period, providing a unified time scale for determining the time interval between adjacent trajectory frames; thereby improving the regularity of the time relationship during trajectory playback, and enabling subsequent angle limiting and intermediate frame supplementation to be performed at a determined time interval.
[0117] In one optional embodiment of this specification, the trajectory frame sequence is filtered based on the unified timestamp to obtain a filtered trajectory frame sequence, including: The trajectory frames in the trajectory frame sequence are filtered according to the increasing timestamp order to obtain the filtered trajectory frame sequence, so that the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive.
[0118] The timestamp increment order is the order in which the trajectory frames in the trajectory frame sequence are arranged according to the chronological relationship represented by their timestamps. Specifically, this order uses the unified timestamps as the basis for comparison. For example, if the timestamps of adjacent trajectory frames in the trajectory frame sequence are 101ms and 105ms, after unification they become 102ms and 106ms. The trajectory frame corresponding to 102ms is placed before the one corresponding to 106ms in this order, and the trajectory frame corresponding to 106ms is placed after the one corresponding to 102ms. When the trajectory frame sequence includes multiple trajectory frames, this order is determined by arranging the trajectory frames in ascending order of their timestamps. The timestamp increment order provides a unified traversal direction for selecting trajectory frames, ensuring that each trajectory frame is compared with the trajectory frames that precede it in this order. Furthermore, this order addresses the chronological relationship of the trajectory frames in the time dimension; it does not change the joint angles recorded by the trajectory frames, nor does it change other information about the trajectory frames besides their arrangement position.
[0119] Strictly increasing timestamps are the property that the timestamps of trajectory frames increase sequentially in ascending order. Specifically, for two adjacent trajectory frames in this order, the timestamp of the later trajectory frame is greater than the timestamp of the earlier trajectory frame. The case where two trajectory frames have the same timestamp does not qualify as strictly increasing; therefore, at most one of multiple trajectory frames with the same timestamp will be retained. For example, two adjacent trajectory frames with timestamps of 102ms and 106ms after unification satisfy strictly increasing timestamps, while two trajectory frames with the same timestamp do not. Trajectory frames with strictly increasing timestamps constitute the filtered sequence of trajectory frames, while trajectory frames with timestamps that are not strictly increasing do not participate in subsequent processing. Specifically, among multiple consecutive trajectory frames with the same timestamp, only one is retained in the filtered sequence of trajectory frames; the remaining trajectory frames can be discarded or marked.
[0120] A positive time interval is a property where the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive. Specifically, the time interval is determined by the difference between the timestamp of the later trajectory frame and the timestamp of the earlier trajectory frame in an adjacent trajectory frame sequence. For example, if the timestamps of adjacent trajectory frames in the filtered trajectory frame sequence are 102ms and 106ms, the time interval between them is 4ms. This difference is greater than zero, therefore the time interval between these adjacent trajectory frames is positive. If the timestamps of adjacent trajectory frames are equal, the difference is zero, and this case does not qualify as a positive time interval. A positive time interval creates an interpolation interval with a length greater than zero between adjacent trajectory frames, providing an effective time scale for determining the allowable variation in joint angles within this interval and for supplementing transition trajectory frames.
[0121] In practical applications, filtering trajectory frames with strictly increasing timestamps from a trajectory frame sequence to obtain a filtered trajectory frame sequence can be achieved through various methods.
[0122] One alternative method is to read the trajectory frames in the trajectory frame sequence one by one in ascending order of timestamps, and compare the timestamp of each trajectory frame with the timestamp of the preceding trajectory frame in the filtered trajectory frame sequence. If the timestamp of the trajectory frame is greater than that of the preceding trajectory frame, the trajectory frame is retained in the filtered trajectory frame sequence. If the timestamp of the trajectory frame is not greater than that of the preceding trajectory frame, the trajectory frame is identified as a non-increasing trajectory frame and is discarded or marked. Specifically, trajectory frames whose timestamps overlap with those of the preceding trajectory frame are not retained as new trajectory frames, ensuring that the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive.
[0123] Another alternative method is to sort the trajectory frames in the trajectory frame sequence according to their timestamps in ascending order, obtaining a sorted trajectory frame sequence. Then, trajectory frames with the same timestamp in the sorted sequence are merged or marked, so that only one of the multiple trajectory frames with the same timestamp is retained. For two adjacent trajectory frames with the same timestamp after sorting, only the one that appears first is retained. Specifically, after the above processing, the timestamps of each trajectory frame in the filtered trajectory frame sequence increase frame by frame in ascending order of timestamps, and the trajectory frames with duplicate timestamps do not add an additional adjacent trajectory frame with a time interval of zero to the filtered trajectory frame sequence.
[0124] In addition, the position and timestamp of the trajectory frames identified as non-incremental can be recorded in the trajectory frame sequence to facilitate subsequent verification of the filtering process.
[0125] In an optional embodiment, trajectory frames whose timestamps overlap with the preceding trajectory frame in the filtered trajectory frame sequence can be discarded, merged, or marked as duplicates. These duplicate trajectory frames do not serve as new interpolation endpoints, do not increase the number of output trajectory frames, and do not generate new interpolation intervals, thus preventing the generation of additional control frames. When trajectory frames with overlapping timestamps are used as interpolation endpoints, adjacent trajectory frames with equal timestamps and a zero time interval will appear in the filtered trajectory frame sequence. There is a lack of transition time intervals between these adjacent trajectory frames, making it impossible to determine the ratio between the change in joint angle and the time interval. Simultaneously, two different joint angle values may appear, making it impossible for the controller to determine the appropriate value. This will also result in overlapping time points in the output trajectory, affecting the fixed-period sampling. Since trajectory frames with overlapping timestamps are not retained, adjacent trajectory frames in the filtered trajectory frame sequence satisfy the condition that the later timestamp is greater than the earlier timestamp, the time interval between them is greater than zero, and the length of the interpolation interval is positive.
[0126] In an optional embodiment, trajectory frames that fail verification in the trajectory frame sequence can be isolated. These include trajectory frames with duplicate timestamps and trajectory frames where the number of joint angles does not match the number of joints in the target robot. Isolated trajectory frames do not participate in subsequent processing; subsequent clipping and interpolation processing are only performed between adjacent trajectory frames in the filtered trajectory frame sequence. For isolated trajectory frames, processing methods include discarding them, repairing them with adjacent trajectory frames, resampling them locally, or not outputting that segment of the trajectory. If the number of trajectory frames in the filtered trajectory frame sequence does not reach the required number to form a trajectory, playback of that trajectory frame sequence can be rejected, and a trajectory format error can be returned.
[0127] In an optional embodiment, the above filtering process can also be applied as a whole to a trajectory playback scenario with abnormal data. For example, if the trajectory contains frames with duplicate timestamps or insufficient joints, the trajectory processing system isolates these abnormal frames and performs amplitude limiting and interpolation only between adjacent verified trajectory frames; if the remaining verified trajectory frames are insufficient to form a trajectory, the playback of the trajectory is rejected and a trajectory format error is returned.
[0128] In the embodiments of this specification, trajectory frames in the trajectory frame sequence with strictly increasing timestamps are filtered based on a unified timestamp and in ascending order of timestamps. This ensures that the timestamps of each trajectory frame in the filtered trajectory frame sequence increase frame by frame in this order. Since the filtering is based on the timestamp of the trajectory frame itself and does not change the joint angles recorded in the trajectory frame, the filtering process is independent of the joint angle content of the trajectory. This allows the filtered trajectory frame sequence to adapt to the playback requirements of the target robot, improving the continuity and consistency of trajectory processing.
[0129] In an optional embodiment of this specification, before determining the time interval between adjacent trajectory frames based on the timestamps of adjacent trajectory frames in a sequence of trajectory frames, the method further includes: Based on the preset number of joints of the target robot, identify and fill in the missing joint angles in the trajectory frame sequence, and unify the joint angle units of each trajectory frame.
[0130] The preset joint count is the total number of joints used by the target robot during trajectory processing. Specifically, the preset joint count is provided by the target robot's specifications, controller configuration, or robot description file. For example, if the target robot has 6 joints, the preset joint count is 6, and each trajectory frame in the trajectory frame sequence records 6 joint angles. Different target robot models have different preset joint counts, and their joint order and speed limit tables may also differ. The preset joint count provides a benchmark for judging the number of joint angles in a trajectory frame. Furthermore, the preset joint count remains unchanged during trajectory processing. The joint angle arrays of each trajectory frame are checked and padded with this count as the target length, ensuring that each trajectory frame has the same array length.
[0131] A trajectory frame with missing joint angles is a trajectory frame sequence in which the number of joint angles recorded is less than the preset number of joints. Specifically, for example, if the preset number of joints is 6, and a trajectory frame's joint angle array only contains 5 angle values, this trajectory frame is considered to have missing joint angles. Such trajectory frames may originate from data loss during acquisition, mixing of trajectory data between different robot models, or field truncation during data format conversion. These trajectory frames need to be identified first, and then the missing angle values need to be filled in according to the preset number of joints.
[0132] The joint angle unit is the measurement unit used for the joint angle values in each trajectory frame. Specifically, joint angle units include radians, degrees, and conventional units such as 0.1 degrees. For example, trajectory frames acquired during the teaching process use 0.1 degrees as the joint angle unit, and the product of a value in the joint angle array and 0.1 degrees is the actual angle of that joint. Trajectory frames from different sources may use different joint angle units; for example, trajectory frames exported from motion choreography software use radians, while trajectory frames acquired by the teach pendant use 0.1 degrees. The joint angle unit, along with the unit of the preset speed limit and the unit of the time interval, jointly determine the correspondence between the change in joint angle and speed. Furthermore, the joint angle unit of each trajectory frame is unified to the same unit, such as radians, to match the unit used for the joint angle with the preset speed limit.
[0133] In practical applications, based on the preset number of joints of the target robot, the trajectory frames with missing joint angles in the trajectory frame sequence can be identified and supplemented through various methods.
[0134] One alternative method is to read the trajectory frames in the sequence sequentially according to the timestamps, based on a preset number of joints. The length of the joint angle array in each trajectory frame is then counted, and trajectory frames with a length less than the preset number of joints are identified as having missing joint angles. Specifically, for example, if the preset number of joints is 6 and a trajectory frame has a length of 5, that trajectory frame is identified. For two adjacent trajectory frames, if one has a length equal to the preset number of joints while the other does not, the trajectory frame with the unequal lengths is identified. If the lengths of both trajectory frames are unequal to the preset number of joints, both trajectory frames are identified, until a trajectory frame with a length equal to the preset number of joints is read.
[0135] Another alternative method is to fill in the joint angle array of a trajectory frame with the difference between the preset number of joints and the number of joint angles in that trajectory frame, so that the number of joint angles after completion equals the preset number of joints. Specifically, the filled angle values are zero-radian angles, for example, the angle value of the missing joint is set to 0 radians; or the joint angle of the same joint in the trajectory frame preceding it in the filtered trajectory frame sequence is used; or the angle value of the missing joint is read from the state of the target robot; or a pre-configured safety angle value is used. The filled angle values are written into the corresponding positions in the joint angle array according to the joint order, so that the angles of each joint after completion correspond one-to-one with the joints of the target robot.
[0136] In addition, the location of trajectory frames identified as missing joint angles and the number of joints added can be recorded, and the number of joint angles in the completed trajectory frames can be checked again to see if they are equal to the preset number of joints.
[0137] After missing joint angles in the trajectory frames are filled in, it is also necessary to ensure that the joint angles of all trajectory frames fall within the same unit of measurement. In practical applications, unifying the unit of measurement for joint angles across trajectory frames can be achieved through various methods.
[0138] One possible approach is to perform the conversion frame-by-frame and joint-by-joint, based on the conversion relationship between the joint angle units used in each trajectory frame and the unified joint angle unit. Specifically, for example, if a trajectory frame uses 0.1 degrees as the joint angle unit, then the product of each angle value in that trajectory frame and 0.1 degrees is taken to obtain the joint angle in degrees, and then the degrees are converted to radians. The conversion is performed separately for each trajectory frame in the trajectory frame sequence, and also for each position in each joint angle array. The converted joint angle is different in value from the original joint angle, but has the same physical meaning.
[0139] Another alternative method is to determine the joint angle unit used based on the unit identifier carried by the trajectory frame or the source of the trajectory frame, and then parse it according to the unified joint angle unit during the reading process. Specifically, for example, if the data structure of the trajectory frame contains a field representing the joint angle unit, the conversion relationship is determined according to this field; if the trajectory frame does not carry this field, the unit is determined according to the agreed unit corresponding to the source of the trajectory frame, for example, the trajectory frame acquired by the teach pendant is processed as 0.1 degrees. Different target robot models have different joint sequences and numbers of joints, and the conversion is performed one by one according to the position of the joints in the joint angle array.
[0140] In addition, the joint angle unit and conversion ratio used by each trajectory frame before conversion can be recorded during the conversion process, and the unified joint angle unit can be matched with the unit of the preset speed limit, so that the change in joint angle and the time interval can participate in subsequent processing in the same unit of measurement.
[0141] In an optional embodiment, if the preset number of joints is not available, the number of joint angles of the first trajectory frame in the trajectory frame sequence can be used as a baseline length. Trajectory frames with a different number of joint angles are identified as having missing joint angles. For trajectory frames with more joint angles than the preset number of joints, they are marked as abnormal and isolated without padding. Isolated trajectory frames do not participate in subsequent processing. For several trajectory frames whose correct joint angle count cannot be determined, they are all marked as abnormal, and playback is rejected and a trajectory format error is returned if the remaining trajectory frames do not reach the required number to form the trajectory. Padding ensures that the number of joint angles in each trajectory frame is consistent, and the angle value corresponding to the missing joint is determined by the value used for padding. If the missing joint undertakes the main movement in the action, the trajectory frame is marked as abnormal during the parsing stage.
[0142] In an optional embodiment, the above-described completion and unit unification process can also be applied as a whole to a trajectory playback scenario with joint dimension errors. For example, if the number of joint angles in a trajectory frame is inconsistent with the preset number of joints of the target robot, the trajectory processing system completes the missing joint angles in the trajectory frame according to the preset number of joints and unifies the joint angle units of each trajectory frame; for trajectory frames that cannot be determined whether to complete or isolate, they are marked as abnormal and excluded from subsequent processing; if the remaining trajectory frames are insufficient to form a trajectory, the playback of the trajectory is rejected and a trajectory format error is returned.
[0143] In the embodiments of this specification, trajectory frames missing joint angles in the trajectory frame sequence are determined and supplemented based on the preset number of joints of the target robot, so that the number of joint angles recorded in each trajectory frame is consistent with the preset number of joints, the angle values corresponding to the missing joints are supplemented, and the joint angle array length of each trajectory frame is the same and maintains a one-to-one correspondence with each joint of the target robot. Since the supplementation and unit unification are completed before the time interval between adjacent trajectory frames is determined, each trajectory frame is consistent in both the number of joint angles and the joint angle units, thereby improving the regularity of trajectory processing and the degree of adaptation to the playback requirements of the target robot.
[0144] In an optional embodiment of this specification, inserting intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot includes: The intermediate frame is obtained by linear calculation based on the joint angles of adjacent trajectory frames and the target joint angle in the trajectory frame sequence; According to the preset control cycle, intermediate frames are inserted between adjacent trajectory frames in the trajectory frame sequence to obtain the control frame sequence.
[0145] Linear calculation is a computation that determines the joint angle of an intermediate frame based on the proportional relationship between the joint angles of adjacent trajectory frames and the target joint angle. Specifically, linear calculation scales the angle difference between the joint angle of the earlier trajectory frame and the target joint angle of the later trajectory frame in the adjacent trajectory frames according to the proportion of the timestamp of the intermediate frame between the two pairs of adjacent trajectory frames, and then superimposes the scaled result with the joint angle of the earlier trajectory frame; for example, if the timestamp of the intermediate frame is located at the midpoint between the two pairs of adjacent trajectory frames, its joint angle is taken as the midpoint of the angle values on both sides.
[0146] In practical applications, intermediate frames can be obtained by linear calculation based on the joint angles of adjacent trajectory frames and the target joint angle in the trajectory frame sequence. This can be achieved through various methods.
[0147] One alternative method is to determine the ratio of the intermediate frame relative to the pair of adjacent trajectory frames based on the relative position of the intermediate frame. Then, the angle difference between the joint angles of the preceding trajectory frame and the target joint angle is scaled according to this ratio. The scaled result is then superimposed with the joint angles of the preceding trajectory frame to obtain the joint angles of each joint in the intermediate frame. Specifically, for example, for the j-th joint, its joint angle at the timestamp of the intermediate frame is determined by the following formula:
[0148] in, For the first Each joint at the timestamp The joint angle at that point, The first trajectory frame in adjacent trajectory frames The joint angles of each joint. For adjacent trajectory frames, the first in the later trajectory frame The target joint angle of each joint. This is the timestamp of the intermediate frame. The timestamp of the earlier trajectory frame. The timestamp is for the later trajectory frame. The above formula represents that the joint angle of the intermediate frame is obtained by superimposing the joint angle of the earlier trajectory frame and the angle difference after scaling, where the scaling ratio is the ratio of the time offset of the intermediate frame relative to the earlier trajectory frame to the time interval between the pair of adjacent trajectory frames.
[0149] Another alternative method is to divide the angle change between adjacent trajectory frames into equal parts according to the multiple relationship between the time interval between adjacent trajectory frames and the preset control cycle, and then accumulate the angle increments of each intermediate frame in the order they appear between the pairs of adjacent trajectory frames to obtain the joint angle of each intermediate frame. Specifically, for example, when an intermediate frame is inserted between adjacent trajectory frames, the joint angle of the intermediate frame is taken as the midpoint between the joint angle of the preceding trajectory frame and the target joint angle; when multiple intermediate frames are inserted, the joint angles of each intermediate frame transition sequentially between the joint angles on both sides according to their order, and the angle increment of each joint is equal to the angle difference of that joint between adjacent trajectory frames divided by the number of equal parts.
[0150] In addition, after obtaining the intermediate frames, it is possible to check whether the joint angles of each intermediate frame are within the range formed by the joint angles of the previous trajectory frame and the target joint angle.
[0151] After obtaining the intermediate frames, the joint angles of each intermediate frame have transitioned between adjacent trajectory frames according to their time positions. It is still necessary to determine the temporal position of each intermediate frame. The intermediate frames, control frame sequence, and preset control period can be found in the descriptions of the foregoing embodiments, and will not be repeated here. In practical applications, intermediate frames are inserted between adjacent trajectory frames in the trajectory frame sequence according to the preset control period to obtain the control frame sequence. This can also be achieved through various methods.
[0152] One alternative method is to sequentially determine the timestamps of intermediate frames between adjacent trajectory frames according to a preset control cycle. That is, starting from the timestamp of the earlier trajectory frame, the timestamps are accumulated sequentially according to the preset control cycle to obtain the timestamps of each intermediate frame. If the accumulated timestamp is earlier than the timestamp of the later trajectory frame, an intermediate frame is inserted at the corresponding time position. Specifically, for example, the timestamps of each intermediate frame are determined according to the following formula:
[0153] in, The timestamp for the intermediate frame. This is the timestamp of the earlier trajectory frame among adjacent trajectory frames. To preset the control cycle, The sequence number of the intermediate frame and The value of is such that the timestamp of the intermediate frame is less than the timestamp of the subsequent trajectory frame. The timestamp of the later trajectory frame in an adjacent trajectory frame is represented by the above formula. The timestamp of each intermediate frame is obtained by adding the timestamp of the earlier trajectory frame to an integer multiple of the preset control period, and the timestamp of each intermediate frame is less than the timestamp of the later trajectory frame. Therefore, the timestamp of each intermediate frame falls on the time grid defined by the preset control period and increases strictly.
[0154] Another alternative method is to determine the number of intermediate frames to be inserted based on the multiple relationship between the time interval between adjacent trajectory frames and the preset control period, and then divide the time span between the pair of adjacent trajectory frames sequentially according to this number, with each intermediate frame located at the divided time position. Specifically, for example, if the timestamps of adjacent trajectory frames are 102ms and 106ms, and the preset control period is 2ms, the time interval between them is 4ms, which is twice the preset control period. In this case, an intermediate frame with a timestamp of 104ms is inserted between 102ms and 106ms. If the time interval is three times the preset control period, two intermediate frames are inserted sequentially between adjacent trajectory frames.
[0155] In addition, after inserting an intermediate frame, it is possible to check whether the timestamps of each frame in the control frame sequence increase sequentially, and to check whether the time interval between the intermediate frame arranged before the subsequent trajectory frame and the subsequent trajectory frame is less than the preset control period.
[0156] In an optional embodiment, the timestamps of intermediate frames can be further verified. For example, the timestamps of each intermediate frame fall on the time grid defined by the preset control period and increase strictly in the order of arrangement. If the timestamps of intermediate frames are required to be even, the preset control period itself satisfies the even unit requirement. For example, if the preset control period is 2ms, then all generated timestamps will be even milliseconds. For different target robots, the control frequency of their controllers varies, and the step size used when inserting intermediate frames is adjusted accordingly according to the control frequency. For example, when the control frequency is high, intermediate frames are inserted between adjacent trajectory frames with a smaller step size.
[0157] In one alternative embodiment, other methods can be used to determine the joint angles of intermediate frames, such as cubic splines, S-curves, fifth-order polynomials, or methods based on the continuity of joint angle changes. The joint angles of each intermediate frame are determined between the joint angles of adjacent trajectory frames and the target joint angle. Furthermore, in addition to the changes in joint angles, factors such as joint angular acceleration, angular jerk, joint torque, joint temperature, or the distance between the target robot and surrounding objects are considered to verify the generated intermediate frames. The preset control cycle is configured according to the target robot's control frequency, the playback frequency in the network environment, or the risk of the action. For example, in cases of high action risk, the preset control cycle is configured to a smaller value.
[0158] In an optional embodiment, the above processing procedure can also be applied as a whole to a specific trajectory playback scenario. For example, in a robot teaching playback scenario, a user drags the target robot to complete a movement using a teach pendant. The timestamps of two adjacent trajectory frames in the collected trajectory are 101ms and 105ms, respectively, and the shoulder joint angle change in the second trajectory frame exceeds the allowable speed. The trajectory processing system normalizes the above timestamps to 102ms and 106ms, and calculates the maximum allowable angle increment of each joint within a 4ms interval; then, an intermediate frame is inserted at 104ms, and all frames are arranged in order according to the target robot's preset control cycle. In this scenario, the underlying playback interface can directly read the processed trajectory data, thereby enabling the target robot to successfully complete the playback according to the trajectory while maintaining the motion intention unchanged, thus maintaining a trajectory that meets the joint speed constraints and can be directly played back by the underlying interface.
[0159] In an alternative embodiment, other constraints may be further introduced during the insertion of intermediate frames. For example, in addition to the change in joint angle, the rate of change of joint angle, the torque on the joint, the joint temperature, and the distance between the target robot and surrounding objects may be considered. These constraints may be checked on the generated intermediate frames, so that while the change in joint angle is constrained, the generated control frame sequence may further satisfy the above-mentioned other constraints.
[0160] In the embodiments of this specification, intermediate frames are obtained by linear calculation based on the joint angles of adjacent trajectory frames and the target joint angle. The joint angles of each intermediate frame transition continuously between adjacent trajectory frames according to their time positions. This facilitates the target robot to execute actions according to the control frame sequence and improves the stability and consistency of trajectory playback.
[0161] In an optional embodiment of this specification, after inserting intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot, the method further includes: Based on the underlying trajectory format corresponding to the target robot, the control frame sequence is encoded to obtain the encoded trajectory data. The underlying trajectory format includes the number of joints and the joint angle of each joint. The trajectory data is sent to the target robot's controller to control the target robot.
[0162] The underlying trajectory format is the way the target robot's controller or trajectory playback interface organizes trajectory data, and its specific form is determined by the target robot. Specifically, the underlying trajectory format includes the number of joints and the joint angles of each joint. These are organized row-wise in the trajectory data, with each row corresponding to a trajectory frame. Within each row, the number of joints and the joint angles of each joint are written sequentially. For example, for a robot with six joints, a single line encoded from a trajectory frame would be "6 0.12". 0.45 1.02 0.33 "0.21 0.08", where the joint angles are written in radians. Furthermore, the above line-by-line organization is just one example; the underlying trajectory format is not limited to a specific protocol and can use text line format, binary format, robot manufacturer's script instruction format, or a custom serial interface protocol.
[0163] Trajectory data is the data obtained after the control frame sequence is serialized according to the underlying trajectory format. Specifically, the trajectory data carries the control frames in the control frame sequence frame by frame in the form of data rows or data units. Each row or unit corresponds to one control frame, which includes the number of joints and the joint angles of each joint. If necessary, it also includes a timestamp, frame header, frame tail, and sequence number. The control frames arranged at a fixed period are arranged sequentially in the trajectory data according to the increasing order of the timestamps. Furthermore, the trajectory data is a data format that can be recognized by the target robot's controller or trajectory playback interface. The controller reads the trajectory data frame by frame according to a preset control cycle, thereby obtaining the joint angles of each joint at each control moment, and driving the movement of each joint of the target robot accordingly.
[0164] In practical applications, the control frame sequence is encoded based on the underlying trajectory format corresponding to the target robot to obtain the encoded trajectory data, which can be achieved through various methods.
[0165] One alternative method is to iterate through each control frame in the control frame sequence, extracting the number of joints and the joint angles of each joint for each frame. Following the field order and separators required by the underlying trajectory format, the number of joints and the joint angles are written onto the same line. The resulting lines for each control frame are arranged sequentially in ascending order of timestamps, yielding trajectory data in text line format. Specifically, for example, for a robot with six joints, a single control frame written onto the same line would contain the number of joints and six joint angles, with the number of joints preceding the six joint angles. The joint angles are written in units required by the underlying trajectory format, such as converting angle values to radians.
[0166] Another alternative method is to sequentially write the timestamps, number of joints, and joint angles of each control frame into binary data blocks according to the fixed byte structure defined by the underlying trajectory format. The joint angles occupy a fixed byte length according to the agreed byte order and unit. The data blocks of each control frame are concatenated end-to-end to form the trajectory data. Specifically, for cases where the underlying trajectory format is a script instruction format, joint trajectory message format, fieldbus process data format, or a custom serial interface protocol, the corresponding data content is generated according to the field names, field order, and delimiters required by that format, so that the encoded data can be directly read by the target robot's controller or trajectory playback interface.
[0167] In addition, after encoding is completed, the encoding results can be checked field by field according to the field order, separator, byte order and unit required by the underlying trajectory format, and the frame header, frame tail and sequence number can be added to the encoding results.
[0168] After obtaining the encoded trajectory data, it can be sent to the target robot's controller. In practical applications, sending trajectory data to the target robot's controller to control the robot can be achieved through various methods.
[0169] One alternative method is to submit the complete trajectory data as a single request to the target robot's controller. The controller then reads each control frame sequentially according to a preset control cycle and sends the joint angles of each joint in each control frame to the corresponding joint actuators to drive the movement of each joint of the target robot. Specifically, in this method, the trajectory data is submitted via the trajectory playback interface provided by the controller. After receiving the trajectory data, the trajectory playback interface stores it in the controller's trajectory buffer and executes each control frame sequentially according to the preset control cycle upon receiving a playback command.
[0170] Another alternative approach is to divide the trajectory data into multiple segments based on its length or the time span it covers, and send these segments sequentially to the target robot's controller according to the timestamps of each control frame. The next segment is sent only after the controller receives and acknowledges the previous one. Specifically, in this method, each data segment corresponds to a consecutive control frame in the control frame sequence. The controller can begin playback upon receiving the first data segment, and subsequent data segments arrive sequentially during playback, continuing from the already played-out portion.
[0171] In addition, after the transmission is completed, the execution result returned by the target robot's controller can be received, and the length of the trajectory data corresponding to this transmission and the transmission time can be recorded so as to verify the playback process.
[0172] In an optional embodiment, the trajectory data can also be validated before being sent to the target robot's controller. For example, cyclic redundancy check (CRC) can be performed on the trajectory data to verify whether bit errors occurred during encoding and transmission; the trajectory length can be verified, i.e., whether the number of control frames in the trajectory data matches the generated control frame sequence; the total duration can be verified, i.e., whether the time span between the first and last control frames in the trajectory data matches the generated control frame sequence; and the resource status can be verified, i.e., whether the target robot's controller currently has the resources required to execute the trajectory data. If any of the above checks fail, the transmission is terminated, and the identifier of the failed check item is retained.
[0173] In an optional embodiment, the encoded trajectory data can also be cached according to a staging identifier and a trajectory identifier. The staging identifier identifies an action staging, and the trajectory identifier identifies a trajectory within that action staging. Together, they determine the ownership of the cache entry. If the trajectory content changes, the cache entry corresponding to that trajectory is invalidated. For example, the content identifier corresponding to the current trajectory content is compared with the content identifier recorded in the cache entry. If they do not match, the cache entry is not reused, and encoding is re-executed. Through caching, the same trajectory does not need to be repeatedly parsed and generated if the content remains unchanged.
[0174] In an optional embodiment, the encoded and transmitted processing results may include at least a success status, error code, and error description, so that the caller can distinguish between parameter errors, object invalidity, disallowed status, and internal execution failure. When multiple requests arrive concurrently, or when the caller resends a request due to lack of response, the request identifier, object version, and current status of each request are compared: if the request content is the same and the earlier request has already been completed, the existing result is returned; if the request content conflicts, or the object version has changed, a conflicting result or an invalid result is returned; side effects are controlled to occur only after verification passes and unique execution qualification is obtained.
[0175] In an optional embodiment, the encoded trajectory data and the current state of the target robot can also be verified. This verification includes at least one or more of the following: cyclic redundancy check, trajectory length check, total duration check, and resource status check. Specifically, the cyclic redundancy check verifies whether the encoded trajectory data has changed during transmission or storage; the trajectory length check verifies whether the number of trajectory frames contained in the encoded trajectory data matches the expected number; the total duration check verifies whether the time span covered by the encoded trajectory data matches the expected time span; and the resource status check verifies whether the target robot currently has the conditions to execute the trajectory data.
[0176] In an optional embodiment, after encoding the control frame sequence based on the underlying trajectory format corresponding to the target robot and obtaining the encoded trajectory data, any one or more of the following can be performed on the encoded trajectory data: cyclic redundancy check, trajectory length check, total duration check, and resource status check, to obtain the check result; if the check result indicates that the check is passed, the encoded trajectory data is sent to the controller of the target robot.
[0177] In an optional embodiment, the encoded trajectory data can be cached according to the arrangement identifier and trajectory identifier corresponding to each processing step. If the content of the trajectory frame sequence changes, the cache corresponding to the changed content is invalidated. For example, if the joint angle, timestamp, or number of trajectory frames in the trajectory frame sequence changes, the trajectory frame sequence is reprocessed and the cache is updated, thereby preventing the calling end from reading cached data that is inconsistent with the current trajectory.
[0178] In the embodiments of this specification, the control frame sequence is encoded based on the underlying trajectory format corresponding to the target robot, so that the control frame sequence obtained by internal processing is serialized into trajectory data used by the controller or trajectory playback interface of the target robot. The number of joints and the joint angle of each joint are given frame by frame in the trajectory data. The controller can determine the number of joint angles in each frame without relying on external metadata. Since the organization of trajectory data is determined according to the underlying trajectory format corresponding to the target robot, the same control frame sequence can adapt to the reading requirements of different controllers or trajectory playback interfaces, thereby improving the adaptability and portability of trajectory processing.
[0179] In one embodiment of this specification, an example of the processing procedure for a robot trajectory processing method is provided. Specifically, see [link to documentation]. Figure 2 , Figure 2 A flowchart illustrating the processing procedure of a robot trajectory processing method provided in one embodiment of this specification is shown.
[0180] like Figure 2 As shown, the processing procedure of this robot trajectory processing method specifically includes the following steps.
[0181] Read the teaching trajectory frames and validate the array and fields of the obtained trajectory frame sequence.
[0182] The timestamps of the verified trajectory frames are made even-numbered so that the timestamps of all trajectory frames are unified to the target time unit.
[0183] The even-numbered trajectory frame sequence is judged by whether the timestamps of each trajectory frame are strictly increasing and whether the joint angle dimensions of each trajectory frame are consistent.
[0184] If the timestamps of each trajectory frame are not strictly incremented or the joint angle dimensions of each trajectory frame are inconsistent, the corresponding trajectory frame will be discarded as an abnormal frame.
[0185] Under the condition that the timestamps of each trajectory frame are strictly incremented and the joint angle dimensions of each trajectory frame are consistent, the joint angles of each trajectory frame in the trajectory frame sequence are converted into angle units, and the trajectory frames with fewer than the preset number of joint angles are supplemented according to the preset number of joints of the target robot.
[0186] After angle unit conversion and joint completion, the time interval between adjacent trajectory frames is determined based on the timestamps of adjacent trajectory frames, and the expected increment per joint is calculated based on this time interval.
[0187] The expected increment for each joint is truncated according to the preset speed limit of the target robot to obtain the target increment for each joint.
[0188] According to the preset control cycle and the target increment of each joint, interpolation frames are inserted between adjacent trajectory frames at a fixed step size to obtain the control frame sequence, and the control frame sequence is encoded into the underlying trajectory format.
[0189] The encoded trajectory data can be cached or sent to the target robot for trajectory playback.
[0190] In the embodiments of this specification, by reading the teaching trajectory frame and verifying the array and fields, incomplete trajectory data is prevented from entering subsequent processing; by inserting interpolation frames at fixed step sizes and encoding the resulting control frame sequence into the underlying trajectory format, the trajectory is organized into data arranged in accordance with the target robot control cycle and cached or sent. The above processing forms a sequentially connected processing link from reading, verification, normalization, amplitude limiting to encoding and playback of the robot trajectory, thereby improving the smoothness and consistency of robot trajectory playback.
[0191] Corresponding to the above method embodiments, this specification also provides embodiments of a robot trajectory processing system. Figure 3 A schematic diagram of a robot trajectory processing system according to one embodiment of this specification is shown. Figure 3 As shown, the robot trajectory processing system includes: The trajectory acquisition module 302 is used to acquire a sequence of trajectory frames for the target robot, wherein each trajectory frame includes a timestamp and a joint angle; The time interval determination module 304 is used to determine the time interval between adjacent trajectory frames based on the timestamps of adjacent trajectory frames in the trajectory frame sequence. The joint angle limiting module 306 is used to limit the change of joint angle in adjacent trajectory frames based on the time interval and the preset speed limit of the target robot, so as to obtain a trajectory frame sequence including the target joint angle. The preset speed limit is used to limit the maximum change of joint angle within a unit time interval. The frame interpolation module 308 is used to insert intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
[0192] The trajectory acquisition module is a functional unit used to obtain the sequence of trajectory frames to be processed. Specifically, the trajectory acquisition module can obtain the sequence of trajectory frames for the target robot from manual teaching, motion choreography results, remote sampling data, or pre-stored trajectory files. Each trajectory frame in the obtained sequence includes a timestamp and joint angles. The trajectory acquisition module can serve as the data entry point for the trajectory processing system, and its output becomes the input for subsequent modules. The trajectory acquisition module can read and reconstruct the trajectory frame sequence according to the data format corresponding to the source of the trajectory frame sequence.
[0193] Furthermore, the trajectory frame sequence obtained by the trajectory acquisition module constitutes the starting point of the data stream of the trajectory processing system, and the subsequent time interval determination module, joint angle limiting module and frame interpolation module all work sequentially based on this trajectory frame sequence.
[0194] The time interval determination module is a functional unit used to determine the time span between adjacent trajectory frames. Specifically, the time interval determination module can receive the trajectory frame sequence output by the trajectory acquisition module, read the timestamps of adjacent trajectory frames one pair according to the order of the trajectory frames in the sequence, and determine the time interval between adjacent trajectory frames by the difference between the timestamp of the later trajectory frame and the timestamp of the earlier trajectory frame. The time interval determination module can determine the time interval for each pair of adjacent trajectory frames in the trajectory frame sequence. The time interval determination module can provide its determined time interval to the joint angle limiting module so that the change in joint angle can be constrained on the corresponding time scale.
[0195] The joint angle limiting module is a functional unit used to constrain the change in joint angles between adjacent trajectory frames. Specifically, the joint angle limiting module can determine the angle change of the same joint in adjacent trajectory frames one by one, and determine the maximum allowable angle change of the joint within the time interval based on the time interval provided by the time interval determination module and the preset speed limit of the target robot. Then, if the angle change exceeds the maximum value, it is limited to the maximum value to obtain the target joint angle. In the trajectory frame sequence output by the joint angle limiting module, the angle change of the same joint between adjacent trajectory frames does not exceed the product of the preset speed limit and the time interval. The joint angle limiting module can ensure that the trajectory output by the trajectory processing system meets the motion capability constraints of each joint of the target robot.
[0196] The frame interpolation module is a functional unit used to supplement trajectory frames. Specifically, the frame interpolation module can receive the trajectory frame sequence output by the joint angle limiting module and insert one or more intermediate frames between adjacent trajectory frames. The joint angles of the intermediate frames can be determined based on the joint angles of the adjacent trajectory frames and the target joint angle. The resulting control frame sequence includes each trajectory frame in the trajectory frame sequence and the inserted intermediate frames. The frame interpolation module can make the control frame sequence output by the trajectory processing system more time-dense, so that the target robot's controller can read and execute frame by frame according to its control cycle.
[0197] In one alternative embodiment, immutable snapshots, shared references, or versioned data objects can be passed between modules in the trajectory processing system; for shared structures involving caches, task queues, or fault queues, they can be protected by mutexes, serial executors, or atomic generational replacement mechanisms so that modules do not observe partially updated states when concurrently accessing the shared structure.
[0198] In one optional embodiment, the processing result output by the trajectory processing system may include at least a success status, an error code, and an error description, so that the calling end can distinguish between parameter errors, object invalidation, state disallowance, and internal execution failure. For duplicate, expired, or invalid inputs, the trajectory processing system may not overwrite the current state with later written results, but instead return a identifiable processing result. For asynchronous tasks, the trajectory processing system may save a data snapshot or generational identifier when the task is created, and cancel the task if the generational identifier changes during execution.
[0199] In one alternative embodiment, the trajectory processing system can also perform necessary field validation, object existence validation, and target robot current state validation before entering the core execution path; when shared data needs to be updated, the trajectory processing system can first construct a complete new state, and then submit the new state all at once within the protected area, so that other threads will not observe the partially updated state.
[0200] In an optional embodiment, the above-described consistency control process can also be applied as a whole to a scenario with concurrent and duplicate requests. For example, when two requests arrive concurrently, or when the calling end resubmits the same request because it has not received a response, the trajectory processing system first compares the request identifier, object version, and current state: if the request content is the same and the previous request has been completed, it returns the existing processing result; if the request content conflicts or the object version has changed, it returns a conflicting or invalid result. In this scenario, the control side effects generated by the trajectory processing system only occur after the verification passes and it obtains unique execution qualification.
[0201] In an alternative embodiment, the trajectory processing system can also orchestrate update operations for shared data into a single-threaded event domain for sequential execution. For example, update operations of each module on the cache, task queue, or fault queue can be submitted to the same event domain, which will then execute the update operations one by one in the submission order. This avoids conflicts caused by concurrent updates without the need to introduce multiple independent locks.
[0202] The robot trajectory processing system provided in this specification comprises a trajectory acquisition module, a time interval determination module, a joint angle limiting module, and a frame interpolation module, which respectively undertake the functions of trajectory acquisition, time interval determination, angle limiting, and frame interpolation. This divides the trajectory processing process into four sequentially connected functional stages. Since each module transmits the processing results sequentially, the trajectory processing system can sequentially complete the determination of time information, the constraint of joint angle changes, and the supplementation of trajectory frames on the same data stream. Furthermore, it ensures that the control frame sequence output to the target robot meets the playback requirements of the target robot in terms of both time distribution and joint angle changes, thereby improving the regularity and maintainability of trajectory processing.
[0203] In an optional embodiment of this specification, the trajectory acquisition module is further configured to acquire a teaching trajectory for the target robot and parse the teaching trajectory to obtain a trajectory frame sequence for the target robot.
[0204] The trajectory acquisition module acquires the teaching trajectory, which records the trajectory data of the target robot's expected movement process. Specifically, the teaching trajectory can be generated by the operator dragging the target robot, by teaching point by point through a teach pendant, or by the motion choreography process, and may contain time information. The trajectory acquisition module can parse the teaching trajectory, extracting the timestamps and joint angles one by one according to the data format used in the teaching trajectory, and combining the extracted timestamps and joint angles into trajectory frames. Multiple trajectory frames are arranged sequentially to form a trajectory frame sequence for the target robot. The trajectory acquisition module can select the appropriate parsing method according to the format of the teaching trajectory. For example, if the teaching trajectory is described in text form, it can be parsed according to its field organization method; if the teaching trajectory is described in binary form, it can be parsed according to its field structure.
[0205] Furthermore, the trajectory acquisition module can check the completeness of the fields of the teaching trajectory during the parsing process. For example, if the root object of the teaching trajectory is not an array, the trajectory frame is missing necessary fields, or the field type is incorrect, the current parsing will be terminated and a trajectory format error will be returned to avoid incomplete trajectory data from entering subsequent processing.
[0206] In terms of data flow and context, the parsing process of the trajectory acquisition module corresponds to the aforementioned process of acquiring and parsing the teaching trajectory. Its output is the trajectory frame sequence for the target robot output by the trajectory acquisition module. The trajectory acquisition module is located at the starting point of the data flow of the trajectory processing system. Its output is provided to the time interval determination module, as well as to the time unification module and the joint verification module.
[0207] In the embodiments of this specification, the teaching trajectory is acquired by the trajectory acquisition module and parsed to obtain the trajectory frame sequence for the target robot, so that the trajectory processing system can directly obtain the trajectory data to be processed from the teaching process. Since the parsing process extracts the timestamp and joint angle according to the data format of the teaching trajectory, the trajectory processing system does not need to rely on external devices to pre-convert the format of the teaching trajectory, thereby expanding the trajectory sources that the trajectory processing system can process.
[0208] In an optional embodiment of this specification, the robot trajectory processing system further includes: The time unification module is used to unify the timestamps of each trajectory frame in the trajectory frame sequence as the target time unit, and to filter the trajectory frame sequence based on the unified timestamps to obtain the filtered trajectory frame sequence.
[0209] The time unification module is a unit used to unify the time information of trajectory frames. Specifically, the time unification module receives the trajectory frame sequence output by the trajectory acquisition module, unifies the timestamps of each trajectory frame to a target time unit, for example, unifying the timestamps of each trajectory frame to an even-numbered time unit required by the controller. After unifying the timestamps, the time unification module can filter the trajectory frames in the trajectory frame sequence according to the increasing timestamp order, retaining the trajectory frames with strictly increasing timestamps, thereby obtaining a filtered trajectory frame sequence, ensuring that the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive. The time unification module can also unify based on the relationship between the target time unit and the preset control cycle of the target robot; for example, the target time unit can be an integer multiple of the preset control cycle.
[0210] In terms of data flow and context, the process executed by the time unification module corresponds to the aforementioned process of unifying and filtering timestamps, as well as the process of filtering trajectory frames in ascending order of timestamps. The time unification module is located between the trajectory acquisition module and the time interval determination module. Its input is the trajectory frame sequence output by the trajectory acquisition module, and its output is the filtered trajectory frame sequence. The filtered trajectory frame sequence is provided to the time interval determination module, which determines the time interval between adjacent trajectory frames in the filtered trajectory frame sequence.
[0211] In the embodiments of this specification, the time unification module unifies the timestamps of each trajectory frame in the trajectory frame sequence and filters the trajectory frame sequence accordingly, so that the trajectory frame sequence processed by the trajectory processing system has a consistent time reference and the time interval between adjacent trajectory frames is positive. Since the unification and filtering of timestamps are completed sequentially in the same module, the determination of time intervals can be carried out on a unified time scale, thereby providing a reliable basis for subsequent constraints on joint angle changes.
[0212] In an optional embodiment of this specification, the robot trajectory processing system further includes: The joint verification module is used to identify and fill in the missing joint angles in the trajectory frame sequence based on the preset number of joints of the target robot, and to unify the joint angle units of each trajectory frame.
[0213] The joint verification module is used to normalize the joint angle structure and unit in trajectory frames. Specifically, the joint verification module can use the preset number of joints of the target robot as a benchmark to check the number of joint angles in each trajectory frame one by one. For trajectory frames with fewer than the preset number of joint angles, the joint verification module can fill in the missing joint angles according to the preset number of joints. For example, it can determine the missing joint angle as the zero angle, use the angle of the corresponding joint in the trajectory frame that precedes it, read the angle of the current joint of the target robot, or take the angle corresponding to the pre-configured safe pose. The joint verification module can also unify the joint angles of each trajectory frame to the same unit, such as radians, so that the joint angles of each trajectory frame can be directly subtracted.
[0214] Furthermore, the joint verification module can also handle trajectory frames where the number of joint angles is inconsistent with the preset number of joints. For example, if it is impossible to determine whether to complete or isolate the trajectory frame, the trajectory frame can be marked as abnormal and prevented from participating in subsequent processing. After completion and unit unification, the number of joint angles in each trajectory frame is the same and the arrangement order is consistent, so that the trajectory frame sequence can determine and limit the angle changes of each joint.
[0215] In terms of data flow and context, the process performed by the joint verification module corresponds to the aforementioned process of determining and supplementing the missing number of joint angles in the trajectory frames based on the preset number of joints, and unifying the joint angle units of each trajectory frame. The joint verification module acts on the joint angle structure and unit of the trajectory frame sequence. Its input is the trajectory frame sequence output by the trajectory acquisition module or the filtered trajectory frame sequence output by the time unification module. Its output is provided to the joint angle limiting module and the frame interpolation module, so that the determination of angle changes and the generation of intermediate frames can be performed according to a fixed joint index.
[0216] In the embodiments of this specification, the joint verification module fills in the missing joint angles of the trajectory frames based on the preset number of joints of the target robot and unifies the joint angle unit, so that each trajectory frame processed by the trajectory processing system has the same number of joint angles and a unified joint angle unit. Since the number of joint angles and the arrangement order of each trajectory frame are consistent, the changes in joint angles can be determined and constrained one by one according to the joints, thereby improving the adaptability of the trajectory processing system to trajectories from different sources.
[0217] In an optional embodiment of this specification, the robot trajectory processing system further includes: The trajectory encoding module is used to encode the control frame sequence obtained by the frame interpolation module based on the underlying trajectory format corresponding to the target robot, and then output the encoded trajectory data.
[0218] The trajectory encoding module is a unit used to convert the control frame sequence into a form recognizable by the target robot. Specifically, the trajectory encoding module receives the control frame sequence output by the frame interpolation module, extracts the timestamp, number of joints, and joint angles of each joint frame by frame based on the underlying trajectory format corresponding to the target robot, and writes them sequentially according to the field order and separation method required by the underlying trajectory format to obtain the encoded trajectory data. The underlying trajectory format for the target robot can include the number of joints and the joint angles of each joint, for example, organized as text lines including the number of joints and the joint angles of each joint per line, or organized according to a fixed byte structure. The trajectory encoding module can also attach verification information or descriptive information to the encoded data, such as cyclic redundancy check information, trajectory length, total duration, and resource status verification information. Furthermore, the trajectory encoding module can provide its output encoded trajectory data to the controller of the target robot so that the controller can drive the movement of each joint of the target robot according to the trajectory data.
[0219] In terms of data flow and context, the process performed by the trajectory encoding module corresponds to the aforementioned process of encoding the control frame sequence based on the underlying trajectory format corresponding to the target robot and sending the trajectory data to the controller of the target robot. The trajectory encoding module is located at the end of the data flow of the trajectory processing system. Its input is the control frame sequence output by the frame interpolation module, and its output is the encoded trajectory data. The encoded trajectory data is provided to the controller of the target robot, thus forming a complete link from trajectory acquisition to trajectory distribution.
[0220] In the embodiments of this specification, the trajectory encoding module encodes and outputs the control frame sequence based on the underlying trajectory format corresponding to the target robot, so that the trajectory data output by the trajectory processing system can be directly recognized by the controller of the target robot. Since the encoding process takes the control frame sequence output by the frame interpolation module as input, the encoded data inherits the constraint results of the control frame sequence in terms of both time distribution and joint angle changes, thereby ensuring the availability of the trajectory data output by the trajectory processing system during playback.
[0221] The above are illustrative schemes of one or more robot trajectory processing systems according to this embodiment. It should be noted that the technical solution of this robot trajectory processing system and the technical solution of the robot trajectory processing method described above belong to the same concept. Details not described in detail in the technical solution of the robot trajectory processing system can be found in the description of the technical solution of the robot trajectory processing method described above.
[0222] Corresponding to the above method embodiments, this specification also provides robot embodiments. Figure 4 A structural block diagram of a robot according to one embodiment of this specification is shown. Figure 4As shown, the robot 400 includes: Memory 410 and processor 420; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the above-described robot trajectory processing method.
[0223] Specifically, the components of the robot 400 include, but are not limited to, a memory 410 and a processor 420.
[0224] The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0225] The robot 400 also includes an access device 440, which enables the robot 400 to communicate via one or more networks 460. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet.
[0226] Access device 440 may include one or more of any type of wired or wireless network interface, such as a Wireless Local Area Network (WLAN) interface, a Worldwide Interoperability for Microwave Access (WiMAX) interface, an Ethernet interface, and a Universal Serial Bus (USB) interface.
[0227] The processor 420 is configured to execute the following computer-executable instructions, which, when executed by the processor 420, implement the steps of the robot trajectory processing method described above.
[0228] In one alternative embodiment, the robot can be any type of stationary or mobile robot, including mobile robots or mobile computing devices, such as collaborative robots, mobile manipulators, and automated guided vehicles. It can also include wearable computing devices, or stationary robots such as industrial robots or CNC machines. The robot can also be a mobile or stationary server. The robot can possess trajectory data processing capabilities, enabling it to execute the aforementioned computer-executable instructions to implement the steps of the robot trajectory processing method.
[0229] Memory is a component in a robot used to store data. Specifically, memory can include read-only memory, random access memory, flash memory, or disk storage, etc. Memory can store computer-executable instructions, which, when executed, enable the robot to process a sequence of trajectory frames. Memory can also store the trajectory frame sequence to be processed, intermediate data generated during trajectory processing, and encoded trajectory data. Memory provides a non-transitory storage medium for computer-executable instructions.
[0230] A processor is a component in a robot used to perform computational and control operations. Specifically, a processor can include a general-purpose processor, a microprocessor, an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA). The processor can read and execute computer-executable instructions from memory to process the trajectory frame sequence and provide the processed trajectory data to the target robot's controller. The processor can execute each processing step indicated by the computer-executable instructions sequentially according to the processing order of the trajectory frame sequence.
[0231] In one optional embodiment, the memory and processor included in the robot can be located in the computing unit of the robot body, so that the trajectory processing is completed inside the robot body; in another optional embodiment, the memory and processor included in the robot can be located in an edge controller that communicates with the robot body, and the edge controller completes the trajectory processing and then sends the trajectory data to the robot body; in yet another optional embodiment, the memory and processor included in the robot can be located in a terminal that communicates with the robot body, and the terminal completes the trajectory processing and then sends the trajectory data to the robot body via a communication link.
[0232] In an optional embodiment, the robot may further include a robot body, a state or resource providing module, a trajectory processing runtime, an interactive terminal, and a robot control interface. The state or resource providing module provides information such as the number of joints, joint angles, and maximum speed of the target robot. The trajectory processing runtime executes the processing procedures indicated by the aforementioned computer-executable instructions. The interactive terminal receives processing requests for the target robot or outputs processing results. The robot control interface receives encoded trajectory data. All of the above components can be connected via reliable communication methods such as wired networks, wireless networks, inter-process communication, or shared storage.
[0233] The robot provided in the embodiments of this specification stores computer-executable instructions in its memory and executes these computer-executable instructions through its processor to implement the robot trajectory processing method, thus integrating trajectory processing capabilities into one side of the robot. Since the computer-executable instructions can be executed sequentially by the processor according to the processing order, the robot can complete the time information correction of the trajectory frame sequence, the constraint of joint angle changes, and the supplementation of trajectory frames before trajectory playback, and ensure that the trajectory played back by the robot meets the requirements of its controller in terms of both time distribution and joint angle changes, thereby improving the stability of robot motion reproduction.
[0234] The above is an illustrative scheme of a robot according to this embodiment. It should be noted that the technical solution of this robot and the technical solution of the robot trajectory processing method described above belong to the same concept. For details not described in detail in the technical solution of the robot, please refer to the description of the technical solution of the robot trajectory processing method described above.
[0235] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the robot trajectory processing method described above.
[0236] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the robot trajectory processing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the robot trajectory processing method described above.
[0237] An embodiment of this specification also provides a computer program product, including computer-executable instructions that, when executed by a processor, implement the steps of the robot trajectory processing method described above.
[0238] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-described robot trajectory processing method belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-described robot trajectory processing method.
[0239] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0240] Computer-executable instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0241] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0242] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0243] The preferred embodiments disclosed above are merely illustrative of this specification. Optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A robot trajectory processing method, characterized in that, include: Obtain a sequence of trajectory frames for the target robot, where each trajectory frame includes a timestamp and joint angles; For adjacent trajectory frames in the trajectory frame sequence, the time interval between adjacent trajectory frames is determined based on the timestamps of the adjacent trajectory frames; Based on the time interval and the preset speed limit of the target robot, the change in joint angle in the adjacent trajectory frames is limited to obtain a trajectory frame sequence including the target joint angle, wherein the preset speed limit is used to limit the maximum change in the joint angle within a unit time interval. Intermediate frames are inserted into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
2. The method according to claim 1, characterized in that, The acquisition of the trajectory frame sequence for the target robot includes: Obtain the teaching trajectory for the target robot; The teaching trajectory is analyzed to obtain a trajectory frame sequence for the target robot.
3. The method according to claim 1, characterized in that, After acquiring the trajectory frame sequence for the target robot, the method further includes: The timestamps of each trajectory frame in the trajectory frame sequence are unified as the target time unit, wherein the target time unit is an integer multiple of the preset control period; Based on the unified timestamp, the trajectory frame sequence is filtered to obtain the filtered trajectory frame sequence.
4. The method according to claim 3, characterized in that, The step of filtering the trajectory frame sequence based on the unified timestamp to obtain the filtered trajectory frame sequence includes: According to the increasing timestamp order, the trajectory frames in the trajectory frame sequence with strictly increasing timestamps are filtered to obtain a filtered trajectory frame sequence, so that the time interval between adjacent trajectory frames in the filtered trajectory frame sequence is positive.
5. The method according to any one of claims 1-4, characterized in that, Before determining the time interval between adjacent trajectory frames based on their timestamps in the trajectory frame sequence, the method further includes: Based on the preset number of joints of the target robot, the trajectory frames with missing joint angles in the trajectory frame sequence are identified and supplemented, and the joint angle units of each trajectory frame are standardized.
6. The method according to any one of claims 1-4, characterized in that, The step of inserting intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot includes: Linear calculations are performed based on the joint angles of adjacent trajectory frames in the trajectory frame sequence and the target joint angle to obtain intermediate frames; According to a preset control cycle, the intermediate frame is inserted between adjacent trajectory frames in the trajectory frame sequence to obtain the control frame sequence.
7. The method according to any one of claims 1-4, characterized in that, After inserting intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot, the method further includes: Based on the underlying trajectory format corresponding to the target robot, the control frame sequence is encoded to obtain encoded trajectory data, wherein the underlying trajectory format includes the number of joints and the joint angle of each joint; The trajectory data is sent to the controller of the target robot to control the target robot.
8. A robot trajectory processing system, characterized in that, include: The trajectory acquisition module is used to acquire a sequence of trajectory frames for the target robot, wherein each trajectory frame includes a timestamp and joint angles; The time interval determination module is used to determine the time interval between adjacent trajectory frames based on the timestamps of the adjacent trajectory frames in the trajectory frame sequence. The joint angle limiting module is used to limit the change of joint angle in adjacent trajectory frames based on the time interval and the preset speed limit of the target robot, so as to obtain a trajectory frame sequence including the target joint angle, wherein the preset speed limit is used to limit the maximum change of the joint angle within a unit time interval. A frame interpolation module is used to insert intermediate frames into the trajectory frame sequence to obtain a control frame sequence for controlling the target robot.
9. The system according to claim 8, characterized in that, The trajectory acquisition module is further configured to acquire the teaching trajectory for the target robot, and parse the teaching trajectory to obtain a trajectory frame sequence for the target robot.
10. The system according to claim 8, characterized in that, Also includes: The time unification module is used to unify the timestamps of each trajectory frame in the trajectory frame sequence as the target time unit, and to filter the trajectory frame sequence based on the unified timestamps to obtain the filtered trajectory frame sequence.
11. The system according to claim 8, characterized in that, Also includes: The joint verification module is used to determine and fill in the missing joint angles in the trajectory frame sequence based on the preset number of joints of the target robot, and to unify the joint angle unit of each trajectory frame.
12. The system according to claim 8, characterized in that, Also includes: The trajectory encoding module is used to encode the control frame sequence obtained by the frame interpolation module based on the underlying trajectory format corresponding to the target robot, and to obtain and output the encoded trajectory data.
13. A robot, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the robot trajectory processing method according to any one of claims 1 to 7.
14. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the robot trajectory processing method according to any one of claims 1 to 7.
15. A computer program product, characterized in that, It includes computer-executable instructions that, when executed by a processor, implement the steps of the robot trajectory processing method according to any one of claims 1 to 7.
