Constrained Planning Tutorial
带约束的规划,这个应用场景就很多了
从下面这段话中可以看出,使用带约束的规划:
- 首先要定义一个约束constraint
- 其次要在受约束的空间进行规划constrained state space
- 约束方程满足f(q):Q→Rnf(q):Q \rightarrow R^nf(q):Q→Rn,f(q)=0f(q) = 0f(q)=0.
- 本次教程使用的约束是:f(q)=∥q∥−1f(q)=\left \| q \right \| - 1f(q)=∥q∥−1, 即:(x2+y2+z2)=1(x^2+y^2+z^2) = 1(x2+y2+z2)=1圆面约束
Defining a constrained motion planning problem is easy and very similar to defining an unconstrained planning problem. The primary difference is the need to define a constraint, and the use of a constrained state space, which wraps around an ambient state space. In this example, we will walk through defining a simple constrained planning problem: a point in R3 that is constrained to be on the surface of a sphere, giving a constraint function f(q)=||q||−1.
1.Defining the Constraint
下面代码是官方给出的圆面约束代码,从中可以看出:
- 自定义的圆面约束方程Sphere需要继承自 Constraint
- 构造函数需要传递两个参数,输入状态的维数(此处是3),输出状态的维数(此处是