当前位置:网站首页>【路径规划】使用垂距限值法与贝塞尔优化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*算法+垂距限值法+贝塞尔+运动模型轨迹
边栏推荐
- redis缓存工具类,值得拥有~
- How to change the formula picture in the paper directly into the formula in word
- JNI uses asan to check memory leaks
- 生鲜行业数字化采购管理系统:助力生鲜企业解决采购难题,全程线上化采购执行
- 2022 届的应届生都找到工作了吗?做自媒体可以吗?
- Flash encryption process and implementation of esp32
- SAP HR reward and punishment information export
- Sequence of entity layer, Dao layer, service layer and controller layer
- 数据库面试题+解析
- MySQL架构
猜你喜欢

Explain

First week of July

生鲜行业数字化采购管理系统:助力生鲜企业解决采购难题,全程线上化采购执行

What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method

伸展树(一) - 图文解析与C语言实现

C inheritance and interface design polymorphism

ASP. Net core middleware request processing pipeline

SAP HR 劳动合同信息 0016

B_ QuRT_ User_ Guide(37)

MySQL Index Optimization Practice II
随机推荐
Summary of common methods of object class (September 14, 2020)
POJ2392 SpaceElevator [DP]
Summary of SQL single table query 2020.7.27
SAP HR 家庭成员信息
StringUtils工具类
Arbre binaire équilibré [Arbre AVL] - Insérer et supprimer
[untitled]
Map operation execution process
【7.4】25. Turn over the linked list in groups of K
做自媒体视频剪辑怎么赚钱呢?
SAP HR labor contract information 0016
包装行业智能供应链S2B2B商城解决方案:开辟电商消费新生态
Oracle statistics by time
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
SAP HR奖罚信息导出
Unity3d learning notes 4 - create mesh advanced interface
C method question 2
UE4_ Ue5 panoramic camera
Display the server hard disk image to the browser through Servlet
C number of words, plus ¥, longest word, average value