当前位置:网站首页>【路径规划】使用垂距限值法与贝塞尔优化A星路径
【路径规划】使用垂距限值法与贝塞尔优化A星路径
2022-07-07 21:52:00 【龙猫略略略】
在之前使用通用的A*算法来规划出路径之后,可以发现路径上其实是有许多的冗余点的,如下图所示:
上图中可以明显看出有一些折弯点是冗余的,因此本节内容就介绍使用垂距限值法来优化冗余点。
垂距限值法
垂距限值法的思想也是比较简单的,概括一下就是:计算当前节点到上节点与下节点连线的距离,超过一定的阈值就从总集合中删除当前点。总体思想就如它的名字一样。
这里我写成了一个函数Vertical_distance_limit:
当然,此函数中我又封装了一个函数,即计算垂距的函数compute_vertical_distance
垂距计算
关于垂距计算,我们可以使用向量法,如下图所示:
使用向量法计算垂距的步骤可以按照如下来进行:
1) 先计算向量last_to_next的单位向量u_last_to_next
2) 计算向量last_to_pos,之后计算last_to_pos与向量u_last_to_next的点乘,即为last_to_pos到向量u_last_to_next上的投影长度L
3) 使用向量u_last_to_next乘以L即为向量last_to_closest
4) 使用last的坐标加上last_to_closest即可求出closest的坐标
5) 之后就可以求出pos与closest的距离
使用垂距限值法的效果
在增加了垂距优化后就可以得到如下的效果:
上图中红色连线点为初始的A*算法路径点,绿色连线点为优化后的路径点
使用五阶贝塞尔优化路径
在优化了路径后,我们可以进一步使用贝塞尔曲线规划出一条更平滑的曲线:
增加运动轨迹模型
之后我们可以按照之前做RRT那样,增加速度S曲线的运动轨迹模型,最后的效果就是这样的:
A*算法+垂距限值法+贝塞尔+运动模型轨迹
边栏推荐
- B_QuRT_User_Guide(39)
- The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
- USB (XVI) 2022-04-28
- Boost regex library source code compilation
- [stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code
- 2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
- 【leetcode】day1
- Navicat connects Oracle
- Illegal behavior analysis 1
- V-for traversal object
猜你喜欢
B_ QuRT_ User_ Guide(37)
postgis学习
Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
Anxinco EC series modules are connected to the multi protocol access products of onenet Internet of things open platform
MySQL架构
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
SAP HR 社会工作经历 0023
Lm12 rolling heikin Ashi double K-line filter
[compilation principle] lexical analysis design and Implementation
随机推荐
B_QuRT_User_Guide(37)
SAP HR 家庭成员信息
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
Map operation execution process
B_ QuRT_ User_ Guide(39)
The 19th Zhejiang Provincial College Programming Contest 2022 f.easyfix chairman tree
Force deduction solution summary 648 word replacement
B_ QuRT_ User_ Guide(40)
HDU 4747 mex "recommended collection"
Oracle statistics by time
S2b2b mall solution of intelligent supply chain in packaging industry: opening up a new ecosystem of e-commerce consumption
IDEA 2021.3. X cracking
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
B_QuRT_User_Guide(36)
C method question 1
LM12丨Rolling Heikin Ashi二重K线滤波器
0-1背包问题
Oracle database backup and recovery
Ora-02437 failed to verify the primary key violation
【7.4】25. Turn over the linked list in groups of K