平滑机器人的路径
我正在计算机器人在具有多边形障碍物的平面上的最短路径。一切都运行良好且快速,没有任何问题。但是,如何平滑路径使其变得弯曲? 下面是用直线连接顶点的路径的图片。 聚苯乙烯 机器人只是一个圆圈。
I'm calculating shortest path of a robot on a plane with polygonal obstacles. Everything works well and fast, no problems there. But, how to smoothen the path so it becomes curvy ?
Below is a picture of a path connecting vertices with a straight line.
P.S
Robot is just a circle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
<一href="http://www.google.com/url?sa=t&source=web&cd=4&ved=0CCwQFjAD&url=http://www.mgvis.com/Papers/Geometry/Short_smooth_paths.pdf& ;rc t=j&q=smooth%20polygonal%20path&ei=WnCbTdPrLcS60QHL2J3nAg&usg=AF QjCNFp8q-YsaasJjP60bmvjpIZ4YAY-w&sig2=Pw9j4gSmInVdsn5Mtw-vcw&cad=rja" rel="noreferrer">这篇论文可能会有用。看起来这是一个不平凡的问题。抽象的:
This paper might be useful. It looks like it's a non-trivial problem. Abstract:
当尝试在 Teragen。我最初尝试使用贝塞尔曲线。
但发现(至少对于飞行而言)它们并没有那么有用。原因是曲线之间的曲率是不连续的,因此不能用于计算飞越的连续正确倾斜角度。此外,很难确定曲线不与山脉相交。
我离题了。我最终选择的方式是一条简单的基于质量弹簧的路径,并将其放松到屈服。
将路径细分为许多小段,越多越好。对于每个点,将其朝某个方向移动一点,以减小它与其相邻点之间的角度,并远离障碍物。重复多次,直到路径稳定下来。
这些有限元松弛技术的好处是,您可以将各种约束编程到其中,并且路径将根据权重(在本例中为 j 和 k)在它们之间进行某种折衷。
如果您热衷于机器人技术,为什么不加入机器人SE呢?
I used to play with path calculation techniques a lot when trying to make realistic flying sequences to be rendered in Teragen. I initially tried using Bézier Curves.
But discovered that (for flying at least) they aren't that useful. The reason is that the curvature between curves is discontinuous, and so cannot be used to calculate a continuous correct banking angle for a fly-by. Also, it's hard to be sure that the curve doesn't intersect an mountain.
I digress. The way I eventually settled on was a simple mass-spring based path, and relax it into submission.
Subdivide the path into lots of little segments, the more the merrier. For each point, move it a little bit in a direction so as to reduce the angle between it and its neighbours, and way from the obstacles. Repeat many times until the path has settled down.
The benefit of these kind of finite element relaxation techniques is that you can program all kinds of constraints into it, and the path will settle on some compromise between them, depending on the weights (j and k in this case).
If you're into robotics, why not come and join the Robotics SE?
难道在路径跟随算法的实际执行中就不能使路径弯曲吗?如果您保持路径不变(即连接的直线),则在路径中实现约 1 米的前视距离(该值取决于机器人的速度以及您为避开障碍物而填充的配置空间的量)计算每个车轮速度的控制算法将自动平滑路径,无需任何预处理。
这是我的意思的快速图像...红色虚线是当您基于前瞻距离控制到一个点时机器人实际执行的路径。前瞻距离只是计算沿路径进一步任意距离的点。
同样,您唯一需要担心的是您要填充多少障碍物以确保您能够避免撞到他们。通常,我认为障碍物的区域由机器人半径的一半填充,但如果您控制前视距离,则可能需要使其稍大一些。
Can't you just make the path curvy in the actual execution of the path following algorithm? If you leave the path as is (i.e. connected straight lines), implementing a look ahead distance of ~1 meter (this value will depend on the speed of your robot and the amount you've padded the configuration space to avoid obstacles) in the control algorithm that calculates the velocity of each wheel will automatically smooth out the path without any need for preprocessing.
Here's a quick images of what I mean...the red dotted-line is the path that is actually executed by the robot when you control to a point based on a lookahead distance. A lookahead distance just computes a point further down the path by some arbitrary distance.
Again, the only thing you have to worry about is how much you're padding obstacles to make sure you avoid hitting them. Normally I believe the area of an obstacle is padded by half the robot's radius, but if you're controlling to a lookahead distance you may have to make this slightly larger.
就机器人而言,我们无法知道未来。我们必须只知道机器人和障碍物的位置来绘制每个点。制作最小长度的弯曲路径的常用方法是用一个圆对机器人进行建模并移动该圆,使其保持与障碍物接触。只要保持一个半径的距离,转弯就会是曲线。
如果您想要曲线而不是最小距离,请尝试使上述半径与您距多边形顶点的距离成正比。
贝塞尔曲线的想法仅适用于使路径在回顾时弯曲。它改变了机器人曾经所在的位置。通常用机器人改变过去被称为“作弊”。避免改变已经走过的道路的一种方法是向前看。但机器人能看到周围的角落吗?您必须更好地指定规则。
In the case of a robot we can't know the future. We have to draw each point knowing only the location of the robot and the obstacles. The usual method for making curved paths of minimum length is to model the robot with a circle and move the circle so it remains in contact with the obstacles. Just keep one radius away and the turns will be curves.
If you want curves and NOT minimum distance try making the above radius proportional to the distance you are from a polygon vertex.
The Bezier curves idea only works to make the path curved in retrospect. It changes where the robot ha been. Usually with robots changing the past is called "cheating". One way to avoid having to change the path you've already walked is to look ahead. But can the robot see around corners? You have to specify the rules better.