Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiprecision test #1077

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
export MAKEFLAGS="-j2"
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COLLISION_SUPPORT=ON -DPYTHON_EXECUTABLE=$(which python2)
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COLLISION_SUPPORT=ON -DPYTHON_EXECUTABLE=$(which python2) -DBUILD_ADVANCED_TESTING=ON
make
make build_tests
export CTEST_OUTPUT_ON_FAILURE=1
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install:
- pip install --user pyopenssl
- pip install --user numpy
script:
- export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE} -DBUILD_WITH_COLLISION_SUPPORT=${BUILD_WITH_COLLISION_SUPPORT}"
- export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE} -DBUILD_WITH_COLLISION_SUPPORT=${BUILD_WITH_COLLISION_SUPPORT} -DBUILD_ADVANCED_TESTING=ON"
- sudo free -m -t
- travis_wait 60 ./.travis/run ../travis_custom/custom_build
after_failure: ./.travis/run after_failure
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ IF(DEFINED BUILD_UNIT_TESTS)
SET(BUILD_TESTING ${BUILD_UNIT_TESTS})
ENDIF(DEFINED BUILD_UNIT_TESTS)

OPTION(BUILD_ADVANCED_TESTING "Build the advanced tests (multiprecision, etc.) of Pinocchio" OFF)

# --- OPTIONAL DEPENDENCIES -------------------------
OPTION(BUILD_WITH_URDF_SUPPORT "Build the library with the URDF format support" ON)
OPTION(BUILD_WITH_COLLISION_SUPPORT "Build the library with the Collision support (required HPP-FCL)" OFF)
Expand Down
7 changes: 6 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ SET(${PROJECT_NAME}_EXAMPLES
kinematics-derivatives
forward-dynamics-derivatives
inverse-dynamics-derivatives
multiprecision
)

IF(BUILD_ADVANCED_TESTING)
LIST(APPEND ${PROJECT_NAME}_EXAMPLES
multiprecision
)
ENDIF(BUILD_ADVANCED_TESTING)

IF(HPP_FCL_FOUND)
LIST(APPEND ${PROJECT_NAME}_EXAMPLES
collisions
Expand Down
4 changes: 3 additions & 1 deletion unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ ADD_PINOCCHIO_UNIT_TEST(center-of-mass-derivatives)
ADD_PINOCCHIO_UNIT_TEST(contact-dynamics-derivatives)

# Multiprecision arithmetic
ADD_PINOCCHIO_UNIT_TEST(multiprecision)
IF(BUILD_ADVANCED_TESTING)
ADD_PINOCCHIO_UNIT_TEST(multiprecision)
ENDIF(BUILD_ADVANCED_TESTING)

# Automatic differentiation
IF(BUILD_WITH_AUTODIFF_SUPPORT)
Expand Down
6 changes: 2 additions & 4 deletions unittest/multiprecision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (c) 2020 INRIA
//

#include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/algorithm/rnea.hpp"
#include "pinocchio/algorithm/aba.hpp"
#include "pinocchio/algorithm/jacobian.hpp"
Expand Down Expand Up @@ -69,10 +68,9 @@ BOOST_AUTO_TEST_CASE(test_cast)
BOOST_AUTO_TEST_CASE(test_mutliprecision)
{
using namespace pinocchio;
const std::string urdf_filename = PINOCCHIO_MODEL_DIR + std::string("/others/robots/talos_data/urdf/talos_reduced.urdf");


Model model;
pinocchio::urdf::buildModel(urdf_filename, model);
pinocchio::buildModels::humanoidRandom(model);
Data data(model);

model.lowerPositionLimit.head<3>().fill(-1.);
Expand Down