From 2affd95315831f00a9d7ae4c9d7fd0f7065c1d03 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Thu, 22 Feb 2018 15:52:57 +0100
Subject: [PATCH] Fix and update documentation.

---
 doc/Doxyfile.extra.in                         |  4 +--
 .../cross-state-optimization.hh               | 26 +++++++++++++++++++
 .../hpp/manipulation/steering-method/graph.hh |  6 ++---
 .../cross-state-optimization/function.cc      |  2 +-
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/doc/Doxyfile.extra.in b/doc/Doxyfile.extra.in
index 5d0ee65..f36a30b 100644
--- a/doc/Doxyfile.extra.in
+++ b/doc/Doxyfile.extra.in
@@ -1,7 +1,7 @@
 INPUT     = @CMAKE_SOURCE_DIR@/doc \
             @CMAKE_SOURCE_DIR@/include \
-            @CMAKE_BINARY_DIR@/doc \
-            @CMAKE_BINARY_DIR@/src/steering-method/cross-state-optimization
+            @CMAKE_SOURCE_DIR@/src/steering-method/cross-state-optimization/function.cc \
+            @CMAKE_BINARY_DIR@/doc
 
 HTML_EXTRA_FILES = @CMAKE_SOURCE_DIR@/doc/ObjectManipulation_MasterThesis_JosephMirabel.pdf
 
diff --git a/include/hpp/manipulation/steering-method/cross-state-optimization.hh b/include/hpp/manipulation/steering-method/cross-state-optimization.hh
index cf040c1..8b55550 100644
--- a/include/hpp/manipulation/steering-method/cross-state-optimization.hh
+++ b/include/hpp/manipulation/steering-method/cross-state-optimization.hh
@@ -28,6 +28,31 @@
 namespace hpp {
   namespace manipulation {
     namespace steeringMethod {
+      /// \addtogroup steering_method
+      /// \{
+
+      /// Optimization-based steering method.
+      ///
+      /// #### Methodology
+      ///
+      /// 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:
+      ///   - 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$,
+      ///   - in case of failure, continue the loop.
+      ///   - call the Edge::build of each \f$ e_j \f$ for each consecutive
+      ///     \f$ (p^*_i, p^*_{i+1}) \f$.
+      ///
+      /// #### Problem formulation
+      /// Find \f$ (p_i) \f$ such that:
+      /// - \f$ p_0 = q_1 \f$,
+      /// - \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).
       class HPP_MANIPULATION_DLLAPI CrossStateOptimization :
         public SteeringMethod
       {
@@ -81,6 +106,7 @@ namespace hpp {
           /// Weak pointer to itself
           CrossStateOptimizationWkPtr_t weak_;
       }; // class CrossStateOptimization
+      /// \}
 
       template <typename T>
         CrossStateOptimizationPtr_t CrossStateOptimization::create
diff --git a/include/hpp/manipulation/steering-method/graph.hh b/include/hpp/manipulation/steering-method/graph.hh
index 5374e80..b3145b7 100644
--- a/include/hpp/manipulation/steering-method/graph.hh
+++ b/include/hpp/manipulation/steering-method/graph.hh
@@ -28,6 +28,8 @@
 
 namespace hpp {
   namespace manipulation {
+    /// \addtogroup steering_method
+    /// \{
     class HPP_MANIPULATION_DLLAPI SteeringMethod : public core::SteeringMethod
     {
       public:
@@ -61,8 +63,6 @@ namespace hpp {
 
     namespace steeringMethod {
       using core::PathPtr_t;
-      /// \addtogroup steering_method
-      /// \{
 
       class HPP_MANIPULATION_DLLAPI Graph : public SteeringMethod
       {
@@ -119,8 +119,8 @@ namespace hpp {
         gsm->innerSteeringMethod (T::create (problem));
         return gsm;
       }
-      /// \}
     } // namespace steeringMethod
+    /// \}
   } // namespace manipulation
 } // namespace hpp
 
diff --git a/src/steering-method/cross-state-optimization/function.cc b/src/steering-method/cross-state-optimization/function.cc
index 40ea940..3ba0c3d 100644
--- a/src/steering-method/cross-state-optimization/function.cc
+++ b/src/steering-method/cross-state-optimization/function.cc
@@ -31,7 +31,7 @@ namespace hpp {
         }
       }
 
-      /// Apply the constraint on a subspace of the input space:
+      /// Apply the constraint on a subspace of the input space.
       /// i.e.: \f$ f (q_0, ... , q_n) = f_{inner} (q_k) \f$
       class HPP_MANIPULATION_LOCAL StateFunction :
         public constraints::DifferentiableFunction
-- 
GitLab