平滑机器人的路径

发布于 2024-10-31 04:34:49 字数 165 浏览 1 评论 0原文

我正在计算机器人在具有多边形障碍物的平面上的最短路径。一切都运行良好且快速,没有任何问题。但是,如何平滑路径使其变得弯曲? 下面是用直线连接顶点的路径的图片。 聚苯乙烯 机器人只是一个圆圈。

顶点

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.

Vertices

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

苏别ゝ 2024-11-07 04:34:49

<一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">这篇论文可能会有用。看起来这是一个不平凡的问题。抽象的:

自动图形绘制器需要计算简单多边形顶点之间的路径,该多边形除了保留在内部之外还需要表现出某些美学特性。其中一些需要结合一些有关多边形形状的信息,而又不会与实际的最短路径相差太远。我们提出了一种算法来计算局部凸区域,该区域“包含”简单多边形的两个顶点之间的最短欧几里得路径。该区域具有“遵循”最短路径形状的边界形状。区域内部的三次贝塞尔样条在两个给定顶点之间提供了一条“短且平滑”的无碰撞曲线。所获得的结果看起来美观且所使用的方法可能具有独立的意义。它们是基本且可实施的。图 7 是我们当前实现产生的示例输出。

This paper might be useful. It looks like it's a non-trivial problem. Abstract:

Automatic graph drawers need to compute paths among ver- tices of a simple polygon which besides remaining in the interior need to exhibit certain aesthetic properties. Some of these require the incorpo- ration of some information about the polygonal shape without being too far from the actual shortest path. We present an algorithm to compute a locally convex region that “contains” the shortest Euclidean path among two vertices of a simple polygon. The region has a boundary shape that “follows” the shortest path shape. A cubic Bezier spline in the region in- terior provides a “short and smooth” collision free curve between the two given vertices. The obtained results appear to be aesthetically pleasant and the methods used may be of independent interest. They are elemen- tary and implementable. Figure 7 is a sample output produced by our current implementation.

风铃鹿 2024-11-07 04:34:49

当尝试在 Teragen。我最初尝试使用贝塞尔曲线

Curves

但发现(至少对于飞行而言)它们并没有那么有用。原因是曲线之间的曲率是不连续的,因此不能用于计算飞越的连续正确倾斜角度。此外,很难确定曲线不与山脉相交。

我离题了。我最终选择的方式是一条简单的基于质量弹簧的路径,并将其放松到屈服。

将路径细分为许多小段,越多越好。对于每个点,将其朝某个方向移动一点,以减小它与其相邻点之间的角度,并远离障碍物。重复多次,直到路径稳定下来。

k = 0.01    // Adjust the values of k and j to your liking.
j = 0.01    // Small values take longer to settle. Larger values are unstable.
For each point P
    normal_vector     = vector_to_previous_point + vector_to_next_point
    obstacle_vector   = vector_to_nearest_obstacle
    obstacle_distance = magnitude(obstacle_vector)
    obstacle_vector  *= obstacle_distance^2
    P                += (normal_vector * k) - (obstacle_vector * j)

这些有限元松弛技术的好处是,您可以将各种约束编程到其中,并且路径将根据权重(在本例中为 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.

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.

k = 0.01    // Adjust the values of k and j to your liking.
j = 0.01    // Small values take longer to settle. Larger values are unstable.
For each point P
    normal_vector     = vector_to_previous_point + vector_to_next_point
    obstacle_vector   = vector_to_nearest_obstacle
    obstacle_distance = magnitude(obstacle_vector)
    obstacle_vector  *= obstacle_distance^2
    P                += (normal_vector * k) - (obstacle_vector * j)

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?

血之狂魔 2024-11-07 04:34:49

难道在路径跟随算法的实际执行中就不能使路径弯曲吗?如果您保持路径不变(即连接的直线),则在路径中实现约 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.

enter image description here

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.

忘羡 2024-11-07 04:34:49

就机器人而言,我们无法知道未来。我们必须只知道机器人和障碍物的位置来绘制每个点。制作最小长度的弯曲路径的常用方法是用一个圆对机器人进行建模并移动该圆,使其保持与障碍物接触。只要保持一个半径的距离,转弯就会是曲线。

如果您想要曲线而不是最小距离,请尝试使上述半径与您距多边形顶点的距离成正比。

贝塞尔曲线的想法仅适用于使路径在回顾时弯曲。它改变了机器人曾经所在的位置。通常用机器人改变过去被称为“作弊”。避免改变已经走过的道路的一种方法是向前看。但机器人能看到周围的角落吗?您必须更好地指定规则。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文