Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit d3360e7

Browse files
committed
format
1 parent a3dd0f4 commit d3360e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1811
-1080
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before_install:
2121
- sudo sh -c "echo \"deb http://robotpkg.openrobots.org/packages/debian/pub precise robotpkg\" >> /etc/apt/sources.list "
2222
- curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
2323
- sudo apt-get update -qq
24-
- sudo apt-get install -qq doxygen doxygen-latex libboost-all-dev libeigen3-dev liblapack-dev libblas-dev gfortran python-dev
24+
- sudo apt-get install -qq doxygen doxygen-latex libboost-all-dev libeigen3-dev liblapack-dev libblas-dev gfortran python-dev
2525
python-sphinx python-numpy libtinyxml-dev robotpkg-console-bridge robotpkg-urdfdom-headers robotpkg-urdfdom robotpkg-eigenpy
2626
- sudo pip install cpp-coveralls
2727
language: cpp

AUTHORS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This package was written by and with the assistance of:
22

33
* Francois Bleibel [email protected]
4-
* François Keith [email protected]
5-
* Nicolas Mansard [email protected]
4+
* François Keith [email protected]
5+
* Nicolas Mansard [email protected]
66
* Olivier Stasse [email protected]
77
* Thomas Moulard [email protected]

CMakeLists.txt

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
11
# Copyright 2010, François Bleibel, Olivier Stasse, JRL, CNRS/AIST
22

3-
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
3+
cmake_minimum_required(VERSION 3.1)
44

55
# Project properties
6-
SET(PROJECT_ORG stack-of-tasks)
7-
SET(PROJECT_NAME sot-dynamic-pinocchio)
8-
SET(PROJECT_DESCRIPTION "pinocchio bindings for dynamic-graph.")
9-
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
6+
set(PROJECT_ORG stack-of-tasks)
7+
set(PROJECT_NAME sot-dynamic-pinocchio)
8+
set(PROJECT_DESCRIPTION "pinocchio bindings for dynamic-graph.")
9+
set(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
1010

1111
# Project options
12-
OPTION(BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
13-
OPTION(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python bindings" OFF)
14-
OPTION(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
12+
option(BUILD_PYTHON_INTERFACE "Build the python bindings" ON)
13+
option(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python bindings" OFF)
14+
option(SUFFIX_SO_VERSION "Suffix library name with its version" ON)
1515

1616
# Project configuration
17-
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
18-
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
19-
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
20-
SET(CUSTOM_HEADER_DIR "sot/dynamic-pinocchio")
21-
SET(CXX_DISABLE_WERROR TRUE)
22-
SET(DOXYGEN_USE_MATHJAX YES)
17+
if(NOT INSTALL_PYTHON_INTERFACE_ONLY)
18+
set(PROJECT_USE_CMAKE_EXPORT TRUE)
19+
endif(NOT INSTALL_PYTHON_INTERFACE_ONLY)
20+
set(CUSTOM_HEADER_DIR "sot/dynamic-pinocchio")
21+
set(CXX_DISABLE_WERROR TRUE)
22+
set(DOXYGEN_USE_MATHJAX YES)
2323

2424
# JRL-cmakemodule setup
25-
INCLUDE(cmake/base.cmake)
26-
INCLUDE(cmake/boost.cmake)
27-
INCLUDE(cmake/lapack.cmake)
28-
INCLUDE(cmake/python.cmake)
25+
include(cmake/base.cmake)
26+
include(cmake/boost.cmake)
27+
include(cmake/lapack.cmake)
28+
include(cmake/python.cmake)
2929

3030
# Project definition
31-
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
32-
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
31+
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
32+
project(${PROJECT_NAME} ${PROJECT_ARGS})
3333

3434
# Project dependencies
35-
ADD_PROJECT_DEPENDENCY(sot-tools REQUIRED)
36-
37-
IF(BUILD_TESTING)
38-
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)
39-
ADD_PROJECT_DEPENDENCY(example-robot-data 3.8.0 REQUIRED)
40-
ENDIF(BUILD_TESTING)
41-
42-
IF(BUILD_PYTHON_INTERFACE)
43-
FINDPYTHON()
44-
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
45-
STRING(REGEX REPLACE "-" "_" PYTHON_DIR ${CUSTOM_HEADER_DIR})
46-
ADD_PROJECT_DEPENDENCY(dynamic-graph-python 4.0.0 REQUIRED)
47-
48-
IF(Boost_VERSION GREATER 107299)
49-
# Silence a warning about a deprecated use of boost bind by boost python
50-
# at least fo boost 1.73 to 1.75
51-
ADD_DEFINITIONS(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
52-
ENDIF()
53-
ENDIF(BUILD_PYTHON_INTERFACE)
35+
add_project_dependency(sot-tools REQUIRED)
36+
37+
if(BUILD_TESTING)
38+
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
39+
add_project_dependency(example-robot-data 3.8.0 REQUIRED)
40+
endif(BUILD_TESTING)
41+
42+
if(BUILD_PYTHON_INTERFACE)
43+
findpython()
44+
search_for_boost_python(REQUIRED)
45+
string(REGEX REPLACE "-" "_" PYTHON_DIR ${CUSTOM_HEADER_DIR})
46+
add_project_dependency(dynamic-graph-python 4.0.0 REQUIRED)
47+
48+
if(Boost_VERSION GREATER 107299)
49+
# Silence a warning about a deprecated use of boost bind by boost python at
50+
# least fo boost 1.73 to 1.75
51+
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
52+
endif()
53+
endif(BUILD_PYTHON_INTERFACE)
5454

5555
# Main Library
56-
SET(${PROJECT_NAME}_HEADERS
57-
include/${CUSTOM_HEADER_DIR}/dynamic-pinocchio.h
58-
include/${CUSTOM_HEADER_DIR}/integrator-force-exact.h
59-
include/${CUSTOM_HEADER_DIR}/zmpreffromcom.h
60-
include/${CUSTOM_HEADER_DIR}/integrator-force.h
61-
include/${CUSTOM_HEADER_DIR}/force-compensation.h
62-
include/${CUSTOM_HEADER_DIR}/mass-apparent.h
63-
include/${CUSTOM_HEADER_DIR}/waist-attitude-from-sensor.h
64-
include/${CUSTOM_HEADER_DIR}/matrix-inertia.h
65-
include/${CUSTOM_HEADER_DIR}/integrator-force-rk4.h
66-
include/${CUSTOM_HEADER_DIR}/angle-estimator.h
67-
)
68-
69-
SET(${PROJECT_NAME}_SOURCES
70-
src/sot-dynamic-pinocchio
71-
)
72-
73-
ADD_LIBRARY(${PROJECT_NAME} SHARED
74-
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
75-
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
76-
TARGET_LINK_LIBRARIES(${PROJECT_NAME} sot-core::sot-core)
77-
78-
IF(SUFFIX_SO_VERSION)
79-
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
80-
ENDIF(SUFFIX_SO_VERSION)
81-
82-
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
83-
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
84-
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
85-
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
86-
87-
ADD_SUBDIRECTORY(src)
88-
IF(BUILD_TESTING)
89-
ADD_SUBDIRECTORY(tests)
90-
ENDIF(BUILD_TESTING)
56+
set(${PROJECT_NAME}_HEADERS
57+
include/${CUSTOM_HEADER_DIR}/dynamic-pinocchio.h
58+
include/${CUSTOM_HEADER_DIR}/integrator-force-exact.h
59+
include/${CUSTOM_HEADER_DIR}/zmpreffromcom.h
60+
include/${CUSTOM_HEADER_DIR}/integrator-force.h
61+
include/${CUSTOM_HEADER_DIR}/force-compensation.h
62+
include/${CUSTOM_HEADER_DIR}/mass-apparent.h
63+
include/${CUSTOM_HEADER_DIR}/waist-attitude-from-sensor.h
64+
include/${CUSTOM_HEADER_DIR}/matrix-inertia.h
65+
include/${CUSTOM_HEADER_DIR}/integrator-force-rk4.h
66+
include/${CUSTOM_HEADER_DIR}/angle-estimator.h)
67+
68+
set(${PROJECT_NAME}_SOURCES src/sot-dynamic-pinocchio)
69+
70+
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}
71+
${${PROJECT_NAME}_HEADERS})
72+
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
73+
target_link_libraries(${PROJECT_NAME} sot-core::sot-core)
74+
75+
if(SUFFIX_SO_VERSION)
76+
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
77+
endif(SUFFIX_SO_VERSION)
78+
79+
if(NOT INSTALL_PYTHON_INTERFACE_ONLY)
80+
install(
81+
TARGETS ${PROJECT_NAME}
82+
EXPORT ${TARGETS_EXPORT_NAME}
83+
DESTINATION lib)
84+
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
85+
endif(NOT INSTALL_PYTHON_INTERFACE_ONLY)
86+
87+
add_subdirectory(src)
88+
if(BUILD_TESTING)
89+
add_subdirectory(tests)
90+
endif(BUILD_TESTING)

doc/additionalDoc/package.hh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
/** \mainpage
1111
\section sot_dynamic_section_introduction Introduction
1212
13-
The sot-dynamic package is a bridge between the stack of tasks framework and the dynamicsJRLJapan library.
14-
It provides an inverse dynamic model of the robot through dynamic-graph entities.
15-
More precisely it wraps the newton euler algorithm implemented by the dynamicsJRLJapan library
16-
to make it accessible for the stack of tasks controllers
17-
(in the Stack of Tasks Framework as defined in \ref Mansard2007.)
13+
The sot-dynamic package is a bridge between the stack of tasks framework and the
14+
dynamicsJRLJapan library. It provides an inverse dynamic model of the robot
15+
through dynamic-graph entities. More precisely it wraps the newton euler
16+
algorithm implemented by the dynamicsJRLJapan library to make it accessible for
17+
the stack of tasks controllers (in the Stack of Tasks Framework as defined in
18+
\ref Mansard2007.)
1819
1920
This package depends on the following packages:
2021
\li dynamicsJRLJapan
@@ -27,9 +28,10 @@ install these packages at https://github.com/jrl-umi3218.
2728
2829
\section python_bindings Python bindings
2930
30-
As most packages based on the dynamic-graph framework (see https://github.com/jrl-umi3218/dynamic-graph),
31-
the functionnality is exposed through entities. Hence python sub-modules of dynamic_graph are generated. See <a
32-
href="../sphinx-html/index.html">sphinx documentation</a> for more details.
31+
As most packages based on the dynamic-graph framework (see
32+
https://github.com/jrl-umi3218/dynamic-graph), the functionnality is exposed
33+
through entities. Hence python sub-modules of dynamic_graph are generated. See
34+
<a href="../sphinx-html/index.html">sphinx documentation</a> for more details.
3335
3436
The following entities are created by this package:\n
3537
(all entites are placed in the namespace sot::)
@@ -41,7 +43,8 @@ The following entities are created by this package:\n
4143
\li sot::IntegratorForce
4244
\li sot::AngleEstimator
4345
\li sot::WaistAttitudeFromSensor
44-
\li sot::Dynamic - provides the inverse dynamics computations for of a humanoid robot
46+
\li sot::Dynamic - provides the inverse dynamics computations for of a humanoid
47+
robot
4548
4649
See each entity's documentation page for more information (when available).
4750

include/sot/dynamic-pinocchio/angle-estimator.h

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <dynamic-graph/entity.h>
3535
#include <dynamic-graph/signal-ptr.h>
3636
#include <dynamic-graph/signal-time-dependent.h>
37+
3738
#include <sot/core/matrix-geometry.hh>
3839

3940
/* STD */
@@ -56,34 +57,52 @@ class SOTANGLEESTIMATOR_EXPORT AngleEstimator : public dg::Entity {
5657
AngleEstimator(const std::string& name);
5758
virtual ~AngleEstimator(void);
5859

59-
public: /* --- SIGNAL --- */
60-
dg::SignalPtr<MatrixRotation, int> sensorWorldRotationSIN; // estimate(worldRc)
61-
dg::SignalPtr<MatrixHomogeneous, int> sensorEmbeddedPositionSIN; // waistRchest
62-
dg::SignalPtr<MatrixHomogeneous, int> contactWorldPositionSIN; // estimate(worldRf)
63-
dg::SignalPtr<MatrixHomogeneous, int> contactEmbeddedPositionSIN; // waistRleg
64-
dg::SignalTimeDependent<dynamicgraph::Vector, int> anglesSOUT; // [ flex1 flex2 yaw_drift ]
65-
dg::SignalTimeDependent<MatrixRotation, int> flexibilitySOUT; // footRleg
66-
dg::SignalTimeDependent<MatrixRotation, int> driftSOUT; // Ryaw = worldRc est(wRc)^-1
67-
dg::SignalTimeDependent<MatrixRotation, int> sensorWorldRotationSOUT; // worldRc
68-
dg::SignalTimeDependent<MatrixRotation, int> waistWorldRotationSOUT; // worldRwaist
69-
dg::SignalTimeDependent<MatrixHomogeneous, int> waistWorldPositionSOUT; // worldMwaist
70-
dg::SignalTimeDependent<dynamicgraph::Vector, int> waistWorldPoseRPYSOUT; // worldMwaist
60+
public: /* --- SIGNAL --- */
61+
dg::SignalPtr<MatrixRotation, int>
62+
sensorWorldRotationSIN; // estimate(worldRc)
63+
dg::SignalPtr<MatrixHomogeneous, int>
64+
sensorEmbeddedPositionSIN; // waistRchest
65+
dg::SignalPtr<MatrixHomogeneous, int>
66+
contactWorldPositionSIN; // estimate(worldRf)
67+
dg::SignalPtr<MatrixHomogeneous, int>
68+
contactEmbeddedPositionSIN; // waistRleg
69+
dg::SignalTimeDependent<dynamicgraph::Vector, int>
70+
anglesSOUT; // [ flex1 flex2 yaw_drift ]
71+
dg::SignalTimeDependent<MatrixRotation, int> flexibilitySOUT; // footRleg
72+
dg::SignalTimeDependent<MatrixRotation, int>
73+
driftSOUT; // Ryaw = worldRc est(wRc)^-1
74+
dg::SignalTimeDependent<MatrixRotation, int>
75+
sensorWorldRotationSOUT; // worldRc
76+
dg::SignalTimeDependent<MatrixRotation, int>
77+
waistWorldRotationSOUT; // worldRwaist
78+
dg::SignalTimeDependent<MatrixHomogeneous, int>
79+
waistWorldPositionSOUT; // worldMwaist
80+
dg::SignalTimeDependent<dynamicgraph::Vector, int>
81+
waistWorldPoseRPYSOUT; // worldMwaist
7182

7283
dg::SignalPtr<dynamicgraph::Matrix, int> jacobianSIN;
7384
dg::SignalPtr<dynamicgraph::Vector, int> qdotSIN;
7485
dg::SignalTimeDependent<dynamicgraph::Vector, int> xff_dotSOUT;
7586
dg::SignalTimeDependent<dynamicgraph::Vector, int> qdotSOUT;
7687

7788
public: /* --- FUNCTIONS --- */
78-
dynamicgraph::Vector& computeAngles(dynamicgraph::Vector& res, const int& time);
79-
MatrixRotation& computeFlexibilityFromAngles(MatrixRotation& res, const int& time);
89+
dynamicgraph::Vector& computeAngles(dynamicgraph::Vector& res,
90+
const int& time);
91+
MatrixRotation& computeFlexibilityFromAngles(MatrixRotation& res,
92+
const int& time);
8093
MatrixRotation& computeDriftFromAngles(MatrixRotation& res, const int& time);
81-
MatrixRotation& computeSensorWorldRotation(MatrixRotation& res, const int& time);
82-
MatrixRotation& computeWaistWorldRotation(MatrixRotation& res, const int& time);
83-
MatrixHomogeneous& computeWaistWorldPosition(MatrixHomogeneous& res, const int& time);
84-
dynamicgraph::Vector& computeWaistWorldPoseRPY(dynamicgraph::Vector& res, const int& time);
85-
dynamicgraph::Vector& compute_xff_dotSOUT(dynamicgraph::Vector& res, const int& time);
86-
dynamicgraph::Vector& compute_qdotSOUT(dynamicgraph::Vector& res, const int& time);
94+
MatrixRotation& computeSensorWorldRotation(MatrixRotation& res,
95+
const int& time);
96+
MatrixRotation& computeWaistWorldRotation(MatrixRotation& res,
97+
const int& time);
98+
MatrixHomogeneous& computeWaistWorldPosition(MatrixHomogeneous& res,
99+
const int& time);
100+
dynamicgraph::Vector& computeWaistWorldPoseRPY(dynamicgraph::Vector& res,
101+
const int& time);
102+
dynamicgraph::Vector& compute_xff_dotSOUT(dynamicgraph::Vector& res,
103+
const int& time);
104+
dynamicgraph::Vector& compute_qdotSOUT(dynamicgraph::Vector& res,
105+
const int& time);
87106

88107
public: /* --- PARAMS --- */
89108
void fromSensor(const bool& fs) { fromSensor_ = fs; }

0 commit comments

Comments
 (0)