Skip to content
Snippets Groups Projects
Commit 86ee5ecb authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Add documentation for Task and Features.

parent 5064297f
No related branches found
No related tags found
No related merge requests found
......@@ -7,3 +7,7 @@ INCLUDE(../cmake/sphinx.cmake)
SPHINX_SETUP()
SPHINX_FINALIZE()
INSTALL (FILES
pictures/feature.png
pictures/task.png
DESTINATION ${PKG_CONFIG_DOXYGENDOCDIR}/pictures)
\ No newline at end of file
INPUT = @CMAKE_SOURCE_DIR@/include \
@CMAKE_SOURCE_DIR@/doc/additionalDoc
IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/pictures
IMAGE_PATH = @PKG_CONFIG_DOXYGENDOCDIR@/pictures
FILE_PATTERNS = *.cc *.cpp *.h *.hh *.hxx
TAGFILES = \
"@JRL_MAL_DOXYGENDOCDIR@/jrl-mal.doxytag = @JRL_MAL_DOXYGENDOCDIR@" \
"@DYNAMIC_GRAPH_DOXYGENDOCDIR@/dynamic-graph.doxytag = @DYNAMIC_GRAPH_DOXYGENDOCDIR@"
COLLABORATION_GRAPH = NO
......@@ -4,19 +4,19 @@
This library implements a modular architecture to test and experiment
controllers in the Stack of Tasks Framework as defined in \ref Mansard2007.
It is specifically targeted to retain real-time performance while
having high level software capabilities, like plugins and scripts.
having high level software capabilities, like plugins and python scripting.
\section sec_organization Organization of the code
The code is based on the dynamic-graph package, which provides the
framework from which sot-core relies. Hence most of the code in sot-core
consists of classes that derive from entities. These entities are usually
The code is based on the <c>dynamic-graph</c> package, which provides the
framework on which sot-core relies. Hence most of the code in <c>sot-core</c>
consists of classes that derive from dynamic_graph::Entity. These entities are usually
compiled and linked in their own dynamic library, as a python module
Aside from the entities, there is a code base to the library, libsot-core,
Aside from the python modules, this package installs a core library libsot-core,
that provides functions and code common to all modules. All python modules
developed here link with libsot-core. For example, common mathematical
entities, definitions and functions are in that library's base.
entities, definitions and functions are in the core library.
See \ref sot_core_base for a list of what's in this code base.
This library implements
......@@ -27,16 +27,14 @@ This library implements
\li A basic C++ "machinery", the \ref factory, that "makes things work"
\section using Using the Stack of Tasks
Using dynamic-graph objects (pool and factory), either through C++ code
or the built-in interpreter, we can
For people who develop software on the HRP2 robot, this package
For people who develop software to control a real robot, this package
alone is insufficient to simulate and control a robot.
The following packages are recommended* in that case:
\li sot-dynamic
\li sot-pattern-generator
\li sot-openhrp (openhrp python module)
\li sot-openhrp-scripts
* These packages are in development at the time of writing and may
be separated or joined along the way. Please check their status and updates
......@@ -47,28 +45,24 @@ at the jrl-umi3218 web page: https://github.com/jrl-umi3218
This package should be compiled and installed with cmake.
This library is based on several packages:
\li dynamic-graph (https://github.com/jrl-umi3218/dynamic-graph)
\li MatrixAbstractLayer (https://github.com/jrl-umi3218/jrl-mal)
\li Lapack
\li Boost
\li pthread
\li <c>dynamic-graph</c> (https://github.com/jrl-umi3218/dynamic-graph)
\li <c>jrl-mal</c> (https://github.com/jrl-umi3218/jrl-mal)
\li <c>lapack</c>
\li <c>boost</c>
\li <c>pthread</c>
Their presence will be checked with the use of pkg-config.
There are talks of open-sourcing the library on github. When this
is done, installation instructions will be on the project's github
page.
\section sot_base Base library
This package is centered around a base library that implements
\section sot_base Core library
This package is centered around a core library that implements
the basic classes needed for operation of the stack of tasks. For
more information, see \ref sot_core_base.
\section sot_plugins Python Modules
While the main library provides a basic framework for computation of a
control law using the Stack of Tasks, it is not expressive enough for
typical usage scenarios (for example, controlling the humanoid robot
HRP-2). Hence, several "specialized" features and tasks have been developed,
typical usage scenarios (for example, controlling a humanoid
robot). Hence, several "specialized" features and tasks have been developed,
and can be used in the Stack of Tasks. For a list of python modules and a short
description, see \ref plugins_list.
......@@ -80,6 +74,14 @@ of tasks (SoT), and thus assigned a priority. The SoT then calculates
(in an iterative manner) the control law, or joint velocity, necessary
to realize the tasks (usually, bring a feature to its desired value).
\subsection features Features
Each feature computes some information
from measurements, from the robot state,or/and
from others features. Features should be lightweight
regarding computation and be included at this level
only if necessary. See documentation of class dynamicgraph::sot::FeatureAbstract
for more information.
\subsection tasks Tasks
Each task implements a specific controller which
......@@ -90,12 +92,7 @@ handling and its gain.
After being defined, tasks are pushed in the Stack of Tasks which then
calculates a control law as explained in \ref Mansard2007.
\subsection features Features
Each feature computes some information
from measurements, from the robot state,or/and
from others features. Features should be lightweight
regarding computation and be included at this level
only if necessary.
See documentation of class dynamicgraph::sot::TaskAbstract for more information.
\section References
\anchor Mansard2007
......@@ -107,14 +104,14 @@ IEEE Trans. on Robotics, 23(1):60-72, February 2007
@defgroup sot_core_base Sot-core base library (libsot-core.[dll|so])
For developers, this is the base library that your project has to
@defgroup sot_core_base Sot-core library (libsot-core.[dll|so])
For developers, this is the core library that your project has to
be linked with. It defines the related algorithms and entities
using the dynamic-graph framework.
\section presento What's in the box?
All the C++ code is placed in the namespace "sot". In the base
All the C++ code is placed in the namespace "dynamic_graph::sot". In the core
library, the following classes are present:
\subsection subsec_sot Stack of Task solvers
......@@ -142,25 +139,30 @@ strings, or set them from the command line (using a script interpreter from
the dynamic-graph package).
\subsection subsec_Features Features
The class sot::FeatureAbstract is the base class for features.
The class dynamicgraph::sot::FeatureAbstract is the base class for features.
all other classes are in entity \ref sot_plugins "python modules".
For more information on what is a feature, see \ref features.
For more information on what is a feature, see the documentation of class dynamic_graph::sot::FeatureAbstract.
\subsection subsec_Tasks Tasks
They are a certain number of pre-written tasks that can be used.
They all derive from the task sot::TaskAbstract; specific tasks
are defined as \ref sot_plugins "python modules".
Tasks are the hierarchical element of the stack of tasks.
A task computes a value and a Jacobian as output signals.
Once stacked into a solver, the solver will compute the control vector
that makes the task value converge toward zero in the
order defined by the priority levels. For more information see the documentation
of class dynamicgraph::sot:TaskAbstract.
\subsection subsec_tools Mathematical base
The following classes encapsulate common mathematical objects, and
are all defined in the base library; see each individual class documentation
are all defined in the core library; see each individual class documentation
for reference.
\li Vectors: (sot::VectorQuaternion, sot::VectorRollPitchYaw, sot::VectorUTheta)
\li Matrices: (sot::MatrixForce, sot::MatrixHomogeneous, sot::MatrixRotation, sot::MatrixTwist)
\li sot::MultiBound can be used to enforce bounds on numeric values
\subsection subsec_others Others
The base library also contains functions for adaptation and extension of
The core library also contains functions for adaptation and extension of
the dynamic-graph shell; see additional-functions.cpp, factory.cpp and pool.cpp
directly for these. In a nutshell, a typical user shouldn't need these.
See \ref factory for additional information.
......@@ -168,7 +170,7 @@ See \ref factory for additional information.
\defgroup plugins_list List of python modules
These python modules are linked with the base library.
These python modules are linked with the core library.
sot/sot-qr
sot/weighted-sot
......
#FIG 3.2 Produced by xfig version 3.2.5b
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
6 910 413 4728 1522
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 59.15 118.32
999 991 1797 991
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
1797 413 3797 413 3797 1522 1797 1522 1797 413
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 59.15 118.32
3797 1389 4595 1389
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 59.15 118.32
3797 1035 4595 1035
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 59.15 118.32
3797 679 4595 679
4 1 0 50 -1 2 13 0.0000 4 150 1470 2775 1035 FeatureAbstract\001
4 2 0 50 -1 0 11 0.0000 4 135 690 1664 900 selection\001
4 0 0 50 -1 0 11 0.0000 4 135 765 3885 1301 dimension\001
4 0 0 50 -1 0 11 0.0000 4 180 630 3885 945 jacobian\001
4 0 0 50 -1 0 11 0.0000 4 90 360 3885 591 error\001
-6
6 540 4905 7380 7020
6 540 4950 7380 6795
6 540 5535 2115 6075
6 630 5535 1845 5850
4 2 0 50 -1 0 22 0.0000 4 255 1170 1823 5813 errordot\001
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
578 5979 2072 5979
-6
6 5805 4995 7380 5535
6 5895 4995 7110 5310
4 2 0 50 -1 0 22 0.0000 4 255 1170 7088 5273 errordot\001
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
5843 5439 7337 5439
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
578 5315 2072 5315
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
578 6726 2072 6726
4 2 0 50 -1 0 22 0.0000 4 180 705 1823 5149 error\001
4 2 0 50 -1 0 22 0.0000 4 330 1230 1823 6560 jacobian\001
4 1 0 50 -1 2 26 0.0000 4 300 2955 3898 5481 FeatureGeneric\001
4 0 0 50 -1 0 18 0.0000 4 195 1335 2487 5951 errSOUT =\001
4 0 0 50 -1 0 18 0.0000 4 195 2685 2487 6320 errorSIN - ref.errorSIN\001
4 0 0 50 -1 0 18 0.0000 4 255 2205 2487 6726 jacSOUT = jacSIN\001
-6
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
2072 4945 5807 4945 5807 7020 2072 7020 2072 4945
-6
6 6120 6030 12690 8145
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
8930 6070 12665 6070 12665 8145 8930 8145 8930 6070
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7470 6485 8930 6485
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
6357 7149 8930 7149
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
6357 7896 8930 7896
4 2 0 50 -1 0 22 0.0000 4 255 2520 8681 6983 articularJacobian\001
4 2 0 50 -1 0 22 0.0000 4 330 1230 8681 7730 jacobian\001
4 2 0 50 -1 0 22 0.0000 4 330 1170 8681 6319 position\001
4 1 0 50 -1 2 26 0.0000 4 300 2940 10756 6651 FeaturePoint6d\001
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3
0 0 1.00 110.67 221.33
3234 1522 3234 2435 5226 2435
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
3732 3348 5226 3348
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
5226 2269 8961 2269 8961 4344 5226 4344 5226 2269
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
8961 4095 10455 4095
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
8961 3431 10455 3431
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
8961 2767 10455 2767
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
0 0 1.00 110.67 221.33
3825 4950 6471 4344
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
0 0 1.00 110.67 221.33
10710 6075 7965 4344
4 1 0 50 -1 2 26 0.0000 4 300 3105 7052 3431 FeatureAbstract\001
4 2 0 50 -1 0 22 0.0000 4 255 1305 4977 3182 selection\001
4 0 0 50 -1 0 22 0.0000 4 255 1545 9127 3929 dimension\001
4 0 0 50 -1 0 22 0.0000 4 330 1230 9127 3265 jacobian\001
4 0 0 50 -1 0 22 0.0000 4 180 705 9127 2601 error\001
4 2 0 50 -1 0 22 0.0000 4 255 1365 4977 2186 reference\001
doc/pictures/feature.png

12.8 KiB

#FIG 3.2 Produced by xfig version 3.2.5b
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
6 3555 360 8820 2475
6 7290 810 8820 1980
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7296 1901 8790 1901
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7296 1237 8790 1237
4 0 0 50 -1 0 22 0.0000 4 330 1230 7462 1735 jacobian\001
4 0 0 50 -1 0 22 0.0000 4 255 600 7462 1071 task\001
-6
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
3561 379 7296 379 7296 2454 3561 2454 3561 379
4 1 0 50 -1 2 26 0.0000 4 300 2550 5387 1541 TaskAbstract\001
-6
6 1575 3285 11250 5895
6 4725 4095 7425 5715
6 4725 5175 7425 5715
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
4725 5175 7425 5175 7425 5715 4725 5715 4725 5175
4 0 0 50 -1 0 18 0.0000 4 195 1020 4950 5535 feature 1\001
-6
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
4725 4095 7425 4095 7425 4635 4725 4635 4725 4095
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
4725 4635 7425 4635 7425 5175 4725 5175 4725 4635
4 0 0 50 -1 0 18 0.0000 4 195 1020 4950 4995 feature 2\001
4 0 0 50 -1 0 18 0.0000 4 30 180 4950 4455 ...\001
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
2738 3740 4232 3740
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
2738 4404 4232 4404
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
2738 5151 4232 5151
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7958 3740 9452 3740
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7958 4404 9452 4404
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
4230 3325 7967 3325 7967 5895 4230 5895 4230 3325
4 1 0 50 -1 2 26 0.0000 4 300 915 6058 3906 Task\001
4 2 0 50 -1 0 22 0.0000 4 255 1755 3983 3574 controlGain\001
4 2 0 50 -1 0 22 0.0000 4 330 2010 3983 4238 dampingGain\001
4 2 0 50 -1 0 22 0.0000 4 255 2385 3983 4985 controlSelection\001
4 0 0 50 -1 0 22 0.0000 4 180 705 8235 3574 error\001
4 0 0 50 -1 0 22 0.0000 4 255 2985 8235 4230 errorTimeDerivative\001
-6
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
0 0 1.00 110.67 221.33
5850 3330 5580 2475
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
0 0 1.00 111.00 222.00
6030 6833 6030 5850
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
2738 7250 4232 7250
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
1 1 1.00 110.67 221.33
7958 7250 9452 7250
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
4230 6835 7965 6835 7965 8325 4230 8325 4230 6835
4 1 0 50 -1 2 26 0.0000 4 300 1500 6058 7416 TaskPD\001
4 2 0 50 -1 0 22 0.0000 4 255 1245 3983 7084 errorDot\001
4 0 0 50 -1 0 22 0.0000 4 255 1245 8235 7084 errorDot\001
doc/pictures/task.png

9.54 KiB

......@@ -52,38 +52,44 @@ namespace dynamicgraph {
In short, a feature is a data evolving according to time. It is defined
by a vector \f${\bf s}(t) \in \mathbb{R}^n \f$ where \f$ t \f$ is the
time. By default a feature has a desired \f${\bf s}^*(t) \f$. The
time. By default a feature has a desired \f${\bf s}^*(t) \f$.
\f${\bf s}^*\f$ is provided by another feature of the same type called
reference. The
feature is in charge of collecting its own current state. A feature is
supposed to compute an error between its current state and the desired
one: \f$ e(t) = {\bf s}^*(t) - {\bf s}(t) \f$. A feature is supposed to
compute a Jacobian according to the robot state vector \f$ \frac{\delta
{\bf s}(t)}{\delta {\bf q}(t)}\f$.
\bigskip
More precisely, a feature is a derivable function of the robot
configuration $q$ and the universe \f$\Omega\f$ into a real vector space:
\f$ f: q,\Omega \rightarrow f(q,\Omega) \in R^n\f$. The object is able to
compute the value, and the value of the Jacobian of \f$f\f$ with respect
to \f$q\f$, \f$J = \frac{\partial f}{\partial q}\f$.
The task is in general computed from the value of the feature at the
current instant \f$f(q(t),\Omega(t))\f$, the Jacobian \f$J\f$ and
evolution of the feature with the evolution of the universe, abusively
denoted as a variation along the variable \f$t\f$ alone: \f$\frac{\partial
f}{\partial t} = \frac{\partial f}{\partial \Omega} \dot{\Omega}\f$.
In general, the feature is computed as the error \f$f = e(q,\Omega)\f$
between the value at the current robot and universe configurations
\f$s(q,\Omega)\f$, and a reference value that does not depend on the robot
current configuration, and thus that is generally denoted \f$s^* = s^*(t)\f$.
In general, \f$s\f$ and \f$s^*\f$ evolves in the same space, and thus, two
objects of the same classes are used to represent \f$s\f$ on one side and
\f$s^*\f$ on the other. A generic solution to maintain a reference on the
object \f$s^*\f$ from the object \f$s\f$ is provided, but is not mandatory. In
that cases, the signal errorSOUT is linked to the update state
of the input of \f$s\f$, and is also automatically linked to the input of
\f$s^*\f$ as soon as \f$s^*\f$ is specifified.
current instant \f$f(q(t),t)\f$, the Jacobian \f$J\f$ and
evolution of the feature with respect to time: \f$\frac{\partial
f}{\partial t}\f$.
\par Time derivative of the error
Some Feature types provide as output signal the derivative of the
error of the feature (<c>errordotSOUT</c>). The value is computed by
method computeErrorDot. In this case, these feature types should
\li have attribute
\code
dg::SignalTimeDependent< ml::Vector,int > errordotSOUT;
\endcode
\li implement method
\code
virtual bool withErrorDot() const { return true; }
\endcode
\li implement method
\code
virtual SignalTimeDependent<ml::Vector,int>& getErrorDot()
{
return errordotSOUT;
}
\endcode
See dynamicgraph::sot::FeatureGeneric for an example.
\image html pictures/feature.png "Feature diagram: Feature types derive from FeatureAbstract. Each feature has a reference of the same type and compute an error by comparing errorSIN signals from itself and from the reference." width=15cm
*/
class SOT_CORE_EXPORT FeatureAbstract
:public Entity
......@@ -191,8 +197,7 @@ namespace dynamicgraph {
/*! \brief This method write a graph description on the file named FileName. */
virtual std::ostream & writeGraph(std::ostream & os) const;
/*! \brief Return true for children that implements the errordot
functionalities. */
/// Return true for children that provide the errordot output signal
virtual bool withErrorDot( void ) const { return false; }
virtual SignalTimeDependent<ml::Vector,int>& getErrorDot( void ) {throw;}
......
......@@ -48,6 +48,15 @@ namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;
/// Hierarchical element of the stack of tasks.
///
/// A task computes a value and a Jacobian as output signals.
/// Once stacked into a solver, the solver will compute the control
/// vector that makes the task values converge toward zero in the
/// order defined by the priority levels.
///
/// \image html pictures/task.png "Task diagram: Task types derive from TaskAbstract. The value and Jacobian of a Task are computed from the features that are stored in the task.
class SOT_CORE_EXPORT TaskAbstract
: public dg::Entity
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment