From fce4c060deacd255f6c1955f46dacee857ee364c Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 17 Nov 2020 09:35:09 +0100 Subject: [PATCH 1/4] Refresh docs in view of iDynTree 2 release --- README.md | 74 +- examples/CMakeLists.txt | 13 +- examples/cxx/CMakeLists.txt | 9 + .../InverseKinematics/CMakeLists.txt | 0 .../{ => cxx}/InverseKinematics/README.md | 0 .../iDynTreeExampleInverseKinematics.cpp | 0 .../CMakeLists.txt | 0 .../KinDynComputationsWithEigen/main.cpp | 4 +- .../CMakeLists.txt | 23 - .../fixedBaseGravityCompensation/aramis.urdf | 13398 ---------------- .../fixedBaseGravityCompensation/main.cpp | 101 - examples/icubArmRegressor/CMakeLists.txt | 23 - examples/icubArmRegressor/main.cpp | 58 - .../SensorsListParsing/SensorsListParsing.m | 29 +- .../Matlab2iDynTreeMat.m | 18 - .../Matlab2iDynTreeVec.m | 15 - .../iCubLeftArmFTRegressor.m | 102 - .../iCubLeftArmDynamicRegressors/icub.urdf | 1290 -- .../iDynTreeWrappers/visualizeRobot.m | 0 ...orial.py => KinDynComputationsTutorial.py} | 0 .../iCubLeftArmFTRegressor.py | 102 - .../python/iCubLeftArmFTRegressor/icub.urdf | 1290 -- examples/walkmanLimbJTSRegressor/main.cpp | 128 - 23 files changed, 64 insertions(+), 16613 deletions(-) create mode 100644 examples/cxx/CMakeLists.txt rename examples/{ => cxx}/InverseKinematics/CMakeLists.txt (100%) rename examples/{ => cxx}/InverseKinematics/README.md (100%) rename examples/{ => cxx}/InverseKinematics/iDynTreeExampleInverseKinematics.cpp (100%) rename examples/{ => cxx}/KinDynComputationsWithEigen/CMakeLists.txt (100%) rename examples/{ => cxx}/KinDynComputationsWithEigen/main.cpp (99%) delete mode 100644 examples/fixedBaseGravityCompensation/CMakeLists.txt delete mode 100644 examples/fixedBaseGravityCompensation/aramis.urdf delete mode 100644 examples/fixedBaseGravityCompensation/main.cpp delete mode 100644 examples/icubArmRegressor/CMakeLists.txt delete mode 100644 examples/icubArmRegressor/main.cpp delete mode 100644 examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeMat.m delete mode 100644 examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeVec.m delete mode 100644 examples/matlab/iCubLeftArmDynamicRegressors/iCubLeftArmFTRegressor.m delete mode 100644 examples/matlab/iCubLeftArmDynamicRegressors/icub.urdf rename examples/{ => matlab}/iDynTreeWrappers/visualizeRobot.m (100%) rename examples/python/{dynamicsComputationTutorial.py => KinDynComputationsTutorial.py} (100%) delete mode 100644 examples/python/iCubLeftArmFTRegressor/iCubLeftArmFTRegressor.py delete mode 100644 examples/python/iCubLeftArmFTRegressor/icub.urdf delete mode 100644 examples/walkmanLimbJTSRegressor/main.cpp diff --git a/README.md b/README.md index f3f54f3e8c8..c9b6f93f42b 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ iDynTree is written in C++ language, but thanks to [SWIG](http://www.swig.org/) * **[Acknowledgments](#acknowledgments)** ## Installation -iDynTree is mainly developed and mantained by the [Dynamic Interaction Control research line](https://www.iit.it/research/lines/dynamic-interaction-control) at the [Italian Institute of Technology](https://www.iit.it/), as part of the [iCub project](http://www.icub.org/) . +iDynTree is mainly developed and mantained by the [iCub Tech facility](https://www.iit.it/research/facilities/icub-tech) and [Dynamic Interaction Control research line](https://www.iit.it/research/lines/dynamic-interaction-control) at the [Italian Institute of Technology](https://www.iit.it/), as part of the [iCub project](http://www.icub.org/) . -For this reason it is usually installed through the [robotology-superbuild](https://github.com/robotology/robotology-superbuild), an easy way to download, compile and install the robotology software on multiple operating systems, using the [CMake](www.cmake.org) build system and its extension [YCM](http://robotology.github.io/ycm). For more informations on the superbuild concept, please check [YCM documentation](http://robotology.github.io/ycm/gh-pages/master/index.html#superbuild). To get iDynTree when using the `robotology-superbuild`, please enable the `ROBOTOLOGY_ENABLE_DYNAMICS` CMake option of the superbuild. +For this reason it is usually installed through the [robotology-superbuild](https://github.com/robotology/robotology-superbuild), an easy way to download, compile and install the robotology software on multiple operating systems, using the [CMake](www.cmake.org) build system and its extension [YCM](http://robotology.github.io/ycm). To get iDynTree when using the `robotology-superbuild`, please enable the `ROBOTOLOGY_ENABLE_DYNAMICS` CMake option of the superbuild. If you are not interested in installing all the robotology software it is still possible to install iDynTree without installing the rest of the robotology software, and please read the rest of the Readme for more info on this. @@ -40,52 +40,37 @@ but you can manually make sure that iDynTree searches or ignores a given depende - [Qt5](https://www.qt.io/) - [YARP](https://github.com/robotology/yarp) - [ICUB](https://github.com/robotology/icub-main) +- [irrlicht](http://irrlicht.sourceforge.net/) ##### Optional for the optimal control part - [ALGLIB](https://github.com/S-Dafarra/alglib-cmake) -- [OSQP](https://github.com/robotology/osqp-eigen) +- [osqp-eigen](https://github.com/robotology/osqp-eigen) - [WORHP](https://worhp.de/) -##### Deprecated -- [Kinematics and Dynamics Library](https://github.com/orocos/orocos_kinematics_dynamics) -- [urdfdom](https://github.com/ros/urdfdom) -- [irrlicht](http://irrlicht.sourceforge.net/) - #### Install dependencies -If you need to install also `YARP` and `ICUB`, it is recommended that you use the [`robotology-superbuild`](https://github.com/robotology/robotology-superbuild), but if you want to install them manually please -check the documentation at [ICub Software Installation](http://wiki.icub.org/wiki/ICub_Software_Installation). The rest of the dependencies can be installed using standard operating system package managers. +If you need to install also `YARP` and `ICUB`, it is recommended that you install iDynTree via the the [`robotology-superbuild`](https://github.com/robotology/robotology-superbuild). If instead you are not interested in the `YARP` and `ICUB` integration, you can easily install the rest of the dependencies using +standard package managers. ##### Windows -There are two ways of installing the required and optional dependencies of iDynTree in Windows: with binary installers or using [`vcpkg`](https://github.com/Microsoft/vcpkg). - -###### Installers -There are several installers that provide the binary dependencies of iDynTree on Windows. - -In particular you can run the [binary installer of YARP](http://www.yarp.it/download.html#download_windows) to install Eigen3, Qt5 and YARP itself, the [binary installer of ICUB software](http://wiki.icub.org/wiki/Windows:_installation_from_sources#Getting_iCub.27s_dependenceis) to install Ipopt and ICUB, and the [robotology-additional-dependencies installer](https://github.com/robotology-playground/robotology-additional-dependencies) to install Libxml2 . -**Important: make sure that you are installing the 64-bit installers, if you want to compile the robotology-superbuild using the the 64-bit compiler!** -These installers will set automatically all the enviroment variables necessary to make sure that these libraries are found by CMake, and they will modify the PATH enviroment variable to make sure that the libraries can be used when launching the programs that use them. +On Windows we recommend to use [`vcpkg`](https://github.com/Microsoft/vcpkg) C++ package manager to install iDynTree dependencies. ###### vcpkg If you use [`vcpkg`](https://github.com/Microsoft/vcpkg), you can install all the required and optional dependencies of iDynTree using the following command: ~~~ - ./vcpkg install --triplet x64-windows eigen3 qt5 libxml2 + ./vcpkg install --triplet x64-windows assimp eigen3 qt5 libxml2 irrlicht ~~~ -Use the `x86-windows` triplet only if you want to compile iDynTree using the 32-bit compiler. The default way to use the libraries provided by vcpkg in CMake is to use the [vcpkg CMake toolchain](https://github.com/Microsoft/vcpkg/blob/master/docs/users/integration.md#cmake-toolchain-file-recommended-for-open-source-cmake-projects). -If you prefer not to use the vcpkg toolchain, to use the libraries installed by vcpkg, it is necessary to use the `CMAKE_PREFIX_PATH`, `CMAKE_PROGRAM_PATH` and `PATH` environment variables. In particular, if your vcpkg is installed in `${VCPKG_ROOT}`, -you need to add `${VCPKG_ROOT}/installed/x64-windows` and `${VCPKG_ROOT}/installed/x64-windows/debug` to `CMAKE_PREFIX_PATH`, -`${VCPKG_ROOT}/installed/x64-windows/tools` to `CMAKE_PROGRAM_PATH` and `${VCPKG_ROOT}/installed/x64-windows/bin` and `${VCPKG_ROOT}/installed/x64-windows/debug/bin` to `PATH`. +If you want also to install the `ipopt` library, we recommend to use the port `ipopt-binary` available at https://github.com/robotology/robotology-vcpkg-ports . ##### macOS You can install most of the required and optional dependencies of iDynTree using [homebrew](https://brew.sh/) with the following command: ~~~ -brew install eigen qt5 ipopt +brew install assimp eigen qt5 ipopt ~~~ - #### Debian/Ubuntu You can install most of the required and optional dependencies of iDynTree using the following command: ~~~ @@ -93,14 +78,15 @@ sudo apt-get install libeigen3-dev libxml2-dev coinor-libipopt-dev qtbase5-dev q ~~~ ### Build -Once you installed the necessary dependencies, the iDynTree library can be compiled as any CMake based project. +Once you installed the necessary dependencies, the iDynTree library can be compiled as any CMake based project. In the following instructions, we indicate with `` where +you should add the platform specific options, as the use of `-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake` if you are using [vcpkg](https://github.com/Microsoft/vcpkg). With `make` facilities: ```bash $ git clone https://github.com/robotology/idyntree $ cd idyntree $ mkdir build && cd build -$ cmake .. +$ cmake .. $ make $ [sudo] make install ``` @@ -110,11 +96,12 @@ With IDE build tool facilities, such as Visual Studio or Xcode $ git clone https://github.com/robotology/idyntree $ cd idyntree $ mkdir build && cd build -$ cmake .. +$ cmake .. $ cmake --build . --target ALL_BUILD --config Release $ cmake --build . --target INSTALL --config Release ``` + If you need more help on how to build CMake-based projects, please check [CGold's First step](https://cgold.readthedocs.io/en/latest/first-step.html) section. In the rest of the documentation, `` will indicate the installation prefix in which you installed iDynTree, i.e. the value that you passed as [`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) during the CMake configuration. @@ -124,7 +111,7 @@ In the rest of the documentation, `` will indicate the installation pref Once the library is installed, you can link it using `CMake` with as little effort as writing the following line of code in your project's `CMakeLists.txt`: ```cmake ... -find_package(iDynTree 0.MINOR.PATCH REQUIRED) +find_package(iDynTree MAJOR.MINOR.PATCH REQUIRED) ... target_link_libraries( PRIVATE ${iDynTree_LIBRARIES}) ... @@ -138,14 +125,12 @@ See [CMake's reference documentation](https://cmake.org/cmake/help/latest/) if y ### Bindings To compile bindings to iDynTree in several scriping languages, you should enable them using the `IDYNTREE_USES_PYTHON`, `IDYNTREE_USES_LUA`, `IDYNTREE_USES_MATLAB`, `IDYNTREE_USES_OCTAVE` CMake options. -Several examples for using the bindings are available in https://github.com/robotology-playground/idyntree/blob/master/doc/geometric_classes.md . - Then, properly accessing bindings to iDynTree can require some additional steps. #### Python You should add to the `PYTHONPATH` enviromental variable the install path of the `iDynTree.py` file. ~~~ -export PYTHONPATH=$PYTHONPATH:/lib/python2.7/dist-packages/ +export PYTHONPATH=$PYTHONPATH:/lib/python../dist-packages/ ~~~ #### Python (pybind11) @@ -161,7 +146,7 @@ export PYTHONPATH=${PYTHONPATH}:/ ``` where `` corresponds to the value specified in `CMAKE_INSTALL_PREFIX` and `` is the Python installation prefix, as returned by - + ```python disutils.sysconfig.get_python_lib(1,0,prefix='') ``` @@ -175,7 +160,7 @@ import idyntree.pybind as iDynTree ``` -#### Matlab +#### MATLAB You should add to Matlab path the `/mex` directory. You can modify the relative location for Matlab bindings files in the installation prefix using the `IDYNTREE_INSTALL_MATLAB_LIBDIR` and `IDYNTREE_INSTALL_MATLAB_MFILESDIR` CMake options. @@ -184,7 +169,7 @@ You should add to Octave path the `/octave` directory. You can modify the relative location for Matlab bindings files in the installation prefix using the`IDYNTREE_INSTALL_OCTAVE_LIBDIR` and `IDYNTREE_INSTALL_OCTAVE_MFILESDIR` CMake options. -##### Matlab/Octave bindings modifications +##### MATLAB/Octave bindings modifications All the other bindings (Python,Lua, ...) are generated by SWIG and compiled on the fly by the user, by enabling the `IDYNTREE_USES_` option. The Matlab and Octave bindings are an exception because they rely on an experimental version of Swig, developed for providing Matlab bindings for the [casadi](https://github.com/casadi/casadi/wiki) project. For this reason, usually the Matlab bindigs @@ -195,18 +180,21 @@ for example because you modified some iDynTree classes, you can install the expe version of Swig with Matlab support from https://github.com/robotology-dependencies/swig/ (branch `matlab`) and then enable Matlab bindings generation with the `IDYNTREE_GENERATE_MATLAB` options. For more info on how to modify the matlab bindings, see https://github.com/robotology/idyntree/blob/master/doc/dev/faqs.md#how-to-add-wrap-a-new-class-or-function-with-swig . -##### Matlab/Octave high level wrappers +##### MATLAB/Octave high level wrappers They are a collection of Matlab/Octave functions that wraps the functionalities of (mainly) the iDyntree class `KinDynComputations` into functions with a typical Matlab/Octave interface. The purpose of the high-level wrappers is to provide a simpler and easy-to-use interface for Matlab/Octave users who want to use iDyntree inside Matlab/Octave, also helping in designing code which is less error-prone and easier to debug (e.g. in case the interface of an iDyntree function will change in the future). More details and a complete list of the wrappers can be found in the [wrappers README](/bindings/matlab/+iDynTreeWrappers/README.md). **Usage**: the wrappers package is installed together with the iDyntree bindings when compiling iDyntree with option `IDYNTREE_USES_MATLAB` or `IDYNTREE_USES_OCTAVE` set to `ON`. The functions can be called from Matlab/Octave using the namespace `iDynTreeWrappers`, i.e. `iDynTreeWrappers.name_of_the_corresponding_iDynTree_method`. ## Tutorials -| Topic | C++ | Matlab | Python | -|:------:|:---:|:------:|:------:| -| Use of the [ExtWrenchesAndJointTorquesEstimator class](https://robotology.github.io/idyntree/master/classiDynTree_1_1ExtWrenchesAndJointTorquesEstimator.html) for computing offset for FT sensors | NA | [examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m](examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m) | NA | -| How to get the axis of a revolute joint expressed in a arbitary frame using the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) | NA | [ examples/matlab/GetJointAxesInWorldFrame.m](examples/matlab/GetJointAxesInWorldFrame.m) | NA | -| How to use the [InverseKinematics class](https://robotology.github.io/docs/idyntree/master/classiDynTree_1_1InverseKinematics.html) for the IK of an industrial fixed-base manipulator. | [examples/InverseKinematics/README.md](examples/InverseKinematics/README.md) | NA | NA | - +| Topic | Location | Language | +|:------:|:--------:|:---------:| +| Basic usage of the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) together with the [Eigen] C++ Matrix library. | [examples/cxx/KinDynComputationsWithEigen/main.cpp](examples/cxx/KinDynComputationsWithEigen/main.cpp) | C++ | +| How to use the [InverseKinematics class](https://robotology.github.io/docs/idyntree/master/classiDynTree_1_1InverseKinematics.html) for the IK of an industrial fixed-base manipulator. | [examples/cxx/InverseKinematics/README.md](examples/cxx/InverseKinematics/README.md) | C++ | +| Use of the [ExtWrenchesAndJointTorquesEstimator class](https://robotology.github.io/idyntree/master/classiDynTree_1_1ExtWrenchesAndJointTorquesEstimator.html) for computing offset for FT sensors | [examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m](examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m) | MATLAB | +| How to get the axis of a revolute joint expressed in a arbitary frame using the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) | [examples/matlab/SensorsListParsing/SensorsListParsing.m](examples/matlab/SensorsListParsing/SensorsListParsing.m) | MATLAB | +| How to read the Six Axis Force Torque sensors information contained in a URDF model. | [examples/matlab/GetJointAxesInWorldFrame.m](examples/matlab/GetJointAxesInWorldFrame.m) | MATLAB | +| Usage of the MATLAB-native visualizer using the [MATLAB high-level wrappers](bindings/matlab/+iDynTreeWrappers/README.md). | [examples/matlab/iDynTreeWrappers/visualizeRobot.m](examples/matlab/iDynTreeWrappers/visualizeRobot.m) | MATLAB | +| Basic usage of the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html). | [examples/python/KinDynComputationsTutorial.py](examples/python/KinDynComputationsTutorial.py) | Python | Are you interested in a tutorial on a specific feature or algorithm? Just [request it on an enhancement issue](https://github.com/robotology/idyntree/issues/new). @@ -219,7 +207,7 @@ The documentation generated from the `devel` branch is available at the URL : [h Announcements on new releases, API changes or other news are done on [`robotology/QA` GitHub repository](https://github.com/robotology/QA). You can watch that repository to get all the iDynTree-related announcements, that will always tagged with the `announcement` tag. ## Developer Documentation -If you want to contribute to iDynTree development, please check the [Developer's FAQ](https://github.com/robotology/idyntree/blob/master/doc/dev/faqs.md). +If you want to contribute to iDynTree development, please check the [Developer's FAQ](doc/dev/faqs.md). ## Reference paper A paper describing some of the algorithms implemented in iDynTree and their use in a real world scenario can be downloaded [here](http://journal.frontiersin.org/article/10.3389/frobt.2015.00006/abstract) . diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 14f4742beae..8366c0ce74a 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,11 +1,10 @@ -# Copyright: 2015 Fondazione Istituto Italiano di Tecnologia -# Author: Silvio Traversaro -# CopyPolicy: Released under the terms of the GNU GPL v2.0. -# +# Copyright: 2020 Fondazione Istituto Italiano di Tecnologia +# CopyPolicy: Released under the terms of the MIT license -cmake_minimum_required(VERSION 2.8.11) -project("iDynTree_Examples") +cmake_minimum_required(VERSION 3.16) -add_subdirectory(KinDynComputationsWithEigen) +project(iDynTreeExamples) + +add_subdirectory(cxx) diff --git a/examples/cxx/CMakeLists.txt b/examples/cxx/CMakeLists.txt new file mode 100644 index 00000000000..09b46ca73e2 --- /dev/null +++ b/examples/cxx/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright: 2020 Fondazione Istituto Italiano di Tecnologia +# CopyPolicy: Released under the terms of the MIT license + +cmake_minimum_required(VERSION 3.16) + +project(iDynTreeExamples) + +add_subdirectory(KinDynComputationsWithEigen) +add_subdirectory(InverseKinematics) diff --git a/examples/InverseKinematics/CMakeLists.txt b/examples/cxx/InverseKinematics/CMakeLists.txt similarity index 100% rename from examples/InverseKinematics/CMakeLists.txt rename to examples/cxx/InverseKinematics/CMakeLists.txt diff --git a/examples/InverseKinematics/README.md b/examples/cxx/InverseKinematics/README.md similarity index 100% rename from examples/InverseKinematics/README.md rename to examples/cxx/InverseKinematics/README.md diff --git a/examples/InverseKinematics/iDynTreeExampleInverseKinematics.cpp b/examples/cxx/InverseKinematics/iDynTreeExampleInverseKinematics.cpp similarity index 100% rename from examples/InverseKinematics/iDynTreeExampleInverseKinematics.cpp rename to examples/cxx/InverseKinematics/iDynTreeExampleInverseKinematics.cpp diff --git a/examples/KinDynComputationsWithEigen/CMakeLists.txt b/examples/cxx/KinDynComputationsWithEigen/CMakeLists.txt similarity index 100% rename from examples/KinDynComputationsWithEigen/CMakeLists.txt rename to examples/cxx/KinDynComputationsWithEigen/CMakeLists.txt diff --git a/examples/KinDynComputationsWithEigen/main.cpp b/examples/cxx/KinDynComputationsWithEigen/main.cpp similarity index 99% rename from examples/KinDynComputationsWithEigen/main.cpp rename to examples/cxx/KinDynComputationsWithEigen/main.cpp index 203953eb517..cf7a1f39933 100644 --- a/examples/KinDynComputationsWithEigen/main.cpp +++ b/examples/cxx/KinDynComputationsWithEigen/main.cpp @@ -12,7 +12,7 @@ // C headers #include -// Eigen headers +// Eigen headers #include // iDynTree headers @@ -20,7 +20,7 @@ #include #include -// Helpers function to convert between +// Helpers function to convert between // iDynTree datastructures #include diff --git a/examples/fixedBaseGravityCompensation/CMakeLists.txt b/examples/fixedBaseGravityCompensation/CMakeLists.txt deleted file mode 100644 index be6f6518fb0..00000000000 --- a/examples/fixedBaseGravityCompensation/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright: 2015 Fondazione Istituto Italiano di Tecnologia -# Author: Silvio Traversaro -# CopyPolicy: Released under the terms of the GNU GPL v2.0. -# - -cmake_minimum_required(VERSION 2.8.11) - -project(fixedBaseGravityCompensation) - -find_package(YARP REQUIRED) -find_package(iDynTree REQUIRED) - -set(folder_source main.cpp) - -source_group("Source Files" FILES ${folder_source}) - -add_executable(${PROJECT_NAME} ${folder_source}) - -target_include_directories(${PROJECT_NAME} PUBLIC ${YARP_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} YARP::YARP_os YARP::YARP_math - ${iDynTree_LIBRARIES}) - - diff --git a/examples/fixedBaseGravityCompensation/aramis.urdf b/examples/fixedBaseGravityCompensation/aramis.urdf deleted file mode 100644 index 8df92aee978..00000000000 --- a/examples/fixedBaseGravityCompensation/aramis.urdf +++ /dev/null @@ -1,13398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/fixedBaseGravityCompensation/main.cpp b/examples/fixedBaseGravityCompensation/main.cpp deleted file mode 100644 index 83e6019f09a..00000000000 --- a/examples/fixedBaseGravityCompensation/main.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** -* @ingroup idyntree_tutorials -* -* -* A tutorial on how to the gravity compensation terms for a fixed -* base manipulator. -* -* \author Silvio Traversaro -* -* CopyPolicy: Released under the terms of GPL 2.0 or later -*/ - -// YARP headers -#include -#include - -// iDynTree headers -#include -#include - -#include -#include - -/*****************************************************************/ -int main(int argc, char *argv[]) -{ - // In this example we use yarp to parse the configuration - // parameters - yarp::os::ResourceFinder rf; - rf.setVerbose(true); - rf.setDefault("name","fixedBaseGravityCompensation"); - rf.setDefault("config","config.ini"); - rf.configure(argc,argv); - - if (rf.check("help")) - { - yInfo() << "Options:\n\n"; - yInfo() << "\t--urdf file: name of the URDF file containing" - " the model of the robot. \n"; - - return 0; - } - - std::string urdf_filename = rf.findFile("urdf"); - - - yInfo() << "Tryng to open " << urdf_filename << " as robot model"; - iCub::iDynTree::DynTree robot_model; - bool ok = robot_model.loadURDFModel(urdf_filename); - - if( !ok ) - { - std::cerr << "Loading urdf file " << urdf_filename << " failed, exiting" << std::endl; - return EXIT_FAILURE; - } - - // - // Now we will set the variable necessary to compute the gravity compensation terms - // - - // The gravity acceleration vector should be expressed in the base link frame, - // in this example we assume that this frame has the Z axis pointing up - // All the inputs are expressed in SI unit of measure, so the gravity acceleration - // is expressed in m/s^2 - yarp::sig::Vector grav(3); - grav(0) = grav(1) = 0.0; - grav(2) = -9.8; - - robot_model.setGravity(grav); - - // We now need to set the joint position for the desired gravity compensation - // For the sake of example, we will put all the joint positions to 10.0 degrees; - yarp::sig::Vector q(robot_model.getNrOfDOFs()); - - double deg2rad = 3.14/180.0; - - for(int i =0; i < q.size(); i++ ) - { - - q(i) = deg2rad*10.0; - } - - // Now we set the joint values - robot_model.setAng(q); - - // Now we can call the RNEA algorithm to compute the gravity torques - robot_model.kinematicRNEA(); - robot_model.dynamicRNEA(); - - // The obtained torques are expressed in Nm - yarp::sig::Vector gravity_torques = robot_model.getTorques(); - - // Output some result - std::cout << "Input gravity : " << grav.toString() << std::endl; - std::cout << "Input joint positions : " << robot_model.getAng().toString() << std::endl; - std::cout << "Output joint torques : " << gravity_torques.toString() << std::endl; - - - return EXIT_SUCCESS; -} - diff --git a/examples/icubArmRegressor/CMakeLists.txt b/examples/icubArmRegressor/CMakeLists.txt deleted file mode 100644 index 011d67ff3bb..00000000000 --- a/examples/icubArmRegressor/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright: 2015 Fondazione Istituto Italiano di Tecnologia -# Author: Silvio Traversaro -# CopyPolicy: Released under the terms of the GNU GPL v2.0. -# - -cmake_minimum_required(VERSION 2.8.11) - -project(icubArmRegressor) - -find_package(YARP REQUIRED) -find_package(iDynTree REQUIRED) - -SET(folder_source main.cpp) - -source_group("Source Files" FILES ${folder_source}) - -add_executable(${PROJECT_NAME} ${folder_source}) - -target_include_directories(${PROJECT_NAME} PUBLIC ${YARP_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} YARP::YARP_os YARP::YARP_math - ${iDynTree_LIBRARIES}) - - diff --git a/examples/icubArmRegressor/main.cpp b/examples/icubArmRegressor/main.cpp deleted file mode 100644 index 65eedad8e96..00000000000 --- a/examples/icubArmRegressor/main.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @ingroup idyntree_tutorials -* -* \defgroup icub_genericChainController Controller for a -* Generic Kinematic Chain -* -* A tutorial on how to obtain the parametric model for -* iCub arm FT sensor measurement. -* -* \author Silvio Traversaro -* -* CopyPolicy: Released under the terms of GPL 2.0 or later -*/ - -// YARP headers -#include -#include - -// iDynTree headers -#include - -#include - -/*****************************************************************/ -int main(int argc, char *argv[]) -{ - yarp::os::ResourceFinder rf; - rf.setVerbose(true); - rf.setDefault("name","icubArmRegressor"); - rf.setDefault("config","config.ini"); - rf.configure(argc,argv); - - if (rf.check("help")) - { - yInfo() << "Options:\n\n"; - yInfo() << "\t--urdf file: name of the URDF file containing" - " the model of the iCub (default: model.urdf). \n"; - - return 0; - } - - std::string urdf_filename = rf.findFile("urdf"); - - yInfo() << "icubArmRegressor: Tryng to open " << urdf_filename - << " as iCub model"; - - /** - * The dynamics regressor generator is a class for calculating arbitrary regressor - * related to robot dynamics, for identification of dynamics parameters, such - * as inertial parameters (masses, centers of mass, inertia tensor elements) or - * other related parameters (for example force/torque sensor offset). - */ - //KDL::CoDyCo::Regressors::DynamicRegressorGenerator ft_regressor_generator; - - return 0; - -} - diff --git a/examples/matlab/SensorsListParsing/SensorsListParsing.m b/examples/matlab/SensorsListParsing/SensorsListParsing.m index 8b8317b455e..938ce92b6d3 100644 --- a/examples/matlab/SensorsListParsing/SensorsListParsing.m +++ b/examples/matlab/SensorsListParsing/SensorsListParsing.m @@ -1,49 +1,52 @@ -% First we create the SensorsList object, -% that will be parsed from URDF +% First we create the SensorsList object, +% that will be parsed from URDF sensList = iDynTree.SensorsList(); % Secondly we load the structure of the sensors list % from URDF -iDynTree.sensorsListFromURDF('./icub.urdf',sensList); +mdlLoader = iDynTree.ModelLoader(); +mdlLoader.loadModelFromFile('./icub.urdf'); -% We can check the number of FT sensors loaded +sensList = mdlLoader.sensors(); + +% We can check the number of FT sensors loaded nrOfFTSensors = sensList.getNrOfSensors(iDynTree.SIX_AXIS_FORCE_TORQUE); fprintf('The loaded model has %d FT sensors\n',nrOfFTSensors) -% We can print the information relative to the sensors +% We can print the information relative to the sensors for sensIndex = 0:(nrOfFTSensors-1) - % Getting the sensor + % Getting the sensor FTSens = sensList.getSixAxisForceTorqueSensor(sensIndex); - + % Print info fprintf('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'); fprintf('Sensor %s has index %d\n',FTSens.getName(),sensIndex); fprintf(' is attached to joint %s\n',FTSens.getParent()); - + % Get the direction of the measure if( FTSens.getAppliedWrenchLink() == FTSens.getFirstLinkIndex() ) fprintf(' it measures the wrench that link %s is applying on link %s\n',FTSens.getSecondLinkName(),FTSens.getFirstLinkName()); else fprintf(' it measures the wrench that link %s is applying on link %s\n',FTSens.getFirstLinkName(),FTSens.getSecondLinkName()); end - + % We get the iDynTree:Transform between the sensor frame and the link frame (sensor_H_link) firstLink_H_sensor = iDynTree.Transform(); secondLink_H_sensor = iDynTree.Transform(); - + FTSens.getLinkSensorTransform(FTSens.getFirstLinkIndex(),firstLink_H_sensor); FTSens.getLinkSensorTransform(FTSens.getSecondLinkIndex(),secondLink_H_sensor); - + % Get the adjoint transformation as matlab matrix from iDynTree % and print it firstLink_X_sensor = firstLink_H_sensor.asAdjointTransform(); secondLink_X_sensor = secondLink_H_sensor.asAdjointTransform(); - + fprintf(' %s_X_sensor is (using linear-angular serialization): \n',FTSens.getFirstLinkName()) disp(firstLink_X_sensor.toMatlab()) fprintf(' %s_X_sensor is (using linear-angular serialization): \n',FTSens.getSecondLinkName()) disp(secondLink_X_sensor.toMatlab()) - + end diff --git a/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeMat.m b/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeMat.m deleted file mode 100644 index cf7f2ef475a..00000000000 --- a/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeMat.m +++ /dev/null @@ -1,18 +0,0 @@ -function [ matrix_idyntree ] = Matlab2iDynTreeMat( matrix_matlab ) -%Matlab2iDynTreeMat Convert an Matlab matrix to a iDynTree MatrixDynSize -% Temporary extremly slow function, proper support should -% be implemented at the C++ SWIG level. - -rows = size(matrix_matlab,1); -cols = size(matrix_matlab,2); - -matrix_idyntree = iDynTree.MatrixDynSize(rows,cols); - -for row = [0:(rows-1)] - for col = [0:(cols-1)] - matrix_idyntree.setVal(row,col,matrix_matlab(row+1,col+1)); - end -end - -end - diff --git a/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeVec.m b/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeVec.m deleted file mode 100644 index 3d17e0112d2..00000000000 --- a/examples/matlab/iCubLeftArmDynamicRegressors/Matlab2iDynTreeVec.m +++ /dev/null @@ -1,15 +0,0 @@ -function [ vector_idyntree ] = Matlab2iDynTreeVec( vector_matlab ) -%iDynTree2MatlabMatrix Convert an Matlab vector to a iDynTree VectorDynSize -% Temporary extremly slow function, proper support should -% be implemented at the C++ SWIG level. - -n = length(vector_matlab); - -vector_idyntree = iDynTree.VectorDynSize(n); - -for i = [0:(n-1)] - vector_idyntree.setVal(i,vector_matlab(i+1)); -end - -end - diff --git a/examples/matlab/iCubLeftArmDynamicRegressors/iCubLeftArmFTRegressor.m b/examples/matlab/iCubLeftArmDynamicRegressors/iCubLeftArmFTRegressor.m deleted file mode 100644 index 522e64d8aa0..00000000000 --- a/examples/matlab/iCubLeftArmDynamicRegressors/iCubLeftArmFTRegressor.m +++ /dev/null @@ -1,102 +0,0 @@ - -% First we create the regressor generator, -% the class to compute the dynamics regressors -regrGen = iDynTree.DynamicsRegressorGenerator(); - -% Secondly we load the structure of the robot -% (kinematic and inertial parameters) and the -% structure of the sensors from an URDF file -regrGen.loadRobotAndSensorsModelFromFile('icub.urdf'); - -% Then we load the structure of the regressor -regrXml = ['' ... - ' ' ... - ' r_upper_arm' ... - ' ' ... - ' r_wrist_1' ... - '']; -regrGen.loadRegressorStructureFromString(regrXml); - -% once we loaded the robot parameters and the regressor structure, -% we can use the regressor generator to get information about the -% generated regressor - -% Get the number of internal degrees of freedom of the considered robot -dof = regrGen.getNrOfDegreesOfFreedom() - -% Get the number of parameters of the regressor (most of them will be zero) -% TODO : put in the regressor only the relevant parameters -params = regrGen.getNrOfParameters() - -% Get the number of outputs of the regressor -% Given that we are considering only the base dynamics -% of a subtree, we will have just 6 outputs (3 force, 3 torques) -outs = regrGen.getNrOfOutputs() - -% We can now create the input for the regressor: -% joint position, velocities and acceleration -% and gravity acceleration at the base frame -% (you can get the base link with the regrGen.getBaseLink() method) - -% If you are unsure of the assumed serialization of the DOFs, you can use -% the regrGen.getDescriptionOfDegreesOfFreedom() method -qj = iDynTree.VectorDynSize(dof); -dqj = iDynTree.VectorDynSize(dof); -ddqj = iDynTree.VectorDynSize(dof); -gravity = iDynTree.SpatialAcc(); - -% Currently the smooth conversion between Matlab and iDynTree vector and -% matrices is still a TODO, so for now we have to rely on the setVal/getVal -% methods -gravity.setVal(0,0.0); -gravity.setVal(1,0.0); -gravity.setVal(2,-9.81); -gravity.setVal(3,0.0); -gravity.setVal(4,0.0); -gravity.setVal(5,0.0); - -% Here we should fill the q/dqj/ddqj with measured values - -% Note that we are using the "fixed base" version of setRobotState -regrGen.setRobotState(qj,dqj,ddqj,gravity); - -% TODO: set sensor values - -% Now we can compute the regressor -regressor = iDynTree.MatrixDynSize(outs,params); -knownTerms = iDynTree.VectorDynSize(outs); -cadParams = iDynTree.VectorDynSize(params); -identifiableSubspacesBasis = iDynTree.MatrixDynSize(); - -% We can get the current model parameters (probably extracted from CAD) -regrGen.getModelParameters(cadParams) - -% We want to set the measure for the `l_arm_ft_sensor` -sensorMeasure = iDynTree.Wrench(); -sensMatlab = [0.0,0.0,10.0,0.4,0.6,0.5]; -sensorMeasure.fromMatlab(sensMatlab); - -sensorIndex = ... - regrGen.getSensorsModel().getSensorIndex(iDynTree.SIX_AXIS_FORCE_TORQUE,'r_arm_ft_sensor'); -regrGen.getSensorsMeasurements().setMeasurement(iDynTree.SIX_AXIS_FORCE_TORQUE,sensorIndex,sensorMeasure); - -regrGen.computeRegressor(regressor,knownTerms); - -% We can then print the computed regressor -display(regressor) -display(knownTerms) - -% We can compute the base matrix, and then we can compute the base -% regressor -display('Computing identifiable subspace...') -regrGen.computeFixedBaseIdentifiableSubspace(identifiableSubspacesBasis); -display('Identifiable subspace computed.') - - -% For matrix operation it is better to convert iDynTree matrices in matlab -% ones -identifiableSubspacesBasis_m = identifiableSubspacesBasis.toMatlab(); -regressor_m = regressor.toMatlab(); -baseParametersRegressor = regressor_m*identifiableSubspacesBasis_m; - -baseParametersRegressor diff --git a/examples/matlab/iCubLeftArmDynamicRegressors/icub.urdf b/examples/matlab/iCubLeftArmDynamicRegressors/icub.urdf deleted file mode 100644 index f20f51a511c..00000000000 --- a/examples/matlab/iCubLeftArmDynamicRegressors/icub.urdf +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - diff --git a/examples/iDynTreeWrappers/visualizeRobot.m b/examples/matlab/iDynTreeWrappers/visualizeRobot.m similarity index 100% rename from examples/iDynTreeWrappers/visualizeRobot.m rename to examples/matlab/iDynTreeWrappers/visualizeRobot.m diff --git a/examples/python/dynamicsComputationTutorial.py b/examples/python/KinDynComputationsTutorial.py similarity index 100% rename from examples/python/dynamicsComputationTutorial.py rename to examples/python/KinDynComputationsTutorial.py diff --git a/examples/python/iCubLeftArmFTRegressor/iCubLeftArmFTRegressor.py b/examples/python/iCubLeftArmFTRegressor/iCubLeftArmFTRegressor.py deleted file mode 100644 index 3e81f008dae..00000000000 --- a/examples/python/iCubLeftArmFTRegressor/iCubLeftArmFTRegressor.py +++ /dev/null @@ -1,102 +0,0 @@ -import iDynTree -import numpy as np - -# First we create the regressor generator, -# the class to compute the dynamics regressors -regrGen = iDynTree.DynamicsRegressorGenerator(); - -# Secondly we load the structure of the robot -# (kinematic and inertial parameters) and the -# structure of the sensors from an URDF file -regrGen.loadRobotAndSensorsModelFromFile('icub.urdf'); - -# Then we load the structure of the regressor -regrXml = '' \ - ' ' \ - ' r_upper_arm' \ - ' ' \ - '' -regrGen.loadRegressorStructureFromString(regrXml); - -# once we loaded the robot parameters and the regressor structure, -# we can use the regressor generator to get information about the -# generated regressor - -# Get the number of internal degrees of freedom of the considered robot -dof = regrGen.getNrOfDegreesOfFreedom() - -# Get the number of parameters of the regressor (most of them will be zero) -# TODO : put in the regressor only the relevant parameters -params = regrGen.getNrOfParameters() - -# Get the number of outputs of the regressor -# Given that we are considering only the base dynamics -# of a subtree, we will have just 6 outputs (3 force, 3 torques) -outs = regrGen.getNrOfOutputs() - -# We can now create the input for the regressor: -# joint position, velocities and acceleration -# and gravity acceleration at the base frame -# (you can get the base link with the regrGen.getBaseLink() method) - -# If you are unsure of the assumed serialization of the DOFs, you can use -# the regrGen.getDescriptionOfDegreesOfFreedom() method -qj = iDynTree.VectorDynSize(dof); -dqj = iDynTree.VectorDynSize(dof); -ddqj = iDynTree.VectorDynSize(dof); -gravity = iDynTree.Twist(); - -# Currently the smooth conversion between Matlab and iDynTree vector and -# matrices is still a TODO, so for now we have to rely on the setVal/getVal -# methods -gravity.setVal(0,0.0); -gravity.setVal(1,0.0); -gravity.setVal(2,-9.81); - -# Here we should fill the q/dqj/ddqj with measured values - -# Note that we are using the "fixed base" version of setRobotState -regrGen.setRobotState(qj,dqj,ddqj,gravity); - -# TODO: set sensor values - -# Now we can compute the regressor -regressor = iDynTree.MatrixDynSize(outs,params); -knownTerms = iDynTree.VectorDynSize(outs); -cadParams = iDynTree.VectorDynSize(params); - -# We can get the current model parameters (probably extracted from CAD) -regrGen.getModelParameters(cadParams) - -# We want to set the measure for the `l_arm_ft_sensor` -sensorMeasure = iDynTree.Wrench(); -sensorMeasure.setVal(0,0.0); -sensorMeasure.setVal(1,0.0); -sensorMeasure.setVal(2,10.0); -sensorMeasure.setVal(3,0.4); -sensorMeasure.setVal(4,0.6); -sensorMeasure.setVal(5,0.5); - -sensorIndex = \ - regrGen.getSensorsModel().getSensorIndex(iDynTree.SIX_AXIS_FORCE_TORQUE,'r_arm_ft_sensor'); -regrGen.getSensorsMeasurements().setMeasurement(iDynTree.SIX_AXIS_FORCE_TORQUE,sensorIndex,sensorMeasure); - -regrGen.computeRegressor(regressor,knownTerms); - -# Convert data to numpy -A = np.fromstring(regressor.toString(), sep=' ').reshape(outs, params); -b = np.fromstring(knownTerms.toString(), sep=' '); -phi_cad = np.fromstring(cadParams.toString(), sep=' '); - -# predict sensor measurement using CAD inertial parameters -sensor_prediction_cad = np.dot(A, phi_cad); - -# We can then print the computed regressor -print "Regressor:" -print regressor.toString() -print "Known terms:" -print knownTerms.toString() -print "\nKnown terms predicted with cad parameters:" -print sensor_prediction_cad -print "\nCAD parameters:" -print cadParams.toString() diff --git a/examples/python/iCubLeftArmFTRegressor/icub.urdf b/examples/python/iCubLeftArmFTRegressor/icub.urdf deleted file mode 100644 index f20f51a511c..00000000000 --- a/examples/python/iCubLeftArmFTRegressor/icub.urdf +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - - - - child - child_to_parent - - 100 - 1 - - - diff --git a/examples/walkmanLimbJTSRegressor/main.cpp b/examples/walkmanLimbJTSRegressor/main.cpp deleted file mode 100644 index 15dc3ac1e5d..00000000000 --- a/examples/walkmanLimbJTSRegressor/main.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** -* @ingroup idyntree_tutorials -* -* -* A tutorial on how to obtain the parametric model for -* fixed base Walkman limb joint torque sensor measurement. -* -* \author Silvio Traversaro -* -* CopyPolicy: Released under the terms of GPL 2.0 or later -*/ - -// YARP headers -#include -#include - -// iDynTree headers -#include > -#include -#include - -#include -#include - -/*****************************************************************/ -int main(int argc, char *argv[]) -{ - // In this example we will use YARP only for parsing command line - // parameters - yarp::os::ResourceFinder rf; - rf.setVerbose(true); - rf.setDefault("name","walkmanLimbJTSRegressor"); - rf.setDefault("config","config.ini"); - rf.configure(argc,argv); - - if (rf.check("help")) - { - yInfo() << "Options:\n\n"; - yInfo() << "\t--urdf file: name of the URDF file containing" - " the model of the Walkman. \n"; - - return 0; - } - - std::string urdf_filename = rf.findFile("urdf"); - - yInfo() << "Tryng to open " << urdf_filename << " as Walkman model"; - - /** - * The dynamics regressor generator is a class for calculating arbitrary regressor - * related to robot dynamics, for identification of dynamics parameters, such - * as inertial parameters (masses, centers of mass, inertia tensor elements). - */ - - //For building the regressor generator, we need several inputs: - // * the model of the robot, given by the KDL::CoDyCo::UndirectedTree object - // * a model of the sensors of the robot, given by the KDL::CoDyCo::SensorsTree object - // (at this moment the SensorsTree supports only six-axis FT sensors, so it is not needed - // for joint torque sensors regressors) - // * a kinematic base (i.e. link for which the velocity/acceleration and the gravity are known: - // in this example we will leave the default one, i.e. the root of the robot) - // * the option for considering or not FT sensors offset in the parameter estimation - // (in this example we don't consider FT sensors, so we put this to false) - // * a list of "fake_links", for which no inertial parameters will be considered, useful for removing - // from the model "fake" links such as frames. - - - KDL::Tree walkman_tree; - if( !kdl_format_io::treeFromUrdfFile(urdf_filename,walkman_tree) ) - { - std::cerr << " Could not parse urdf robot model" << std::endl; - return EXIT_FAILURE; - } - - KDL::CoDyCo::UndirectedTree walkman_undirected_tree(walkman_tree); - - - KDL::CoDyCo::SensorsTree walkman_sensors_tree; - std::string kinematic_base = ""; - bool consider_ft_offsets = false; - std::vector< std::string > fake_links; - KDL::CoDyCo::Regressors::DynamicRegressorGenerator jts_regressor_generator(walkman_undirected_tree, - walkman_sensors_tree, - kinematic_base, - consider_ft_offsets, - fake_links); - - // We add the structure now: the list of joint torque sensors that we are considering - std::vector< std::string > jts_names; - - for(int jts = 0; jts < jts_names.size(); jts++ ) - { - jts_regressor_generator.addTorqueRegressorRows(jts_names[jts]); - } - - // Now we can print some information about the regressor - std::cout << "Regressor information: " << std::endl; - std::cout << "Outputs: " << std::endl; - std::cout << jts_regressor_generator.getDescriptionOfOutputs() << std::endl; - std::cout << "Parameters: " << std::endl; - std::cout << jts_regressor_generator.getDescriptionOfParameters() << std::endl; - - // We now have to set the robot state (in the fixed base case); - KDL::JntArray q(walkman_undirected_tree.getNrOfDOFs()); - KDL::JntArray dq(walkman_undirected_tree.getNrOfDOFs()); - KDL::JntArray ddq(walkman_undirected_tree.getNrOfDOFs()); - - // For this example we will consider all joint positions, velocities and accelerations to zero - KDL::SetToZero(q); - KDL::SetToZero(dq); - KDL::SetToZero(ddq); - - KDL::Vector gravity; - gravity(2) = -9.8; - - KDL::Twist gravity_twist(gravity,KDL::Vector::Zero()); - - jts_regressor_generator.setRobotState(q,dq,ddq,gravity_twist); - - // Now we can generate the actual regressor - Eigen::MatrixXd regressor(jts_regressor_generator.getNrOfOutputs(),jts_regressor_generator.getNrOfParameters()); - Eigen::VectorXd known_terms(jts_regressor_generator.getNrOfOutputs()); - jts_regressor_generator.computeRegressor(regressor,known_terms); - - return 0; - -} - From 31987f69ca5101c92cb809917fa8a4865b047a58 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 17 Nov 2020 10:17:46 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9b6f93f42b..26dc5d171cc 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ In the rest of the documentation, `` will indicate the installation pref Once the library is installed, you can link it using `CMake` with as little effort as writing the following line of code in your project's `CMakeLists.txt`: ```cmake ... -find_package(iDynTree MAJOR.MINOR.PATCH REQUIRED) +find_package(iDynTree REQUIRED) ... target_link_libraries( PRIVATE ${iDynTree_LIBRARIES}) ... @@ -188,7 +188,7 @@ They are a collection of Matlab/Octave functions that wraps the functionalities ## Tutorials | Topic | Location | Language | |:------:|:--------:|:---------:| -| Basic usage of the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) together with the [Eigen] C++ Matrix library. | [examples/cxx/KinDynComputationsWithEigen/main.cpp](examples/cxx/KinDynComputationsWithEigen/main.cpp) | C++ | +| Basic usage of the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) together with the [[Eigen](http://eigen.tuxfamily.org) C++ Matrix library. | [examples/cxx/KinDynComputationsWithEigen/main.cpp](examples/cxx/KinDynComputationsWithEigen/main.cpp) | C++ | | How to use the [InverseKinematics class](https://robotology.github.io/docs/idyntree/master/classiDynTree_1_1InverseKinematics.html) for the IK of an industrial fixed-base manipulator. | [examples/cxx/InverseKinematics/README.md](examples/cxx/InverseKinematics/README.md) | C++ | | Use of the [ExtWrenchesAndJointTorquesEstimator class](https://robotology.github.io/idyntree/master/classiDynTree_1_1ExtWrenchesAndJointTorquesEstimator.html) for computing offset for FT sensors | [examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m](examples/matlab/SixAxisFTOffsetEstimation/SixAxisFTOffsetEstimation.m) | MATLAB | | How to get the axis of a revolute joint expressed in a arbitary frame using the [KinDynComputations class](https://robotology.github.io/idyntree/master/classiDynTree_1_1KinDynComputations.html) | [examples/matlab/SensorsListParsing/SensorsListParsing.m](examples/matlab/SensorsListParsing/SensorsListParsing.m) | MATLAB | From 762f4995399ba8e9204a51467f09f58216b671f7 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 17 Nov 2020 10:30:16 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: Stefano Dafarra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26dc5d171cc..a7368fbbb8f 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ but you can manually make sure that iDynTree searches or ignores a given depende #### Install dependencies -If you need to install also `YARP` and `ICUB`, it is recommended that you install iDynTree via the the [`robotology-superbuild`](https://github.com/robotology/robotology-superbuild). If instead you are not interested in the `YARP` and `ICUB` integration, you can easily install the rest of the dependencies using +If you need to install also `YARP` and `ICUB`, it is recommended that you install iDynTree via the [`robotology-superbuild`](https://github.com/robotology/robotology-superbuild). If instead you are not interested in the `YARP` and `ICUB` integration, you can easily install the rest of the dependencies using standard package managers. ##### Windows From 225178fff2bf184db33e70c6d920961621671808 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 17 Nov 2020 10:31:33 +0100 Subject: [PATCH 4/4] Update CMakeLists.txt --- examples/cxx/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cxx/CMakeLists.txt b/examples/cxx/CMakeLists.txt index 09b46ca73e2..c04f033f9c6 100644 --- a/examples/cxx/CMakeLists.txt +++ b/examples/cxx/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16) -project(iDynTreeExamples) +project(iDynTreeCxxExamples) add_subdirectory(KinDynComputationsWithEigen) add_subdirectory(InverseKinematics)