• No results found

Part II Contributions

Chapter 8 Toward visual constraints relaxation: planning under

8.6 Connecting the graphs

Connecting the two graphs is a critical step. One has to ensure state continuity between two candidate vertices. This problem is known as the Boundary Value Problem (BVP). Moreover, one wants to ensure feasibility as well and connections have to be evaluated quickly since the process may be called many times. We propose an optimal formulation to the BVP that can be solved as a single convex quadratic program. We exploit the convex-hull property of B-splines in order to

8.6. Connecting the graphs impose constraints directly on the curve control points to alleviate the solver. 8.6.1 Solving the constrained BVP

The original problem we want to solve is the following Problem 13 Find η, 9η, :η such that:

min η, 9η,:η żT 0 }:ηpτq} 2 dτ s.t. sp0q “ s0, spT q “ sT, ¯v ď vpτq ď ¯v, @τ P r0, T s |ωpτq| ď ¯ω @τ P r0, T s (8.13a) (8.13b) (8.13c) (8.13d) (8.13e) We penalize the input norm to obtain a smooth connection trajectory. Now, we parameterize the flat state s as B-splines to turn the infinite dimensional problem to a finite one with a limited number of coefficients that can be solved numerically. A trajectory s is parameterized as sptq “ i“n ÿ i“0 Bi,ppτqP , @τ P r0, T s (8.14)

where Bi is a polynomial basis of degree p (of order k “ p ` 1) and P P Rn`1

represents the set of coefficients.

Now, Problem 13 involves nonlinear constraints (8.13d) and (8.13e) and would require a nonlinear solver. We choose to simplify this problem by replacing these constraints with bounds on the linear velocity 9η and acceleration :ηwith

r 9ηpτq, :ηpτqsT P Xf ree @τ P r0, T s (8.15) with Xf ree :“ r´¯v, ¯vs2

ˆ r´¯a, ¯as2 the hypercube space of the admissible velocities

and accelerations.

8.6.2 A linear quadratic program based on B-splines

The reason we use B-splines is for their convex hull property that will allow us to write linear inequality constraints directly function of the B-spline control points. A similar approach has been used in [212] for manipulators.

These techniques are attractive and mostly adopted because of the convex hull property of the B-spline parametrization, which states that a spline is always con- tained in the convex hull of its B-spline coefficients [124]. This way, spline con- straints can be relaxed to constraints on the B-spline coefficients and we are ensured

that the B-spline curve will satisfy the same constraints. Replacing semi-infinite sets of constraints by finite, yet conservative sets is called a B-spline relaxation. B-spline relaxations can only be applied on splines, meaning that all constraints must be writ- ten as derivatives, antiderivatives, or polynomials of splines. Therefore, a nonlinear change of variables needs to be adopted to transform all constraints into bounds on spline functions [213] The major advantage is that B-spline relaxations avoid time gridding of the constraints, while they guarantee constraint satisfaction at all times. The disadvantage is that B-spline relaxations also introduce some conservatism. This conservatism can be reduced by choosing a higher dimensional basis, at the cost of introducing extra constraints [212]. This conservatism stems from the dis- tance between the control polygon and the spline itself. Knot insertion is generally the preferred technique, since, in this way, the conservatism reduces quadratically with the number of constraints, while this decrease is only linear when using degree elevation [214]. In addition, knot insertion allows refining the control polygon only locally, whereas degree elevation always affects the entire control polygon. Since using a higher dimensional basis translates into more constraints, it is necessary to make a trade-off between conservatism and computational complexity (number of constraints).

For nonlinear systems, one can resort to convex approximations of the feasible set [215, 138]. Inevitably, this method introduces conservatism in the problem. Moreover, some feasible sets do not admit such a polytopic approximation, e.g. obstacle avoidance constraints.

Constraints (8.15) can be mapped in the space of the control points. Let us differentiate the B-spline of degree p defined on the clamped knot vector of size n` k ` 1 such that uiďui`1, i“ 0, . . . , n ´ k U “ p0, . . . , 0 lo omo on p`1 , up`1, . . . , uk´p´1,1, . . . , 1lo omo on p`1 q (8.16)

The first derivative can be expressed as a function of the control points P with s1puq “ p i“n´1 ÿ i“0 Bi`1,p´1ptq Pi`1´ Pi Tpui`p`1´ ui`1q (8.17) Let us define the vector of new coefficients

Qi “ p Pi`1´ Pi Tpui`p`1´ ui`1q

, @i P v0, n ´ 1w (8.18)

The new knot vector is obtained by dropping the first and last knots from U, i.e., U1 “ p0, ..., 0 loomoon p , up`1, ..., um´p´1,1, ..., 1 loomoon p q (8.19)

8.6. Connecting the graphs For the second derivative one has

s2puq “

i“n´2

ÿ

i“0

Bi`2,p´2ptqRi (8.20)

where Ri are the control points of the second derivative. One has

Ri “ pp ´ 1q

Qi`1´ Qi Tpui`p`1´ ui`2q

, @i P v0, n ´ 2w (8.21)

Now we can express Q and R as functions of P with

Q“ AQP, R“ ARQ“ ARAQP (8.22)

where matrix AQ P Rnˆpn`1q and AR P Rpn´1qˆn. Now, one can easily set semi-

infinite bounds on the derivatives coefficients Q and R that are linear in P . All the constraints can be rewritten as functions of the control points P . This strategy avoids discretizing the flat outputs and the constraints that would may lead to a great number of constraints. We want to solve the following problem on each axis Problem 14 Find P such that:

min P P T pBTrBrqP s.t.@P , Bi pp0qD “ ηi0, @i P v0, r ´ 1w @P , Bi ppT qD “ ηiT, @i P v0, r ´ 1w ´ ¯Q ď Qi ď ¯Q, @i P v0, n ´ 1w ´ ¯R ď Ri ď ¯R @i P v0, n ´ 2w (8.23a) (8.23b) (8.23c) (8.23d) (8.23e) where Bdppsq P Rn is d-th order derivative B-spline basis of degree p evaluated

at s P rt, t ` T s. In this case Br P RHˆn represents the r-th order derivative

basis discretized in H samples between t and t` T . Finally, as we minimize the acceleration we choose r“ 2.

The problem can be written in the compact form of a quadratic program with Problem 15 Find P such that:

min P 1 2P THP ` fTP s.t. AP ď b, AeqP “ beq lbďP ďub (8.24a) (8.24b) (8.24c) (8.24d)

where H P Rnˆn denotes a positive (semi-)definite Hessian matrix, f P Rn is the

gradient vector (null here), AP Rmˆn is the constraint matrix and A

eq P Rrˆn is

the equality constraint matrix. The upper and lower bounds on the constraints are defined by the vectors b P Rm and b

eq P Rr and bounds on the decision variables

can be set with lb P Rn and ub P Rn but will be null in our case. Here we will not

impose bounds on P , i.e, (8.24d) is not considered.

Problem14will be solved using qpOASES [216] that implements an online active set strategy. Note that the connection time T is fixed and we found that choosing T “ τ generates a reasonable amount of successful connections.