Robot teaching trajectory optimization method and device and robot
By generating sampling groups and selecting reference sampling points to optimize the teaching trajectory, the problem of abnormal tracking caused by redundant operations during robot teaching was solved, and a more stable and smoother tracking effect was achieved.
Patent Information
- Application Number
- CN202510152981.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-02-11
AI Technical Summary
During robot teaching, redundant operations are recorded in the teaching trajectory, leading to tracking anomalies during the line-following process.
By generating multiple sampling groups, the robot's motion state is determined based on the state information of the sampling groups, and a reference sampling point is selected from multiple sampling points to generate a target teaching trajectory to optimize the teaching trajectory and eliminate redundant operations.
The optimized teaching trajectory is smoother and more fluid, improving the stability and smoothness of the robot's tracking process.
Smart Images

Figure CN119839854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of robot control, and particularly relates to a robot teaching trajectory optimization method and device and a robot. BACKGROUND
[0002] In actual scenarios such as industrial automation, logistics and warehousing scenarios, a robot often needs to be repeatedly run under a specified trajectory, in which case, the robot is usually controlled by a user to be taught, and a teaching trajectory is obtained so that the robot can be tracked according to the teaching trajectory.
[0003] However, in the process of teaching the robot, manual control of the robot movement often has some redundant operations, such as re-adjusting after the turning angle exceeds the target angle, re-retreating after the moving distance exceeds the target distance, and the like, and these redundant operations are also recorded in the teaching trajectory, and thus tracking abnormalities occur in the tracking process according to the above teaching trajectory. SUMMARY
[0004] Therefore, the present application provides a robot teaching trajectory optimization method and device and a robot to optimize the teaching trajectory to avoid tracking abnormalities in the tracking process.
[0005] The technical solutions provided by the present application are as follows:
[0006] According to the embodiment of the first aspect of the present application, a robot teaching trajectory optimization method is provided, which comprises:
[0007] obtaining an initial teaching trajectory of the robot, the initial teaching trajectory comprising state information of a plurality of sampling points;
[0008] generating a plurality of sampling groups based on the plurality of sampling points included in the initial teaching trajectory, each sampling group comprising at least two sampling points;
[0009] for each sampling group, determining a motion state corresponding to the sampling group according to the state information of the sampling points included in the sampling group, the motion state being a motion state of the robot between the sampling points included in the sampling group;
[0010] selecting a plurality of reference sampling points from the plurality of sampling points according to the motion states of the robot corresponding to the plurality of sampling groups, the reference sampling points comprising sampling points at which the motion state of the robot changes;
[0011] generating a target teaching trajectory according to the reference sampling points, so as to control the robot to track based on the target teaching trajectory.
[0012] Optionally, the state information comprises a position and an attitude angle of the robot; and determining the motion state corresponding to the sampling group according to the state information of the sampling points comprised in the sampling group comprises:
[0013] determining a Euclidean distance between the two sampling points according to the position of the earliest sampling point and the position of the latest sampling point in the sampling group;
[0014] determining an attitude angle variation between the two sampling points according to the attitude angle of the earliest sampling point and the attitude angle of the latest sampling point in the sampling group;
[0015] determining the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle variation.
[0016] Optionally, the determining the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle variation comprises:
[0017] if the Euclidean distance is not less than a preset distance threshold, determining that the motion state corresponding to the sampling group is straight movement;
[0018] if the Euclidean distance is less than the preset distance threshold and the attitude angle variation is less than a preset angle threshold, determining that the motion state corresponding to the sampling group is static;
[0019] if the Euclidean distance is less than the preset distance threshold and the attitude angle variation is not less than the preset angle threshold, determining that the motion state corresponding to the sampling group is rotation in place.
[0020] Optionally, the motion state comprises static and rotation in place; and the selecting a plurality of reference sampling points from the plurality of sampling points according to the motion state corresponding to the plurality of sampling groups comprises:
[0021] dividing the sampling points comprised in each sampling group into a sampling point set corresponding to the motion state of the sampling group based on the motion state corresponding to the sampling group, the sampling point set comprising a static sampling point set and a rotation-in-place sampling point set;
[0022] performing clustering on all the sampling points comprised in the static sampling point set and the rotation-in-place sampling point set according to the state information of the sampling points, to obtain a plurality of reference sub-sets, the sampling points comprised in each reference sub-set being continuous sampling points in the initial teaching trajectory;
[0023] for each reference sub-set, taking the start point and the end point of the continuous sampling points comprised in the reference sub-set as reference sampling points.
[0024] Optionally, the initial teaching trajectory comprises at least one pre-configured key point in the plurality of sampling points, the key point being used to indicate that the robot performs a specified action at the sampling point; before the start point and the end point of the continuous sampling points included in the reference subset are taken as the reference sampling points, the method further comprises:
[0025] detecting whether the key point is included in the continuous sampling points included in the reference subset, if yes, taking the start point, the end point and the key point of the continuous sampling points included in the reference subset as the reference sampling points;
[0026] if no, continuing to perform the step of taking the start point and the end point of the continuous sampling points included in the reference subset as the reference sampling points.
[0027] Optionally, the motion state further comprises straight movement, and the sampling point set further comprises a straight movement set, and the selecting a plurality of reference sampling points from the plurality of sampling points according to the motion state of the robot in the plurality of sampling groups further comprises:
[0028] determining a plurality of candidate subsets included in the straight movement set according to the state information of the sampling points included in the straight movement set and the start point and the end point of the continuous sampling points included in each reference subset, the sampling points included in each candidate subset being continuous sampling points in the initial teaching trajectory;
[0029] taking the sampling points included in each candidate subset as the reference sampling points.
[0030] Optionally, before the sampling points included in each candidate subset are taken as the reference sampling points, the method further comprises:
[0031] for each candidate subset, determining a straight line equation corresponding to the candidate subset according to the state information of the continuous sampling points included in the candidate subset, the straight line equation being used to represent the motion trajectory of the sampling points included in the candidate subset;
[0032] determining a midpoint of a straight movement region corresponding to the candidate subset according to the straight line equation and the start point and the end point of the continuous sampling points included in the candidate subset, and dividing the straight movement region into a plurality of sub-regions, the straight movement region being a line segment between the start point and the end point of the continuous sampling points included in the candidate subset;
[0033] According to the midpoint of the straight line region and the plurality of sub-regions, the sampling points included between the start point and the end point of the continuous sampling points in the candidate sub-set are re-allocated to the sub-regions; wherein the number of the re-allocated sampling points in each sub-region is positively correlated with the reference distance corresponding to the sub-region, the reference distance corresponding to the sub-region refers to the distance between the midpoint of the sub-region and the midpoint of the straight line region;
[0034] For each sub-region, according to the straight line equation and the number of the re-allocated sampling points in the sub-region, the state information of the re-allocated sampling points in the sub-region is determined to update the candidate sub-set.
[0035] According to the embodiment of the second aspect of the present application, a robot teaching trajectory optimization device is provided, the device comprises:
[0036] An acquisition unit is configured to acquire an initial teaching trajectory of the robot, the initial teaching trajectory comprising state information of a plurality of sampling points;
[0037] A determination unit is configured to generate a plurality of sampling groups based on the plurality of sampling points included in the initial teaching trajectory, each sampling group comprising at least two sampling points;
[0038] For each sampling group, according to the state information of the sampling points included in the sampling group, a motion state corresponding to the sampling group is determined, the motion state refers to the motion state of the robot between the sampling points included in the sampling group;
[0039] A selection unit is configured to select a plurality of reference sampling points from the plurality of sampling points according to the motion states corresponding to the plurality of sampling groups, the reference sampling points comprising the sampling points at which the motion state of the robot changes;
[0040] A generation unit is configured to generate a target teaching trajectory according to the reference sampling points, so as to control the robot to follow the target teaching trajectory.
[0041] Optionally, the state information comprises the position and the attitude angle of the robot; and the determination unit is specifically configured to:
[0042] determine the Euclidean distance between the two sampling points according to the positions of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group;
[0043] determine the attitude angle change amount between the two sampling points according to the attitude angles of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group;
[0044] determine the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle change amount.
[0045] Optionally, the determining unit is specifically configured to:
[0046] if the Euclidean distance is not less than a preset distance threshold, determining that the motion state corresponding to the sampling group is straight running;
[0047] if the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is less than a preset angle threshold, determining that the motion state corresponding to the sampling group is static;
[0048] if the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is not less than the preset angle threshold, determining that the motion state corresponding to the sampling group is rotating in place.
[0049] Optionally, the motion state includes static and rotating in place, and the selecting unit is specifically configured to:
[0050] based on the motion state corresponding to each sampling group, dividing the sampling points included in the sampling group into a sampling point set corresponding to the motion state of the sampling group, the sampling point set including a static sampling point set and a rotating-in-place sampling point set;
[0051] according to state information of all sampling points included in the static sampling point set and the rotating-in-place sampling point set, clustering all sampling points included in the static sampling point set and the rotating-in-place sampling point set to obtain a plurality of reference sub-sets, sampling points included in each reference sub-set being continuous sampling points in the initial teaching trajectory;
[0052] for each reference sub-set, taking the start point and the end point of the continuous sampling points included in the reference sub-set as reference sampling points.
[0053] Optionally, the initial teaching trajectory includes at least one pre-configured key point among the plurality of sampling points, the key point being used to indicate that the robot performs a specified action at the sampling point; before taking the start point and the end point of the continuous sampling points included in the reference sub-set as reference sampling points, the selecting unit is further configured to:
[0054] detecting whether the key point is included in the continuous sampling points included in the reference sub-set, if yes, taking the start point, the end point and the key point of the continuous sampling points included in the reference sub-set as reference sampling points;
[0055] if not, continuing to perform the step of taking the start point and the end point of the continuous sampling points included in the reference sub-set as reference sampling points.
[0056] Optionally, the motion state further includes straight running, and the sampling point set further includes a straight running set, and the selecting unit is further configured to:
[0057] According to state information of the sampling points included in the straight moving set and start points and end points of the continuous sampling points included in each of the reference sub-sets, a plurality of candidate sub-sets included in the straight moving set are determined, and the sampling points included in each of the candidate sub-sets are continuous sampling points in the initial teaching trajectory;
[0058] The sampling points included in each of the candidate sub-sets are taken as reference sampling points.
[0059] Optionally, before the sampling points included in each of the candidate sub-sets are taken as reference sampling points, the selecting unit is further configured to:
[0060] For each of the candidate sub-sets, according to state information of the continuous sampling points included in the candidate sub-set, a straight line equation corresponding to the candidate sub-set is determined, and the straight line equation is used to represent a motion trajectory of the sampling points included in the candidate sub-set;
[0061] According to the straight line equation and the start point and the end point of the continuous sampling points included in the candidate sub-set, a midpoint of a straight moving region corresponding to the candidate sub-set is determined, and the straight moving region is divided into a plurality of sub-regions, the straight moving region refers to a line segment between the start point and the end point of the continuous sampling points included in the candidate sub-set.
[0062] According to the midpoint of the straight moving region and the plurality of sub-regions, the sampling points included between the start point and the end point of the continuous sampling points in the candidate sub-set are re-distributed into the sub-regions, and the number of the re-distributed sampling points in each of the sub-regions is positively correlated with a reference distance corresponding to the sub-region, the reference distance corresponding to the sub-region refers to a distance between the midpoint of the sub-region and the midpoint of the straight moving region.
[0063] For each of the sub-regions, according to the straight line equation and the number of the re-distributed sampling points in the sub-region, state information of the re-distributed sampling points in the sub-region is determined to update the candidate sub-set.
[0064] According to the embodiment of the third aspect of the present application, a robot is provided, the robot comprising:
[0065] a sensor configured to detect state information of the robot;
[0066] a logic operator configured to execute the method of the first aspect.
[0067] Optionally, the robot is a two-wheeled spherical robot, and the robot further comprises:
[0068] A camera device parallel to a horizontal plane when the robot is stationary is used to collect images to determine whether the robot performs a specified action, which includes the robot collecting images at specified sampling points in a specified pose.
[0069] From the above technical solutions, the present application generates a plurality of sampling groups based on a plurality of sampling points included in an initial teaching trajectory, for each sampling group, determines the motion state of the robot between the sampling points included in the sampling group according to the state information included in the sampling group, and selects a plurality of reference sampling points from the plurality of sampling points according to the motion states of the robot corresponding to the plurality of sampling groups, and further generates a target teaching trajectory according to the reference sampling points, to control the robot to follow the track based on the target teaching trajectory. The present application determines the sampling points at which the motion state of the robot changes through the motion states of the robot in the plurality of sampling groups, optimizes the initial teaching trajectory according to the sampling points at which the motion state changes, can eliminate irrelevant sampling points caused by redundant operations, makes the target teaching trajectory smoother and more smooth, and improves the stability and smoothness of the robot in the tracking process. BRIEF DESCRIPTION OF DRAWINGS
[0070] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0071] Figure 1 A motion scene schematic diagram of a two-wheel spherical robot provided for an embodiment of the present application;
[0072] Figure 2 A flow chart of a robot teaching trajectory optimization method provided for an embodiment of the present application;
[0073] Figure 3 A straight line area sampling point reassignment schematic diagram provided for an embodiment of the present application;
[0074] Figure 4 A specific flowchart schematic diagram of a robot teaching trajectory optimization method provided for an embodiment of the present application;
[0075] Figure 5 A structure schematic diagram of a robot provided for an embodiment of the present application;
[0076] Figure 6 A structure diagram of a robot teaching trajectory optimization device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0077] In order for those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and in order for the above-mentioned purposes, characteristics and advantages of the embodiments of the present application to be more apparent and easy to understand, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the drawings.
[0078] In actual scenarios such as industrial automation, logistics and warehousing scenarios, robots often need to be repeatedly operated under a specified trajectory, in which case, the robot is usually controlled by a user to be taught, and a teaching trajectory is obtained so that the robot can follow the teaching trajectory.
[0079] However, during the teaching of the robot, some redundant operations often occur when the robot is manually controlled, such as re-adjusting after the turning angle exceeds the target angle, re-backing after the moving distance exceeds the target distance, and the like, and these redundant operations will also be recorded in the teaching trajectory, and thus following the above-mentioned teaching trajectory during the following process will also cause tracking abnormalities.
[0080] The following describes possible problems in the following process of the robot by taking a two-wheel spherical robot as an example.
[0081] Please refer to Figure 1 , Figure 1 The motion scenario of the two-wheel spherical robot provided by the embodiments of the present application is shown in the figure.
[0082] As shown in Figure 1 , the two-wheel spherical robot usually experiences straight movement, stopping and turning during movement.
[0083] If a redundant operation occurs during teaching, such as a target turning angle of 60 degrees, and the user controls the robot to turn 70 degrees and then readjusts 10 degrees during operation, this process will also be recorded in the teaching trajectory, so that the robot will first turn 70 degrees and then readjust 10 degrees during the following process, causing the robot to follow the trajectory incoherently.
[0084] In addition, the robot will also perform rapid acceleration and deceleration during the following process, especially during straight movement, which will cause the robot to shake back and forth.
[0085] Based on this, the present application provides a robot teaching trajectory optimization method to optimize the teaching trajectory of the robot and improve the stability and fluency of the robot during the following process.
[0086] Please refer to Figure 2 , Figure 2 The flowchart of the robot teaching trajectory optimization method provided by the embodiments of the present application is shown in the figure.
[0087] As shown in Figure 2As shown, the method can include the following steps:
[0088] Step 201, obtaining an initial teaching trajectory of the robot.
[0089] In this embodiment, the initial teaching trajectory of the robot can be obtained by manually controlling the robot to move along a specified trajectory, or the initial teaching trajectory of the robot can be directly sent to the robot, and the application does not limit this.
[0090] The initial teaching trajectory includes a plurality of sampling points, and each sampling point records state information of the robot at the sampling point.
[0091] The initial teaching trajectory is a trajectory composed of a plurality of sampling points, and the sampling points can be obtained by sampling at a specified sampling frequency during teaching. The sampling points include state information of the robot at the sampling point at the sampling time.
[0092] For example, the state information can be the position, attitude angle, velocity, acceleration, and other information used to describe the current running state of the robot, and the application does not limit this.
[0093] So far, the description of step 201 ends, and step 202 is executed.
[0094] Step 202, generating a plurality of sampling groups based on the plurality of sampling points included in the initial teaching trajectory.
[0095] In this embodiment, the plurality of sampling points included in the initial teaching trajectory can be divided to obtain a plurality of sampling groups, and each sampling group includes at least two sampling points. It is generally considered that the motion states of the sampling points in the same sampling group are the same.
[0096] As an example, each adjacent two sampling points in the initial teaching trajectory can be taken as a sampling group to obtain a plurality of sampling groups.
[0097] The specific division method of the sampling group will be described in combination with step 203, which will not be described here.
[0098] Step 203, for each sampling group, determining the motion state corresponding to the sampling group according to the state information of the sampling points included in the sampling group.
[0099] In this embodiment, for the plurality of sampling groups determined in step 202, the motion state corresponding to each sampling group can be determined according to the state information included in the sampling group.
[0100] As an example, the Euclidean distance between the robot at the earliest sampling point and the latest sampling point in the sampling group can be determined according to the positions of the two sampling points.
[0101] According to the pose angle of the earliest sampling point and the latest sampling point in the sampling group, the pose angle change of the robot between the two sampling points is determined.
[0102] According to the Euclidean distance and the pose angle change, the motion state corresponding to the sampling group is determined.
[0103] In the embodiment, the state information can include the position of the robot and the pose angle, wherein the pose angle refers to the angle of rotation of the robot with the center axis of its vertical direction.
[0104] The motion state refers to the motion state of the robot between the sampling points included in the sampling group. By the Euclidean distance and the pose angle change between the sampling points, the change in distance and direction of the robot can be determined, and then the motion state of the robot between the sampling points included in the sampling group can be determined.
[0105] It should be noted that if there are only two sampling points in the sampling group, the Euclidean distance and the pose angle of the two sampling points can be directly determined. If the sampling points included in the sampling group are more than two, the Euclidean distance and the pose angle of the first sampling point (the earliest sampling point) and the last sampling point (the latest sampling point) can be determined, and the motion state of the sampling group can be determined based on the above two sampling points.
[0106] Alternatively, the Euclidean distance and the pose angle can also be determined between each two adjacent sampling points in the sampling group, and the motion state corresponding to the sampling group can be further determined according to the motion state of the robot between each two sampling points. For example, if there are consecutive sampling points A, B and C in a sampling group, the motion state of the robot between each two sampling points can be detected. If it is detected that the motion state of the robot between A and B is straight, and the motion state of the robot between B and C is also straight, it can be determined that the motion state corresponding to the sampling group is straight. If it is detected that the motion state of the robot between A and B is straight, and the motion state of the robot between B and C is static, point B can be ignored, and the motion state of the first sampling point (the earliest sampling point) and the last sampling point (the latest sampling point) is detected, and the motion state is taken as the motion state corresponding to the sampling group.
[0107] It is easy to understand that in the process of generating the sampling group, the optimization accuracy of the teaching trajectory can be adjusted by adjusting the number of sampling points included in the sampling group. If a more accurate teaching trajectory is required, the number of sampling points included in each sampling group can be set to be smaller, such as every two adjacent sampling points as a sampling group. If less resource occupation is required, the number of sampling points included in each sampling group can be set to be larger, such as every four sampling points as a sampling group. The present application does not limit this.
[0108] Specifically, the motion state of the robot between the two adjacent sampling points is determined according to the Euclidean distance and the attitude angle change amount, including:
[0109] The motion state corresponding to the sampling group is determined according to the Euclidean distance and the attitude angle change amount, including:
[0110] If the Euclidean distance is not less than the preset distance threshold, it is determined that the motion state corresponding to the sampling group is straight line;
[0111] If the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is less than the preset angle threshold, it is determined that the motion state corresponding to the sampling group is static;
[0112] If the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is not less than the preset angle threshold, the motion state corresponding to the sampling group is rotation in place.
[0113] In the present embodiment, the distance threshold and the angle threshold can be preset. If it is detected that the Euclidean distance between the two sampling points of the robot in the sampling group is not less than the preset distance threshold, it indicates that the robot moves a long distance between the two sampling points. At this time, it can be considered that the motion state of the robot between the two adjacent sampling points is straight line, that is, the motion state corresponding to the sampling group is straight line.
[0114] If it is detected that the Euclidean distance between the two sampling points of the robot in the sampling group is less than the preset distance threshold, it indicates that the robot has almost no change in position between the two sampling points. In this process, the robot can be static or rotate in place.
[0115] Further, the relationship between the attitude angle change amount of the robot between the two sampling points and the preset angle threshold can be determined. If the attitude angle change amount of the robot between the two sampling points is less than the preset angle threshold, it indicates that the robot has almost no rotation between the two sampling points. At this time, it can be determined that the motion state of the robot between the two sampling points is static, that is, the motion state corresponding to the sampling group is static.
[0116] If it is found that the change of the pose angle of the robot between two sampling points is not less than the preset angle threshold, it is indicated that the robot rotates a large enough angle between the two sampling points, and at this time, it can be determined that the motion state of the robot between the two sampling points is rotating in place, that is, the motion state corresponding to the sampling group is rotating in place.
[0117] So far, the description of step 203 is ended, and step 204 is executed.
[0118] Step 204: selecting a plurality of reference sampling points from the plurality of sampling points according to the motion state of the robot in the plurality of sampling groups.
[0119] The reference sampling points include the sampling points at which the motion state of the robot changes.
[0120] In the embodiment, the motion state can include straight movement, static state and rotating in place, and the determination method of the reference sampling points corresponding to the three motion states is described as follows:
[0121] As an embodiment, the selecting of the plurality of reference sampling points from the plurality of sampling points according to the motion state of the robot in the plurality of sampling groups includes:
[0122] The sampling points included in each sampling group are divided into the sampling point set corresponding to the motion state of the sampling group according to the motion state of the sampling group, and the sampling point set includes a static sampling point set and a rotating-in-place sampling point set;
[0123] According to the state information of all the sampling points included in the static sampling point set and the rotating-in-place sampling point set, all the sampling points included in the static sampling point set and the rotating-in-place sampling point set are clustered to obtain a plurality of reference sub-sets, and the sampling points included in each reference sub-set are continuous sampling points in the initial teaching trajectory.
[0124] For each reference sub-set, the start point and the end point of the continuous sampling points included in the reference sub-set are taken as the reference sampling points.
[0125] Firstly, according to the motion state of the robot in each sampling group obtained in step 203, each sampling point in the initial teaching trajectory is divided into the sampling point set corresponding to the motion state of the sampling point.
[0126] Specifically, the sampling points in the sampling group with the motion state of straight movement can be divided into the straight movement sampling point set, the sampling points in the sampling group with the motion state of static state can be divided into the static sampling point set, and the sampling points in the sampling group with the motion state of rotating in place can be divided into the rotating-in-place sampling point set.
[0127] As an embodiment, the repeated points in the two pairs of adjacent sampling points with changed motion states can be divided into the sampling point sets corresponding to the two remote states.
[0128] For example, taking every two adjacent sampling points as a sampling group, there are continuous sampling points A, B, C, and D. If it is detected that the motion state of the robot between A and B is static, the motion state between B and C is stationary rotation, and the motion state between C and D is straight running, then in the process of dividing the sampling points, the sampling points A and B can be divided into the static sampling point set, the sampling points B and C can be divided into the stationary rotation sampling point set, and the sampling points C and D can be divided into the straight running sampling point set.
[0129] In this embodiment, the method for determining the reference sampling points in the static state and the stationary rotation state is the same, which is introduced together here.
[0130] After dividing all the sampling points, the static sampling point set and the stationary rotation sampling point set can be further clustered to obtain a plurality of reference sub-sets.
[0131] It is easy to understand that the sampling points included in each reference sub-set obtained after clustering are continuous sampling points, i.e., a continuous static or continuous stationary rotation process, and all the reference sub-sets are all the static and stationary rotation processes included in the initial teaching trajectory. For each static or stationary rotation process, the start point and the end point of the continuous sampling points included in the reference sub-set can be determined, i.e., the start point and the end point of the static or stationary rotation, and the start point and the end point are taken as the reference sampling points.
[0132] In this embodiment, the method for clustering the plurality of sampling points is a common method in the related art, which is not described here. It can be seen that the determined reference sampling points do not include the influence of the redundant operation in the redundant operation process.
[0133] As an embodiment, the initial teaching trajectory includes at least one pre-configured key point in the plurality of sampling points, and the key point is used to indicate that the robot performs a specified action at the sampling point. Before taking the start point and the end point of the continuous sampling points included in the reference sub-set as the reference sampling points, the method further includes:
[0134] detecting whether the key point is included in the continuous sampling points included in the reference sub-set, if yes, taking the start point, the end point, and the key point of the continuous sampling points included in the reference sub-set as the reference sampling points;
[0135] If not, the step of taking the start point and the end point of the continuous sampling points included in the reference subset as the reference sampling points is continuously performed.
[0136] In this embodiment, the initial teaching trajectory can further include at least one pre-configured key point in the plurality of sampling points, the key point refers to that the robot performs a specified action at the sampling point, such as image acquisition, and the present application does not limit this.
[0137] It can be seen that the key point is actually a sampling point set by a person and plays a key role in the tracking process, based on this, whether the pre-configured key point is included in each reference subset can be further considered in the process of determining the reference sampling point, if included, the key point and the start point and the end point are taken as the reference sampling point together.
[0138] The method for determining the reference sampling point in the straight line state will be introduced below.
[0139] According to the motion state of the robot in the plurality of sampling groups corresponding to the plurality of sampling points, the plurality of reference sampling points are selected from the plurality of sampling points, and the method further includes:
[0140] According to the state information of the sampling points included in the straight line set and the start point and the end point of the continuous sampling points included in each reference subset, a plurality of candidate subsets included in the straight line set are determined, and the sampling points included in each candidate subset are continuous sampling points in the initial teaching trajectory.
[0141] The sampling points included in each candidate subset are taken as the reference sampling points.
[0142] In this embodiment, the reference sampling points determined in the above-mentioned static and in-place rotation set are actually pause points and turning points in the teaching trajectory, and between these points, the robot moves through linear motion.
[0143] According to the state information of the sampling points included in the straight line set and the above-mentioned pause points and turning points, a plurality of candidate subsets included in the straight line set can be determined, and it is easy to understand that each candidate subset actually represents a straight line region.
[0144] As an embodiment, the sampling points included in the straight moving set can be arranged in a sampling time sequence, and the reference sampling points determined in the above-mentioned stationary set and the set of stationary rotations are searched from the sampling points included in the straight moving set, that is, the stop points and the turning points (denoted as target points) in the teaching trajectory are searched from the sampling points included in the straight moving set, and whether there are other sampling points between each two adjacent target points is detected, if there are, the set of the two adjacent target points and all the sampling points between the two adjacent target points is taken as a candidate sub-set included in the straight moving set. The connection line of all the sampling points included in the candidate sub-set represents a continuous straight moving area, that is, the motion state of the robot between the start point and the end point (that is, the above-mentioned two adjacent target points) of each straight moving area is straight moving.
[0145] Further, each sampling point included in each candidate sub-set can be taken as a reference sampling point.
[0146] Meanwhile, considering that the robot may also shake back and forth when performing rapid acceleration and deceleration during the tracking process, especially during the straight moving process, the application further optimizes the teaching trajectory during the straight moving process.
[0147] Before taking the sampling points included in each candidate sub-set as reference sampling points, the method proposed by the application can further include:
[0148] For each candidate sub-set, according to the state information of the continuous sampling points included in the candidate sub-set, a straight line equation corresponding to the candidate sub-set is determined, and the straight line equation is used to represent the motion trajectory of the sampling points included in the candidate sub-set;
[0149] According to the straight line equation and the start point and the end point of the continuous sampling points included in the candidate sub-set, a midpoint of a straight moving area corresponding to the candidate sub-set is determined, and the straight moving area is divided into a plurality of sub-areas, and the straight moving area refers to a line segment between the start point and the end point of the continuous sampling points included in the candidate sub-set;
[0150] According to the midpoint of the straight moving area and the plurality of sub-areas, the sampling points included between the start point and the end point of the continuous sampling points in the candidate sub-set are redistributed into the sub-areas; wherein the number of the redistributed sampling points in each sub-area is positively correlated with a reference distance corresponding to the sub-area, and the reference distance corresponding to the sub-area refers to the distance between the midpoint of the sub-area and the midpoint of the straight moving area;
[0151] For each sub-area, according to the straight line equation and the number of the redistributed sampling points in the sub-area, the state information of the redistributed sampling points in the sub-area is determined to update the candidate sub-set.
[0152] In this embodiment, considering that during straight running, the robot usually accelerates at the start of the straight running area and decelerates at the end of the straight running area, at which time the problem of front and rear shaking is prone to occur, based on this, the sampling points included in the straight running area can be rearranged so that the sampling points in the intervals closer to the start and end are denser, and the sampling points in the intervals farther from the start and end are sparser, to obtain a more smooth teaching trajectory.
[0153] For example, the origin of the coordinate system can be established at the start point of the teaching trajectory, if the start point of one of the straight running areas is p1(x1, y1) and the end point is p2(x2, y2), then the straight line equation corresponding to the straight running area can be determined according to the coordinates of the start point p1 and the end point p2:
[0154] wherein k = (y2-y1) / (x2-x1), b = y1-k*x1.
[0155] Meanwhile, the length D of the straight line area can also be determined according to the coordinates of the start point p1 and the end point p2:
[0156]
[0157] If the length D of the straight line area is less than the preset threshold value ε, it indicates that the length of the straight line area is short, and the robot usually does not appear sudden acceleration and sudden deceleration in the short straight line area, and the probability of front and rear shaking phenomenon is low when moving in the straight line area, at this time, the sampling points included in the straight line area do not need to be rearranged, and the target teaching trajectory can be generated directly according to the poses of the sampling points included in the straight line area.
[0158] If the length D of the straight line area is not less than the preset threshold value ε, it indicates that the length of the straight line area is long, and the robot is more prone to sudden acceleration and sudden deceleration in the long straight line area, that is, more prone to front and rear shaking phenomenon, at this time, the sampling points included in the straight line area can be rearranged.
[0159] Specifically, please refer to Figure 3 , Figure 3 the straight line area sampling point redistribution schematic diagram provided by the embodiments of the present application.
[0160] As Figure 3 shown, for the straight line area shown in Figure 3 , the straight line area can be divided into multiple sub-areas from the left and right sides of the midpoint of the straight line area, such as being divided into 6 equally spaced sub-areas symmetrically about the midpoint of the straight line area, and each sub-area corresponds to a length of Δd = D / 6.
[0161] Meanwhile, for each sub-region, a sampling point ratio corresponding to the sub-region is pre-configured, the sampling point ratio refers to a ratio of the number of the sampling points re-allocated in the sub-region to the total number of the sampling points included in the straight-line region (except for the start point and the end point), and is used to indicate the number of the sampling points re-allocated in the sub-region.
[0162] In the embodiment, the sampling point ratio is positively correlated with a reference distance corresponding to the sub-region (i.e. a distance between a point in the sub-region and a point in the straight-line region), that is, the closer to the point in the straight-line region, the fewer the number of the sampling points re-allocated in the sub-region, and the farther away from the point in the straight-line region, the more the number of the sampling points re-allocated in the sub-region.
[0163] For example, in the straight-line region shown in Figure 3 , according to the distance between the point in the sub-region and the point in the straight-line region, the sampling point ratio corresponding to each sub-region is respectively set to 1 / 4, 1 / 6, 1 / 12, 1 / 12, 1 / 6, and 1 / 4, and the sum of the sampling point ratios corresponding to all the sub-regions is generally 1.
[0164] Further, the sampling points included in the straight-line region except for the start point and the end point can be re-allocated to each sub-region according to the above sampling point ratio based on the sampling time sequence.
[0165] In the straight-line region shown in Figure 3 , taking the number of the sampling points included in the straight-line region except for the start point and the end point as N for example, after the division according to the above sampling point ratio, the number of the re-allocated sampling points corresponding to each sub-region is respectively:
[0166] n1=N / 4; n2=N / 6; n3=N / 12; n4=N / 12; n5=N / 6; n6=N / 4.
[0167] Wherein, n i is the number of the re-allocated sampling points corresponding to the i-th sub-region in the straight-line region.
[0168] The interval between the re-allocated sampling points corresponding to each sub-region is respectively:
[0169] d1=Δd / n1; d2=Δd / n2; d3=Δd / n3; d4=Δd / n4; d5=Δd / n5; d6=
[0170] Δd / n6.
[0171] Wherein, n i is the number of the re-allocated sampling points corresponding to the i-th sub-region in the straight-line region, and d i is the interval between the re-allocated sampling points corresponding to the i-th sub-region in the straight-line region.
[0172] Further, the state information of each sampling point after the re-distribution can be determined according to the straight line equation corresponding to the straight running area and the interval between the re-distributed sampling points corresponding to each sub-area.
[0173] Since the attitude angle of each sampling point during the straight running is fixed, the focus is to determine the position of each sampling point after the re-distribution, i.e., the coordinates corresponding to each sampling point.
[0174] As an embodiment, for each re-distributed sampling point in the straight running area, the coordinates can be determined in the following manner: Figure 3
[0175] y j =k*x j +b
[0176]
[0177] wherein k=(y2-y1) / (x2-x1), b=y1-k*x1, the starting point of the straight running area is p1(x1, y1), the ending point is p2(x2, y2), n i is the number of re-distributed sampling points corresponding to the i-th sub-area in the straight running area, d i is the interval between the re-distributed sampling points corresponding to the i-th sub-area in the straight running area, x j is the x coordinate of the j-th re-distributed sampling point in the straight running area in the order of sampling time, and y j is the y coordinate of the j-th re-distributed sampling point in the straight running area in the order of sampling time.
[0178] In the present embodiment, the distribution of the re-distributed sampling points is more sparse in the position closer to the midpoint of the straight running area, and more dense in the position farther away from the midpoint of the straight running area, i.e., closer to the starting point or the ending point of the straight running area. In the area where the sampling points are more dense, the tracking speed of the robot during the tracking process is slower, and in the area where the sampling points are more sparse, the tracking speed during the tracking process is faster, thereby avoiding the problem of the robot shaking back and forth caused by the sudden acceleration or deceleration of the robot near the starting point and the ending point of the straight running area during the straight running.
[0179] It should be noted that in the present embodiment, since the sub-areas included in the straight running area are symmetrically divided on both sides of the midpoint of the straight running area, the corresponding coordinates of the sampling points on one side of the midpoint of the straight running area can be determined first, and then the coordinates of the sampling points on the other side of the midpoint of the straight running area can be determined according to the symmetry relationship. The present application does not limit this.
[0180] In the embodiment, interpolation can also be performed in the candidate sub-set corresponding to each straight line region, that is, a plurality of sampling points are inserted between the start point and the end point in the candidate sub-set, so that the robot moves smoothly in the straight line region.
[0181] Specifically, according to the state information of the sampling points included in each candidate sub-set, the straight line equation corresponding to the sampling points in the candidate sub-set can be determined, and further, according to the start point, the end point and the straight line equation, the midpoint of the straight line region can be determined.
[0182] As an embodiment, when interpolation is performed, the closer to the midpoint position, the fewer the number of inserted sampling points, and the farther away from the midpoint position, the more the number of inserted sampling points, so as to ensure that enough sampling points are inserted in the region with faster acceleration and deceleration to smooth the movement of the robot.
[0183] After the re-distribution and / or interpolation of the sampling points included in the straight line region is completed, the candidate sub-set can be updated according to the processed sampling points, and the sampling points included in the updated candidate sub-set are also used as reference sampling points, and then the target teaching trajectory is obtained according to the reference sampling points, which can make the trajectory realize smooth acceleration and deceleration, so as to complete the task of smooth tracking in the tracking process.
[0184] So far, the description of step 204 is ended, and step 205 is executed.
[0185] Step 205, generating a target teaching trajectory according to the reference sampling points, so as to control the robot to track based on the target teaching trajectory.
[0186] In the embodiment, after a plurality of reference sampling points are obtained by step 204, a target teaching trajectory can be generated according to the plurality of reference sampling points.
[0187] Specifically, the reference sampling points can be connected in order according to the sampling time of the reference sampling points to obtain the target teaching trajectory, which is not limited in the present application.
[0188] So far, the description of step 204 is ended, and step 205 is executed. Figure 1
[0189] The application generates a plurality of sampling groups based on a plurality of sampling points included in an initial teaching trajectory, for each sampling group, determines a motion state of the robot between the sampling points included in the sampling group according to state information included in the sampling group, and selects a plurality of reference sampling points from the plurality of sampling points according to the motion states of the robot corresponding to the plurality of sampling groups, and further generates a target teaching trajectory according to the reference sampling points, so as to control the robot to follow the target teaching trajectory. The application determines the sampling points at which the motion state of the robot changes through the motion states of the robot in the plurality of sampling groups, optimizes the initial teaching trajectory according to the sampling points at which the motion state of the robot changes, can eliminate irrelevant sampling points caused by redundant operations, makes the target teaching trajectory smoother, and improves the stability and fluency of the robot in the following process.
[0190] The application will be described below according to Figure 4 The overall process of the robot teaching trajectory optimization method proposed in the application is briefly described through a specific embodiment.
[0191] Please refer to Figure 4 , Figure 4 A specific process diagram of a robot teaching trajectory optimization method provided by the embodiment of the application is shown.
[0192] As Figure 4 shown, first determine whether there is an initial teaching trajectory, if there is no corresponding initial teaching trajectory, re-teaching is needed.
[0193] Traverse the teaching trajectory, take each adjacent two sampling points as a sampling group for example, calculate the Euclidean distance deltD and the attitude angle change amount deltA of the robot at the adjacent two sampling points.
[0194] If deltD is greater than or equal to the threshold TH1, it is determined that the motion state of the robot is straight, and the straight sampling point set P1 in the straight movement of the robot at this time is recorded;
[0195] If deltD is less than the threshold TH1 and deltA is less than TH2, it is determined that the motion state of the robot is static, and the static sampling point set P2 in the static process of the robot at this time is recorded;
[0196] If deltD is less than the threshold TH1 and deltA is greater than or equal to TH2, it is determined that the motion state of the robot is rotation in place, and the rotation sampling point set P3 in the rotation process of the robot at this time is recorded;
[0197] The pose sets P2 and P3 detected in the static and rotating processes are clustered to obtain a plurality of reference sub-sets, each of which corresponds to a complete static or in-place rotating operation, to be compatible with the rotating drift generated in the motion process, filter redundant poses to optimize the rotating motion, and filter redundant static actions to avoid long waiting time in the tracking process, and determine the start point, end point and key point in each reference sub-set.
[0198] According to the start point and end point, the sampling points included in the straight line sampling point set are divided into a plurality of candidate sub-sets, each of which represents a straight line region, the straight line equation corresponding to the straight line region is further determined, and the sampling points included in the straight line region are re-distributed according to the distance from the midpoint of the straight line region, so that the sampling points in the interval closer to the start point and the end point are more dense, and the sampling points in the interval farther away from the start point and the end point are more sparse, thereby realizing smooth acceleration and deceleration in the tracking process.
[0199] Further, according to the start point, end point, key point in the above-mentioned reference sub-set and the sampling points included in each candidate sub-set, a target teaching trajectory is generated.
[0200] According to the target teaching trajectory, the tracking process is completed according to the frequency control of PID.
[0201] In this embodiment, the process of tracking the target teaching trajectory according to PID is a common method in the related art, which will not be described here.
[0202] Thus, the description of the robot is ended. Figure 4
[0203] Please refer to Figure 5 , Figure 5 is a schematic structural diagram of a robot proposed in an embodiment of the present application. At the hardware level, the robot includes a logic operator, an internal bus and a sensor, and of course can also include other hardware required by the business (such as a camera device).
[0204] As an embodiment, the sensor can include an inertial measurement unit and a linear Hall sensor, the inertial measurement unit can be used to detect the attitude angle of the robot at the sampling point, and the linear Hall sensor can be used to detect the position information of the sampling point. The specific detection method is a common method in the related art, which will not be described here.
[0205] The logic operator can be used to execute the method shown in the above Figure 1
[0206] As an embodiment, the robot can be a two-wheel spherical robot, and the robot can further include:
[0207] The camera device is parallel to a horizontal plane when the robot is stationary, and is used to capture images to determine whether the robot performs a specified action, the specified action including the robot capturing images at specified sampling points and in specified poses.
[0208] Thus far, the description of the robot structure in Figure 5 is complete.
[0209] Please refer to Figure 6 , Figure 6 is a robot teaching trajectory optimization device structure diagram proposed in an embodiment of the present application. As shown in Figure 6 , the device can include an acquisition unit 601, a determination unit 602, a selection unit 603, and a generation unit 604. Specifically, the device includes:
[0210] The acquisition unit 601 is configured to acquire an initial teaching trajectory of the robot, the initial teaching trajectory including state information of a plurality of sampling points.
[0211] The determination unit 602 is configured to generate a plurality of sampling groups based on the plurality of sampling points included in the initial teaching trajectory, each sampling group including at least two sampling points.
[0212] For each sampling group, the motion state corresponding to the sampling group is determined according to the state information of the sampling points included in the sampling group, the motion state referring to the motion state of the robot between the sampling points included in the sampling group.
[0213] The selection unit 603 is configured to select a plurality of reference sampling points from the plurality of sampling points according to the motion states corresponding to the plurality of sampling groups, the reference sampling points including the sampling points at which the motion state of the robot changes.
[0214] The generation unit 604 is configured to generate a target teaching trajectory according to the reference sampling points, so as to control the robot to follow the target teaching trajectory based on the target teaching trajectory.
[0215] Optionally, the state information includes the position and the attitude angle of the robot; and the determination unit 602 is specifically configured to:
[0216] determine the Euclidean distance between the two sampling points according to the positions of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group;
[0217] determine the attitude angle change amount between the two sampling points according to the attitude angles of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group;
[0218] determine the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle change amount.
[0219] Optionally, the determining unit 602 is specifically configured to:
[0220] If the Euclidean distance is not less than the preset distance threshold, it is determined that the motion state corresponding to the sampling group is straight running.
[0221] If the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is less than the preset angle threshold, it is determined that the motion state corresponding to the sampling group is static.
[0222] If the Euclidean distance is less than the preset distance threshold, and the attitude angle change amount is not less than the preset angle threshold, the motion state corresponding to the sampling group is rotating in place.
[0223] Optionally, the motion state includes static and rotating in place; the selecting unit 603 is specifically configured to:
[0224] Based on the motion state corresponding to each sampling group, the sampling points included in the sampling group are divided into a sampling point set corresponding to the motion state of the sampling group, and the sampling point set includes a static sampling point set and a rotating in place sampling point set.
[0225] According to the state information of all sampling points included in the static sampling point set and the rotating in place sampling point set, all sampling points included in the static sampling point set and the rotating in place sampling point set are clustered to obtain a plurality of reference sub-sets, and the sampling points included in each reference sub-set are continuous sampling points in the initial teaching trajectory.
[0226] For each reference sub-set, the start point and the end point of the continuous sampling points included in the reference sub-set are taken as reference sampling points.
[0227] Optionally, the initial teaching trajectory includes at least one pre-configured key point in the plurality of sampling points, and the key point is used to indicate that the robot performs a specified action at the sampling point; before the start point and the end point of the continuous sampling points included in the reference sub-set are taken as reference sampling points, the selecting unit 603 is further configured to:
[0228] Detect whether the key point is included in the continuous sampling points included in the reference sub-set, if yes, the start point, the end point and the key point of the continuous sampling points included in the reference sub-set are taken as reference sampling points;
[0229] If not, the step of taking the start point and the end point of the continuous sampling points included in the reference sub-set as reference sampling points is continued.
[0230] Optionally, the motion state further includes straight running, and the sampling point set further includes a straight running set; the selecting unit 603 is further configured to:
[0231] According to the state information of the sampling points included in the straight-ahead set and the start point and the end point of the continuous sampling points included in each reference sub-set, a plurality of candidate sub-sets included in the straight-ahead set are determined, and the sampling points included in each candidate sub-set are continuous sampling points in the initial teaching trajectory;
[0232] The sampling points included in each candidate sub-set are taken as reference sampling points.
[0233] Optionally, before taking the sampling points included in each candidate sub-set as reference sampling points, the selecting unit 603 is further configured to:
[0234] For each candidate sub-set, according to the state information of the continuous sampling points included in the candidate sub-set, a straight line equation corresponding to the candidate sub-set is determined, and the straight line equation is used to represent the motion trajectory of the sampling points included in the candidate sub-set;
[0235] According to the straight line equation and the start point and the end point of the continuous sampling points included in the candidate sub-set, a midpoint of a straight-ahead region corresponding to the candidate sub-set is determined, and the straight-ahead region is divided into a plurality of sub-regions, and the straight-ahead region refers to a line segment between the start point and the end point of the continuous sampling points included in the candidate sub-set.
[0236] According to the midpoint of the straight-ahead region and the plurality of sub-regions, the sampling points included between the start point and the end point of the continuous sampling points in the candidate sub-set are re-distributed into the sub-regions, and the number of the re-distributed sampling points in each sub-region is positively correlated with a reference distance corresponding to the sub-region, and the reference distance corresponding to the sub-region refers to a distance between the midpoint of the sub-region and the midpoint of the straight-ahead region.
[0237] For each sub-region, according to the straight line equation and the number of the re-distributed sampling points in the sub-region, the state information of the re-distributed sampling points in the sub-region is determined to update the candidate sub-set. Thus, the Figure 6 The description of the robot teaching trajectory optimization device is completed.
[0238] Correspondingly, the present application also provides a computer readable storage medium, and the computer readable storage medium stores a plurality of computer instructions, and the computer instructions can implement the method disclosed in the above examples of the present application when executed.
[0239] Exemplarily, the computer readable storage medium described above can be any electronic, magnetic, optical, or other physical storage apparatus, and can contain or store information such as executable instructions, data, and the like. For example, the computer readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard drive), a solid state drive, any type of storage disk (such as an optical disk, a DVD, and the like), or similar storage medium, or a combination thereof.
[0240] The preferred embodiments of the present application have been described above with the aid of a number of drawings. These embodiments are illustrative only, and there can be other embodiments which do not depart from the spirit and essence of the application. It should be understood that various modifications and changes can be aimed at generalizing the concepts of the application and can be executed by those skilled in the art. Any modification, equivalent replacement, improvement, and the like within the spirit and principle of the present application shall be included in the scope of the present application.
Claims
1. A robot teach trajectory optimization method, characterized by, The method comprises: acquiring an initial teaching trajectory of the robot, the initial teaching trajectory comprising state information of a plurality of sampling points; generating a plurality of sampling groups based on the plurality of sampling points comprised in the initial teaching trajectory, each sampling group comprising at least two sampling points; for each sampling group, determining a motion state corresponding to the sampling group according to the state information of the sampling points comprised in the sampling group, the motion state referring to a motion state of the robot between the sampling points comprised in the sampling group; selecting a plurality of reference sampling points from the plurality of sampling points according to the motion states corresponding to the plurality of sampling groups, the reference sampling points comprising sampling points at which the motion state of the robot changes; generating a target teaching trajectory according to the reference sampling points, so as to control the robot to follow the target teaching trajectory.
2. The method of claim 1, wherein, The state information comprises a position and an attitude angle of the robot; and the determination of the motion state corresponding to the sampling group according to the state information of the sampling points comprised in the sampling group comprises: determining an Euclidean distance between two sampling points according to the positions of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group; determining an attitude angle change amount between two sampling points according to the attitude angles of the sampling point with the earliest sampling time and the sampling point with the latest sampling time in the sampling group; and determining the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle change amount.
3. The method of claim 2, wherein, The determination of the motion state corresponding to the sampling group according to the Euclidean distance and the attitude angle change amount comprises: if the Euclidean distance is not less than a preset distance threshold, determining that the motion state corresponding to the sampling group is straight movement; if the Euclidean distance is less than the preset distance threshold and the attitude angle change amount is less than a preset angle threshold, determining that the motion state corresponding to the sampling group is static; if the Euclidean distance is less than the preset distance threshold and the attitude angle change amount is not less than the preset angle threshold, determining that the motion state corresponding to the sampling group is rotation in place.
4. The method of claim 1, wherein, The motion state comprises static and rotation in place; and the selection of the plurality of reference sampling points from the plurality of sampling points according to the motion states corresponding to the plurality of sampling groups comprises: dividing the sampling points comprised in each sampling group into a sampling point set corresponding to the motion state of the sampling group based on the motion state corresponding to the sampling group, the sampling point set comprising a static sampling point set and a rotation-in-place sampling point set; performing clustering on all the sampling points comprised in the static sampling point set and the rotation-in-place sampling point set according to the state information of all the sampling points, to obtain a plurality of reference sub-sets, each reference sub-set comprising continuous sampling points in the initial teaching trajectory; for each reference sub-set, taking the start point and the end point of the continuous sampling points comprised in the reference sub-set as reference sampling points.
5. The method of claim 4, wherein, The initial teaching trajectory includes at least one pre-configured key point in a plurality of sampling points, and the key point is used to indicate that the robot performs a specified action at the sampling point; before the start point and the end point of the continuous sampling points included in the reference subset are taken as reference sampling points, the method further includes: detecting whether the key point is included in the continuous sampling points included in the reference subset, if yes, taking the start point, the end point and the key point of the continuous sampling points included in the reference subset as reference sampling points; if not, continuing to perform the step of taking the start point and the end point of the continuous sampling points included in the reference subset as reference sampling points.
6. The method of claim 4, wherein, The motion state further includes straight movement, and the sampling point set further includes a straight movement set. The selecting a plurality of reference sampling points from the plurality of sampling points according to the motion state of the robot in the plurality of sampling groups further includes: determining a plurality of candidate subsets included in the straight movement set according to the state information of the sampling points included in the straight movement set and the start point and the end point of the continuous sampling points included in each reference subset, and the sampling points included in each candidate subset are continuous sampling points in the initial teaching trajectory; taking the sampling points included in each candidate subset as reference sampling points.
7. The method of claim 6, wherein, Before taking the sampling points included in each candidate subset as reference sampling points, the method further includes: for each candidate subset, determining a straight line equation corresponding to the candidate subset according to the state information of the continuous sampling points included in the candidate subset, and the straight line equation is used to represent the motion trajectory of the sampling points included in the candidate subset; determining a midpoint of a straight movement area corresponding to the candidate subset according to the straight line equation and the start point and the end point of the continuous sampling points included in the candidate subset, and dividing the straight movement area into a plurality of sub-areas, the straight movement area refers to a line segment between the start point and the end point of the continuous sampling points included in the candidate subset; redistributing the sampling points included between the start point and the end point of the continuous sampling points in the candidate subset into the sub-areas according to the midpoint of the straight movement area and the plurality of sub-areas; wherein the number of the redistributed sampling points in each sub-area is positively correlated with a reference distance corresponding to the sub-area, and the reference distance corresponding to the sub-area refers to the distance between the midpoint of the sub-area and the midpoint of the straight movement area; for each sub-area, determining the state information of the redistributed sampling points in the sub-area according to the straight line equation and the number of the redistributed sampling points in the sub-area, to update the candidate subset.
8. A robot teaching trajectory optimization device, characterized in that, The device includes: an acquisition unit configured to acquire an initial teaching trajectory of the robot, the initial teaching trajectory including state information of a plurality of sampling points; a determination unit configured to generate a plurality of sampling groups based on the plurality of sampling points included in the initial teaching trajectory, each sampling group including at least two sampling points; For each sampling group, a motion state corresponding to the sampling group is determined according to state information of sampling points included in the sampling group, the motion state referring to a motion state of the robot between the sampling points included in the sampling group; a selecting unit configured to select a plurality of reference sampling points from the plurality of sampling points according to the motion states corresponding to the plurality of sampling groups, the reference sampling points including sampling points at which the motion state of the robot changes; a generating unit configured to generate a target teaching trajectory according to the reference sampling points, so as to control the robot to track based on the target teaching trajectory.
9. A robot, characterized in that The robot comprises: a sensor configured to detect state information of the robot; a logic operator configured to execute the method in any one of claims 1 to 7.
10. The robot of claim 9, wherein, The robot is a two-wheel spherical robot, and the robot further comprises: a camera device, the camera device being parallel to a horizontal plane when the robot is stationary, and being configured to perform image acquisition to determine whether the robot performs a specified action, the specified action including that the robot performs image acquisition at a specified sampling point according to a specified pose.
Citation Information
Patent Citations
Robot teaching track generation method and device, equipment and medium
CN116372927A
Topological path diagram generation method and device, robot and storage medium
CN117553801A