Unverified Commit 09fdc614 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

Merge branch 'topic/devel' into topic/master

Merge current devel branch into master for continuous git history.
Only commits on branch devel have been kepts, devel branch being the most advanced one.
parents 9ab087d9 0962b9a7
......@@ -11,91 +11,79 @@ cache:
.robotpkg-pinocchio: &robotpkg-pinocchio
except:
- gh-pages
before_script:
- mkdir -p ccache
script:
- mkdir -p ccache
- cd /root/robotpkg/math/pinocchio
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make check
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
robotpkg-pinocchio-14.04:
robotpkg-pinocchio-14.04-release:
<<: *robotpkg-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/pinocchio:14.04
robotpkg-pinocchio-dubnium:
<<: *robotpkg-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/pinocchio:dubnium
robotpkg-pinocchio-16.04:
robotpkg-pinocchio-16.04-release:
<<: *robotpkg-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/pinocchio:16.04
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
robotpkg-pinocchio-18.04:
robotpkg-pinocchio-18.04-release:
<<: *robotpkg-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/pinocchio:18.04
.robotpkg-py-pinocchio: &robotpkg-py-pinocchio
except:
- gh-pages
before_script:
- mkdir -p ccache
script:
- mkdir -p ccache
- cd /root/robotpkg/math/py-pinocchio
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make check
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
robotpkg-py-pinocchio-14.04:
robotpkg-py-pinocchio-py3-18.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:14.04
robotpkg-py-pinocchio-dubnium:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:dubnium
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio-py3:18.04
robotpkg-py-pinocchio-16.04:
robotpkg-py-pinocchio-16.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:16.04
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
robotpkg-py-pinocchio-18.04:
robotpkg-py-pinocchio-18.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:18.04
robotpkg-py-pinocchio-py3-14.04:
robotpkg-py-pinocchio-py3-14.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio-py3:14.04
robotpkg-py-pinocchio-py3-dubnium:
robotpkg-py-pinocchio-14.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio-py3:dubnium
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:14.04
robotpkg-py-pinocchio-py3-16.04:
robotpkg-py-pinocchio-py3-16.04-release:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio-py3:16.04
robotpkg-py-pinocchio-py3-18.04:
doc-coverage:
<<: *robotpkg-py-pinocchio
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio-py3:18.04
image: eur0c.laas.fr:5000/stack-of-tasks/pinocchio/py-pinocchio:16.04
before_script:
- echo -e 'CXXFLAGS+= --coverage\nLDFLAGS+= --coverage\nPKG_DEFAULT_OPTIONS= debug' >> /opt/openrobots/etc/robotpkg.conf
after_script:
- cd /root/robotpkg/math/py-pinocchio
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
- mkdir -p ${CI_PROJECT_DIR}/coverage/
- gcovr -r .
- gcovr -r . --html --html-details -o ${CI_PROJECT_DIR}/coverage/index.html
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
- coverage/
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/minimal:14.04
RUN apt-get update && apt-get install -qqy doxygen robotpkg-hpp-fcl liburdfdom-dev && rm -rf /var/lib/apt/lists/*
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/minimal:16.04
RUN apt-get update && apt-get install -qqy doxygen robotpkg-hpp-fcl liburdfdom-dev && rm -rf /var/lib/apt/lists/*
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/minimal:zesty
RUN apt-get update && apt-get install -qqy doxygen robotpkg-hpp-fcl liburdfdom-dev && rm -rf /var/lib/apt/lists/*
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/robotpkg:14.04
RUN apt-get update -qqy && apt-get install -qqy \
ccache \
cmake \
g++ \
pkg-config \
libboost-test-dev \
libboost-filesystem-dev \
libeigen3-dev \
libpython-dev \
libboost-python-dev \
python-numpy \
robotpkg-eigenpy \
&& rm -rf /var/lib/apt/lists/*
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/robotpkg:16.04
RUN apt-get update -qqy && apt-get install -qqy \
ccache \
cmake \
g++ \
pkg-config \
libboost-test-dev \
libboost-filesystem-dev \
libeigen3-dev \
libpython-dev \
libboost-python-dev \
python-numpy \
robotpkg-eigenpy \
&& rm -rf /var/lib/apt/lists/*
FROM eur0c.laas.fr:4567/stack-of-tasks/pinocchio/robotpkg:zesty
RUN apt-get update -qqy && apt-get install -qqy \
ccache \
cmake \
g++ \
pkg-config \
libboost-test-dev \
libboost-filesystem-dev \
libeigen3-dev \
libpython-dev \
libboost-python-dev \
python-numpy \
robotpkg-eigenpy \
&& rm -rf /var/lib/apt/lists/*
FROM ubuntu:14.04
RUN echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub trusty robotpkg" > /etc/apt/sources.list.d/robotpkg.list
RUN apt-key adv --keyserver hkp://pgp.mit.edu --recv-key BC48D7C832FF7241
ENV OPENROB /opt/openrobots
ENV CMAKE_PREFIX_PATH $OPENROB:$CMAKE_PREFIX_PATH
ENV LD_LIBRARY_PATH $OPENROB/lib:$OPENROB/lib/plugin:$LD_LIBRARY_PATH
ENV PATH $OPENROB/bin:$OPENROB/sbin:$PATH
ENV PKG_CONFIG_PATH $OPENROB/lib/pkgconfig:$PKG_CONFIG_PATH
ENV PYTHONPATH $OPENROB/lib/python2.7/site-packages:$PYTHONPATH
ENV ROS_PACKAGE_PATH $OPENROB/share:$ROS_PACKAGE_PATH
FROM ubuntu:16.04
RUN echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub xenial robotpkg" > /etc/apt/sources.list.d/robotpkg.list
RUN apt-key adv --keyserver hkp://pgp.mit.edu --recv-key BC48D7C832FF7241
ENV OPENROB /opt/openrobots
ENV CMAKE_PREFIX_PATH $OPENROB:$CMAKE_PREFIX_PATH
ENV LD_LIBRARY_PATH $OPENROB/lib:$OPENROB/lib/plugin:$LD_LIBRARY_PATH
ENV PATH $OPENROB/bin:$OPENROB/sbin:$PATH
ENV PKG_CONFIG_PATH $OPENROB/lib/pkgconfig:$PKG_CONFIG_PATH
ENV PYTHONPATH $OPENROB/lib/python2.7/site-packages:$PYTHONPATH
ENV ROS_PACKAGE_PATH $OPENROB/share:$ROS_PACKAGE_PATH
FROM ubuntu:zesty
RUN apt-get update && apt-get install -qqy dirmngr && rm -rf /var/lib/apt/lists/*
RUN echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub zesty robotpkg" > /etc/apt/sources.list.d/robotpkg.list
RUN apt-key adv --keyserver hkp://pgp.mit.edu --recv-key BC48D7C832FF7241
ENV OPENROB /opt/openrobots
ENV CMAKE_PREFIX_PATH $OPENROB:$CMAKE_PREFIX_PATH
ENV LD_LIBRARY_PATH $OPENROB/lib:$OPENROB/lib/plugin:$LD_LIBRARY_PATH
ENV PATH $OPENROB/bin:$OPENROB/sbin:$PATH
ENV PKG_CONFIG_PATH $OPENROB/lib/pkgconfig:$PKG_CONFIG_PATH
ENV PYTHONPATH $OPENROB/lib/python2.7/site-packages:$PYTHONPATH
ENV ROS_PACKAGE_PATH $OPENROB/share:$ROS_PACKAGE_PATH
#!/bin/bash
set -e
for tag in 14.04 16.04 zesty
do
(
docker pull ubuntu:$tag
docker build -t eur0c.laas.fr:4567/stack-of-tasks/pinocchio/robotpkg:$tag -f Dockerfile.robotpkg.$tag .
docker push eur0c.laas.fr:4567/stack-of-tasks/pinocchio/robotpkg:$tag &
docker build -t eur0c.laas.fr:4567/stack-of-tasks/pinocchio/minimal:$tag -f Dockerfile.minimal.$tag .
docker push eur0c.laas.fr:4567/stack-of-tasks/pinocchio/minimal:$tag &
docker build -t eur0c.laas.fr:4567/stack-of-tasks/pinocchio/full:$tag -f Dockerfile.full.$tag .
docker push eur0c.laas.fr:4567/stack-of-tasks/pinocchio/full:$tag
) &
done
wait
......@@ -59,7 +59,6 @@ OPTION (BUILD_BENCHMARK "Build the benchmarks" OFF)
OPTION (BUILD_UNIT_TESTS "Build the unitary tests" ON)
OPTION (BUILD_UTILS "Build the utils" OFF)
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION (BUILD_TESTS_WITH_HPP "Build geom tests and benchmarks with hpp to do comparisons" OFF)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (BUILD_WITH_LUA_SUPPORT "Build the lua parser" OFF)
OPTION (BUILD_WITH_COMMIT_VERSION "Build libraries by setting specific commit version" OFF)
......@@ -81,22 +80,6 @@ ADD_OPTIONAL_DEPENDENCY("metapod >= 1.0.7")
ADD_OPTIONAL_DEPENDENCY("urdfdom >= 0.2.0")
ADD_OPTIONAL_DEPENDENCY("hpp-fcl >= 0.5.1")
# Spetcial care of Eigen3 greater than 3.2.10
IF(EIGEN3_FOUND)
IF(${EIGEN3_VERSION} VERSION_GREATER "3.2.10")
ADD_DEFINITIONS(-DEIGEN3_FUTURE)
SET(EIGEN3_FUTURE TRUE)
PKG_CONFIG_APPEND_CFLAGS("-DEIGEN3_FUTURE")
IF(${EIGEN3_VERSION} VERSION_LESS "3.3.0")
ADD_DEFINITIONS(-DEIGEN3_BETA_3_2_9x)
SET(EIGEN3_FUTURE TRUE)
PKG_CONFIG_APPEND_CFLAGS("-DEIGEN3_BETA_3_2_9x")
ENDIF(${EIGEN3_VERSION} VERSION_LESS "3.3.0")
ELSE(${EIGEN3_VERSION} VERSION_GREATER "3.2.10")
SET(EIGEN3_FUTURE FALSE)
ENDIF(${EIGEN3_VERSION} VERSION_GREATER "3.2.10")
ENDIF(EIGEN3_FOUND)
# Special care of urdfdom version
IF(URDFDOM_FOUND)
IF(${URDFDOM_VERSION} VERSION_LESS "0.3.0")
......@@ -144,7 +127,7 @@ SET(BOOST_OPTIONAL_COMPONENTS "")
IF(BUILD_PYTHON_INTERFACE)
SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS} python)
FINDPYTHON()
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
ENDIF(BUILD_PYTHON_INTERFACE)
SET(BOOST_COMPONENTS ${BOOST_REQUIERED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
......@@ -154,7 +137,7 @@ SEARCH_FOR_BOOST()
SET(CFLAGS_DEPENDENCIES)
# Path to boost headers
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
......@@ -167,22 +150,36 @@ SET(${PROJECT_NAME}_MATH_HEADERS
math/matrix.hpp
)
SET(${PROJECT_NAME}_TOOLS_HEADERS
tools/timer.hpp
tools/string-generator.hpp
tools/file-explorer.hpp
SET(${PROJECT_NAME}_UTILS_HEADERS
utils/axis-label.hpp
utils/timer.hpp
utils/string-generator.hpp
utils/file-explorer.hpp
utils/version.hpp
)
SET(${PROJECT_NAME}_SPATIAL_HEADERS
spatial/symmetric3.hpp
spatial/se3.hpp
spatial/motion.hpp
spatial/motion-base.hpp
spatial/motion-dense.hpp
spatial/motion-tpl.hpp
spatial/motion-ref.hpp
spatial/motion-zero.hpp
spatial/force.hpp
spatial/force-base.hpp
spatial/force-dense.hpp
spatial/force-tpl.hpp
spatial/force-ref.hpp
spatial/inertia.hpp
spatial/fwd.hpp
spatial/skew.hpp
spatial/act-on-set.hpp
spatial/act-on-set.hxx
spatial/explog.hpp
spatial/cartesian-axis.hpp
spatial/spatial-axis.hpp
)
SET(${PROJECT_NAME}_MULTIBODY_JOINT_HEADERS
......@@ -208,6 +205,11 @@ SET(${PROJECT_NAME}_MULTIBODY_JOINT_HEADERS
SET(${PROJECT_NAME}_MULTIBODY_LIEGROUP_HEADERS
multibody/liegroup/liegroup.hpp
multibody/liegroup/liegroup-algo.hpp
multibody/liegroup/liegroup-algo.hxx
multibody/liegroup/liegroup-variant.hpp
multibody/liegroup/liegroup-variant-visitors.hpp
multibody/liegroup/liegroup-variant-visitors.hxx
multibody/liegroup/operation-base.hpp
multibody/liegroup/operation-base.hxx
multibody/liegroup/vector-space.hpp
......@@ -223,14 +225,22 @@ SET(${PROJECT_NAME}_MULTIBODY_HEADERS
multibody/frame.hpp
multibody/model.hpp
multibody/model.hxx
multibody/data.hpp
multibody/data.hxx
multibody/visitor.hpp
)
SET(${PROJECT_NAME}_ALGORITHM_HEADERS
algorithm/aba.hpp
algorithm/aba.hxx
algorithm/aba-derivatives.hpp
algorithm/aba-derivatives.hxx
algorithm/centroidal.hpp
algorithm/centroidal.hxx
algorithm/rnea.hpp
algorithm/rnea.hxx
algorithm/rnea-derivatives.hpp
algorithm/rnea-derivatives.hxx
algorithm/crba.hpp
algorithm/crba.hxx
algorithm/finite-differences.hpp
......@@ -241,6 +251,8 @@ SET(${PROJECT_NAME}_ALGORITHM_HEADERS
algorithm/cholesky.hxx
algorithm/kinematics.hpp
algorithm/kinematics.hxx
algorithm/kinematics-derivatives.hpp
algorithm/kinematics-derivatives.hxx
algorithm/dynamics.hpp
algorithm/center-of-mass.hpp
algorithm/center-of-mass.hxx
......@@ -310,7 +322,7 @@ ENDIF(LUA5_FOUND)
SET(HEADERS
${${PROJECT_NAME}_MATH_HEADERS}
${${PROJECT_NAME}_TOOLS_HEADERS}
${${PROJECT_NAME}_UTILS_HEADERS}
${${PROJECT_NAME}_SPATIAL_HEADERS}
${${PROJECT_NAME}_MULTIBODY_JOINT_HEADERS}
${${PROJECT_NAME}_MULTIBODY_LIEGROUP_HEADERS}
......@@ -333,7 +345,7 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/liegro
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/lua")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/urdf")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/tools")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/utils")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/container")
......
......@@ -6,7 +6,9 @@ Pinocchio: a C++ library for efficient Rigid Multi-body Dynamics computations
[![Coverage Status](https://coveralls.io/repos/github/stack-of-tasks/pinocchio/badge.svg?branch=devel)](https://coveralls.io/github/stack-of-tasks/pinocchio?branch=devel)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/7824/badge.svg)](https://scan.coverity.com/projects/pinocchio)
**Pinocchio** instatiates state-of-the-art Rigid Body Algotithms for poly-articulated systems based on revisited Roy Featherstone's algorithms. It is first tailored for legged robotics applications, but it can be used in extra contextes.
**Pinocchio** instatiates state-of-the-art Rigid Body Algotithms for poly-articulated systems based on revisited Roy Featherstone's algorithms.
In addition, **Pinocchio** instantiates analytical derivatives of the main Rigid-Body Algorithms like the Recursive Newton-Euler Algorithms or the Articulated-Body Algorithm.
**Pinocchio** is first tailored for legged robotics applications, but it can be used in extra contextes.
It is built upon Eigen for linear algebra and FCL for collision detections. **Pinocchio** comes with a Python interface for fast code protyping.
**Pinocchio** is now at the hearth of various robotics softwares as the [Stack-of-Tasks](http://stack-of-tasks.github.io) or the [Humanoid Path Planner](https://humanoid-path-planner.github.io/hpp-doc).
......@@ -15,15 +17,18 @@ It is built upon Eigen for linear algebra and FCL for collision detections. **Pi
**Pinocchio** can be easily installed on various Linux and Unix distributions. Please refer to the [installation procedure](http://stack-of-tasks.github.io/pinocchio/download.html).
## Examples
We provide some basic examples on how to use **Pinocchio** in Python in the [examples/python](./examples/python/REAME.md) directory.
## Tutorials
**Pinocchio** is comming with a large bunch of tutorials aiming at introducting the basic tools for robotics control.
The content of the tutorials are described [here](http://projects.laas.fr/gepetto/index.php/Teach/Supaero2018) and the code source of these tutorials is located [here](https://github.com/stack-of-tasks/pinocchio-tutorials).
The content of the tutorials are described [here](http://projects.laas.fr/gepetto/index.php/Teach/Supaero2018) and the source code of these tutorials is located [here](https://github.com/stack-of-tasks/pinocchio-tutorials).
## Dependencies
The Pinocchio software depends on several packages which
have to be available on your machine.
**Pinocchio** depends on few additional packages which have to be available on your machine.
### Build dependencies
- cmake (version >= 2.6)
......@@ -48,7 +53,7 @@ have to be available on your machine.
## Citing Pinocchio
If you want to cite **Pinocchio** in your papers, please use the following bibtex line:
To cite **Pinocchio** in your academic research, please use the following bibtex line:
```
@misc{pinocchioweb,
author = {Justin Carpentier and Florian Valenza and Nicolas Mansard and others},
......@@ -57,6 +62,15 @@ If you want to cite **Pinocchio** in your papers, please use the following bibte
year = {2015--2018}
}
```
The algorithms for the analytical derivatives of rigid-body dynamics algorithms are detailed here:
```
@inproceedings{carpentier2018analytical,
title={Analytical Derivatives of Rigid Body Dynamics Algorithms},
author={Carpentier, Justin and Mansard, Nicolas},
booktitle={Robotics: Science and Systems},
year={2018}
}
```
## Questions
......
#
# Copyright (c) 2015-2016 CNRS
# Copyright (c) 2015-2018 CNRS
#
# This file is part of Pinocchio
# pinocchio is free software: you can redistribute it
......@@ -17,51 +17,54 @@
# ----------------------------------------------------
# --- BENCHMARK --------------------------------------
# ----------------------------------------------------
ADD_CUSTOM_TARGET(bench)
MACRO(ADD_BENCH bench_name)
IF(BUILD_BENCHMARK)
ADD_EXECUTABLE(${bench_name} ${bench_name}.cpp)
ELSE(BUILD_BENCHMARK)
ADD_EXECUTABLE(${bench_name} EXCLUDE_FROM_ALL ${bench_name}.cpp)
ENDIF(BUILD_BENCHMARK)
SET(ExtraMacroArgs ${ARGN})
LIST(LENGTH ExtraMacroArgs NumExtraMacroArgs)
IF(NumExtraMacroArgs GREATER 0)
SET(link_to_main_lib ${ARGV1})
IF(link_to_main_lib)
SET_TARGET_PROPERTIES(${bench_name} PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_SOURCE_DIR="${${PROJECT_NAME}_SOURCE_DIR}")
TARGET_LINK_LIBRARIES(${bench_name} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${bench_name} eigen3)
ENDIF(link_to_main_lib)
ENDIF()
ADD_DEPENDENCIES(bench ${bench_name})
ENDMACRO(ADD_BENCH)
MACRO(ADD_TEST_CFLAGS target flag)
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
# timings
#
ADD_BENCH(timings TRUE)
# timings
#
IF(BUILD_BENCHMARK)
ADD_EXECUTABLE(timings timings.cpp)
ELSE(BUILD_BENCHMARK)
ADD_EXECUTABLE(timings EXCLUDE_FROM_ALL timings.cpp)
ENDIF(BUILD_BENCHMARK)
TARGET_LINK_LIBRARIES (timings ${PROJECT_NAME})
SET_TARGET_PROPERTIES (timings PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_SOURCE_DIR="${${PROJECT_NAME}_SOURCE_DIR}")
ADD_BENCH(timings-cholesky TRUE)
# timings-eigen
# timings derivatives
#
IF(BUILD_BENCHMARK)
ADD_EXECUTABLE(timings-eigen timings-eigen.cpp)
ELSE(BUILD_BENCHMARK)
ADD_EXECUTABLE(timings-eigen EXCLUDE_FROM_ALL timings-eigen.cpp)
ENDIF(BUILD_BENCHMARK)
PKG_CONFIG_USE_DEPENDENCY(timings-eigen eigen3)
ADD_BENCH(timings-derivatives TRUE)
TARGET_LINK_LIBRARIES(timings-derivatives ${PROJECT_NAME})
# timings-eigen
#
ADD_BENCH(timings-eigen)
# geomTimings
# timings-geometry
#
IF(URDFDOM_FOUND AND HPP_FCL_FOUND)
IF(BUILD_BENCHMARK)
ADD_EXECUTABLE(geomTimings timings-geometry.cpp)
ELSE(BUILD_BENCHMARK)
ADD_EXECUTABLE(geomTimings EXCLUDE_FROM_ALL timings-geometry.cpp)
ENDIF(BUILD_BENCHMARK)
IF(BUILD_TESTS_WITH_HPP)
ADD_OPTIONAL_DEPENDENCY("hpp-model-urdf")
IF(HPP_MODEL_URDF_FOUND)
PKG_CONFIG_USE_DEPENDENCY(geomTimings hpp-model-urdf)
ADD_TEST_CFLAGS(geomTimings "-DWITH_HPP_MODEL_URDF")
ENDIF(HPP_MODEL_URDF_FOUND)
ENDIF(BUILD_TESTS_WITH_HPP)
TARGET_LINK_LIBRARIES (geomTimings ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(geomTimings hpp-fcl)
SET_TARGET_PROPERTIES (geomTimings PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_SOURCE_DIR="${${PROJECT_NAME}_SOURCE_DIR}")
ADD_BENCH(timings-geometry TRUE)
PKG_CONFIG_USE_DEPENDENCY(timings-geometry hpp-fcl)
ENDIF(URDFDOM_FOUND AND HPP_FCL_FOUND)
//
// Copyright (c) 2018 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#include "pinocchio/spatial/fwd.hpp"
#include "pinocchio/spatial/se3.hpp"
#include "pinocchio/multibody/visitor.hpp"
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
#include "pinocchio/algorithm/crba.hpp"
#include "pinocchio/algorithm/aba.hpp"
#include "pinocchio/algorithm/cholesky.hpp"
#include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/parsers/sample-models.hpp"
#include <iostream>
#include "pinocchio/utils/timer.hpp"
#include <Eigen/StdVector>
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::VectorXd)
int main(int argc, const char ** argv)
{
using namespace Eigen;
using namespace se3;
PinocchioTicToc timer(PinocchioTicToc::US);
#ifdef NDEBUG
const int NBT = 1000*100;
#else
const int NBT = 1;
std::cout << "(the time score in debug mode is not relevant) " << std::endl;
#endif
se3::Model model;
std::string filename = PINOCCHIO_SOURCE_DIR"/models/simple_humanoid.urdf";
if(argc>1) filename = argv[1];
if( filename == "HS")
se3::buildModels::humanoidSimple(model,true);
else if( filename == "H2" )
se3::buildModels::humanoid2d(model);
else
se3::urdf::buildModel(filename,JointModelFreeFlyer(),model);
std::cout << "nq = " << model.nq << std::endl;
se3::Data data(model);
VectorXd q = VectorXd::Random(model.nq);
VectorXd qdot = VectorXd::Random(model.nv);
VectorXd qddot = VectorXd::Random(model.nv);
MatrixXd A(model.nv,model.nv), B(model.nv,model.nv);
A.setZero(); B.setRandom();
std::vector<VectorXd> qs (NBT);
std::vector<VectorXd> lhs (NBT);
std::vector<VectorXd> rhs (NBT);
for(size_t i=0;i<NBT;++i)
{
qs[i] = Eigen::VectorXd::Random(model.nq);
lhs[i] = Eigen::VectorXd::Zero(model.nv);
rhs[i] = Eigen::VectorXd::Random(model.nv);
}
double total = 0;
SMOOTH(NBT)
{
crba(model,data,qs[_smooth]);
timer.tic();
cholesky::decompose(model,data);
total += timer.toc(timer.DEFAULT_UNIT);
}