Trajectory smoothing method, electronic device and readable storage medium
By constructing transition ball and curve models, the motion trajectory of industrial equipment is smoothed, which solves the problem of low control efficiency caused by discontinuous motion trajectory of equipment and achieves more efficient control.
Patent Information
- Application Number
- CN202211352387.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-10-31
AI Technical Summary
The motion trajectory of industrial equipment is usually multi-stage splicing and discontinuous, resulting in low control efficiency and the equipment pauses in discontinuous parts.
By obtaining the first motion trajectory and the second motion trajectory of the industrial equipment, a transition ball is constructed, a control point is positioned, a curve model is constructed, and the motion trajectory is smoothed, the target motion trajectory is obtained.
The smoothness and continuity of the motion trajectory are achieved, avoiding the equipment's pause in the discontinuous part and improving the control efficiency.
Smart Images

Figure CN115826500B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial equipment, and in particular to a trajectory smoothing method, an electronic device, and a readable storage medium. Background Art
[0002] With the rapid development of science and technology, the control technology of industrial equipment has become more and more mature. At present, industrial equipment is usually controlled to run with a fixed motion trajectory, and the motion trajectory of industrial equipment is usually spliced with multiple segments, and the motion trajectory is not static. There may be discontinuities between segments of the motion trajectory. If the industrial equipment is still controlled to run with the original motion trajectory, the industrial equipment will pause at the discontinuous part of the motion trajectory, resulting in low control efficiency of the industrial equipment. Summary of the invention
[0003] The main purpose of the present application is to provide a trajectory smoothing method, an electronic device and a readable storage medium, aiming to solve the technical problem of low control efficiency of industrial equipment in the prior art.
[0004] To achieve the above object, the present application provides a trajectory smoothing method, which is applied to a trajectory smoothing device. The trajectory smoothing method includes:
[0005] Acquire a first motion trajectory and a second motion trajectory of the industrial equipment;
[0006] Constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0007] Locate a control point according to the first motion trajectory, the second motion trajectory and the transition ball to obtain the coordinates of the control point;
[0008] Constructing a curve model according to the coordinates of the control points;
[0009] According to the curve model, the first motion trajectory and the second motion trajectory are smoothed respectively to obtain a target motion trajectory.
[0010] To achieve the above object, the present application further provides a trajectory smoothing device, which is applied to a trajectory smoothing device, and the trajectory smoothing device comprises:
[0011] An acquisition module, used to acquire a first motion trajectory and a second motion trajectory of the industrial equipment;
[0012] A first construction module, configured to construct a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0013] A positioning module, used for positioning a control point according to the first motion trajectory, the second motion trajectory and the transition ball, and obtaining the coordinates of the control point;
[0014] A second construction module is used to construct a curve model according to the coordinates of the control points;
[0015] A smoothing module is used to perform smoothing processing on the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory.
[0016] The present application also provides an electronic device, comprising: a memory, a processor, and a program of the trajectory smoothing method stored in the memory and executable on the processor. When the program of the trajectory smoothing method is executed by the processor, the steps of the trajectory smoothing method as described above can be implemented.
[0017] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the trajectory smoothing method. When the program for the trajectory smoothing method is executed by a processor, the steps of the trajectory smoothing method as described above are implemented.
[0018] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned trajectory smoothing method when executed by a processor.
[0019] The present application provides a trajectory smoothing method, an electronic device and a readable storage medium. Compared with controlling industrial equipment to run with a fixed motion trajectory, the present application obtains a first motion trajectory and a second motion trajectory of the industrial equipment; constructs a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locates control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructs a curve model according to the control point coordinates; and smoothes the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory. By smoothing the trajectories of each motion trajectory, the smoothness and continuity of the target motion trajectory are achieved, thereby avoiding the situation that the motion trajectory of the industrial equipment is usually a multi-segment splicing, and the motion trajectory is not static, and there may be discontinuity between segments of the motion trajectory. If the industrial equipment is still controlled to run with the original motion trajectory, the industrial equipment will pause in the discontinuous part of the motion trajectory, thereby improving the control efficiency of the industrial equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 This is a flow chart of the first embodiment of the trajectory smoothing method of the present application;
[0023] Figure 2 This is an example diagram of a specific scenario when the first motion trajectory and the second motion trajectory are arcs in the trajectory smoothing method of the present application;
[0024] Figure 3 This is an example diagram of a specific scenario when the first motion trajectory is an arc and the second motion trajectory is a straight line in the trajectory smoothing method of this application;
[0025] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the trajectory smoothing method in the embodiment of the present application.
[0026] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0027] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of this application.
[0028] Embodiment 1
[0029] The present application embodiment provides a trajectory smoothing method. In the first embodiment of the trajectory smoothing method of the present application, refer to Figure 1 , the trajectory smoothing method comprises:
[0030] Step S10, obtaining a first motion trajectory and a second motion trajectory of the industrial equipment;
[0031] Step S20, constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0032] Step S30, locating a control point according to the first motion trajectory, the second motion trajectory and the transition ball to obtain the coordinates of the control point;
[0033] Step S40, constructing a curve model according to the control point coordinates;
[0034] Step S50: smoothing the first motion trajectory and the second motion trajectory respectively according to the curve model to obtain a target motion trajectory.
[0035] In this embodiment, it should be noted that the first motion trajectory can be the motion position information of the industrial equipment at the current time step, or the motion position information of the industrial equipment at the next time step, wherein the motion position information includes a series of motion position coordinates and / or motion position directions of the industrial equipment, and each of the motion position information constitutes a motion trajectory. The first motion trajectory and the second motion trajectory are time- or position-continuous trajectories, and the second motion trajectory is the motion trajectory of the industrial equipment after the first motion trajectory. The first motion trajectory can be a straight line trajectory or a circular arc trajectory. The second motion trajectory can be a straight line trajectory or a circular arc trajectory. The industrial equipment is an industrial production equipment, and the industrial equipment can be an industrial robot or a CNC (Computer numerical control, computer numerical control machine tool) equipment. The curve model can be a Bezier curve model, a NURBS (Non-Uniform Rational B-Splines) curve model, or any other arbitrary polynomial curve model. The control point is a point used to characterize the curve feature.
[0036] It is understandable that in order to solve the technical defect of the above-mentioned industrial equipment stopping at discontinuous parts in the motion trajectory, the motion trajectory is usually smoothed multiple times. Although this method can improve the continuity of the connection between the motion trajectories, the smooth curve obtained by multiple fittings may have local closures or sharp points, resulting in large local changes in the motion trajectory of the industrial equipment.
[0037] To solve the above defects, exemplarily, steps S10 to S50 include: obtaining a first motion trajectory and a second motion trajectory of the industrial equipment; judging whether the first motion trajectory and the second motion trajectory are smoothly connected, and if the first motion trajectory and the second motion trajectory are not smoothly connected, constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locating control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructing a curve model according to the control point coordinates; smoothing the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory; if the first motion trajectory and the second motion trajectory are smoothly connected, returning to the execution step: obtaining the first motion trajectory and the second motion trajectory of the industrial equipment until the first motion trajectory and the second motion trajectory are not smoothly connected, by constructing a curve model with a lower urgency between the first motion trajectory and the second motion trajectory, so that the first motion trajectory and the second motion trajectory have a smooth transition, avoiding the technical defect that the motion trajectory of the industrial equipment is still discontinuous due to the local closure or cusp of the smooth curve obtained by fitting when the motion trajectory is directly smoothed multiple times, thereby improving the control efficiency of the industrial equipment.
[0038] As an example, the first motion trajectory is a straight line and the second motion trajectory is a circular arc, or the first motion trajectory is a circular arc and the second motion trajectory is a straight line, or the first motion trajectory is a straight line and the second motion trajectory is a straight line, or the first motion trajectory is a circular arc and the second motion trajectory is a circular arc.
[0039] Exemplarily, step S50 includes: the target motion trajectory includes a target first motion trajectory and a target second motion trajectory, obtaining first trajectory intersection information between the curve model and the first motion trajectory, and obtaining second trajectory intersection information between the curve model and the second motion trajectory; according to the first trajectory intersection information, removing the intersection line between the first motion trajectory and the curve model to obtain the target first motion trajectory, and according to the second trajectory intersection information, removing the intersection line between the first motion trajectory and the curve model to obtain the target second motion trajectory.
[0040] Wherein, in step S20, the step of constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory includes:
[0041] Step S21, determining first trajectory feature information corresponding to the first motion trajectory and determining second trajectory feature information corresponding to the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0042] Step S22, determining a radius corresponding to the transition ball according to the first trajectory feature information and the second trajectory feature information;
[0043] Step S23, taking the connection point between the first motion trajectory and the second motion trajectory as the center of the transition ball;
[0044] Step S24, constructing the transition sphere according to the radius and the sphere center.
[0045] Exemplarily, steps S21 to S24 include: obtaining a first trajectory type corresponding to the first motion trajectory and a second trajectory type corresponding to the second motion trajectory, determining first trajectory feature information according to a first feature determination method corresponding to the first trajectory type, and determining second trajectory feature information according to a second feature determination method corresponding to the second trajectory type; determining a radius corresponding to the transition sphere according to the first trajectory feature information and the second trajectory feature information; taking a connection point between the first motion trajectory and the second motion trajectory as the center of the transition sphere; and constructing the transition sphere according to the radius and the center of the sphere.
[0046] As an example, when the first trajectory type is a straight line and the second trajectory type is a straight line, the first feature determination method and the second feature determination method are straight line feature determination methods, and step S21 includes: determining the first trajectory feature information and the second trajectory feature information according to the straight line feature determination method.
[0047] As an example, when the first trajectory type is an arc and the second trajectory type is an arc, the first feature determination method and the second feature determination method are arc feature determination methods, and step S21 includes: determining the first trajectory feature information and the second trajectory feature information according to the arc feature determination method.
[0048] As an example, when the first trajectory type is an arc and the second trajectory type is a straight line, the first feature determination method is an arc feature determination method, and the second feature determination method is a straight line feature determination method. Step S21 includes: determining the first trajectory feature information according to the arc feature determination method, and determining the second trajectory feature information according to the straight line feature determination method.
[0049] As an example, when the first trajectory type is a straight line and the second trajectory type is an arc, the first feature determination method is a straight line feature determination method, and the second feature determination method is an arc feature determination method. Step S21 includes: determining the first trajectory feature information according to the straight line feature determination method, and determining the second trajectory feature information according to the arc feature determination method.
[0050] It is understandable that when the radius of the transition ball is too large, the straight line features and / or arc features are easily lost, resulting in a large difference between the target motion trajectory obtained by smoothing the curve model constructed according to the transition ball and the first motion trajectory and / or the second motion trajectory, which in turn leads to lower control accuracy of the industrial equipment.
[0051] To solve the above-mentioned defects, the first intersection point between the transition ball and the first motion trajectory does not exceed the first midpoint corresponding to the first motion trajectory, and the second intersection point between the transition ball and the second motion trajectory does not exceed the second midpoint corresponding to the second motion trajectory, thereby ensuring that the target motion trajectory retains the straight line characteristics and / or arc characteristics in the first motion trajectory and the second motion trajectory, thereby improving the control accuracy of the industrial equipment.
[0052] Wherein, in step S30, the step of locating the control point according to the first motion trajectory, the second motion trajectory and the transition ball to obtain the coordinates of the control point includes:
[0053] Step S31, locating a first intersection point between the transition ball and the first motion trajectory according to the first trajectory feature information corresponding to the first motion trajectory and the transition ball, and obtaining the coordinates of the first intersection point;
[0054] Step S32, locating a second intersection point between the transition ball and the second motion trajectory according to the second trajectory feature information corresponding to the second motion trajectory and the transition ball, and obtaining the coordinates of the second intersection point;
[0055] Step S33: locate the control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates.
[0056] Exemplarily, steps S31 to S33 include: obtaining a first trajectory type corresponding to the first motion trajectory and a second trajectory type corresponding to the second motion trajectory, and locating a first intersection between the transition ball and the first motion trajectory according to a first intersection determination method corresponding to the first trajectory type, first trajectory feature information corresponding to the first motion trajectory, and the transition ball, to obtain first intersection coordinates; locating a second intersection between the transition ball and the second motion trajectory according to a second intersection determination method corresponding to the second trajectory type, second trajectory feature information corresponding to the second motion trajectory, and the transition ball, to obtain second intersection coordinates; locating a control point according to the first intersection coordinates and the second intersection coordinates, to obtain the control point coordinates.
[0057] As an example, when the first trajectory type is a straight line, the first intersection determination method is a straight line intersection determination method, and step S31 includes: according to the straight line intersection determination method, the first trajectory feature information corresponding to the first motion trajectory and the transition ball, locating the first intersection between the transition ball and the first motion trajectory to obtain the first intersection coordinates.
[0058] As an example, when the first trajectory type is an arc, the first intersection determination method is an arc intersection determination method, and step S31 includes: according to the arc intersection determination method, the first trajectory feature information corresponding to the first motion trajectory and the transition ball, locating the first intersection between the transition ball and the first motion trajectory to obtain the first intersection coordinates.
[0059] As an example, when the second trajectory type is a straight line, the second intersection determination method is a straight line intersection determination method, and step S32 includes: locating the second intersection between the transition ball and the second motion trajectory according to the straight line intersection determination method, the second trajectory feature information corresponding to the second motion trajectory, and the transition ball, to obtain the second intersection coordinates.
[0060] As an example, when the second trajectory type is an arc, the second intersection determination method is an arc intersection determination method, and step S31 includes: according to the arc intersection determination method, the second trajectory feature information corresponding to the second motion trajectory and the transition ball, locating the second intersection between the transition ball and the second motion trajectory to obtain the second intersection coordinates.
[0061] Wherein, in step S33, the control point coordinates include the first control point coordinates, the second control point coordinates and the third control point coordinates, and the control points include the first control point, the second control point and the third control point.
[0062] The step of locating the control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates comprises:
[0063] Step A10, taking the first intersection point as the first control point, and taking the coordinates of the first intersection point as the coordinates of the first control point;
[0064] Step A20, using the second intersection point as the second control point, and using the coordinates of the second intersection point as the coordinates of the second control point;
[0065] Step A30: locate the third control point between the first control point and the second control point according to the coordinates of the first control point, the coordinates of the second control point and the transition sphere, and obtain the coordinates of the third control point.
[0066] Exemplarily, the transition ball feature information includes the coordinates of the center of the transition ball (i.e., the connection point between the first motion trajectory and the second motion trajectory, i.e., the first end point coordinates of the first motion trajectory, i.e., the second starting point coordinates of the second motion trajectory). Step A30 includes: locating the third control point between the first control point and the second control point according to the coordinates of the first control point, the coordinates of the second control point and the coordinates of the center of the transition ball to obtain the coordinates of the third control point.
[0067] Optionally, the step of locating the third control point between the first control point and the second control point according to the coordinates of the first control point, the coordinates of the second control point and the coordinates of the center of the transition sphere to obtain the coordinates of the third control point may specifically be:
[0068]
[0069] Among them, p2 is the coordinate of the third control point, p0 is the coordinate of the first control point, P3 is the coordinate of the center of the transition sphere, and p4 is the coordinate of the second control point.
[0070] Wherein, in step S33, the control point coordinates also include the fourth control point coordinates and the fifth control point coordinates, and the control points also include the fourth control point and the fifth control point.
[0071] The step of locating the control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates further includes:
[0072] Step B10, locating a first tangent point direction of the first intersection on the first motion trajectory according to the first motion feature information and the coordinates of the first control point, and locating a second tangent point direction of the second intersection on the second motion trajectory according to the second motion feature information and the coordinates of the second control point;
[0073] Step B20, locating a fourth control point between the first control point and the third control point according to the first tangent point direction, the first control point coordinates and the third control point coordinates, and obtaining the fourth control point coordinates;
[0074] Step B30: locate a fifth control point between the third control point and the second control point according to the second tangent point direction, the second control point coordinates and the third control point coordinates, and obtain the fifth control point coordinates.
[0075] Exemplarily, step B10 includes: according to the first tangent point direction determination method corresponding to the first trajectory type, according to the first tangent point direction determination method, the first motion feature information and the first control point coordinates, locating the first tangent point direction of the first intersection on the first motion trajectory; and, according to the second tangent point direction determination method corresponding to the second trajectory type, according to the second tangent point direction determination method, the second motion feature information and the second control point coordinates, locating the second tangent point direction of the second intersection on the second motion trajectory.
[0076] As an example, when the first trajectory type and the second trajectory type are straight lines, the first tangent point direction determination method and the second tangent point direction determination method are straight line tangent point direction determination methods, and step B10 includes: locating the first tangent point direction of the first intersection on the first motion trajectory according to the straight line tangent point direction determination method, the first motion feature information and the first control point coordinates, and locating the second tangent point direction of the second intersection on the second motion trajectory according to the straight line tangent point direction determination method, the second motion feature information and the second control point coordinates.
[0077] As an example, when the first trajectory type and the second trajectory type are arcs, the first tangent point direction determination method and the second tangent point direction determination method are arc tangent point direction determination methods, and step B10 includes: locating the first tangent point direction of the first intersection on the first motion trajectory according to the arc tangent point direction determination method, the first motion feature information and the first control point coordinates, and locating the second tangent point direction of the second intersection on the second motion trajectory according to the arc tangent point direction determination method, the second motion feature information and the second control point coordinates.
[0078] As an example, when the first trajectory type is an arc and the second trajectory type is a straight line, the first tangent point direction determination method is an arc tangent point direction determination method, and the second tangent point direction determination method is a straight line tangent point direction determination method, step B10 includes: locating the first tangent point direction of the first intersection on the first motion trajectory according to the arc tangent point direction determination method, the first motion feature information and the first control point coordinates, and locating the second tangent point direction of the second intersection on the second motion trajectory according to the straight line tangent point direction determination method, the second motion feature information and the second control point coordinates.
[0079] As an example, when the first trajectory type is a straight line and the second trajectory type is an arc, the first tangent point direction determination method is a straight line tangent point direction determination method, and the second tangent point direction determination method is an arc tangent point direction determination method, step B10 includes: locating the first tangent point direction of the first intersection on the first motion trajectory according to the straight line tangent point direction determination method, the first motion feature information and the first control point coordinates, and locating the second tangent point direction of the second intersection on the second motion trajectory according to the arc tangent point direction determination method, the second motion feature information and the second control point coordinates.
[0080] Optionally, the step of locating a fourth control point between the first control point and the third control point according to the first tangent point direction, the first control point coordinates and the third control point coordinates, and obtaining the fourth control point coordinates may specifically be:
[0081]
[0082] Among them, p1 is the coordinate of the fourth control point, p0 is the coordinate of the first control point, p2 is the coordinate of the third control point, and v1 is the first tangent point direction.
[0083] Optionally, the step of locating a fifth control point between the third control point and the second control point according to the second tangent point direction, the second control point coordinates and the third control point coordinates, and obtaining the fifth control point coordinates may specifically be:
[0084]
[0085] Among them, p3 is the coordinate of the fifth control point, p4 is the coordinate of the second control point, v2 is the second tangent point direction, and p2 is the coordinate of the third control point.
[0086] Wherein, in step S40, the step of constructing a curve model according to the control point coordinates includes:
[0087] Step S41, determining the curve construction intermediate parameters corresponding to the NURBS curve model according to the control point coordinates;
[0088] Step S42, constructing intermediate parameters according to the curve, mapping the control points to theoretical control points of the curve model, and obtaining coordinates of the theoretical control points;
[0089] Step S43, constructing the NURBS curve model according to the coordinates of the theoretical control points and the intermediate parameters of the curve.
[0090] Exemplarily, steps S41 to S43 include: the curve construction intermediate parameters include a first type parameter group, a second type parameter group, a third type parameter group, a fourth type parameter group, a fifth type parameter group and a sixth type parameter group, and the first type parameter group is determined according to the control point coordinates; the second type parameter group is determined according to the first type parameter group; the third type parameter group, the fourth type parameter group and the fifth type parameter group are respectively determined according to the second type parameter group; the sixth type parameter group is determined according to the second type parameter group, the first tangent point direction, the second tangent point direction and the control point coordinates; according to the sixth type parameter group, the third type parameter group, the fourth type parameter group and the fifth type parameter group, the control points are mapped to theoretical control points of the NURBS curve model to obtain theoretical control point coordinates; the NURBS curve model is constructed according to the theoretical control point coordinates and the curve construction intermediate parameters.
[0091] Optionally, the step of determining the first type of parameter group according to the control point coordinates may specifically be:
[0092]
[0093] Among them, u i is the first type of parameter group, p i is the coordinate of the control point, and i is the subscript.
[0094] It can be understood that the value of i is determined by the repetition of both ends of the NURBS open curve. For a cubic NURBS open curve, the repetition of both ends is 4, and for a quartic NURBS open curve, the repetition of both ends is 5, that is, 1 is added to the number. When the repetition of both ends is 4, the first type of parameter group includes the following relationship:
[0095] u0=u1=u2=u3=0
[0096] u7=u8=u9=u 10 =1
[0097] Wherein, u0 is the first parameter in the first type of parameter group, u1 is the second parameter in the first type of parameter group, u2 is the third parameter in the first type of parameter group, u3 is the fourth parameter in the first type of parameter group, u7 is the eighth parameter in the first type of parameter group, u8 is the ninth parameter in the first type of parameter group, u9 is the tenth parameter in the first type of parameter group, and u 10 It is the eleventh parameter in the first parameter group.
[0098] Optionally, the step of determining the second type of parameter group according to the first type of parameter group may specifically be:
[0099] Δ i =u i+1 -u i
[0100] Among them, Δ i is the second type of parameter group, u i is the first type of parameter group, and i is a subscript.
[0101] Optionally, the step of respectively determining the third type parameter group, the fourth type parameter group and the fifth type parameter group according to the second type parameter group may specifically include:
[0102]
[0103] Among them, a i is the third type of parameter group, Δ i is the second type of parameter group, i is the subscript.
[0104]
[0105] Among them, b i is the fourth type of parameter group, Δ i is the second type of parameter group, i is the subscript.
[0106]
[0107] Among them, c i is the fifth type of parameter group, Δ i is the second type of parameter group, i is the subscript.
[0108] Optionally, the step of determining the sixth type of parameter group according to the second type of parameter group, the first tangent point direction, the second tangent point direction and the control point coordinates may specifically include:
[0109]
[0110] Among them, e1 is the first parameter in the sixth type parameter group, p0 is the coordinate of the first control point, Δ3 is the third parameter in the second type parameter group, and v1 is the first tangent point direction.
[0111]
[0112] Among them, e5 is the fifth parameter in the sixth type parameter group, p4 is the end point position information, v2 is the second tangent point direction, and Δ6 is the sixth parameter in the second type parameter group.
[0113] e i =(Δ i+1 +Δ i+2 ) i-1
[0114] Among them, e i is the sixth parameter group, Δ i For the second type of parameter group, p i is the coordinate of the control point, and i is the subscript.
[0115] Optionally, the theoretical control point coordinates include first theoretical control point coordinates, second theoretical control point coordinates, third theoretical control point coordinates, fourth theoretical control point coordinates and fifth theoretical control point coordinates, and the step of mapping the control points to theoretical control points of the NURBS curve model according to the sixth parameter group, the third parameter group, the fourth parameter group and the fifth parameter group to obtain the theoretical control point coordinates may specifically be:
[0116]
[0117] Among them, a2 is the second parameter in the third parameter group, a3 is the third parameter in the third parameter group, a4 is the fourth parameter in the third parameter group, d1 is the coordinate of the first theoretical control point, d2 is the coordinate of the second theoretical control point, d3 is the coordinate of the third theoretical control point, d4 is the coordinate of the fourth theoretical control point, d5 is the coordinate of the fifth theoretical control point, e1 is the first parameter in the sixth parameter group, e2 is the second parameter in the sixth parameter group, e3 is the third parameter in the sixth parameter group, e4 is the fourth parameter in the sixth parameter group, e5 is the fifth parameter in the sixth parameter group, b2 is the second parameter in the fourth parameter group, b3 is the third parameter in the fourth parameter group, b4 is the fourth parameter in the fourth parameter group, c2 is the second parameter in the fifth parameter group, c3 is the third parameter in the fifth parameter group, and c4 is the fourth parameter in the fifth parameter group.
[0118] Optionally, the step of constructing the NURBS curve according to the coordinates of the theoretical control points and the intermediate parameters of the curve may specifically be:
[0119]
[0120] Where, p(u) is the NURBS curve, d i is the coordinate of the theoretical control point, N i,k (u) is the seventh parameter group, and i is a subscript.
[0121] Optionally, the seventh parameter group may be determined specifically as follows:
[0122]
[0123] Among them, N i,0 is the first parameter in the seventh parameter group, u i is the first type of parameter group, N i,k () is the seventh parameter group, and i is a subscript.
[0124] Wherein, in step S20, before the step of constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory, the method further includes:
[0125] Step C10, if the first middle point of the first motion trajectory, the second middle point of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are not collinear, then executing the steps of: constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0126] Step C20, if the first intermediate point, the second intermediate point and the connection point are collinear, return to the execution step: obtain the first motion trajectory and the second motion trajectory of the industrial equipment until the first intermediate point, the second intermediate point and the connection point are not collinear.
[0127] Exemplarily, steps C10 to C20 include: determining whether the first midpoint of the first motion trajectory, the second midpoint of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are collinear; if the first midpoint of the first motion trajectory, the second midpoint of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are not collinear, executing the step of: constructing a transition ball between the first motion trajectory and the second motion trajectory based on the first motion trajectory and the second motion trajectory; if the first midpoint, the second midpoint, and the connection point are collinear, returning to execute the step of: obtaining the first motion trajectory and the second motion trajectory of the industrial equipment until the first midpoint, the second midpoint, and the connection point are not collinear.
[0128] Optionally, the step of determining whether the first middle point of the first motion trajectory, the second middle point of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are collinear may specifically be:
[0129] When the first intermediate point, the second intermediate point and the connection point are collinear:
[0130]
[0131] Among them, P2 is the first intermediate point coordinate corresponding to the first intermediate point, P3 is the connection point coordinate corresponding to the connection point, and P4 is the second intermediate point coordinate corresponding to the second intermediate point.
[0132] The embodiment of the present application provides a trajectory smoothing method. Compared with controlling the industrial equipment to run with a fixed motion trajectory, the embodiment of the present application obtains a first motion trajectory and a second motion trajectory of the industrial equipment; constructs a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locates control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructs a curve model according to the control point coordinates; and smoothes the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory. By smoothing the trajectories of each motion trajectory, the smoothness and continuity of the target motion trajectory are achieved, thereby avoiding the situation that the motion trajectory of the industrial equipment is usually spliced with multiple segments, and the motion trajectory is not static, and discontinuity between segments of the motion trajectory may occur. If the industrial equipment is still controlled to run with the original motion trajectory, the industrial equipment will pause in the discontinuous part of the motion trajectory, thereby improving the control efficiency of the industrial equipment.
[0133] Embodiment 2
[0134] Further, based on the first embodiment of the present application, in another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above description, and will not be described in detail later. On this basis, when the first motion trajectory is an arc and the second motion trajectory is an arc, the first trajectory feature information includes first arc feature information, first starting point pointing arc feature information and first end point pointing arc feature information, and the step of determining the first trajectory feature information according to the arc feature determination method includes:
[0135] Obtain the first starting point coordinates, the first intermediate point coordinates and the first end point coordinates of the first motion trajectory, wherein the first intermediate point coordinates are the coordinates of the intermediate point between the starting point and the end point on the first motion trajectory, and the intermediate point can be the midpoint of the first motion trajectory, and can also be any point on the first motion trajectory except the starting point and the end point; determine the first arc feature information according to the first starting point coordinates, the first intermediate point coordinates and the first end point coordinates; determine the arc feature information that the first starting point points to according to the first starting point coordinates and the arc feature information; determine the arc feature information that the first end point points to according to the first end point coordinates and the arc feature information.
[0136] The first arc feature information includes first arc unit normal vector information, first arc radius information and first circle center coordinate information, and the step of determining the first arc feature information according to the first starting point coordinates, the first intermediate point coordinates and the first end point coordinates includes:
[0137] The first arc unit normal vector information, the first arc radius information and the first circle center coordinate information are determined according to the first starting point coordinates, the first intermediate point coordinates and the first end point coordinates.
[0138] Optionally, the step of determining the first arc unit normal vector information, the first arc radius information, and the first circle center coordinate information according to the first starting point coordinates, the first intermediate point coordinates, and the first end point coordinates may specifically include:
[0139]
[0140] Among them, n is the first arc unit normal vector information, P1 is the first starting point coordinates, P2 is the first intermediate point coordinates, and P3 is the first end point coordinates.
[0141]
[0142] Among them, P1 is the first starting point coordinate, P2 is the first intermediate point coordinate, P3 is the first end point coordinate, and R1 is the first arc radius information corresponding to the first motion trajectory.
[0143] O1=αP1+βP2+γP3
[0144] Among them, α is the first circle center parameter, β is the second circle center parameter, γ is the third circle center parameter, P1 is the first starting point coordinate, P2 is the first intermediate point coordinate, P3 is the first end point coordinate, and O1 is the first circle center coordinate information corresponding to the first motion trajectory.
[0145]
[0146] Among them, α is the first circle center parameter, P1 is the first starting point coordinate, P2 is the first intermediate point coordinate, and P3 is the first end point coordinate.
[0147]
[0148] Among them, β is the second center parameter, P1 is the first starting point coordinate, P2 is the first intermediate point coordinate, and P3 is the first end point coordinate.
[0149]
[0150] Among them, γ is the third circle center parameter, P1 is the first starting point coordinate, P2 is the first intermediate point coordinate, and P3 is the first end point coordinate.
[0151] The first starting point pointing arc feature information includes first center-pointing starting point unit vector information and first arc starting point unit tangent vector information, and the step of determining the first starting point pointing arc feature information according to the first starting point coordinates and the first arc feature information includes:
[0152] The unit vector information of the first center of the circle pointing to the starting point is determined according to the first starting point coordinates and the first center coordinates; the unit tangent vector information of the first arc starting point is determined according to the unit vector information of the first center of the circle pointing to the starting point and the first arc unit normal vector information.
[0153] Optionally, the step of determining the unit vector information of the first circle center pointing to the starting point according to the first starting point coordinates and the first circle center coordinates may specifically be:
[0154]
[0155] Among them, v sis the unit vector information pointing from the first circle center to the starting point, P1 is the coordinates of the first starting point, and O1 is the coordinate information of the first circle center.
[0156] Optionally, the step of determining the unit tangent vector information of the arc starting point according to the unit vector information of the circle center pointing to the starting point and the unit normal vector information of the arc may specifically be:
[0157] p s =v s ×n
[0158] Among them, p s is the unit tangent vector information of the first arc starting point, v s is the unit vector information pointing from the center of the first circle to the starting point, and n is the unit normal vector information of the first arc.
[0159] The endpoint-pointing arc feature information includes first center-pointing arc unit vector information and first arc endpoint unit tangent vector information. The step of determining the first endpoint-pointing arc feature information according to the first endpoint coordinates and the arc feature information includes:
[0160] The unit vector information of the first center of the circle pointing to the end point is determined according to the first end point coordinates and the first center coordinates; the unit tangent vector information of the first arc end point is determined according to the unit vector information of the first center of the circle pointing to the end point and the first arc unit normal vector information.
[0161] Optionally, the step of determining the unit vector information of the first circle center pointing to the end point according to the first end point coordinates and the first circle center coordinate information may specifically be:
[0162]
[0163] Among them, v e is the unit vector information pointing from the first circle center to the end point, P3 is the coordinates of the first end point, and O1 is the coordinate information of the first circle center.
[0164] Optionally, the step of determining the first arc endpoint unit tangent vector information according to the first circle center pointing to the endpoint unit vector information and the first arc unit normal vector information may specifically be:
[0165] p e =v e ×n
[0166] Among them, p e is the unit tangent vector information of the first arc endpoint, v e is the unit vector information pointing from the center of the first circle to the end point, and n is the unit normal vector information of the first arc.
[0167] As an example, when the second motion trajectory is an arc, the specific implementation method of determining the second trajectory feature information according to the arc feature determination method refers to the specific implementation process of determining the first trajectory feature information according to the arc feature determination method, which will not be repeated here.
[0168] The step of locating the first intersection point between the transition ball and the first motion trajectory according to the arc intersection determination method, the first trajectory feature information corresponding to the first motion trajectory, and the transition ball to obtain the coordinates of the first intersection point comprises:
[0169] The line connecting the first intersection point between the transition ball and the first motion trajectory and the first center of the circle corresponding to the first motion trajectory is taken as the first straight line, the line connecting the first center of the circle and the center of the transition ball is taken as the second straight line, and the angle between the second straight line and the first straight line is taken as the characteristic angle; the coordinates of the first intersection point are determined according to the first center coordinate information corresponding to the first center of the circle, the corresponding first arc radius information, the corresponding first circle pointing starting point unit vector information, the corresponding first arc starting point unit tangent vector information and the characteristic angle.
[0170] Optionally, the step of determining the coordinates of the first intersection point according to the first circle center coordinate information corresponding to the first circle center, the corresponding first arc radius information, the corresponding first circle pointing starting point unit vector information, the corresponding first arc starting point unit tangent vector information and the characteristic angle may specifically include:
[0171] p0=O1+R1(cos(θ)·v s +sin(θ)·p s )
[0172] Wherein, p0 is the coordinate of the first intersection point, O1 is the coordinate information of the first circle center, θ is the characteristic angle, R1 is the radius information of the first arc, and v s is the unit vector information of the first circle center pointing to the starting point, p s The unit tangent vector information of the starting point of the first arc.
[0173] Optionally, the characteristic angle may be determined specifically as follows:
[0174]
[0175] Among them, θ is the characteristic angle, R1 is the first arc radius information, and r is the radius of the transition sphere.
[0176] As an example, when the second motion trajectory is an arc, the specific implementation method of locating the second intersection between the transition ball and the second motion trajectory according to the arc intersection determination method, the second trajectory feature information corresponding to the second motion trajectory and the transition ball, and obtaining the coordinates of the second intersection can refer to the above-mentioned specific implementation process of locating the first intersection between the transition ball and the first motion trajectory according to the arc intersection determination method, the first trajectory feature information corresponding to the first motion trajectory and the transition ball, and obtaining the coordinates of the first intersection, which will not be repeated here.
[0177] The step of locating the first tangent point direction of the first intersection on the first motion trajectory according to the arc tangent point direction determination method, the first motion feature information and the first control point coordinates comprises:
[0178]
[0179] Among them, v1 is the first tangent point direction, p0 is the first control point coordinates, n is the arc unit normal vector information, and O1 is the first circle center coordinate information.
[0180] As an example, when the second motion trajectory is an arc, the specific implementation content of the step of locating the second tangent direction of the second intersection on the second motion trajectory according to the arc tangent direction determination method, the second motion feature information and the second control point coordinates can refer to the above-mentioned specific implementation method of locating the first tangent direction of the first intersection on the first motion trajectory according to the arc tangent direction determination method, the first motion feature information and the first control point coordinates, and will not be repeated here.
[0181] As an example, when the first motion trajectory is an arc and the second motion trajectory is an arc, refer to Figure 2 , Figure 2 Including: the first starting point P1 of the first motion trajectory, the first middle point P2 of the first motion trajectory, the first end point of the first motion trajectory (that is, the second starting point of the second motion trajectory, or, the center of the transition sphere between the first motion trajectory and the second motion trajectory, or, the connection point between the first motion trajectory and the second motion trajectory) P3, the trajectory midpoint D1 of the second motion trajectory, the trajectory end point P5 of the second motion trajectory, the second middle point P4 of the second motion trajectory, the center O1 of the first motion trajectory, the center O2 of the second motion trajectory, the trajectory radius R1 of the first motion trajectory, the trajectory radius R2 of the second motion trajectory, the radius r1 of the transition sphere, the first control point p0 of the curve model, the fourth control point p1, the third control point p2, the fifth control point p3, the second control point p4, the first tangent direction v1 and the second tangent direction v2.
[0182] The embodiment of the present application provides a trajectory smoothing method. Compared with controlling the industrial equipment to run with a fixed motion trajectory, the embodiment of the present application obtains a first motion trajectory and a second motion trajectory of the industrial equipment; constructs a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locates control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructs a curve model according to the control point coordinates; and smoothes the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory. By smoothing the trajectories of each motion trajectory, the smoothness and continuity of the target motion trajectory are achieved, thereby avoiding the situation that the motion trajectory of the industrial equipment is usually spliced with multiple segments, and the motion trajectory is not static, and discontinuity between segments of the motion trajectory may occur. If the industrial equipment is still controlled to run with the original motion trajectory, the industrial equipment will pause in the discontinuous part of the motion trajectory, thereby improving the control efficiency of the industrial equipment.
[0183] Embodiment 3
[0184] Further, based on the first embodiment and / or the second embodiment of the present application, in another embodiment of the present application, the same or similar contents as those in the above embodiment and / or the second embodiment 1 can be referred to the above description, and will not be described in detail later. On this basis, when the first motion trajectory is an arc and the second motion trajectory is a straight line, the second trajectory feature information includes second straight line direction feature information and second straight line distance feature information, and the step of determining the second trajectory feature information according to the straight line feature determination method includes:
[0185] Obtain the second starting point coordinates and the second end point coordinates of the second motion trajectory; obtain the vector modulus between the second starting point coordinates and the second end point coordinates, and use the vector modulus as the second straight line distance feature information; determine the second straight line direction feature information based on the vector between the second starting point coordinates and the second end point coordinates and the second straight line distance feature information.
[0186] Optionally, the step of using the vector modulus between the second starting point coordinates and the second end point coordinates as the straight-line distance feature information may specifically be:
[0187]
[0188] Among them, len is the second straight-line distance feature information, P3 is the second starting point coordinate, and P4 is the second end point coordinate.
[0189] Optionally, the step of determining the second straight line direction characteristic information according to the vector between the second starting point coordinates and the second end point coordinates and the straight line distance characteristic information may specifically be:
[0190]
[0191] Among them, v a is the second straight line direction feature information, line.len is the second straight line distance feature information, P3 is the second starting point coordinate, and P4 is the second end point coordinate.
[0192] As an example, when the first motion trajectory is a straight line, the specific implementation method of determining the first trajectory feature information according to the straight line feature determination method refers to the specific implementation process of the step of determining the second trajectory feature information according to the straight line feature determination method, and will not be repeated here.
[0193] The step of locating the second tangent point direction of the second intersection point on the second motion trajectory according to the straight line tangent point direction determination method, the second motion feature information and the second control point coordinates comprises:
[0194] The second straight line direction feature information is used as the second tangent point direction.
[0195] As an example, when the first motion trajectory is an arc, the specific implementation method of locating the first tangent direction of the first intersection on the second motion trajectory according to the straight line tangent direction determination method, the first motion feature information and the first control point coordinates can refer to the above-mentioned specific implementation process of locating the second tangent direction of the second intersection on the second motion trajectory according to the straight line tangent direction determination method, the second motion feature information and the second control point coordinates, which will not be repeated here.
[0196] The step of locating the second intersection point between the transition ball and the second motion trajectory according to the straight line intersection determination method, the second trajectory feature information corresponding to the second motion trajectory and the transition ball to obtain the coordinates of the second intersection point comprises:
[0197] p0=P4+v a ·r
[0198] Where p0 is the coordinate of the first control point, P4 is the coordinate of the second starting point, v a is the first straight line direction feature information, and r is the radius of the transition sphere.
[0199] As an example, when the first motion trajectory is an arc and the second motion trajectory is a straight line, refer to Figure 3 , Figure 3 Including: the first starting point P1 of the first motion trajectory, the first intermediate point P2, the first end point of the first motion trajectory (that is, the second starting point of the second motion trajectory, or, the center of the transition sphere between the first motion trajectory and the second motion trajectory, or, the connection point between the first motion trajectory and the second motion trajectory) P3, the second end point P4 of the second motion trajectory, the center O3 of the first motion trajectory, the trajectory radius R3 of the first motion trajectory, the radius r2 of the transition sphere, the first control point p0 of the curve model, the fourth control point p1, the third control point p2, the fifth control point p3, the second control point p4, the first tangent point direction v1 and the second tangent point direction v2.
[0200] The embodiment of the present application provides a trajectory smoothing method. Compared with controlling the industrial equipment to run with a fixed motion trajectory, the embodiment of the present application obtains a first motion trajectory and a second motion trajectory of the industrial equipment; constructs a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locates control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructs a curve model according to the control point coordinates; and smoothes the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory. By smoothing the trajectories of each motion trajectory, the smoothness and continuity of the target motion trajectory are achieved, thereby avoiding the situation that the motion trajectory of the industrial equipment is usually spliced with multiple segments, and the motion trajectory is not static, and discontinuity between segments of the motion trajectory may occur. If the industrial equipment is still controlled to run with the original motion trajectory, the industrial equipment will pause in the discontinuous part of the motion trajectory, thereby improving the control efficiency of the industrial equipment.
[0201] Embodiment 4
[0202] The present application also provides a trajectory smoothing device, which is applied to a trajectory smoothing device, and includes:
[0203] An acquisition module, used to acquire a first motion trajectory and a second motion trajectory of the industrial equipment;
[0204] A first construction module, configured to construct a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0205] A positioning module, used for positioning a control point according to the first motion trajectory, the second motion trajectory and the transition ball, and obtaining the coordinates of the control point;
[0206] A second construction module is used to construct a curve model according to the coordinates of the control points;
[0207] A smoothing module is used to perform smoothing processing on the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory.
[0208] Optionally, the first building block is further used for:
[0209] Determine, according to the first motion trajectory and the second motion trajectory, first trajectory feature information corresponding to the first motion trajectory and second trajectory feature information corresponding to the second motion trajectory;
[0210] Determining a radius corresponding to the transition sphere according to the first trajectory feature information and the second trajectory feature information;
[0211] Taking the connection point between the first motion trajectory and the second motion trajectory as the center of the transition ball;
[0212] The transition sphere is constructed according to the radius and the sphere center.
[0213] Optionally, a first intersection point between the transition ball and the first motion trajectory does not exceed a first midpoint corresponding to the first motion trajectory, and a second intersection point between the transition ball and the second motion trajectory does not exceed a second midpoint corresponding to the second motion trajectory.
[0214] Optionally, the positioning module is further used for:
[0215] Locating a first intersection point between the transition ball and the first motion trajectory according to first trajectory feature information corresponding to the first motion trajectory and the transition ball, and obtaining coordinates of the first intersection point;
[0216] According to the second track feature information corresponding to the second track and the transition ball, a second intersection point between the transition ball and the second track is located to obtain the coordinates of the second intersection point;
[0217] The control point is located according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates.
[0218] Optionally, the control point coordinates include first control point coordinates, second control point coordinates and third control point coordinates, the control points include the first control point, the second control point and the third control point, and the positioning module is further used for:
[0219] Taking the first intersection point as the first control point, and taking the coordinates of the first intersection point as the coordinates of the first control point;
[0220] Taking the second intersection point as the second control point, and taking the coordinates of the second intersection point as the coordinates of the second control point;
[0221] The third control point between the first control point and the second control point is located according to the coordinates of the first control point, the coordinates of the second control point and the transition sphere to obtain the coordinates of the third control point.
[0222] Optionally, the control point coordinates further include a fourth control point coordinate and a fifth control point coordinate, the control points further include a fourth control point and a fifth control point, and the positioning module is further used for:
[0223] Locating a first tangent point direction of the first intersection point on the first motion trajectory according to the first motion feature information and the coordinates of the first control point, and locating a second tangent point direction of the second intersection point on the second motion trajectory according to the second motion feature information and the coordinates of the second control point;
[0224] Locate a fourth control point between the first control point and the third control point according to the first tangent point direction, the first control point coordinates and the third control point coordinates, and obtain the fourth control point coordinates;
[0225] According to the second tangent point direction, the second control point coordinates and the third control point coordinates, a fifth control point between the third control point and the second control point is located to obtain the fifth control point coordinates.
[0226] Optionally, the curve model is a NURBS curve model, and the second building module is further used for:
[0227] Determining, according to the coordinates of the control points, intermediate parameters of the curve construction corresponding to the NURBS curve model;
[0228] Constructing intermediate parameters according to the curve, mapping the control points to theoretical control points of the NURBS curve model, and obtaining coordinates of the theoretical control points;
[0229] The NURBS curve model is constructed according to the coordinates of the theoretical control points and the intermediate parameters of the curve.
[0230] Optionally, before the step of constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory, the trajectory smoothing device is further used to:
[0231] If the first middle point of the first motion trajectory, the second middle point of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are not collinear, performing the steps of: constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory;
[0232] If the first intermediate point, the second intermediate point and the connection point are collinear, return to the execution step: obtain the first motion trajectory and the second motion trajectory of the industrial equipment until the first intermediate point, the second intermediate point and the connection point are not collinear.
[0233] The trajectory smoothing device provided by the present application adopts the trajectory smoothing method in the above embodiment to solve the technical problem of low control efficiency of industrial equipment. Compared with the prior art, the beneficial effects of the trajectory smoothing device provided by the embodiment of the present application are the same as the beneficial effects of the trajectory smoothing method provided by the above embodiment, and the other technical features in the trajectory smoothing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0234] Embodiment 5
[0235] An embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the trajectory smoothing method in the above embodiment.
[0236] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0237] like Figure 4As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0238] Typically, the following systems can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0239] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0240] The electronic device provided by the present application adopts the trajectory smoothing method in the above embodiment to solve the technical problem of low control efficiency of industrial equipment. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present application are the same as the beneficial effects of the trajectory smoothing method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0241] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0242] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0243] Embodiment 6
[0244] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the trajectory smoothing method in the above embodiment.
[0245] The computer-readable storage medium provided in the embodiment of the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a system or a device or used in combination with it. The program code contained on the computer-readable storage medium can be transmitted with any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0246] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0247] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: obtains a first motion trajectory and a second motion trajectory of industrial equipment; constructs a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; locates control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain control point coordinates; constructs a curve model according to the control point coordinates; and smoothes the first motion trajectory and the second motion trajectory according to the curve model to obtain a target motion trajectory.
[0248] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0249] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0250] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0251] The computer-readable storage medium provided by the present application stores computer-readable program instructions for executing the above-mentioned trajectory smoothing method, which solves the technical problem of low control efficiency of industrial equipment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present application are the same as the beneficial effects of the trajectory smoothing method provided by the above-mentioned implementation, and will not be repeated here.
[0252] Embodiment 7
[0253] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned trajectory smoothing method when executed by a processor.
[0254] The computer program product provided by the present application solves the technical problem of low control efficiency of industrial equipment. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the trajectory smoothing method provided by the above embodiment, which will not be repeated here.
[0255] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A trajectory smoothing method, characterized in that: The trajectory smoothing method comprises: Acquire a first motion trajectory and a second motion trajectory of the industrial equipment; Constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; Locate control points according to the first motion trajectory, the second motion trajectory and the transition ball to obtain coordinates of the control points; According to the coordinates of the control points, a curve model is constructed, wherein the curve model is a NURBS curve model; According to the curve model, smoothing the first motion trajectory and the second motion trajectory is performed respectively to obtain a target motion trajectory; The step of locating the control point and obtaining the coordinates of the control point according to the first motion trajectory, the second motion trajectory and the transition ball comprises: Locating a first intersection point between the transition ball and the first motion trajectory according to first trajectory feature information corresponding to the first motion trajectory and the transition ball, and obtaining coordinates of the first intersection point; Locating a second intersection point between the transition ball and the second motion trajectory according to the second trajectory feature information corresponding to the second motion trajectory and the transition ball, and obtaining the coordinates of the second intersection point; Locate a control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates; The control point coordinates include the first control point coordinates, the second control point coordinates and the third control point coordinates, and the control points include the first control point, the second control point and the third control point. The step of locating the control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates comprises: Taking the first intersection point as the first control point, and taking the coordinates of the first intersection point as the coordinates of the first control point; Taking the second intersection point as the second control point, and taking the coordinates of the second intersection point as the coordinates of the second control point; Locate the third control point between the first control point and the second control point according to the coordinates of the first control point, the coordinates of the second control point and the transition sphere, and obtain the coordinates of the third control point; The control point coordinates include the fifth control point coordinates and the fourth control point coordinates, and the step of locating the control point according to the first intersection point coordinates and the second intersection point coordinates to obtain the control point coordinates further includes: Locating a first tangent point direction of the first intersection point on the first motion trajectory according to the first trajectory feature information and the first control point coordinates, and locating a second tangent point direction of the second intersection point on the second motion trajectory according to the second trajectory feature information and the second control point coordinates; Locate a fourth control point between the first control point and the third control point according to the first tangent point direction, the first control point coordinates and the third control point coordinates, and obtain the fourth control point coordinates; According to the second tangent point direction, the second control point coordinates and the third control point coordinates, a fifth control point between the third control point and the second control point is located to obtain the fifth control point coordinates; wherein: The calculation formula of the coordinates of the third control point is expressed as: p2 is the coordinate of the third control point, p0 is the coordinate of the first control point, P3 is the coordinate of the center of the transition sphere, and p4 is the coordinate of the second control point; The calculation formula of the coordinates of the fourth control point is expressed as: p1 is the coordinate of the fourth control point, v1 is the direction of the first tangent point; The calculation formula of the coordinates of the fifth control point is expressed as: p3 is the coordinate of the fifth control point, and v2 is the direction of the second tangent point.
2. The trajectory smoothing method according to claim 1, characterized in that: The step of constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory comprises: Determine, according to the first motion trajectory and the second motion trajectory, first trajectory feature information corresponding to the first motion trajectory and second trajectory feature information corresponding to the second motion trajectory; Determining a radius corresponding to the transition sphere according to the first trajectory feature information and the second trajectory feature information; Taking the connection point between the first motion trajectory and the second motion trajectory as the center of the transition ball; The transition sphere is constructed according to the radius and the sphere center.
3. The trajectory smoothing method according to claim 2, characterized in that: The first intersection point between the transition ball and the first motion trajectory does not exceed the first midpoint corresponding to the first motion trajectory, and the second intersection point between the transition ball and the second motion trajectory does not exceed the second midpoint corresponding to the second motion trajectory.
4. The trajectory smoothing method according to claim 1, characterized in that: The step of constructing a curve model according to the control point coordinates comprises: The NURBS curve model is constructed by calculating mapping parameters according to the control point coordinates.
5. The trajectory smoothing method according to claim 1, characterized in that: Before the step of constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory, the step further includes: If the first middle point of the first motion trajectory, the second middle point of the second motion trajectory, and the connection point between the first motion trajectory and the second motion trajectory are not collinear, performing the steps of: constructing a transition ball between the first motion trajectory and the second motion trajectory according to the first motion trajectory and the second motion trajectory; If the first intermediate point, the second intermediate point and the connection point are collinear, return to the execution step: obtain the first motion trajectory and the second motion trajectory of the industrial equipment until the first intermediate point, the second intermediate point and the connection point are not collinear.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the trajectory smoothing method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the trajectory smoothing method, and the program for implementing the trajectory smoothing method is executed by a processor to implement the steps of the trajectory smoothing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Transition trajectory generation method, robot and computer readable storage medium
CN111857037A