当前位置:   article > 正文

Hybrid_AStar算法Reeds-sheep曲线_reeds-shepp

reeds-shepp

 Reeds-Shepp曲线简介

Reeds-Shepp曲线由 J.AReeds 和 L.A.Sheep 于 1990 年发表的论文 optimal path for a car that goes both forward and backwards中提出,是一种基于 Dubins 算法的改进算法, 相比于Dubins曲线只允许车辆向前运动,Reeds-Shepp曲线运动模型既允许车辆向前运动,也允许车辆向后运动。这就使得在某些情况下可以得出比 Dubins 曲线更优的解。J Reeds和L Shepp证明Reeds Shepp Car从起点到终点的最短路径一定是下面的word的其中之一。word中的"|"表示车辆运动朝向由正向转为反向或者由反向转为正向,带π/2下标表示该段轨迹的弧长/弧长对应的角度为π/2。带β下标的相邻两段轨迹的弧长/弧长对应的角度相等,加号代表前行,减号代表倒车

展开后对应以下48种组合,尽管HJ Sussman 和 G Tang在70多页的论文中已经证明L-R+L-和R-L+R-这两种是多余的,依然还有46种组合相比于Dubins曲线只有6种可能的组合,Reeds-Shepp要复杂很多。

Reeds-Shepp曲线轨迹求解

1、位姿变化

   在求解轨迹前,为方便运算,需要先对当前位姿和目标位姿进行变换,假设起始姿态为qi=(xi, yi,ψi),目标姿态为qg=(xg,yg, ψg),车辆转弯半径为r=ρ。首先将向量qiqg,平移到原点(0,0),平移量为(-x1,-y1)。则qi平移到(0,0),qg平移到(x2-x1,y2 -y1),然后再将向量qiqg旋转-ψ1度,(注意,是–ψ1度,很多参考资料里写的是ψ1度,是错误的),旋转后再将向量qiqg进行缩放,使其除以最小转弯半径ρ,这样就可以把最小转弯半径归一化为1,变换过程的公式如下所示:

2、六种基础运动公式

   Reed-Shepp曲线允许进行倒车,因此车辆存在六种最基础的运动,即左转前进,右转前进ψ,直行前进,左转倒车,右转倒车,直行倒车,车辆从当前位姿(x,y,ψ)分别按照以上基础运动来运动弧长t(直行时代表直线距离)后对应的姿态如下所示:

 现假设机器人位于S点处横纵坐标分别为x、y,与x轴夹角为ψ,因此,机器人在S点的状态可以表示为(x,y,ψ),执行L+基础运动前行左转弧长t后,到达G点。求机器人在G点的状态,根据第一个公式可得G点的状态如下:

以下示意图,图中大写字母是为了方便对图中的边和角进行描述,图中的小写字母是角度。

  G点的第三个状态是与x轴的夹角,执行L+运动之前为ψ, 由于是向前左转,也就是逆时针运动,逆时针运动为正,又因为L+运动向前左转了弧长t,计算时会将最小转弯半径归一化为1,即上图中边FG和边FS的长度为1,弧长=弧长圆心角x半径,所以弧长t也对应转过的弧度制角度,因此G点与x轴的夹角为ψ+t

  由上图容易知道,G点的横纵坐标Xg,Yg满足下式:

所以我们只要求得边GS的长度和∠GSA即可求得Xg,Yg,我们先来求边GS,现在我们已知∠GFS=t,边GF=边FS=1,由余弦公式c^{2}=a^{2}+b^{2}-2abcos\gamma得,边GS的长度为:

                   GS2=GF2+FS22GFFScos\angleGFS=2(1-cost)

 由半角公式sin\frac{a}{2}=\pm \sqrt{\frac{1-cosa}{2}}得,上式可化为:

            

 所以:

                       

我们再来求∠GSA,过程如下:

  将求得的边GS和∠GSA带入,可得G点的横纵坐标Xg,Yg的表达式:

最后再运用一下如下所示的积化和差公式:

                  

 利用积化和差公式,我们可以对Xg,Yg的表达式进一步化简,如下:

                                       Xg=x+sin(t+\varphi )-sin(\varphi )

                                       Yg=y-cos(t+\varphi )+cos(\varphi )

到这里,我们已经得到了推导前给出的G点的状态表达式:

 也就是,文章开头处给出的第一个Reeds-Shepp曲线的基础运动公式:

3、轨迹求解

   假设经过位姿变化后的起点和目标点位姿分别为(0,0,0)和(x,y,ψ),假设要求解从起点到目标点的L+S+L+轨迹,则只需要将起点(0,0,0)代入到上面六种基础运动中的L+公式中,将结果再代入S+公式中,再将结果代入L+公式中,得到的结果与已知的目标点位姿(x,y,ψ)等价,因此可以得到3个等式,未知数便是基础运动公式中的t,代入了3次,即t1、t2、t3,或者可以用t、u、v来表示,如下面的公式所示:

同理,可以对其他的轨迹进行分析求解

4、类型变换

   事实上,我们并不需要将48或者46种轨迹的求解公式都求出来,我们可以通过以下几种变换,以转换的形式以某种轨迹的求解公式来求其他轨迹的解,常见的变换有以下3种及其组合。

  (1)时间变换 (timeflip)

   时间变换通过交换轨迹字母上标符号+和- ,即车取反向的行进方向。举个例子, 从起点(0,0, 0)到目标点(x,y,ψ)的L-S-L-轨迹 可以通过从起点(0, 0,0)到点(-x,y,-ψ)的L+S+L+轨迹求得,因为两者关于x轴对称,通俗一点讲,当我们需要求解 从起点(0,0, 0)到目标点(x,y,ψ)的L-S-L-轨迹 的时候,我们可以选择求解从起点(0, 0,0)到点(-x,y,-ψ)的L+S+L+轨迹,由于两个轨迹关于x轴对称,将得到的L+S+L+轨迹关于x轴对称变化后,即可得到我们真正想要求的轨迹,通过以上的转换,我们不再需要求解L-S-L-轨迹的求解公式,就可以得到L-S-L-轨迹。

(2)反射变换 (reflect)

反射变换通过交换轨迹字母中的R和L ,即将R变成L,将L变成R,举个例子, 从起点(0,0, 0)到目标点(x,y,ψ)的R+S+R+轨迹 可以通过从起点(0, 0,0)到点(x,-y,-ψ)的L+S+L+轨迹求得,因为两者关于y轴对称。

(3)逆向变换 (backwards)

第三种转换关系:“backwards”,即将原曲线的路径逆序转换,得到的曲线与原来的曲线长度相同的新曲线。

“backwards”实例图如图所示,蓝色曲线L-S-R-L+与红色曲线 L+R-S-L-不具有以上两种的堆成关系,但是很直观的可以看出L-S-R-L+的逆序排列得到L+R-S-L-,两条路径曲线上的路径进行逆向排列。从起始点O(0,0,0)到目标点A(x,y,θ)的路径可以通过起始点O(0,0,0)到目标点B(x∗cosθ+y∗sinθ,x∗sinθ−y∗cosθ,θ)的路径圆周方向取反计算获得
       通过时间变换,反射变换,逆向变换可将48种轨迹简化为9种,也就是说,所有的48种轨迹均可以通过以上9种轨迹的求解公式,直接或间接的求解出来

Reeds-sheep曲线MATLAB仿真

代码:

这里只放出了主要求解代码,详细源代码可去参考链接下载

CSC

  1. function [isok,path,costFinal] = CSCtypeTraj(x,y,phi,start,endp,veh,Types) % X:矩阵旋转后x坐标,Y:矩阵旋转后y坐标,veh:车辆规格
  2. % :角度差,start:起点,endp:终点,Types:路径类型
  3. costFinal = inf;
  4. type = repmat('N',[1,5]); %构造一个1*5数值全为N的向量
  5. path = RSpathStruct(type,0,0,0,0,0);
  6. % according to the formula 8.1 in the paper to calculate L+S+L+
  7. [isok,t,u,v] = LpSpLp(x,y,phi);
  8. if isok
  9. pathTemp = RSpathStruct(Types(15,:),t,u,v,0,0); %将路径类型,角度,半径,航向角存入pathTemp结构体
  10. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  11. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  12. costTot = trajCostGet(t,u,v,0,0);
  13. if costFinal > costTot && logi_final == 1
  14. costFinal = costTot;
  15. path = RSpathStruct(Types(15,:),t,u,v,0,0);
  16. end
  17. end
  18. % according to the formula 8.1 in the paper and timeflip symmetry to calculate L-S-L-
  19. [isok,t,u,v] = LpSpLp(-x,y,-phi);
  20. if isok
  21. pathTemp = RSpathStruct(Types(15,:),-t,-u,-v,0,0);
  22. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  23. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  24. costTot = trajCostGet(-t,-u,-v,0,0);
  25. if costFinal > costTot && logi_final == 1
  26. costFinal = costTot;
  27. path = RSpathStruct(Types(15,:),-t,-u,-v,0,0);
  28. end
  29. end
  30. % according to the formula 8.1 in the paper and reflect symmetry to calculate R+S+R+
  31. [isok,t,u,v] = LpSpLp(x,-y,-phi);
  32. if isok
  33. pathTemp = RSpathStruct(Types(16,:),t,u,v,0,0);
  34. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  35. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  36. costTot = trajCostGet(t,u,v,0,0);
  37. if costFinal > costTot && logi_final == 1
  38. costFinal = costTot;
  39. path = RSpathStruct(Types(16,:),t,u,v,0,0);
  40. end
  41. end
  42. % according to the formula 8.1 in the paper and timeflp + reflect symmetry to calculate R-S-R-
  43. [isok,t,u,v] = LpSpLp(-x,-y,phi);
  44. if isok
  45. pathTemp = RSpathStruct(Types(16,:),-t,-u,-v,0,0);
  46. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  47. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  48. costTot = trajCostGet(-t,-u,-v,0,0);
  49. if costFinal > costTot && logi_final == 1
  50. costFinal = costTot;
  51. path = RSpathStruct(Types(16,:),-t,-u,-v,0,0);
  52. end
  53. end
  54. % according to the formula 8.1 in the paper calculate L+S+R+
  55. [isok,t,u,v] = LpSpRp(x,y,phi);
  56. if isok
  57. pathTemp = RSpathStruct(Types(13,:),t,u,v,0,0);
  58. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  59. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  60. costTot = trajCostGet(t,u,v,0,0);
  61. if costFinal > costTot && logi_final == 1
  62. costFinal = costTot;
  63. path = RSpathStruct(Types(13,:),t,u,v,0,0);
  64. end
  65. end
  66. % according to the formula 8.2 in the paper and timeflp symmetry to calculate L-S-R-
  67. [isok,t,u,v] = LpSpRp(-x,y,-phi);
  68. if isok
  69. pathTemp = RSpathStruct(Types(13,:),-t,-u,-v,0,0);
  70. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  71. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  72. costTot = trajCostGet(-t,-u,-v,0,0);
  73. if costFinal > costTot && logi_final == 1
  74. costFinal = costTot;
  75. path = RSpathStruct(Types(13,:),-t,-u,-v,0,0);
  76. end
  77. end
  78. % according to the formula 8.2 in the paper and reflect symmetry to calculate R+S+L+
  79. [isok,t,u,v] = LpSpRp(x,-y,-phi);
  80. if isok
  81. pathTemp = RSpathStruct(Types(14,:),t,u,v,0,0);
  82. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  83. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  84. costTot = trajCostGet(t,u,v,0,0);
  85. if costFinal > costTot && logi_final == 1
  86. costFinal = costTot;
  87. path = RSpathStruct(Types(14,:),t,u,v,0,0);
  88. end
  89. end
  90. % according to the formula 8.2 in the paper and timeflip + reflect symmetry to calculate R-S-L-
  91. [isok,t,u,v] = LpSpRp(-x,-y,phi);
  92. if isok
  93. pathTemp = RSpathStruct(Types(14,:),-t,-u,-v,0,0);
  94. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  95. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  96. costTot = trajCostGet(-t,-u,-v,0,0);
  97. if costFinal > costTot && logi_final == 1
  98. costFinal = costTot;
  99. path = RSpathStruct(Types(14,:),-t,-u,-v,0,0);
  100. end
  101. end
  102. if costFinal == inf
  103. isok = false;
  104. else
  105. isok = true;
  106. end
  107. end
  108. % formula 8.1
  109. function [isok,t,u,v] = LpSpLp(x,y,phi)
  110. [t,u] = cart2pol(x-sin(phi),y-1+cos(phi)); %将笛卡尔坐标转换为极坐标t为角度,u为半径,v为标准化航向角
  111. % if t >= 0
  112. v = limitAngleRange(phi-t);
  113. % if t >= 0 && u >= 0 && v >= 0 % the sign represent forward or backward
  114. isok = true;
  115. return
  116. % end
  117. % end
  118. % isok = false;
  119. % t = 0;
  120. % u = 0;
  121. % v = 0;
  122. end
  123. % formula 8.2
  124. function [isok,t,u,v] = LpSpRp(x,y,phi)
  125. [t1,u1] = cart2pol(x+sin(phi),y-1-cos(phi));
  126. if u1^2 >= 4
  127. u = sqrt(u1^2-4);
  128. [theta,~]= cart2pol(u,2);
  129. % theta = atan2(2,u);
  130. t = limitAngleRange(t1+theta);
  131. v = limitAngleRange(t-phi);
  132. % if t >= 0 && v >= 0 % the sign represent forward or backward
  133. isok = true;
  134. return
  135. % end
  136. end
  137. isok = false;
  138. t = 0;
  139. u = 0;
  140. v = 0;
  141. end

CCC

  1. function [isok,path,costFinal] = CCCtypeTraj(x,y,phi,start,endp,veh,Types)
  2. costFinal= inf;
  3. type = repmat('N',[1,5]);
  4. path = RSpathStruct(type,0,0,0,0,0);
  5. [isok,t,u,v] = LpRmL(x,y,phi);
  6. % according to the formula 8.3 and 8.4 to calculate L+R-L+ and L+R-L-
  7. if isok
  8. pathTemp = RSpathStruct(Types(1,:),t,u,v,0,0);
  9. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  10. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  11. costTot = trajCostGet(t,u,v,0,0);
  12. if costFinal > costTot && logi_final == 1
  13. costFinal = costTot;
  14. path = RSpathStruct(Types(1,:),t,u,v,0,0);
  15. end
  16. end
  17. % according to the formula 8.3 and 8.4 and timeflip symmetry to calculate L-R+L- and L-R+L+
  18. [isok,t,u,v] = LpRmL(-x,y,-phi);
  19. if isok
  20. pathTemp = RSpathStruct(Types(1,:),-t,-u,-v,0,0);
  21. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  22. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  23. costTot = trajCostGet(-t,-u,-v,0,0);
  24. if costFinal > costTot && logi_final == 1
  25. costFinal = costTot;
  26. path = RSpathStruct(Types(1,:),-t,-u,-v,0,0);
  27. end
  28. end
  29. % according to the formula 8.3 and 8.4 and reflect symmetry to calculate R+L-R+ and R+L-R-
  30. [isok,t,u,v] = LpRmL(x,-y,-phi);
  31. if isok
  32. pathTemp = RSpathStruct(Types(2,:),t,u,v,0,0);
  33. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  34. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  35. costTot = trajCostGet(t,u,v,0,0);
  36. if costFinal > costTot && logi_final == 1
  37. costFinal = costTot;
  38. path = RSpathStruct(Types(2,:),t,u,v,0,0);
  39. end
  40. end
  41. % according to the formula 8.3 and 8.4 and timeflip + reflect symmetry to calculate R-L+R- and R-L+R+
  42. [isok,t,u,v] = LpRmL(-x,-y,phi); % reflect
  43. if isok
  44. pathTemp = RSpathStruct(Types(2,:),-t,-u,-v,0,0);
  45. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  46. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  47. costTot = trajCostGet(-t,-u,-v,0,0);
  48. if costFinal > costTot && logi_final == 1
  49. costFinal = costTot;
  50. path = RSpathStruct(Types(2,:),-t,-u,-v,0,0);
  51. end
  52. end
  53. % backwards
  54. xb = x*cos(phi)+y*sin(phi);
  55. yb = x*sin(phi)-y*cos(phi);
  56. % according to the formula 8.3 and 8.4 to calculate L-R-L+
  57. [isok,t,u,v] = LpRmL(xb,yb,phi);
  58. if isok
  59. pathTemp = RSpathStruct(Types(1,:),v,u,t,0,0);
  60. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  61. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  62. costTot = trajCostGet(v,u,t,0,0);
  63. if costFinal > costTot && logi_final == 1
  64. costFinal = costTot;
  65. path = RSpathStruct(Types(1,:),v,u,t,0,0);
  66. end
  67. end
  68. % according to the formula 8.3 and 8.4 and timeflip symmetry to calculate L+R+L-
  69. [isok,t,u,v] = LpRmL(-xb,yb,-phi);
  70. if isok
  71. pathTemp = RSpathStruct(Types(1,:),-v,-u,-t,0,0);
  72. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  73. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  74. costTot = trajCostGet(-v,-u,-t,0,0);
  75. if costFinal > costTot && logi_final == 1
  76. costFinal = costTot;
  77. path = RSpathStruct(Types(1,:),-v,-u,-t,0,0);
  78. end
  79. end
  80. % according to the formula 8.3 and 8.4 and reflect symmetry to calculate R-L-R+
  81. [isok,t,u,v] = LpRmL(xb,-yb,-phi);
  82. if isok
  83. pathTemp = RSpathStruct(Types(2,:),v,u,t,0,0);
  84. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  85. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  86. costTot = trajCostGet(v,u,t,0,0);
  87. if costFinal > costTot && logi_final == 1
  88. costFinal = costTot;
  89. path = RSpathStruct(Types(2,:),v,u,t,0,0);
  90. end
  91. end
  92. % according to the formula 8.3 and 8.4 and timeflip + reflect symmetry to calculate R+L+R-
  93. [isok,t,u,v] = LpRmL(-xb,-yb,phi);
  94. if isok
  95. pathTemp = RSpathStruct(Types(2,:),-v,-u,-t,0,0);
  96. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  97. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  98. costTot = trajCostGet(-v,-u,-t,0,0);
  99. if costFinal > costTot && logi_final == 1
  100. costFinal = costTot;
  101. path = RSpathStruct(Types(2,:),-v,-u,-t,0,0);
  102. end
  103. end
  104. if costFinal == inf
  105. isok = false;
  106. else
  107. isok = true;
  108. end
  109. end
  110. % improvement formula 8.3/8.4
  111. function [isok,t,u,v] = LpRmL(x,y,phi)
  112. xi = x-sin(phi);
  113. eta = y-1+cos(phi);
  114. [theta,u1] = cart2pol(xi,eta);
  115. if u1 <= 4
  116. u = -2*asin(u1/4);
  117. t = limitAngleRange(theta+u/2+pi);
  118. v = limitAngleRange(phi-t+u);
  119. % if t >= 0 && u <= 0
  120. isok = true;
  121. return
  122. % end
  123. end
  124. isok = false;
  125. t = 0;
  126. u = 0;
  127. v = 0;
  128. end

CCCC

  1. function [isok,path,costFinal] = CCCCtypeTraj(x,y,phi,start,endp,veh,Types)
  2. costFinal = inf;
  3. type = repmat('N',[1,5]);
  4. path = RSpathStruct(type,0,0,0,0,0);
  5. [isok,t,u,v] = LpRupLumRm(x,y,phi);
  6. % according to the formula 8.7 in the paper to calculate L+R+L-R-
  7. if isok
  8. pathTemp = RSpathStruct(Types(3,:),t,u,-u,v,0);
  9. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  10. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  11. costTot = trajCostGet(t,u,-u,v,0);
  12. if costFinal > costTot && logi_final == 1
  13. costFinal = costTot;
  14. path = RSpathStruct(Types(3,:),t,u,-u,v,0);
  15. end
  16. end
  17. % according to the formula 8.7 in the paper and timeflip symmetry to calculate L-R-L+R+
  18. [isok,t,u,v] = LpRupLumRm(-x,y,-phi);
  19. if isok
  20. pathTemp = RSpathStruct(Types(3,:),-t,-u,u,-v,0);
  21. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  22. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  23. costTot = trajCostGet(t,u,-u,v,0);
  24. if costFinal > costTot && logi_final == 1
  25. costFinal = costTot;
  26. path = RSpathStruct(Types(3,:),-t,-u,u,-v,0);
  27. end
  28. end
  29. % according to the formula 8.7 in the paper and reflect symmetry to calculate R+L+R-L-
  30. [isok,t,u,v] = LpRupLumRm(x,-y,-phi);
  31. if isok
  32. pathTemp = RSpathStruct(Types(4,:),t,u,-u,v,0);
  33. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  34. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  35. costTot = trajCostGet(t,u,-u,v,0);
  36. if costFinal > costTot && logi_final == 1
  37. costFinal = costTot;
  38. path = RSpathStruct(Types(4,:),t,u,-u,v,0);
  39. end
  40. end
  41. % according to the formula 8.7 in the paper and timeflip + reflect symmetry to calculate R-L-R+L+
  42. [isok,t,u,v] = LpRupLumRm(-x,-y,phi);
  43. if isok
  44. pathTemp = RSpathStruct(Types(1,:),-t,-u,u,-v,0);
  45. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  46. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  47. costTot = trajCostGet(-t,-u,u,-v,0);
  48. if costFinal > costTot && logi_final == 1
  49. costFinal = costTot;
  50. path = RSpathStruct(Types(4,:),-t,-u,u,-v,0);
  51. end
  52. end
  53. [isok,t,u,v] = LpRumLumRp(x,y,phi);
  54. % according to the formula 8.8 in the paper to calculate L+R-L-R+
  55. if isok
  56. pathTemp = RSpathStruct(Types(3,:),t,-u,-u,v,0);
  57. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  58. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  59. costTot = trajCostGet(t,-u,-u,v,0);
  60. if costFinal > costTot && logi_final == 1
  61. costFinal = costTot;
  62. path = RSpathStruct(Types(3,:),t,-u,-u,v,0);
  63. end
  64. end
  65. [isok,t,u,v] = LpRumLumRp(-x,y,-phi);
  66. % according to the formula 8.8 in the paper and timeflip symmetry to calculate L-R+L+R-
  67. if isok
  68. pathTemp = RSpathStruct(Types(3,:),-t,u,u,-v,0);
  69. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  70. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  71. costTot = trajCostGet(-t,u,u,-v,0);
  72. if costFinal > costTot && logi_final == 1
  73. costFinal = costTot;
  74. path = RSpathStruct(Types(3,:),-t,u,u,-v,0);
  75. end
  76. end
  77. % according to the formula 8.8 in the paper and reflect symmetry to calculate R+L-R-L+
  78. [isok,t,u,v] = LpRumLumRp(x,-y,-phi);
  79. if isok
  80. pathTemp = RSpathStruct(Types(4,:),t,-u,-u,v,0);
  81. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  82. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  83. costTot = trajCostGet(t,-u,-u,v,0);
  84. if costFinal > costTot && logi_final == 1
  85. costFinal = costTot;
  86. path = RSpathStruct(Types(4,:),t,-u,-u,v,0);
  87. end
  88. end
  89. % according to the formula 8.8 in the paper and timeflip + reflect symmetry to calculate R-L+R+L-
  90. [isok,t,u,v] = LpRumLumRp(-x,-y,phi);
  91. if isok
  92. pathTemp = RSpathStruct(Types(4,:),-t,u,u,-v,0);
  93. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  94. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  95. costTot = trajCostGet(-t,u,u,-v,0);
  96. if costFinal > costTot && logi_final == 1
  97. costFinal = costTot;
  98. path = RSpathStruct(Types(4,:),-t,u,u,-v,0);
  99. end
  100. end
  101. if costFinal == inf
  102. isok = false;
  103. else
  104. isok = true;
  105. end
  106. end
  107. % formula 8.7 in the paper, tauOmega() is formula 8.6
  108. function [isok,t,u,v] = LpRupLumRm(x,y,phi)
  109. xi = x+sin(phi);
  110. eta = y-1-cos(phi);
  111. rho = (2+sqrt(xi^2+eta^2))/4;
  112. if rho >= 0 && rho <= 1
  113. u = acos(rho);
  114. [t,v] = tauOmega(u,-u,xi,eta,phi);
  115. % if t >= 0 && v <= 0 % the sign represent forward or backward
  116. isok = true;
  117. return
  118. % end
  119. end
  120. isok = false;
  121. t = 0;
  122. u = 0;
  123. v = 0;
  124. end
  125. % formula 8.8 in the paper
  126. function [isok,t,u,v] = LpRumLumRp(x,y,phi)
  127. xi = x+sin(phi);
  128. eta = y-1-cos(phi);
  129. rho = (20-xi^2-eta^2)/16;
  130. if rho >= 0 && rho <= 1
  131. u = -acos(rho);
  132. % if u >= pi/2
  133. [t,v] = tauOmega(u,u,xi,eta,phi);
  134. % if t >=0 && v >=0
  135. isok = true;
  136. return
  137. % end
  138. % end
  139. end
  140. isok = false;
  141. t = 0;
  142. u = 0;
  143. v = 0;
  144. end
  145. % formula 8.6
  146. function [tau,omega] = tauOmega(u,v,xi,eta,phi)
  147. delta = limitAngleRange(u-v);
  148. A = sin(u)-sin(delta);
  149. B = cos(u)-cos(delta)-1;
  150. t1 = atan2(eta*A-xi*B,xi*A+eta*B);
  151. t2 = 2*(cos(delta)-2*cos(v)-2*cos(u))+3;
  152. if t2 < 0
  153. tau = limitAngleRange(t1+pi);
  154. else
  155. tau = limitAngleRange(t1);
  156. end
  157. omega = limitAngleRange(tau-u+v-phi);
  158. end

CCSC

  1. function [isok,path,costFinal] = CCSCtypeTraj(x,y,phi,start,endp,veh,Types)
  2. costFinal = inf;
  3. type = repmat('N',[1,5]);
  4. path = RSpathStruct(type,0,0,0,0,0);
  5. % according to the formula 8.9 in the paper to calculate L+R-S-L-
  6. [isok,t,u,v] = LpRmSmLm(x,y,phi);
  7. if isok
  8. pathTemp = RSpathStruct(Types(5,:),t,-pi/2,u,v,0);
  9. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  10. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  11. costTot = trajCostGet(t,-pi/2,u,v,0);
  12. if costFinal > costTot && logi_final == 1
  13. costFinal = costTot;
  14. path = RSpathStruct(Types(5,:),t,-pi/2,u,v,0);
  15. end
  16. end
  17. % according to the formula 8.9 in the paper and timeflip symmetry to calculate L-R+S+L+
  18. [isok,t,u,v] = LpRmSmLm(-x,y,-phi);
  19. if isok
  20. pathTemp = RSpathStruct(Types(5,:),-t,pi/2,-u,-v,0);
  21. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  22. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  23. costTot = trajCostGet(-t,pi/2,-u,-v,0);
  24. if costFinal > costTot && logi_final == 1
  25. costFinal = costTot;
  26. path = RSpathStruct(Types(5,:),-t,pi/2,-u,-v,0);
  27. end
  28. end
  29. % according to the formula 8.9 in the paper and reflect symmetry to calculate R+L-S-R-
  30. [isok,t,u,v] = LpRmSmLm(x,-y,-phi);
  31. if isok
  32. pathTemp = RSpathStruct(Types(6,:),t,-pi/2,u,v,0);
  33. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  34. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  35. costTot = trajCostGet(t,-pi/2,u,v,0);
  36. if costFinal > costTot && logi_final == 1
  37. costFinal = costTot;
  38. path = RSpathStruct(Types(6,:),t,-pi/2,u,v,0);
  39. end
  40. end
  41. % according to the formula 8.9 in the paper and timeflip + reflect symmetry to calculate R-L+S+R+
  42. [isok,t,u,v] = LpRmSmLm(-x,-y,phi);
  43. if isok
  44. pathTemp = RSpathStruct(Types(6,:),-t,pi/2,-u,-v,0);
  45. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  46. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  47. costTot = trajCostGet(-t,pi/2,-u,-v,0);
  48. if costFinal > costTot && logi_final == 1
  49. costFinal = costTot;
  50. path = RSpathStruct(Types(6,:),-t,pi/2,-u,-v,0);
  51. end
  52. end
  53. % according to the formula 8.10 in the paper to calculate L+R-S-R-
  54. [isok,t,u,v] = LpRmSmRm(x,y,phi);
  55. if isok
  56. pathTemp = RSpathStruct(Types(9,:),t,-pi/2,u,v,0);
  57. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  58. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  59. costTot = trajCostGet(t,-pi/2,u,v,0);
  60. if costFinal > costTot && logi_final == 1
  61. costFinal = costTot;
  62. path = RSpathStruct(Types(9,:),t,-pi/2,u,v,0);
  63. end
  64. end
  65. % according to the formula 8.10 in the paper and timeflip symmetry to calculate L-R+S+R+
  66. [isok,t,u,v] = LpRmSmRm(-x,y,-phi);
  67. if isok
  68. pathTemp = RSpathStruct(Types(9,:),-t,pi/2,-u,-v,0);
  69. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  70. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  71. costTot = trajCostGet(-t,pi/2,-u,-v,0);
  72. if costFinal > costTot && logi_final == 1
  73. costFinal = costTot;
  74. path = RSpathStruct(Types(9,:),-t,pi/2,-u,-v,0);
  75. end
  76. end
  77. % according to the formula 8.10 in the paper and reflect symmetry to calculate R+L-S-L-
  78. [isok,t,u,v] = LpRmSmRm(x,-y,-phi);
  79. if isok
  80. pathTemp = RSpathStruct(Types(10,:),t,-pi/2,u,v,0);
  81. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  82. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  83. costTot = trajCostGet(t,-pi/2,u,v,0);
  84. if costFinal > costTot && logi_final == 1
  85. costFinal = costTot;
  86. path = RSpathStruct(Types(10,:),t,-pi/2,u,v,0);
  87. end
  88. end
  89. % according to the formula 8.10 in the paper and timeflip + reflect symmetry to calculate R-L+S+L+
  90. [isok,t,u,v] = LpRmSmRm(-x,-y,phi);
  91. if isok
  92. pathTemp = RSpathStruct(Types(10,:),-t,pi/2,-u,-v,0);
  93. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  94. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  95. costTot = trajCostGet(-t,pi/2,-u,-v,0);
  96. if costFinal > costTot && logi_final == 1
  97. costFinal = costTot;
  98. path = RSpathStruct(Types(10,:),-t,pi/2,-u,-v,0);
  99. end
  100. end
  101. if costFinal == inf
  102. isok = false;
  103. else
  104. isok = true;
  105. end
  106. end
  107. % formula 8.9 in the paper
  108. function [isok,t,u,v] = LpRmSmLm(x,y,phi)
  109. xi = x+sin(phi);
  110. eta = y-1-cos(phi);
  111. % xi = x-sin(phi);
  112. % eta = y-1+cos(phi);
  113. [theta,rho] = cart2pol(-eta,xi);
  114. % [theta,rho] = cart2pol(xi,eta);
  115. if rho >= 2
  116. [theta1,~] = cart2pol(sqrt(rho^2-4),-2);
  117. t = limitAngleRange(theta-theta1);
  118. u = 2-theta1;
  119. v = limitAngleRange(phi-pi/2-t);
  120. % if t >= 0 && u <= 0 && v <= 0
  121. isok = true;
  122. return
  123. % end
  124. end
  125. isok = false;
  126. t = 0;
  127. u = 0;
  128. v = 0;
  129. end
  130. % formula 8.10 in the paper
  131. function [isok,t,u,v] = LpRmSmRm(x,y,phi)
  132. xi = x+sin(phi);
  133. eta = y-1-cos(phi);
  134. [theta,rho] = cart2pol(-eta,xi);
  135. if rho >= 2
  136. t = theta;
  137. u = 2-rho;
  138. v = limitAngleRange(t+pi/2-phi);
  139. % if t >= 0 && u <= 0 && v <= 0
  140. isok = true;
  141. return
  142. % end
  143. end
  144. isok = false;
  145. t = 0;
  146. u = 0;
  147. v = 0;
  148. end

CSCC

  1. % CSCC is the opposite direction of the CCSC
  2. function [isok,path,costFinal] = CSCCtypeTraj(x,y,phi,start,endp,veh,Types)
  3. costFinal = inf;
  4. type = repmat('N',[1,5]);
  5. path = RSpathStruct(type,0,0,0,0,0);
  6. % backwards
  7. xb = x*cos(phi)+y*sin(phi);
  8. yb = x*sin(phi)-y*cos(phi);
  9. % according to the formula 8.9 in the paper to calculate L-S-R-L+
  10. [isok,t,u,v] = LpRmSmLm(xb,yb,phi);
  11. if isok
  12. pathTemp = RSpathStruct(Types(7,:),v,u,-pi/2,t,0);
  13. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  14. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  15. costTot = trajCostGet(v,u,-pi/2,t,0);
  16. if costFinal > costTot && logi_final == 1
  17. costFinal = costTot;
  18. path = RSpathStruct(Types(7,:),v,u,-pi/2,t,0);
  19. end
  20. end
  21. % according to the formula 8.9 in the paper and timeflip symmetry to calculate L-S-R-L+
  22. [isok,t,u,v] = LpRmSmLm(-xb,yb,-phi);
  23. if isok
  24. pathTemp = RSpathStruct(Types(7,:),-v,-u,pi/2,-t,0);
  25. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  26. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  27. costTot = trajCostGet(-v,-u,pi/2,-t,0);
  28. if costFinal > costTot && logi_final == 1
  29. costFinal = costTot;
  30. path = RSpathStruct(Types(7,:),-v,-u,pi/2,-t,0);
  31. end
  32. end
  33. % according to the formula 8.9 in the paper and reflect symmetry to calculate R-S-L-R+
  34. [isok,t,u,v] = LpRmSmLm(xb,-yb,-phi);
  35. if isok
  36. pathTemp = RSpathStruct(Types(8,:),v,u,-pi/2,t,0);
  37. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  38. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  39. costTot = trajCostGet(v,u,-pi/2,t,0);
  40. if costFinal > costTot && logi_final == 1
  41. costFinal = costTot;
  42. path = RSpathStruct(Types(8,:),v,u,-pi/2,t,0);
  43. end
  44. end
  45. % according to the formula 8.9 in the paper and timeflip + reflect symmetry to calculate R+S+L+R-
  46. [isok,t,u,v] = LpRmSmLm(-xb,-yb,phi);
  47. if isok
  48. pathTemp = RSpathStruct(Types(8,:),-v,-u,pi/2,-t,0);
  49. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  50. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  51. costTot = trajCostGet(-v,-u,pi/2,-t,0);
  52. if costFinal > costTot && logi_final == 1
  53. costFinal = costTot;
  54. path = RSpathStruct(Types(8,:),-v,-u,pi/2,-t,0);
  55. end
  56. end
  57. % according to the formula 8.10 in the paper to calculate R-S-R-L+
  58. [isok,t,u,v] = LpRmSmRm(xb,yb,phi);
  59. if isok
  60. pathTemp = RSpathStruct(Types(11,:),v,u,-pi/2,t,0);
  61. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  62. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  63. costTot = trajCostGet(v,u,-pi/2,t,0);
  64. if costFinal > costTot && logi_final == 1
  65. costFinal = costTot;
  66. path = RSpathStruct(Types(11,:),v,u,-pi/2,t,0);
  67. end
  68. end
  69. % according to the formula 8.10 in the paper and to timeflip symmetry calculate R+S+R+L-
  70. [isok,t,u,v] = LpRmSmRm(-xb,yb,-phi);
  71. if isok
  72. pathTemp = RSpathStruct(Types(11,:),-v,-u,pi/2,-t,0);
  73. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  74. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  75. costTot = trajCostGet(-v,-u,pi/2,-t,0);
  76. if costFinal > costTot && logi_final == 1
  77. costFinal = costTot;
  78. path = RSpathStruct(Types(11,:),-v,-u,pi/2,-t,0);
  79. end
  80. end
  81. % according to the formula 8.10 in the paper and to reflect symmetry calculate L-S-L-R+
  82. [isok,t,u,v] = LpRmSmRm(xb,-yb,-phi);
  83. if isok
  84. pathTemp = RSpathStruct(Types(12,:),v,u,-pi/2,t,0);
  85. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  86. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  87. costTot = trajCostGet(v,u,-pi/2,t,0);
  88. if costFinal > costTot && logi_final == 1
  89. costFinal = costTot;
  90. path = RSpathStruct(Types(12,:),v,u,-pi/2,t,0);
  91. end
  92. end
  93. % according to the formula 8.10 in the paper and to timeflip + reflect symmetry calculate L+S+L+R-
  94. [isok,t,u,v] = LpRmSmRm(-xb,-yb,phi);
  95. if isok
  96. pathTemp = RSpathStruct(Types(12,:),-v,-u,pi/2,-t,0);
  97. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  98. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  99. costTot = trajCostGet(-v,-u,pi/2,-t,0);
  100. if costFinal > costTot && logi_final == 1
  101. costFinal = costTot;
  102. path = RSpathStruct(Types(12,:),-v,-u,pi/2,-t,0);
  103. end
  104. end
  105. if costFinal == inf
  106. isok = false;
  107. else
  108. isok = true;
  109. end
  110. end
  111. % formula 8.9 in the paper
  112. function [isok,t,u,v] = LpRmSmLm(x,y,phi)
  113. xi = x+sin(phi);
  114. eta = y-1-cos(phi);
  115. % xi = x-sin(phi);
  116. % eta = y-1+cos(phi);
  117. [theta,rho] = cart2pol(-eta,xi);
  118. % [theta,rho] = cart2pol(xi,eta);
  119. if rho >= 2
  120. [theta1,~] = cart2pol(sqrt(rho^2-4),-2);
  121. t = limitAngleRange(theta-theta1);
  122. u = 2-theta1;
  123. v = limitAngleRange(phi-pi/2-t);
  124. % if t >= 0 && u <= 0 && v <= 0
  125. isok = true;
  126. return
  127. % end
  128. end
  129. isok = false;
  130. t = 0;
  131. u = 0;
  132. v = 0;
  133. end
  134. % formula 8.10 in the paper
  135. function [isok,t,u,v] = LpRmSmRm(x,y,phi)
  136. xi = x+sin(phi);
  137. eta = y-1-cos(phi);
  138. [theta,rho] = cart2pol(-eta,xi);
  139. if rho >= 2
  140. t = theta;
  141. u = 2-rho;
  142. v = limitAngleRange(t+pi/2-phi);
  143. % if t >= 0 && u <= 0 && v <= 0
  144. isok = true;
  145. return
  146. % end
  147. end
  148. isok = false;
  149. t = 0;
  150. u = 0;
  151. v = 0;
  152. end

CCSCC

  1. function [isok,path,costFinal] = CCSCCtypeTraj(x,y,phi,start,endp,veh,Types)
  2. costFinal = inf;
  3. type = repmat('N',[1,5]);
  4. path = RSpathStruct(type,0,0,0,0,0);
  5. [isok,t,u,v] = LpRmSLmRp(x,y,phi);
  6. % according to the formula 8.11 to calculate L+R-S-L-R+
  7. if isok
  8. pathTemp = RSpathStruct(Types(17,:),t,-pi/2,u,-pi/2,v);
  9. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  10. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  11. costTot = trajCostGet(t,-pi/2,u,-pi/2,v);
  12. if costFinal > costTot && logi_final == 1
  13. costFinal = costTot;
  14. path = RSpathStruct(Types(17,:),t,-pi/2,u,-pi/2,v);
  15. end
  16. end
  17. % according to the formula 8.11 and timeflip symmetry to calculate L+R-S-L-R+
  18. [isok,t,u,v] = LpRmSLmRp(-x,y,-phi);
  19. if isok
  20. pathTemp = RSpathStruct(Types(17,:),-t,pi/2,-u,pi/2,-v);
  21. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  22. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  23. costTot = trajCostGet(-t,pi/2,-u,pi/2,-v);
  24. if costFinal > costTot && logi_final == 1
  25. costFinal = costTot;
  26. path = RSpathStruct(Types(17,:),-t,pi/2,-u,pi/2,-v);
  27. end
  28. end
  29. % according to the formula 8.11 and reflect symmetry to calculate R+L-S-R-L+
  30. [isok,t,u,v] = LpRmSLmRp(x,-y,-phi);
  31. if isok
  32. pathTemp = RSpathStruct(Types(18,:),t,-pi/2,u,-pi/2,v);
  33. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  34. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  35. costTot = trajCostGet(t,-pi/2,u,-pi/2,v);
  36. if costFinal > costTot && logi_final == 1
  37. costFinal = costTot;
  38. path = RSpathStruct(Types(18,:),t,-pi/2,u,-pi/2,v);
  39. end
  40. end
  41. % according to the formula 8.11 and timeflip + reflect symmetry to calculate R-L+S+R+L-
  42. [isok,t,u,v] = LpRmSLmRp(-x,-y,phi);
  43. if isok
  44. pathTemp = RSpathStruct(Types(18,:),-t,pi/2,-u,pi/2,-v);
  45. [traj_x,traj_y,traj_th] = trajPointGet(pathTemp,start,veh);
  46. logi_final = reachGoalJudge(traj_x,traj_y,traj_th,endp);
  47. costTot = trajCostGet(-t,pi/2,-u,pi/2,-v);
  48. if costFinal > costTot && logi_final == 1
  49. costFinal = costTot;
  50. path = RSpathStruct(Types(18,:),-t,pi/2,-u,pi/2,-v);
  51. end
  52. end
  53. if costFinal == inf
  54. isok = false;
  55. else
  56. isok = true;
  57. end
  58. end
  59. % improvement formula 8.11
  60. function [isok,t,u,v] = LpRmSLmRp(x,y,phi)
  61. xi = x+sin(phi);
  62. eta = y-1-cos(phi);
  63. [~,rho] = cart2pol(xi,eta);
  64. if rho >= 2
  65. u = 4-sqrt(rho^2-4);
  66. % if u <= 0
  67. t = limitAngleRange(atan2((4-u)*xi-2*eta,-2*xi+(u-4)*eta));
  68. v = limitAngleRange(t-phi);
  69. % if t >= 0 && v >= 0
  70. isok = true;
  71. return
  72. % end
  73. % end
  74. end
  75. isok = false;
  76. t = 0;
  77. u = 0;
  78. v = 0;
  79. end
  80. % the formula 8.11 in the paper
  81. % formula 8.11
  82. % function [isok,t,u,v] = LpRmSLmRp(x,y,phi)
  83. % xi = x+sin(phi);
  84. % eta = y-1-cos(phi);
  85. % [theta,rho] = cart2pol(xi,eta);
  86. % if rho >= 2
  87. % t = limitAngleRange(theta - acos(-2/rho));
  88. % if t > 0
  89. % u = 4 - (xi + 2 * cos(t))/sin(t);
  90. % v = limitAngleRange(t-phi);
  91. % % if t > 0 && v >= 0
  92. % isok = true;
  93. % return
  94. % % end
  95. % end
  96. % end
  97. % isok = false;
  98. % t = 0;
  99. % u = 0;
  100. % v = 0;
  101. % end

免责声明

      本文章中的资料来源于互联网,这里只进行了总结,目的是为了更好的体验,资料查找更高效,如果资料作者有任何异议,都欢迎与我联系沟通删除。

参考链接

https://github.com/BaiChenuXu/ReedsSheppCurve-Application-Improvement

Reeds-Shepp曲线学习笔记及相关思考

Reeds-Shepp曲线基础运动公式推导过程

[自动驾驶]路径规划——ReedsShepp 曲线总结(python实现 | c++实现)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/467550
推荐阅读
相关标签
  

闽ICP备14008679号