Unverified Commit e37ac7fe authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #503 from jcarpent/topic/release

Uniformization of git history between master and devel branches
parents 4947e157 f12f92dc
......@@ -21,6 +21,7 @@ INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/ide.cmake)
INCLUDE(cmake/test.cmake)
SET(PROJECT_NAME pinocchio)
SET(PROJECT_DESCRIPTION "Rigid multi body dynamics algorithms")
......@@ -68,6 +69,12 @@ IF (INITIALIZE_WITH_NAN)
ADD_DEFINITIONS(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
ENDIF (INITIALIZE_WITH_NAN)
IF(BUILD_UNIT_TESTS)
SET(DISABLE_TESTS OFF)
ELSE(BUILD_UNIT_TESTS)
SET(DISABLE_TESTS ON)
ENDIF(BUILD_UNIT_TESTS)
MACRO(TAG_LIBRARY_VERSION target)
SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDMACRO(TAG_LIBRARY_VERSION)
......
......@@ -67,7 +67,7 @@ class RobotWrapper(object):
self.collision_data = None
self.visual_data = None
if verbose:
print 'Info: the Geometry Module has not been compiled with Pinocchio. No geometry model and data have been built.'
print('Info: the Geometry Module has not been compiled with Pinocchio. No geometry model and data have been built.')
else:
if self.collision_model is None:
self.collision_data = None
......@@ -137,6 +137,11 @@ class RobotWrapper(object):
se3.forwardKinematics(self.model, self.data, q, v)
return self.data.v[index]
def acceleration(self, q, v, a, index, update_kinematics=True):
if update_kinematics:
se3.forwardKinematics(self.model, self.data, q, v, a)
return self.data.a[index]
def framePosition(self, q, index, update_kinematics=True):
if update_kinematics:
se3.forwardKinematics(self.model, self.data, q)
......@@ -151,11 +156,6 @@ class RobotWrapper(object):
parentJointVel = self.data.v[frame.parent]
return frame.placement.actInv(parentJointVel)
def acceleration(self, q, v, a, index, update_kinematics=True):
if update_kinematics:
se3.forwardKinematics(self.model, self.data, q, v, a)
return self.data.a[index]
def frameAcceleration(self, q, v, a, index, update_kinematics=True):
if update_kinematics:
se3.forwardKinematics(self.model, self.data, q, v, a)
......
Subproject commit 8746a86f5b885f0bc73bb2c0651ddbc80c098420
Subproject commit 52d25e05c3b5dfd70c79b3e75787fdc78c6f695e
import pinocchio as pin
from pinocchio.romeo_wrapper import RomeoWrapper
DISPLAY = False
## Load Romeo with RomeoWrapper
import os
current_path = os.getcwd()
# The model of Romeo is contained in the path PINOCCHIO_GIT_REPOSITORY/models/romeo
model_path = current_path + "/" + "../../models/romeo"
mesh_dir = model_path
urdf_filename = "romeo_small.urdf"
urdf_model_path = model_path + "/romeo_description/urdf/" + urdf_filename
robot = RomeoWrapper(urdf_model_path, [mesh_dir])
## alias
model = robot.model
data = robot.data
## do whatever, e.g. compute the center of mass position in the world frame
q0 = robot.q0
com = robot.com(q0)
# This last command is similar to
com2 = pin.centerOfMass(model,data,q0)
## load model into gepetto-gui
if DISPLAY:
import gepetto.corbaserver
cl = gepetto.corbaserver.Client()
gui = cl.gui
if gui.nodeExists("world"):
gui.deleteNode("world","ON")
robot.initDisplay(loadModel=False)
robot.loadDisplayModel("pinocchio")
robot.display(robot.q0)
gui = robot.viewer.gui
......@@ -23,12 +23,8 @@ MACRO(ADD_TEST_CFLAGS target flag)
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
MACRO(ADD_UNIT_TEST NAME PKGS)
IF (BUILD_UNIT_TESTS)
ADD_EXECUTABLE(${NAME} ${NAME})
ELSE (BUILD_UNIT_TESTS)
ADD_EXECUTABLE(${NAME} EXCLUDE_FROM_ALL ${NAME})
ENDIF (BUILD_UNIT_TESTS)
MACRO(ADD_PINOCCHIO_UNIT_TEST NAME PKGS)
ADD_UNIT_TEST(${NAME} ${NAME}.cpp)
SET_TARGET_PROPERTIES(${NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_INCLUDE_DIRECTORIES(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
......@@ -47,52 +43,44 @@ MACRO(ADD_UNIT_TEST NAME PKGS)
TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
ADD_TEST(NAME ${NAME} COMMAND ${NAME})
ADD_DEPENDENCIES(check ${NAME})
ENDMACRO(ADD_UNIT_TEST)
ENDMACRO(ADD_PINOCCHIO_UNIT_TEST)
# --- RULES -------------------------------------------------------------------
# --- RULES -------------------------------------------------------------------
# --- RULES -------------------------------------------------------------------
IF(APPLE)
ADD_CUSTOM_TARGET(check COMMAND export DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH} && ${CMAKE_CTEST_COMMAND})
ELSE(APPLE)
ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
ENDIF(APPLE)
ADD_UNIT_TEST(tspatial eigen3)
ADD_UNIT_TEST(symmetric eigen3)
ADD_UNIT_TEST(aba eigen3)
ADD_UNIT_TEST(rnea eigen3)
ADD_UNIT_TEST(crba eigen3)
ADD_UNIT_TEST(centroidal eigen3)
ADD_UNIT_TEST(com eigen3)
ADD_UNIT_TEST(jacobian eigen3)
ADD_UNIT_TEST(cholesky eigen3)
ADD_UNIT_TEST(dynamics eigen3)
ADD_PINOCCHIO_UNIT_TEST(tspatial eigen3)
ADD_PINOCCHIO_UNIT_TEST(symmetric eigen3)
ADD_PINOCCHIO_UNIT_TEST(aba eigen3)
ADD_PINOCCHIO_UNIT_TEST(rnea eigen3)
ADD_PINOCCHIO_UNIT_TEST(crba eigen3)
ADD_PINOCCHIO_UNIT_TEST(centroidal eigen3)
ADD_PINOCCHIO_UNIT_TEST(com eigen3)
ADD_PINOCCHIO_UNIT_TEST(jacobian eigen3)
ADD_PINOCCHIO_UNIT_TEST(cholesky eigen3)
ADD_PINOCCHIO_UNIT_TEST(dynamics eigen3)
IF(URDFDOM_FOUND)
ADD_UNIT_TEST(urdf "eigen3;urdfdom")
ADD_PINOCCHIO_UNIT_TEST(urdf "eigen3;urdfdom")
ADD_TEST_CFLAGS(urdf '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_UNIT_TEST(value "eigen3;urdfdom")
ADD_PINOCCHIO_UNIT_TEST(value "eigen3;urdfdom")
ADD_TEST_CFLAGS(value '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
IF(HPP_FCL_FOUND)
ADD_UNIT_TEST(geom "eigen3;urdfdom")
ADD_PINOCCHIO_UNIT_TEST(geom "eigen3;urdfdom")
ADD_TEST_CFLAGS(geom '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_UNIT_TEST(srdf "eigen3;urdfdom")
ADD_PINOCCHIO_UNIT_TEST(srdf "eigen3;urdfdom")
ADD_TEST_CFLAGS(srdf '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ENDIF(HPP_FCL_FOUND)
ENDIF(URDFDOM_FOUND)
IF(LUA5_FOUND)
ADD_UNIT_TEST(lua "eigen3;${LUA5_PACKAGE}")
ADD_PINOCCHIO_UNIT_TEST(lua "eigen3;${LUA5_PACKAGE}")
ADD_TEST_CFLAGS(lua '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ENDIF(LUA5_FOUND)
IF(BUILD_PYTHON_INTERFACE)
ADD_UNIT_TEST(python_parser eigen3)
ADD_PINOCCHIO_UNIT_TEST(python_parser eigen3)
ADD_TEST_CFLAGS(python_parser '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
TARGET_LINK_LIBRARIES(python_parser ${PYWRAP})
......@@ -101,26 +89,26 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF(BUILD_PYTHON_INTERFACE)
# Work in progress
ADD_UNIT_TEST(model eigen3)
ADD_UNIT_TEST(constraint eigen3)
#ADD_UNIT_TEST(variant eigen3)
ADD_UNIT_TEST(joints eigen3)
ADD_UNIT_TEST(compute-all-terms eigen3)
ADD_UNIT_TEST(energy eigen3)
ADD_UNIT_TEST(frames eigen3)
ADD_UNIT_TEST(joint-configurations eigen3)
ADD_UNIT_TEST(joint eigen3)
ADD_UNIT_TEST(explog eigen3)
ADD_UNIT_TEST(finite-differences eigen3)
ADD_UNIT_TEST(visitor eigen3)
ADD_UNIT_TEST(algo-check eigen3)
ADD_UNIT_TEST(joint-composite eigen3)
ADD_UNIT_TEST(liegroups eigen3)
ADD_UNIT_TEST(regressor eigen3)
ADD_UNIT_TEST(version eigen3)
ADD_PINOCCHIO_UNIT_TEST(model eigen3)
ADD_PINOCCHIO_UNIT_TEST(constraint eigen3)
#ADD_PINOCCHIO_UNIT_TEST(variant eigen3)
ADD_PINOCCHIO_UNIT_TEST(joints eigen3)
ADD_PINOCCHIO_UNIT_TEST(compute-all-terms eigen3)
ADD_PINOCCHIO_UNIT_TEST(energy eigen3)
ADD_PINOCCHIO_UNIT_TEST(frames eigen3)
ADD_PINOCCHIO_UNIT_TEST(joint-configurations eigen3)
ADD_PINOCCHIO_UNIT_TEST(joint eigen3)
ADD_PINOCCHIO_UNIT_TEST(explog eigen3)
ADD_PINOCCHIO_UNIT_TEST(finite-differences eigen3)
ADD_PINOCCHIO_UNIT_TEST(visitor eigen3)
ADD_PINOCCHIO_UNIT_TEST(algo-check eigen3)
ADD_PINOCCHIO_UNIT_TEST(joint-composite eigen3)
ADD_PINOCCHIO_UNIT_TEST(liegroups eigen3)
ADD_PINOCCHIO_UNIT_TEST(regressor eigen3)
ADD_PINOCCHIO_UNIT_TEST(version eigen3)
# Derivatives algo
ADD_UNIT_TEST(kinematics-derivatives eigen3)
ADD_UNIT_TEST(rnea-derivatives eigen3)
ADD_UNIT_TEST(aba-derivatives eigen3)
ADD_PINOCCHIO_UNIT_TEST(kinematics-derivatives eigen3)
ADD_PINOCCHIO_UNIT_TEST(rnea-derivatives eigen3)
ADD_PINOCCHIO_UNIT_TEST(aba-derivatives eigen3)
......@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE ( test_FD_with_damping )
// Actual Residuals
Eigen::VectorXd constraint_residual (J * data.ddq + gamma);
Eigen::VectorXd dynamics_residual (data.M * data.ddq + data.nle - tau - J.transpose()*data.lambda_c);
BOOST_CHECK(constraint_residual.norm() <= 1e-10);
BOOST_CHECK(constraint_residual.norm() <= 1e-9);
BOOST_CHECK(dynamics_residual.norm() <= 1e-12);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment