CN113848922B - Method, device and storage medium for degenerate splicing of trajectory containing straight path - Google Patents
Method, device and storage medium for degenerate splicing of trajectory containing straight path Download PDFInfo
- Publication number
- CN113848922B CN113848922B CN202111151249.9A CN202111151249A CN113848922B CN 113848922 B CN113848922 B CN 113848922B CN 202111151249 A CN202111151249 A CN 202111151249A CN 113848922 B CN113848922 B CN 113848922B
- Authority
- CN
- China
- Prior art keywords
- path
- order
- sub
- bezier curve
- splicing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0212—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
- G05D1/0221—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory involving a learning process
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0276—Control of position or course in two dimensions specially adapted to land vehicles using signals provided by a source external to the vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Aviation & Aerospace Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Image Generation (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及导航路径拼接优化技术领域,尤其涉及一种对含有直线路径轨迹的简并拼接方法、装置及其存储介质。The present invention relates to the technical field of navigation path splicing optimization, and in particular to a degenerate splicing method, device and storage medium for a trajectory containing a straight path.
背景技术Background technique
由于贝塞尔曲线在路径规划中应用广泛,因此在目前大多数的多段路径拼接算法与策略中只考虑了由不同阶贝塞尔曲线构成的路径拼接问题,但是在实际移动机器人的路径拼接问题中,往往会碰到多条连续直线需要拼接的复杂路径,而直线路径的拼接处只能满足连接点的切向连续,无法保证曲率连续,从而影响机器人的轨迹跟随精度和移动的平稳性。Since Bezier curves are widely used in path planning, most of the current multi-segment path splicing algorithms and strategies only consider the path splicing problem composed of Bezier curves of different orders. However, in the actual path splicing problem of mobile robots, complex paths with multiple continuous straight lines that need to be spliced are often encountered. The splicing of straight line paths can only satisfy the tangential continuity of the connection points, and the curvature continuity cannot be guaranteed, which affects the robot's trajectory following accuracy and the smoothness of movement.
此时若采用3阶贝塞尔曲线进行拼接,当其与两条直线拼接时,中间的两个控制点只能位于两条直线延长线的交点处,缺少曲线的可调整性。而采用5阶贝塞尔曲线对两条直线进行拼接时,虽然能够同时满足与直线相切,并且保持曲线的可调整性。但是由于过于灵活(拥有过多的控制点),很难适用于通过手动拖动控制点,来调整线性,因此只能通过优化方法来自动调整线性,可见若采用手动方式调整,则增加了用户使用时的手调复杂性,而自动调整却降低用户使用的自由度,牺牲了一定的体验感。At this time, if a 3rd-order Bezier curve is used for splicing, when it is spliced with two straight lines, the two control points in the middle can only be located at the intersection of the extension lines of the two straight lines, and the curve lacks adjustability. When a 5th-order Bezier curve is used to splice two straight lines, although it can simultaneously meet the tangency with the straight line and maintain the adjustability of the curve. However, due to its excessive flexibility (having too many control points), it is difficult to adjust the linearity by manually dragging the control points. Therefore, the linearity can only be adjusted automatically through optimization methods. It can be seen that if manual adjustment is used, the complexity of manual adjustment during user use is increased, while automatic adjustment reduces the user's freedom of use and sacrifices a certain sense of experience.
为此,本领域亟待一种技术来解决上述问题,以在保留路径调整自由度的同时,降低用户使用时的复杂度,并且使路径在连接点处切线连续与曲率连续。Therefore, there is an urgent need in the art for a technology to solve the above problems, so as to reduce the complexity of user use while retaining the freedom of path adjustment, and to make the path tangent continuous and curvature continuous at the connection points.
发明内容Summary of the invention
本发明的主要目的在于提供一种对含有直线路径轨迹的简并拼接方法、装置及其存储介质,以解决背景技术中的问题。The main purpose of the present invention is to provide a method, device and storage medium for degenerate splicing of trajectories containing straight path, so as to solve the problems in the background technology.
为了实现上述目的,根据本发明的第一个方面,提供了一种对含有直线路径轨迹的简并拼接方法,其步骤包括:In order to achieve the above object, according to a first aspect of the present invention, a method for degenerate splicing of a trajectory containing a straight path is provided, the steps of which include:
S1遍历多段预设子路径,筛查可优化子路径;S1 traverses multiple preset sub-paths and screens the sub-paths that can be optimized;
S2以可优化子路径为起点,判断前后相邻路径中,直线子路径的存在数量是否等于二,若为是,则根据第一法则,对可优化子路径进行优化;S2 takes the optimizable subpath as the starting point and determines whether the number of straight subpaths in the adjacent paths is equal to two. If yes, the optimizable subpath is optimized according to the first rule;
S3对步骤S2优化后的可优化子路径进行简并平滑处理。S3 performs degenerate smoothing processing on the optimizable subpath optimized in step S2.
其中,所述第一法则包括:可优化子路径采用N阶贝塞尔曲线进行子路径轨迹拼接,其中N≥5。The first rule includes: the sub-path can be optimized to use N-order Bezier curves to splice the sub-path trajectories, where N≥5.
其中,所述简并平滑处理步骤包括:Wherein, the degenerate smoothing processing step includes:
D1计算直线子路径的一阶及二阶导数数据;D1 calculates the first and second order derivative data of the straight line subpath;
D2使优化后的可优化子路径的贝塞尔曲线的一阶及二阶导数与相邻的直线子路径的一阶及二阶导数在连接点处相等;D2 makes the first-order and second-order derivatives of the optimized Bezier curve of the optimized subpath equal to the first-order and second-order derivatives of the adjacent straight line subpath at the connection point;
D3根据第二法则对优化后的可优化子路径的控制点进行重合处理。D3 performs overlap processing on the control points of the optimized sub-path according to the second rule.
其中,所述第二法则包括根据下述中的至少一种方式对控制点进行重合处理:重合所有控制点,生成绝对控制点坐标;或所有控制点分为两组,且组内控制点顺序连续,各组组内控制点重合,以生成第一控制点和第二控制点。Among them, the second rule includes overlapping the control points according to at least one of the following methods: overlapping all control points to generate absolute control point coordinates; or all control points are divided into two groups, and the control points in the groups are in a continuous sequence, and the control points in each group overlap to generate the first control point and the second control point.
在可能的优选实施方式下,所述可优化子路径的贝塞尔曲线的一阶及二阶导数的计算步骤包括:In a possible preferred implementation, the step of calculating the first-order and second-order derivatives of the Bezier curve that can optimize the subpath includes:
解算贝塞尔曲线的控制点求导公式Solving the control point derivative formula of Bezier curve
其中,n为贝塞尔曲线的阶数,Pi是贝塞尔曲线的第i个控制点,且C(0)=P0,C(1)=Pn,其中一阶导数可以表示为:Where n is the order of the Bezier curve, Pi is the ith control point of the Bezier curve, and C(0) = P0 , C(1) = Pn , The first-order derivative can be expressed as:
其中,Di=n(Pi+1-Pi),因此贝塞尔曲线在端点处的一阶导数可以表示为:Where, Di = n(Pi +1 - Pi ), so the first-order derivative of the Bezier curve at the endpoint can be expressed as:
其中,表示其在起点处的一阶导数值,/>表示其在末端出的一阶导数值,而贝塞尔曲线在起点与终点处的二阶导数值/>与/>为:in, represents the first-order derivative value at the starting point,/> It represents the first-order derivative value at the end, and the second-order derivative value of the Bezier curve at the starting point and the end point/> With/> for:
为了实现上述目的,根据本发明的第二个方面,还提供了一种导航路径曲率连续拼接优化处理装置,其包括:导航路径规划模块,路径拼接处理模块,其中移动机器人经扫描模块获取导航数据,以传输至导航路径模块中,经处理后生成多段子路径数据,并向路径拼接处理模块传输,所述路径拼接处理模块依据如上述的对含有直线路径轨迹的简并拼接方法,执行对直线路径轨迹的简并拼接处理。In order to achieve the above-mentioned purpose, according to the second aspect of the present invention, there is also provided a navigation path curvature continuous splicing optimization processing device, which includes: a navigation path planning module, a path splicing processing module, wherein the mobile robot obtains navigation data through the scanning module to transmit it to the navigation path module, generates multiple segments of sub-path data after processing, and transmits them to the path splicing processing module, and the path splicing processing module performs degenerate splicing processing on the straight path trajectory according to the degenerate splicing method for the straight path trajectory containing the straight path as mentioned above.
为了实现上述目的,根据本发明的第二个方面,还提供了一种可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时,实现上述的对含有直线路径轨迹的简并拼接方法的步骤。In order to achieve the above-mentioned purpose, according to the second aspect of the present invention, a readable storage medium is further provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the above-mentioned degenerate splicing method for a trajectory containing a straight path are implemented.
通过本发明提供的该对含有直线路径轨迹的简并拼接方法、装置及其存储介质,其有益效果包括:The degenerate splicing method, device and storage medium of the pair of straight path trajectories provided by the present invention have the following beneficial effects:
1、克服了在使用贝塞尔曲线进行两直线路径平滑拼接时,五阶及以上的贝塞尔曲线自由度过高,而三阶贝塞尔曲线自由度不足的缺点,同时得以在保留路径调整自由度的同时,降低用户使用时的复杂度。1. It overcomes the shortcomings of the fifth-order and above Bezier curves having too high a degree of freedom and the third-order Bezier curves having insufficient degrees of freedom when using Bezier curves to smoothly connect two straight paths. At the same time, it is able to reduce the complexity of user use while retaining the freedom of path adjustment.
2、同时可以有效的使贝塞尔曲线路径与直线路径,在交点处切线方向连续并且曲率连续,从而使机器人运行的更加平稳。2. At the same time, it can effectively make the Bezier curve path and the straight line path have continuous tangent direction and curvature at the intersection, so that the robot runs more smoothly.
3、路径的切线方向连续,意味着机器人的角度变化连续,路径的曲率连续意味着机器人角速度的变化率连续,有利于提高机器人轨迹跟踪控制的精度与效率。3. The continuity of the tangent direction of the path means that the angle of the robot changes continuously, and the continuity of the curvature of the path means that the rate of change of the robot's angular velocity is continuous, which is conducive to improving the accuracy and efficiency of the robot's trajectory tracking control.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
构成本申请的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
图1是本发明第一实施例的方法步骤示意图;FIG1 is a schematic diagram of the method steps of a first embodiment of the present invention;
图2是本发明第一实施例中实验例简并后的路径示意图;FIG2 is a schematic diagram of a path after degeneration of an experimental example in the first embodiment of the present invention;
图3是本发明第一实施例中对简并后的路径进行控制点调整时的示意图;3 is a schematic diagram of adjusting control points on a degenerate path in the first embodiment of the present invention;
具体实施方式Detailed ways
下面对本发明的具体实施方式进行详细地说明。以下示例将有助于本领域的技术人员进一步理解本发明,但不以任何形式限制本发明。应当指出的是,对本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进。这些都属于本发明的保护范围。The specific embodiments of the present invention are described in detail below. The following examples will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
为了使本领域的技术人员更好的理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,在本领域普通技术人员没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明的保护范围。In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“S1”、“S2”、“D1”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。此外除非另有明确的规定和限定,术语“设置”、“布设”、“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以根据具体情况,结合现有技术来理解上述术语在本发明中的具体含义。It should be noted that the terms "first", "second", "S1", "S2", "D1", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. In addition, unless otherwise clearly specified and limited, the terms "set", "layout", "install", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances and in combination with the prior art.
其中本案发明提供的该对含有直线路径轨迹的简并拼接方法,在下述实施例中,主要针对含有直线子路径轨迹(直线也即一阶贝塞尔曲线)的多段复杂路径,进行简并平滑处理。为此本发明提供的拼接优化方案中,假设存在一条由多段不同阶贝塞尔曲线子路径组成的一条待优化路径。The degenerate splicing method for the pair of straight path trajectories provided by the present invention, in the following embodiments, mainly performs degenerate smoothing on multiple complex paths containing straight sub-path trajectories (straight lines, i.e., first-order Bezier curves). For this reason, in the splicing optimization scheme provided by the present invention, it is assumed that there is a path to be optimized composed of multiple Bezier curve sub-paths of different orders.
(一)(one)
具体来说,如图1所示,本实施例中该对含有直线路径轨迹的简并拼接方法,其步骤包括:Specifically, as shown in FIG1 , the degenerate splicing method for the pair of trajectories containing straight path in this embodiment comprises the following steps:
S1遍历多段预设子路径,对路径中的每一条子路径进行遍历,并判断该子路径的类型,以筛查出可优化子路径;如果遍历到的路径是直线子路径或被锁定不许优化的子路径时,则认为是不可优化的路径,因此跳过这条子路径继续遍历到下一条,从而筛查出可优化子路径;S1 traverses multiple preset sub-paths, traverses each sub-path in the path, and determines the type of the sub-path to screen out the sub-path that can be optimized; if the traversed path is a straight sub-path or a sub-path that is locked and cannot be optimized, it is considered to be a non-optimizable path, so this sub-path is skipped and the traversal continues to the next one, thereby screening out the sub-path that can be optimized;
S2当遍历到的路径是可优化子路径时,则以可优化子路径为起点,判断前后相邻路径中,直线子路径的存在数量是否等于二,若为是,则意味着当前子路径首尾两端拼接着两条直线子路径,因此其为优化目标,因此则根据第一法则,对可优化子路径进行优化;其中该第一法则包括:可优化子路径采用N阶贝塞尔曲线进行子路径轨迹拼接,其中N≥5。S2 When the traversed path is an optimizable sub-path, the optimizable sub-path is taken as the starting point to determine whether the number of straight sub-paths in the front and rear adjacent paths is equal to two. If so, it means that the current sub-path is spliced with two straight sub-paths at both ends, so it is the optimization target. Therefore, according to the first rule, the optimizable sub-path is optimized; the first rule includes: the optimizable sub-path uses N-order Bezier curves to splice sub-path trajectories, where N≥5.
S3对步骤S2优化后的可优化子路径进行简并平滑处理。其中所述简并平滑处理步骤包括:D1计算直线子路径的一阶及二阶导数数据;D2使优化后的可优化子路径的贝塞尔曲线的一阶及二阶导数与相邻的直线子路径的一阶及二阶导数在连接点处相等;D3根据第二法则对优化后的可优化子路径的控制点进行重合处理。S3 performs degenerate smoothing on the optimizable subpath optimized in step S2. The degenerate smoothing step includes: D1 calculating the first-order and second-order derivative data of the straight line subpath; D2 making the first-order and second-order derivatives of the Bezier curve of the optimized optimizable subpath equal to the first-order and second-order derivatives of the adjacent straight line subpath at the connection point; D3 performing coincidence processing on the control points of the optimized optimizable subpath according to the second rule.
其中所述第二法则包括根据下述中的至少一种方式对控制点进行重合处理:The second rule includes performing coincidence processing on the control points according to at least one of the following methods:
1.重合所有控制点,生成绝对控制点坐标;1. Overlap all control points and generate absolute control point coordinates;
2.或所有控制点分为两组,且组内控制点顺序连续,各组组内控制点重合,以生成第一控制点和第二控制点。2. Or all control points are divided into two groups, and the control points in each group are continuous, and the control points in each group overlap to generate the first control point and the second control point.
其中所述可优化子路径的贝塞尔曲线的一阶及二阶导数的计算步骤包括:The calculation steps of the first-order and second-order derivatives of the Bezier curve that can optimize the subpath include:
解算贝塞尔曲线的控制点求导公式Solving the control point derivative formula of Bezier curve
其中,n为贝塞尔曲线的阶数,Pi是贝塞尔曲线的第i个控制点,且C(0)=P0,C(1)=Pn, 其中一阶导数可以表示为:Where n is the order of the Bezier curve, Pi is the ith control point of the Bezier curve, and C(0) = P0 , C(1) = Pn , The first-order derivative can be expressed as:
其中,Di=n(Pi+1-Pi),因此贝塞尔曲线在端点处的一阶导数可以表示为:Where, Di = n(Pi +1 - Pi ), so the first-order derivative of the Bezier curve at the endpoint can be expressed as:
其中,表示其在起点处的一阶导数值,/>表示其在末端出的一阶导数值,而贝塞尔曲线在起点与终点处的二阶导数值/>与/>为:in, represents the first-order derivative value at the starting point,/> It represents the first-order derivative value at the end, and the second-order derivative value of the Bezier curve at the starting point and the end point/> With/> for:
通过上述公式,可方便的计算出贝塞尔路径在拼接点处的一阶与二阶导数的数值,从而可使优化后的可优化子路径的贝塞尔曲线的一阶及二阶导数与相邻的直线子路径的一阶及二阶导数在连接点处相等,即可使得拼接路径之间在连接点处的切线方向连续与曲率连续。Through the above formula, the values of the first-order and second-order derivatives of the Bezier path at the splicing point can be easily calculated, so that the first-order and second-order derivatives of the optimized Bezier curve of the optimized sub-path can be equal to the first-order and second-order derivatives of the adjacent straight line sub-path at the connection point, which can make the tangent direction and curvature between the spliced paths at the connection point continuous.
当贝塞尔曲线在x-y平面上时,其任意时刻的曲率可以表示为:When the Bezier curve is on the x-y plane, its curvature at any time can be expressed as:
具体来说,由于直线可被视为特殊的一阶贝塞尔曲线C1,其控制点为直线两端点。Specifically, since the straight line can be regarded as a special first-order Bezier curve C 1 , its control points are the two end points of the straight line.
因此可以得到其端点的一阶导数为其中/>与/>为直线两端点,其二阶导数为0,曲率为0。其中,/>为i阶贝塞尔曲线的第j个控制点。Therefore, the first-order derivative of its endpoint can be obtained as Where/> With/> are the two end points of the straight line, its second-order derivative is 0 and the curvature is 0. Among them,/> is the j-th control point of the i-th order Bezier curve.
对于由四个控制点生成的三阶贝塞尔曲线C3,其起始点处一阶导数为/>其二阶导数为/> 其末端点处一阶导数为/>其二阶导数为/> For by The third-order Bezier curve C 3 generated by four control points has a first-order derivative at the starting point of/> Its second-order derivative is/> The first-order derivative at the end point is/> Its second-order derivative is/>
对于由六个控制点生成的五阶贝塞尔曲线C5,其起始点处一阶导数为/>其二阶导数为/> 其末端点处一阶导数为/>其二阶导数为 For by The fifth-order Bezier curve C5 generated by six control points has a first-order derivative at the starting point of/> Its second-order derivative is/> The first-order derivative at the end point is/> Its second-order derivative is
当需要完成从直线子路径到三阶贝塞尔路径的光滑时。为使直线子路径与贝塞尔路径拼接光滑,首先应满足为了保证直线与三阶贝塞尔曲线的切线方向连续,需要满足/>其中a为任意不为0实数,即需要使/>在直线的切线方向上。When it is necessary to complete the smoothing from the straight sub-path to the third-order Bezier path. In order to make the straight sub-path and the Bezier path smooth, the first thing to do is to satisfy In order to ensure the continuity of the tangent direction of the straight line and the third-order Bezier curve, it is necessary to satisfy/> Where a is any real number that is not 0, that is, it is necessary to use/> In the direction of the tangent to the line.
因为直线曲率为0,为使两路径在接点处去曲率相等,由贝塞尔曲线任意时刻下的曲率公式κ(t)可知,需要使与/>共线,即需要使/>在直线的切线方向上。类似的,当需要完成从贝塞尔曲线子路径到直线子路径的光滑,则也需要使/>与后面的直线子路径共线。Since the curvature of a straight line is 0, in order to make the curvature of the two paths equal at the junction, it can be seen from the curvature formula κ(t) of the Bezier curve at any time that we need to make With/> Collinear, that is, you need to make/> In the tangent direction of the line. Similarly, when you need to smooth the transition from a Bezier curve subpath to a straight line subpath, you also need to use /> Collinear with the following straight subpath.
因此,在使用三阶贝塞尔曲线与前后两直线进行光滑连接时,需要将控制点选取在两直线的切点的交点上。这时因为没有多余的可移动控制点,所以导致生成的贝塞尔曲线是不可调整的。Therefore, when using a third-order Bezier curve to smoothly connect the two straight lines, the control point Select the intersection of the two straight lines. At this time, because there are no extra movable control points, the generated Bezier curve cannot be adjusted.
与上述分析类似,当需要完成从直线子路径到五阶贝塞尔路径的光滑时,需要使且/>与前直线子路径共线。当需要完成从五阶贝塞尔路径到直线子路径的光滑时,需要使/>与后直线子路径共线切接点处连续。Similar to the above analysis, when it is necessary to complete the smoothing from the straight line subpath to the fifth-order Bezier path, it is necessary to use And/> Collinear with the previous straight subpath. When you need to smooth from a fifth-order Bezier path to a straight subpath, you need to use/> Continuous at the collinear tangent point with the subsequent straight line subpath.
因此,在使用五阶贝塞尔曲线与前后两直线子路径进行光滑连接时,四个控制点均可移动,只要在对应的直线的切线方向上即可。这时,用户需要合理安排四个控制点,但此举将增加用户使用的复杂度。Therefore, when using the fifth-order Bezier curve to smoothly connect the two straight line sub-paths before and after, All four control points can be moved as long as they are in the tangent direction of the corresponding straight line. At this time, the user needs to arrange the four control points reasonably, but this will increase the complexity of user use.
为此本发明所称简并是指,使用N阶贝塞尔曲线(N≥5)进行与前后两直线子路径进行光滑连接时,如使用五阶贝塞尔曲线时,使与/>重合,/>与/>重合,即通过使控制点重合的方法,将原本需要用户指定的4个控制点降低为只需要用户指定2个控制点,即/>与/>甚至1个控制点,即/>与三阶贝塞尔曲线类似的是,简并五阶贝塞尔曲线也需指定两个控制点,不同的是,后者的两个控制点是可以移动的。For this purpose, the so-called degeneration in the present invention refers to the use of an N-order Bezier curve (N≥5) to smoothly connect the two straight line sub-paths before and after, such as using a fifth-order Bezier curve. With/> Overlap, /> With/> Overlap, that is By making the control points overlap, the original 4 control points that the user needs to specify are reduced to only 2 control points that the user needs to specify, that is, /> With/> Even 1 control point, that is /> Similar to the third-order Bezier curve, the degenerate fifth-order Bezier curve also requires the specification of two control points. The difference is that the two control points of the latter can be moved.
此外本发明在对两直线进行拼接时,上述实施例虽然举例了使用五阶贝塞尔曲线进行简并时,将所有控制点根据顺序分为两组,形成与/>重合为第一控制点,/>与/>重合为第二控制点的实施例。而实际上,可以类似的推出简并七阶的方法,即:使七阶贝塞尔路径的/>重合,/>重合。亦可类似的推出简并九阶贝塞尔曲线,即:使九阶贝塞尔路径的/>重合,/>重合。其余更高阶的简并贝塞尔曲线类似。In addition, when the present invention splices two straight lines, although the above embodiment uses a fifth-order Bezier curve for degeneration, all control points are divided into two groups according to the order to form With/> coincide with the first control point,/> With/> In fact, a method for degenerating the seventh order can be similarly derived, that is, making the seventh-order Bezier path Overlap, /> Overlap. A degenerate ninth-order Bezier curve can also be derived similarly, that is, making the ninth-order Bezier path /> Overlap, /> The other higher-order degenerate Bezier curves are similar.
而类似于偶数阶贝塞尔曲线,如六阶贝塞尔曲线控制点有5个控制点,因为不能平均分配为两组,则该简并六阶贝塞尔曲线控制点的方法,也可将所有控制点根据顺序任意分为两组,如重合,/>重合;/>重合;/>重合,重合等,进行各类排列组合方式,进行简并出第一及第二控制点。Similar to the even-order Bezier curve, for example, the sixth-order Bezier curve has 5 control points, because they cannot be evenly distributed into two groups, the method of degenerating the sixth-order Bezier curve control points can also arbitrarily divide all control points into two groups according to the order, such as Overlap, /> overlap; /> overlap; /> coincide, Overlap, etc., perform various permutations and combinations to simplify the first and second control points.
此外前述N阶贝塞尔曲线的简并,也可以把所有控制点合重合为一个绝对控制点,也可以实现简并效果。In addition, the degeneration of the aforementioned N-order Bezier curve can also combine all control points into one absolute control point, which can also achieve a degenerate effect.
实验例Experimental example
例:若前后两段子路径轨迹均为直线,使用简并五阶贝塞尔曲线进行拼接。Example: If the trajectories of the two sub-paths are both straight lines, use a degenerate fifth-order Bezier curve to connect them.
具体来说:前段路径为直线y=x,x∈[-10,0],后端路径为直线y=10,x∈[60,90].根据控制点选取规则,选取为直线末端点,生成的轨迹与控制点的如附件中的图2所示。当机器人路径上存在障碍物或者其他原因,需要重新设计一条新的路径时,可以随意改动中间的两个控制点,比如/>新生成的路径如图3所示,这样的路径在与直线拼接处依旧能够保证光滑。Specifically, the front path is a straight line y=x, x∈[-10, 0], and the back path is a straight line y=10, x∈[60, 90]. According to the control point selection rule, select is the end point of the straight line, The generated trajectory and control points are shown in Figure 2 in the attachment. When there are obstacles on the robot path or other reasons, and a new path needs to be redesigned, the two control points in the middle can be changed at will, such as/> The newly generated path is shown in Figure 3. Such a path can still be guaranteed to be smooth at the junction with the straight line.
此外上述实施例及实验例中,只是针对直线路径轨迹的简并拼接方法,后续针对不同阶贝塞尔曲线之间的平滑算法可以参照下述方案,或已有文献进行处理。In addition, in the above embodiments and experimental examples, only the degenerate splicing method for straight path trajectories is used. The subsequent smoothing algorithm between Bezier curves of different orders can refer to the following scheme or existing literature for processing.
如针对含有圆弧导航路径段的曲率连续拼接优化方法,步骤包括:For example, the curvature continuous splicing optimization method for arc navigation path segments includes the following steps:
步骤S1遍历多段预设子路径,对路径中的每一条子路径进行遍历,并判断该子路径的类型,以筛查出可优化子路径;如果遍历到的路径是圆弧轨迹子路径时,由于圆弧轨迹没有控制点,是不可优化的路径,因此跳过这条子路径继续遍历到下一条。Step S1 traverses multiple preset sub-paths, traverses each sub-path in the path, and determines the type of the sub-path to screen out optimizable sub-paths; if the traversed path is an arc trajectory sub-path, since the arc trajectory has no control points and is a non-optimizable path, this sub-path is skipped and traversal continues to the next one.
步骤S2当遍历到的路径不是圆弧时,由于在假设中,该导航路径包含:三阶与五阶贝塞尔曲线子路径,与圆弧轨迹子路径,因此需要先判断是否为三阶或者五阶贝塞尔曲线中的一种,即可优化子路径,此时便可以可优化子路径为起点,判断相邻路径中圆弧轨迹子路径的存在数量,并根据第一法则,对可优化子路径进行优化。In step S2, when the traversed path is not an arc, since in the assumption, the navigation path includes: third-order and fifth-order Bezier curve sub-paths, and arc trajectory sub-paths, it is necessary to first determine whether it is one of the third-order or fifth-order Bezier curves, that is, the optimizable sub-path. At this time, the optimizable sub-path can be used as the starting point to determine the number of arc trajectory sub-paths in the adjacent path, and optimize the optimizable sub-path according to the first rule.
其中本实施例下,该第一法则包括:In this embodiment, the first rule includes:
步骤C1当相邻路径中圆弧轨迹子路径的数量为一时,判断当前可优化子路径类型:当其类型为三阶贝塞尔曲线时,以第一方案进行优化包括:使用三阶贝塞尔曲线进行子路径轨迹拼接;当其类型为五阶贝塞尔曲线时,以第二方案进行优化包括:使用五阶贝塞尔曲线进行子路径轨迹拼接;Step C1: when the number of arc trajectory sub-paths in the adjacent path is one, determine the type of the currently optimizable sub-path: when its type is a third-order Bezier curve, optimize with the first scheme including: use the third-order Bezier curve to splice the sub-path trajectory; when its type is a fifth-order Bezier curve, optimize with the second scheme including: use the fifth-order Bezier curve to splice the sub-path trajectory;
步骤C2当相邻路径中圆弧轨迹子路径的数量为二时,判断当前可优化子路径类型:当其类型为五阶贝塞尔曲线时,以第三方案进行优化包括:使用五阶贝塞尔曲线进行子路径轨迹拼接;当其类型为三阶贝塞尔曲线时,则跳过该子路径,继续遍历下一条;Step C2: when the number of arc trajectory sub-paths in the adjacent path is two, determine the type of the current optimizable sub-path: when its type is a fifth-order Bezier curve, optimize with the third scheme including: use the fifth-order Bezier curve to splice the sub-path trajectories; when its type is a third-order Bezier curve, skip the sub-path and continue to traverse the next one;
步骤C3当相邻路径中圆弧轨迹子路径的数量为零时,此时应考虑的则是多段贝塞尔曲线的连接问题,这时可以参考申请人另案申请的方案,或以其它文献中提及的平滑方法进行处理,本实施例并不进行限制。In step C3, when the number of arc trajectory sub-paths in adjacent paths is zero, the connection problem of multiple Bezier curves should be considered. At this time, reference can be made to the solution of another application by the applicant, or the smoothing method mentioned in other documents can be used for processing, which is not limited in this embodiment.
步骤S3对步骤S2优化后的可优化子路径进行平滑处理。其中本实施例下的该子路径平滑处理定义为,子路径在连接点处切线方向连续并且曲率连续的路径。Step S3 performs smoothing on the optimizable subpath optimized in step S2. The subpath smoothing in this embodiment is defined as a path where the tangent direction of the subpath at the connection point is continuous and the curvature is continuous.
为此在导航轨迹平滑连接时,需要根据相邻路径中的一条圆弧路径的导数信息,或者相邻路径中的两条圆弧路径的导数信息对轨迹进行平滑拼接处理。本实施例中优选由贝塞尔曲线的求导公式,解得三阶或者五阶贝塞尔曲线在连接点处的导数信息,通过合理安排贝塞尔曲线的控制点坐标,使得贝塞尔曲线的一阶二阶导数与相邻的圆弧路径的一阶二阶导数,可以在连接点处相等。从而达到路径平滑的目的。For this reason, when the navigation track is smoothly connected, it is necessary to smoothly splice the track according to the derivative information of one arc path in the adjacent path, or the derivative information of two arc paths in the adjacent path. In this embodiment, the derivative information of the third-order or fifth-order Bezier curve at the connection point is preferably solved by the derivative formula of the Bezier curve, and the first-order and second-order derivatives of the Bezier curve and the first-order and second-order derivatives of the adjacent arc path can be equal at the connection point by reasonably arranging the coordinates of the control points of the Bezier curve. Thereby achieving the purpose of path smoothing.
具体来说,在优选实施方式中,所述平滑处理步骤包括:Specifically, in a preferred embodiment, the smoothing step includes:
步骤D1计算圆弧轨迹子路径的一阶及二阶导数数据;Step D1 calculates the first-order and second-order derivative data of the arc trajectory subpath;
步骤D2设置优化后的可优化子路径的控制点坐标;使其贝塞尔曲线的一阶及二阶导数与相邻的圆弧轨迹子路径的一阶及二阶导数在连接点处相等。Step D2 sets the coordinates of the control points of the optimized sub-path; making the first-order and second-order derivatives of its Bezier curve equal to the first-order and second-order derivatives of the adjacent arc trajectory sub-path at the connection point.
其中,圆弧轨迹子路径的导数计算步骤包括:The derivative calculation steps of the arc trajectory sub-path include:
以圆弧轨迹参数方程表达式计算出圆弧路径末端点处的一阶导数/>二阶导数/>与后段路径C3前端点处的一阶导数/>二阶导数/> The arc trajectory parameter equation expression Calculate the first-order derivative at the end point of the arc path/> Second Derivative/> The first-order derivative at the front end of the rear path C 3 /> Second Derivative/>
在可能的优选实施方式中,优化后的可优化子路径的导数计算步骤包括:In a possible preferred embodiment, the derivative calculation step of the optimized optimizable subpath includes:
解算贝塞尔曲线的求导公式:The derivative formula for solving the Bezier curve is:
其中,n为贝塞尔曲线的阶数,Pi是贝塞尔曲线的第i个控制点,且P(0)=P0,P(1)=Pn,其中一阶导数可以表示为:Where n is the order of the Bezier curve, Pi is the ith control point of the Bezier curve, and P(0) = P0 , P(1) = Pn , The first-order derivative can be expressed as:
其中Di=n(Pi+1-Pi),因此贝塞尔曲线在端点处的一阶导数可以表示为:Where D i =n(P i+1 -P i ), so the first-order derivative of the Bezier curve at the endpoint can be expressed as:
其中表示其在起点处的一阶导数值,/>表示其在末端处的一阶导数值,同理可得贝塞尔曲线在起点与末端处的二阶导数值/>与/> in represents the first-order derivative value at the starting point,/> Indicates the first-order derivative value at the end. Similarly, the second-order derivative value of the Bezier curve at the starting point and the end can be obtained. With/>
通过上述公式结算,便可计算出在给定控制点后,该段贝塞尔曲线路径在前后端点(即拼接点)处的一阶与二阶导数的数值。路径拼接的要求需要使得路径在连接点处切线方向连续与曲率连续,贝塞尔曲线可以由参数方程决定。由曲率的计算公式:By using the above formula, we can calculate the first and second order derivatives of the Bezier curve path at the front and back endpoints (i.e. the splicing points) after a given control point. The requirement for path splicing is to make the path tangent direction and curvature continuous at the connection point. The Bezier curve can be expressed by the parametric equation Determined by the curvature calculation formula:
单位切线向量的计算公式:The calculation formula for the unit tangent vector is:
由此可以看出,只需要使得两路径在连接点处一阶导数以及二阶导数连续即可以保证路径在拼接点处切线方向连续与曲率连续。From this, it can be seen that the continuity of the tangent direction and the curvature of the paths at the splicing points can be guaranteed only by making the first-order derivatives and second-order derivatives of the two paths continuous at the connection points.
另一方面,为了针对后续不同阶贝塞尔曲线之间实现平滑算法,本案在下述还给出了一种实施方案,其主要针对具有不同贝塞尔曲线阶数(主要为一阶、三阶与五阶)的多段复杂路径,进行光滑连接处理。为此本发明提供的拼接优化方案中,假设存在一条由若干段具有不同贝塞尔阶数的子路径连接起来的一条待优化路径。On the other hand, in order to implement a smoothing algorithm between subsequent Bezier curves of different orders, this case also provides an implementation scheme in the following, which mainly performs smooth connection processing on multiple complex paths with different Bezier curve orders (mainly first order, third order and fifth order). For this reason, in the splicing optimization scheme provided by the present invention, it is assumed that there is a path to be optimized that is connected by several sub-paths with different Bezier orders.
针对此路径,策略上设计了对路径的三次遍历,来解决多段子路径优化时的优化顺序问题。在实施拼接策略时,需要根据前段的子路径或者前后两段的子路径,分别对轨迹进行优化及平滑处理,从而达到平滑拼接的效果。For this path, the strategy is designed to traverse the path three times to solve the optimization order problem when optimizing multiple sub-paths. When implementing the splicing strategy, it is necessary to optimize and smooth the trajectory according to the sub-path of the previous segment or the sub-paths of the previous and next segments, so as to achieve the effect of smooth splicing.
为此本实施例构思上,主要通过使用五阶贝塞尔曲线对一,三,五阶贝塞尔曲线进行路径拼接,或者使用三阶贝塞尔曲线对一、三阶贝塞尔曲线进行拼接。Therefore, in the conception of this embodiment, the fifth-order Bezier curve is mainly used to perform path splicing on the first-order, third-order and fifth-order Bezier curves, or the third-order Bezier curve is used to splice the first-order and third-order Bezier curves.
同时在进行路径拼接时,根据其前、后段贝塞尔曲线子路径的控制点坐标,由贝塞尔曲线的求导公式,可以得到其在连接点处的一阶导数和二阶导数信息,由此便可合理安排该被优化的贝塞尔曲线的控制点坐标,使其贝塞尔曲线的一阶二阶导数与前、后段曲线的一阶二阶导数在连接点处相等,从而便可实现移动机器人在路径连接点处切线连续并且曲率连续。At the same time, when performing path splicing, according to the control point coordinates of the front and rear Bezier curve sub-paths, the first-order derivative and second-order derivative information at the connection point can be obtained from the derivation formula of the Bezier curve. Therefore, the control point coordinates of the optimized Bezier curve can be reasonably arranged so that the first-order and second-order derivatives of the Bezier curve are equal to the first-order and second-order derivatives of the front and rear curves at the connection point, thereby realizing tangent continuity and curvature continuity of the mobile robot at the path connection point.
具体来说,其步骤包括:Specifically, the steps include:
S1遍历多段预设子路径,筛查不可优化子路径;其中该不可优化子路径包括以下中的至少一种子路径:一阶贝塞尔曲线子路径、预设被锁定的子路径。S1 traverses multiple preset sub-paths to screen non-optimizable sub-paths; wherein the non-optimizable sub-paths include at least one of the following sub-paths: a first-order Bezier curve sub-path, and a preset locked sub-path.
S2以不可优化子路径为起始子路径,依次向其两端遍历,以筛查各可优化子路径中是否存在一阶贝塞尔曲线子路径、三阶贝塞尔曲线子路径,如存在则根据第一法则对可优化子路径进行优化后,再进行平滑处理,如不存在则执行步骤S3。S2 takes the non-optimizable subpath as the starting subpath, and traverses to both ends of it in turn to screen whether there is a first-order Bezier curve subpath or a third-order Bezier curve subpath in each optimizable subpath. If so, the optimizable subpath is optimized according to the first rule and then smoothed. If not, execute step S3.
其中所述第一法则包括:当筛查出存在三阶贝塞尔曲线子路径时,统计其相邻两端路径中一阶贝塞尔曲线子路径的数量,根据第三法则以进行分类优化。The first rule includes: when a third-order Bezier curve sub-path is screened out, the number of first-order Bezier curve sub-paths in the adjacent two end paths is counted, and classification optimization is performed according to the third rule.
其中所述第三法则包括:当其相邻两端路径中一阶贝塞尔曲线子路径数量n1=1时,设置其控制点选取在与其相邻的一阶贝塞尔曲线子路径的切线方向上;The third rule includes: when the number of first-order Bezier curve sub-paths in the adjacent two end paths n1=1, setting the control point to be selected in the tangent direction of the first-order Bezier curve sub-path adjacent to it;
当n1=2时,设置与其相邻的一阶贝塞尔曲线子路径的控制点,选取在与其相邻的两条一阶贝塞尔曲线子路径的延长线交点处;When n1=2, the control point of the adjacent first-order Bezier curve subpath is set to the intersection of the extension lines of the two adjacent first-order Bezier curve subpaths;
当n1=0时,统计其相邻两端子路径中三阶贝塞尔曲线的数量n2;When n1=0, count the number of third-order Bezier curves n2 in its adjacent two terminal paths;
当n2=1时,判断前段子路径是否为五阶贝塞尔曲线且被锁定,若为否,则以三阶贝塞尔曲线作为参考路径进行平滑处理;若为是,则以前端被锁定的五阶贝塞尔曲线作为参考路径进行平滑处理;When n2=1, determine whether the previous sub-path is a fifth-order Bezier curve and is locked. If not, use the third-order Bezier curve as the reference path for smoothing; if yes, use the fifth-order Bezier curve locked at the front end as the reference path for smoothing;
当n2=2时,以前段三阶贝塞尔曲线作为参考路径进行平滑处理;When n2=2, the first third-order Bezier curve is used as the reference path for smoothing;
当n2=0时,判断前段路径是否为五阶贝塞尔曲线子路径且被锁定,若为是,则以前端被锁定的五阶贝塞尔曲线作为参考路径进行平滑处理。When n2=0, it is determined whether the front path is a fifth-order Bezier curve subpath and is locked. If yes, the fifth-order Bezier curve locked at the front end is used as a reference path for smoothing.
S3筛查各可优化子路径中是否存在五阶贝塞尔曲线子路径,如存在,则根据第二法则对剩余可优化子路径进行优化后,再进行平滑处理;其中所述第二法则包括:判断五阶贝塞尔曲线子路径的前后两段子路径是否为五阶贝塞尔曲线,若为是,则根据其前后两段路径类型,依据第一策略进行优化。S3 screens whether there is a fifth-order Bezier curve subpath in each optimizable subpath. If so, the remaining optimizable subpaths are optimized according to the second rule and then smoothed. The second rule includes: determining whether the front and rear subpaths of the fifth-order Bezier curve subpath are fifth-order Bezier curves. If so, optimizing according to the first strategy based on the types of the front and rear subpaths.
其中考虑到使用贝塞尔曲线与两条相邻贝塞尔曲线平滑连接的问题,假设已知前后两段子路径控制点的信息,通过已知信息设计出中间拼接子路径,使之连接前后两段子路径,并在接点处达到切线方向连续与曲率连续的效果。The problem of using a Bezier curve to smoothly connect two adjacent Bezier curves is taken into consideration. Assuming that the information of the control points of the front and rear sub-paths is known, an intermediate splicing sub-path is designed based on the known information to connect the front and rear sub-paths and achieve the effects of tangent direction continuity and curvature continuity at the connection point.
为此本实施例所设计的平滑子路径优选为三阶或者五阶贝塞尔曲线,为满足切线方向与曲率连续的条件,根据前后段子路径的信息,本实施例中给出了贝塞尔曲线控制点的选取方法。其中本发明中的光滑路径定义为,切线方向连续并且曲率连续的路径。For this reason, the smooth subpath designed in this embodiment is preferably a third-order or fifth-order Bezier curve. In order to meet the conditions of tangent direction and curvature continuity, a method for selecting Bezier curve control points is provided in this embodiment based on the information of the previous and next subpaths. The smooth path in the present invention is defined as a path with continuous tangent direction and continuous curvature.
具体来说:其中该第一策略包括:Specifically, the first strategy includes:
C1若前后两段子路径均为一阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化;C1 If the two sub-paths before and after are both first-order Bezier curves, the splicing sub-path is optimized using a fifth-order Bezier curve;
C2若前后两段子路径均为一阶贝塞尔曲线时,拼接子路径采用三阶贝塞尔曲线优化;C2: If both the previous and next sub-paths are first-order Bezier curves, the splicing sub-path is optimized using a third-order Bezier curve;
C3若前段子路径为一阶贝塞尔曲线,后段子路径为五阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化;C3: If the first sub-path is a first-order Bezier curve and the second sub-path is a fifth-order Bezier curve, the splicing sub-path is optimized using the fifth-order Bezier curve;
C4若前段子路径为一阶贝塞尔曲线,后段子路径为五阶贝塞尔曲线时,拼接子路径采用三阶贝塞尔曲线优化;C4: If the previous sub-path is a first-order Bezier curve and the subsequent sub-path is a fifth-order Bezier curve, the splicing sub-path is optimized using a third-order Bezier curve;
C5若前段子路径为五阶贝塞尔曲线,后段子路径也为五阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化;C5: If the first sub-path is a fifth-order Bezier curve and the second sub-path is also a fifth-order Bezier curve, the splicing sub-path is optimized using the fifth-order Bezier curve;
C6若前段子路径为五阶贝塞尔曲线,后段子路径为三阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化;C6 If the first sub-path is a fifth-order Bezier curve and the second sub-path is a third-order Bezier curve, the splicing sub-path is optimized using the fifth-order Bezier curve;
C7若前段子路径为三阶贝塞尔曲线,后段子路径为五阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化;C7: If the first sub-path is a third-order Bezier curve and the second sub-path is a fifth-order Bezier curve, the splicing sub-path is optimized using the fifth-order Bezier curve;
C8若前段子路径为三阶贝塞尔曲线,后段子路径也为三阶贝塞尔曲线时,拼接子路径采用五阶贝塞尔曲线优化。C8 If the previous sub-path is a third-order Bezier curve and the subsequent sub-path is also a third-order Bezier curve, the splicing sub-path is optimized using a fifth-order Bezier curve.
其中该平滑处理步骤包括:The smoothing step includes:
D1根据前段子路径的贝塞尔曲线的控制点坐标,由贝塞尔曲线的求导公式,解得前段子路径在连接点处的一阶导数和二阶导数;D1 solves the first-order derivative and second-order derivative of the previous subpath at the connection point according to the coordinates of the control points of the Bezier curve of the previous subpath and the derivative formula of the Bezier curve;
D2根据后段子路径的贝塞尔曲线的控制点坐标,由贝塞尔曲线的求导公式,解得后段子路径在连接点处的一阶导数和二阶导数;D2 solves the first-order derivative and second-order derivative of the latter subpath at the connection point according to the coordinates of the control points of the Bezier curve of the latter subpath and the derivative formula of the Bezier curve;
D3设置可优化子路径的控制点坐标,使其前后连接点处的贝塞尔曲线的一阶导数与二阶导数,分别与前/后段子路径连接点处的一阶导数与二阶导数相等。The D3 setting can optimize the coordinates of the control points of the subpath so that the first-order derivative and second-order derivative of the Bezier curve at the front and back connection points are equal to the first-order derivative and second-order derivative at the connection points of the front/back subpath, respectively.
其中该设计原理为:考虑前后段子路径,根据前段子路径末端点处的一阶与二阶导数,与后段子路径前端点处的一阶与二阶导数,来选取评价子路径的三阶或者五阶贝塞尔曲线的控制点,使得其与前后段子路径连接处切线方向连续,曲率连续。The design principle is as follows: considering the front and rear sub-paths, the control points of the third-order or fifth-order Bezier curve of the evaluation sub-path are selected according to the first-order and second-order derivatives at the end point of the front sub-path and the first-order and second-order derivatives at the front end point of the rear sub-path, so that the tangent direction and curvature of the curve at the connection between the front and rear sub-paths are continuous.
其中对于贝塞尔曲线的求导公式表达为:The derivative formula for the Bezier curve is expressed as:
其中,n为贝塞尔曲线的阶数,Pi是贝塞尔曲线的第i个控制点,且P(0)=P0,P(1)=Pn,其中一阶导数可以表示为:Where n is the order of the Bezier curve, Pi is the ith control point of the Bezier curve, and P(0) = P0 , P(1) = Pn , The first-order derivative can be expressed as:
其中Di=n(Pi+1-Pi),因此贝塞尔曲线在端点处的一阶导数可以表示为:Where D i =n(P i+1 -P i ), so the first-order derivative of the Bezier curve at the endpoint can be expressed as:
其中表示其在起点处的一阶导数值,/>表示其在末端处的一阶导数值,同理可得贝塞尔曲线在起点与末端处的二阶导数值/>与/> in represents the first-order derivative value at the starting point,/> Indicates the first-order derivative value at the end. Similarly, the second-order derivative value of the Bezier curve at the starting point and the end can be obtained./> With/>
通过上述公式,可方便的计算出前后段贝塞尔曲线子路径在拼接点处的一阶与二阶导数的数值,同样的中间的贝塞尔曲线拼接子路径在端点出的数值,也可以通过待确定的控制点表示出来。Through the above formula, the values of the first-order and second-order derivatives of the front and rear Bezier curve sub-paths at the splicing point can be easily calculated. Similarly, the values of the middle Bezier curve splicing sub-path at the endpoints can also be expressed by the control points to be determined.
路径拼接的要求,需要使得路径在连接点处切线方向连续与曲率连续,贝塞尔曲线可以由参数方程决定。由曲率的计算公式:The requirement for path splicing is that the path should be continuous in tangent direction and curvature at the connection point. The Bezier curve can be expressed by the parametric equation Determined by the curvature calculation formula:
单位切线向量的计算公式:The calculation formula for the unit tangent vector is:
由此可以看出,只需要使得两路径在连接点处一阶导数以及二阶导数连续即可以保证路径在拼接点处切线方向连续与曲率连续。From this, it can be seen that the continuity of the tangent direction and the curvature of the paths at the splicing points can be guaranteed only by making the first-order derivatives and second-order derivatives of the two paths continuous at the connection points.
其中步骤S3中进行的第三次循环时,会涉及到对于不同类型曲线路径的平滑连接问题。而步骤S2中的第二次循环对于单端路径的拼接问题可以较为简单的从对于双段路径的轨迹拼接问题中简化出来。The third cycle in step S3 involves the problem of smooth connection of different types of curved paths. The second cycle in step S2 for the splicing of single-end paths can be simplified from the splicing of double-segment paths.
因此,在进一步优化过程中主要针对两条子路径拼接轨迹的平滑连接进行优化。另一方面,本实施例研究了轨迹的光滑连接问题,其中光滑定义为切线方向连续并且曲率连续。对分段路径进行光滑的拼接不仅能够使机器人运行的更加平稳,也可以提高轨迹跟踪的精度。根据实际拼接时遇到的路径类型,分别考虑由一阶贝塞尔曲线(直线),三阶贝塞尔曲线与五阶贝塞尔曲线组成的路径。针对实际需求,本方案只考虑8种情况下的路径光滑问题。并且,可以通过组合这8种情况,来解决更加复杂的线路平滑问题,也可以通过简化这8中情况得到在上述第二次循环中需要用到的单条轨迹的优化问题。Therefore, in the further optimization process, the smooth connection of the two sub-path splicing trajectories is mainly optimized. On the other hand, the present embodiment studies the problem of smooth connection of trajectories, where smoothness is defined as continuity in the tangent direction and continuity in curvature. Smooth splicing of segmented paths can not only make the robot run more smoothly, but also improve the accuracy of trajectory tracking. According to the path type encountered during actual splicing, paths composed of first-order Bezier curves (straight lines), third-order Bezier curves and fifth-order Bezier curves are considered respectively. In view of actual needs, this scheme only considers path smoothing problems in 8 cases. Moreover, more complex line smoothing problems can be solved by combining these 8 cases, and the optimization problem of a single trajectory required in the above-mentioned second cycle can also be obtained by simplifying these 8 cases.
(二)(two)
本发明的第二个方面,还提供了一种导航路径曲率连续拼接优化处理装置,其包括:导航路径规划模块,路径拼接处理模块,其中移动机器人经扫描模块获取导航数据,以传输至导航路径模块中,经处理后生成多段子路径数据,并向路径拼接处理模块传输,所述路径拼接处理模块依据如上述的对含有直线路径轨迹的简并拼接方法,执行对直线路径轨迹的简并拼接处理。The second aspect of the present invention also provides a navigation path curvature continuous splicing optimization processing device, which includes: a navigation path planning module, a path splicing processing module, wherein the mobile robot obtains navigation data through the scanning module and transmits it to the navigation path module, generates multiple segments of sub-path data after processing, and transmits them to the path splicing processing module, and the path splicing processing module performs degenerate splicing processing on the straight path trajectory according to the degenerate splicing method for the straight path trajectory containing the straight path as mentioned above.
(三)(three)
本发明的第二个方面,还提供了一种可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时,实现上述的对含有直线路径轨迹的简并拼接方法的步骤。According to a second aspect of the present invention, a readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the above-mentioned method for degenerate splicing of trajectories containing straight path are implemented.
综上所述,通过本发明提供的该对含有直线路径轨迹的简并拼接方法、装置及其存储介质,克服了在使用贝塞尔曲线进行两直线路径平滑拼接时,五阶及以上的贝塞尔曲线自由度过高,而三阶贝塞尔曲线自由度不足的缺点,同时得以在保留路径调整自由度的同时,降低用户使用时的复杂度。In summary, the degenerate splicing method, device and storage medium of a pair of straight path trajectories provided by the present invention overcome the shortcomings of the fifth-order and above Bezier curves having too high a degree of freedom and the third-order Bezier curves having insufficient degrees of freedom when using Bezier curves to smoothly splice two straight path trajectories. At the same time, the complexity of user use is reduced while retaining the freedom of path adjustment.
此外本发明还可以有效的使贝塞尔曲线路径与直线路径,在交点处切线方向连续并且曲率连续,从而使机器人运行的更加平稳。可见路径的切线方向连续,意味着机器人的角度变化连续,路径的曲率连续意味着机器人角速度的变化率连续,有利于提高机器人轨迹跟踪控制的精度与效率。In addition, the present invention can also effectively make the Bezier curve path and the straight line path have continuous tangent direction and continuous curvature at the intersection, so that the robot runs more smoothly. It can be seen that the continuity of the tangent direction of the path means that the angle change of the robot is continuous, and the continuity of the curvature of the path means that the change rate of the robot's angular velocity is continuous, which is conducive to improving the accuracy and efficiency of the robot's trajectory tracking control.
以上公开的本发明优选实施例只是用于帮助阐述本发明。优选实施例并没有详尽叙述所有的细节,也不限制该发明仅为所述的具体实施方式。显然,根据本说明书的内容,可作很多的修改和变化。本说明书选取并具体描述这些实施例,是为了更好地解释本发明的原理和实际应用,从而使所属技术领域技术人员能很好地理解和利用本发明。本发明仅受权利要求书及其全部范围和等效物的限制,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is only limited by the claims and their full scope and equivalents. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
本领域技术人员可以理解,除了以纯计算机可读程序代码方式实现本发明提供的系统、装置及其各个模块以外,完全可以通过将方法步骤进行逻辑编程来使得本发明提供的系统、装置及其各个模块以逻辑门、开关、专用集成电路、可编程逻辑控制器以及嵌入式微控制器等的形式来实现相同程序。所以,本发明提供的系统、装置及其各个模块可以被认为是一种硬件部件,而对其内包括的用于实现各种程序的模块也可以视为硬件部件内的结构;也可以将用于实现各种功能的模块视为既可以是实现方法的软件程序又可以是硬件部件内的结构。Those skilled in the art can understand that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be regarded as structures within the hardware component; the modules for implementing various functions can also be regarded as both software programs for implementing the method and structures within the hardware component.
此外实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得单片机、芯片或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-On ly Memory)、随机存取存储器(RAM,RandomAccess Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a single-chip microcomputer, a chip or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program codes.
此外,本发明实施例的各种不同的实施方式之间也可以进行任意组合,只要其不违背本发明实施例的思想,其同样应当视为本发明实施例所公开的内容。In addition, various implementations of the embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111151249.9A CN113848922B (en) | 2021-09-29 | 2021-09-29 | Method, device and storage medium for degenerate splicing of trajectory containing straight path |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111151249.9A CN113848922B (en) | 2021-09-29 | 2021-09-29 | Method, device and storage medium for degenerate splicing of trajectory containing straight path |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113848922A CN113848922A (en) | 2021-12-28 |
CN113848922B true CN113848922B (en) | 2024-05-03 |
Family
ID=78977123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111151249.9A Active CN113848922B (en) | 2021-09-29 | 2021-09-29 | Method, device and storage medium for degenerate splicing of trajectory containing straight path |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113848922B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08249480A (en) * | 1994-12-15 | 1996-09-27 | Kao Corp | CAD system, and data conversion device and method for Bezier curve in CAD system |
CN107702723A (en) * | 2017-11-27 | 2018-02-16 | 安徽工程大学 | A kind of robot path planning method, storage medium and equipment |
CN112269965A (en) * | 2020-08-10 | 2021-01-26 | 中国北方车辆研究所 | Continuous curvature path optimization method under incomplete constraint condition |
CN113031592A (en) * | 2021-02-25 | 2021-06-25 | 杭州国辰机器人科技有限公司 | Robot path smoothing method and system based on fifth-order Bezier curve |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200147796A1 (en) * | 2018-11-12 | 2020-05-14 | Cloudminds (Shenzhen) Robotics Systems Co., Ltd. | Moving method and device for a robot, robot, electronic apparatus and readable medium |
-
2021
- 2021-09-29 CN CN202111151249.9A patent/CN113848922B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08249480A (en) * | 1994-12-15 | 1996-09-27 | Kao Corp | CAD system, and data conversion device and method for Bezier curve in CAD system |
CN107702723A (en) * | 2017-11-27 | 2018-02-16 | 安徽工程大学 | A kind of robot path planning method, storage medium and equipment |
CN112269965A (en) * | 2020-08-10 | 2021-01-26 | 中国北方车辆研究所 | Continuous curvature path optimization method under incomplete constraint condition |
CN113031592A (en) * | 2021-02-25 | 2021-06-25 | 杭州国辰机器人科技有限公司 | Robot path smoothing method and system based on fifth-order Bezier curve |
Non-Patent Citations (1)
Title |
---|
汽车造型特征的高效图像参数化重建;刘崇;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150715;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113848922A (en) | 2021-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109648560B (en) | Space trajectory transition method and system of industrial robot and robot | |
CN114063612B (en) | Path planning method, path planning device and electronic equipment | |
CN113686345B (en) | Multi-segment navigation path curvature continuous splicing optimization processor, method and storage medium | |
CN101650798B (en) | Flow modeling method | |
CN111897216A (en) | A Multi-segment Velocity Planning and Interpolation Method | |
CN115357032B (en) | NURBS-based mobile robot path generation method, system and storage medium | |
CN110617817A (en) | Navigation route determining method, device, equipment and storage medium | |
CN113848922B (en) | Method, device and storage medium for degenerate splicing of trajectory containing straight path | |
CN113865594B (en) | Method, device and storage medium for optimizing curvature continuous splicing of path segments containing circular arc navigation | |
CN114474072A (en) | Track fusion method, device, equipment and storage medium | |
CN111310106A (en) | A B-spline fitting optimization method based on stepwise approximation to the original contour | |
CN114564905A (en) | A circuit schematic layout method based on iterative tabu search algorithm | |
CN113414762A (en) | Welding bead path offset method and device, robot and storage device | |
CN114721327B (en) | Numerical control machining tool path track optimization method based on asymmetric PH curve | |
CN109596136B (en) | Hermite interpolation path generation method, insertion path generation method and storage device | |
CN111610751B (en) | Interpolation error multi-subdivision iterative calculation method for cross point set NURBS interpolation curve | |
CN117221146B (en) | Interface layout system and layout method for ladder diagram logic configuration | |
CN111192216B (en) | Lane line smoothing method and system | |
TW201627787A (en) | Trajectory planning system for integrating computer numerical control (CNC) machine, trajectory planning device, trajectory planning method, and computer program product thereof | |
CN107966953B (en) | Method for processing turn-back line segment in numerical control machining track | |
CN115509215B (en) | Terrace grinding path generation method and apparatus based on robot | |
CN118012034A (en) | Local path generation method, device, vehicle and storage medium | |
CN114954521A (en) | A method and device for controlling the running of a vehicle | |
CN118915625A (en) | S-shaped speed planning and improved filtering processing method and system based on single period | |
CN115578268A (en) | Lane Center Line Smoothing Method and Device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Building 11, Lane 2777, Jinxiu East Road, Pudong New Area, Shanghai, 201206 Patentee after: Shanghai Xiangong Intelligent Technology Co.,Ltd. Country or region after: China Address before: Building No. 11, Lane 2777, Jinxiu East Road, Pudong New Area, Shanghai Patentee before: Shanghai Xiangong Intelligent Technology Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |