From 4f2d5fcb0c21caea9c27e8ad2139e04e24190dca Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Tue, 10 Sep 2019 13:32:40 +0200
Subject: [PATCH] [CrossStateOptimization] Update documentation of class and
 NEWS file.

---
 NEWS                                          |  2 ++
 .../cross-state-optimization.hh               | 34 +++++++++++++++++--
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 811baea..da741c0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
                                                                 -*- outline -*-
+* Rewrite steering method CrossStateOptimization
+  - decouple waypoint computations.
 New in 4.6.0
 * Add setter to relative motion matrix in edges.
 * Add method Edge::neighborEdges.
diff --git a/include/hpp/manipulation/steering-method/cross-state-optimization.hh b/include/hpp/manipulation/steering-method/cross-state-optimization.hh
index 7490507..1c188d5 100644
--- a/include/hpp/manipulation/steering-method/cross-state-optimization.hh
+++ b/include/hpp/manipulation/steering-method/cross-state-optimization.hh
@@ -35,13 +35,14 @@ namespace hpp {
 
       /// Optimization-based steering method.
       ///
-      /// #### Methodology
+      /// #### Sketch of the method
       ///
       /// Given two configuration \f$ (q_1,q_2) \f$, this class formulates and
       /// solves the problem as follows.
       /// - Compute the corresponding states \f$ (s_1, s_2) \f$.
-      /// - For a each path \f$ (e_0, ... e_n) \f$ between \f$ (s_1, s_2) \f$
-      ///   in the constraint graph, do:
+      /// - For a each path \f$ (e_0, ... e_n) \f$ of length not more than
+      ///   parameter "CrossStateOptimization/maxDepth" between
+      ///   \f$ (s_1, s_2)\f$ in the constraint graph, do:
       ///   - define \f$ n-1 \f$ intermediate configuration \f$ p_i \f$,
       ///   - initialize the optimization problem, as explained below,
       ///   - solve the optimization problem, which gives \f$ p^*_i \f$,
@@ -55,6 +56,33 @@ namespace hpp {
       /// - \f$ p_{n+1} = q_2 \f$,
       /// - \f$ p_i \f$ is in state between \f$ (e_{i-1}, e_i) \f$, (\ref StateFunction)
       /// - \f$ (p_i, p_{i+1}) \f$ are reachable with transition \f$ e_i \f$ (\ref EdgeFunction).
+      ///
+      /// #### Problem resolution
+      ///
+      /// One solver (hpp::constraints::solver::BySubstitution) is created
+      /// for each waypoint \f$p_i\f$.
+      /// - 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 CrossStateOptimization::solveOptimizationProblem loops over
+      ///   the waypoint solvers, solves for each waypoint after
+      ///   initializing the right hand sides with the proper values.
+      /// - 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.
       class HPP_MANIPULATION_DLLAPI CrossStateOptimization :
         public SteeringMethod
       {
-- 
GitLab