Optimization-based path planning method.
Sketch of the method
Given two configurations \( (q_1,q_2) \), this class formulates and solves the problem as follows.
- Compute the corresponding states \( (s_1, s_2) \).
- For each path \( (e_0, ... e_n) \) of length not more than parameter "StatesPathFinder/maxDepth" between \( (s_1, s_2)\) in the constraint graph, do:
- define \( n-1 \) intermediate configuration \( p_i \),
- initialize the optimization problem, as explained below,
- solve the optimization problem, which gives \( p^*_i \),
- in case of failure, continue the loop.
Problem formulation
Find \( (p_i) \) such that:
- \( p_0 = q_1 \),
- \( p_{n+1} = q_2 \),
- \( p_i \) is in state between \( (e_{i-1}, e_i) \), (StateFunction)
- \( (p_i, p_{i+1}) \) are reachable with transition \( e_i \) (EdgeFunction).
Problem resolution
One solver (hpp::constraints::solver::BySubstitution) is created for each waypoint \(p_i\).
- method buildOptimizationProblem builds a matrix the rows of which are the parameterizable numerical constraints present in the graph, and the columns of which are the waypoints. Each value in the matrix defines the status of each constraint right hand side for this waypoint, among {absent from the solver, equal to value for previous waypoint, equal to value for start configuration, equal to value for end configuration}.
- method analyseOptimizationProblem loops over the waypoint solvers, tests what happens when solving each waypoint after initializing only the right hand sides that are equal to the initial or goal configuration, and detects if a collision is certain to block any attempts to solve the problem in the solveOptimizationProblem step.
- method solveOptimizationProblem tries to solve for each waypoint after initializing the right hand sides with the proper values, backtracking to the previous waypoint if the solving failed or a collision is detected a number of times set from the parameter "StatesPathFinder/nTriesUntilBacktrack". If too much backtracking occurs, the method can eventually return false.
- eventually method buildPath build paths between waypoints with the constraints of the transition in which the path lies.
Current status
The method has been successfully tested with romeo holding a placard and the construction set benchmarks. The result is satisfactory except between pregrasp and grasp waypoints that may be far away from each other if the transition between those state does not contain the grasp complement constraint. The same holds between placement and pre-placement.