Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-6.8'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	CMakeLists.txt
#	package.xml
  • Loading branch information
jslee02 committed May 1, 2019
2 parents e74fb3e + 9d127d0 commit bc98c8f
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 19 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@

* MSVC: 19.20

### [DART 6.8.3 (2019-05-01)](https://github.com/dartsim/dart/milestone/55?closed=1)

#### Changes

* Parser

* Fixed VskParker returning incorrect resource retriever: [#1300](https://github.com/dartsim/dart/pull/1300)

* Build

* Fixed building with pagmo's optional dependencies: [#1301](https://github.com/dartsim/dart/pull/1301)

#### Compilers Tested

* Linux

* GCC 64-bit: 5.4.0, 7.3.0, 8.2.0
* GCC 32-bit: 5.4.0

* macOS

* AppleClang: 9.1.0, 10.0.0

### [DART 6.8.2 (2019-04-23)](https://github.com/dartsim/dart/milestone/54?closed=1)

#### Changes
Expand Down
3 changes: 3 additions & 0 deletions cmake/DARTFindIPOPT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@

find_package(IPOPT 3.11.9 QUIET MODULE)

# HAVE_CSTDDEF is necessary to workaround this bug:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684062
if(IPOPT_FOUND AND NOT TARGET IPOPT::ipopt)
add_library(IPOPT::ipopt INTERFACE IMPORTED)
set_target_properties(IPOPT::ipopt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${IPOPT_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${IPOPT_LIBRARIES}"
INTERFACE_COMPILE_DEFINITIONS HAVE_CSTDDEF
)
endif()
71 changes: 71 additions & 0 deletions cmake/DARTFindpagmo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,74 @@
# This file is provided under the "BSD-style" License

find_package(pagmo QUIET CONFIG)

dart_find_package(NLOPT)
dart_find_package(IPOPT)

if(TARGET Pagmo::pagmo)

# Check for pagmo optional dependencies
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_DEFINITIONS "")
set(CMAKE_REQUIRED_LIBRARIES Pagmo::pagmo)
set(CMAKE_REQUIRED_FLAGS "-std=c++11 -w")

check_cxx_source_compiles(
"
#include <pagmo/config.hpp>
int main()
{
#if defined(PAGMO_WITH_NLOPT)
static_assert(true, \"Pagmo is build with NLOPT\");
#else
static_assert(false, \"Pagmo is NOT build with NLOPT\");
#endif
return 0;
}
"
PAGMO_BUILT_WITH_NLOPT
)

check_cxx_source_compiles(
"
#include <pagmo/config.hpp>
int main()
{
#if defined(PAGMO_WITH_IPOPT)
static_assert(true, \"Pagmo is build with IPOPT\");
#else
static_assert(false, \"Pagmo is NOT build with IPOPT\");
#endif
return 0;
}
"
PAGMO_BUILT_WITH_IPOPT
)

unset(CMAKE_REQUIRED_FLAGS)
unset(CMAKE_REQUIRED_LIBRARIES)
unset(CMAKE_REQUIRED_DEFINITIONS)

if(PAGMO_BUILT_WITH_NLOPT)
dart_find_package(NLOPT)
if(NOT TARGET NLOPT::nlopt)
message(STATUS
"The installed version of pagmo is built with nlopt, but nlopt is not "
"found. Please install nlopt to use dart-optimizer-pagmo."
)
set(pagmo_FOUND FALSE)
endif()
endif()

if(PAGMO_BUILT_WITH_IPOPT)
dart_find_package(IPOPT)
if(NOT TARGET IPOPT::ipopt)
message(STATUS
"The installed version of pagmo is built with ipopt, but ipopt is not "
"found. Please install ipopt to use dart-optimizer-pagmo."
)
set(pagmo_FOUND FALSE)
endif()
endif()

endif()
7 changes: 0 additions & 7 deletions dart/optimizer/ipopt/IpoptSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,8 @@
#ifndef DART_OPTIMIZER_IPOPT_IPOPTSOLVER_HPP_
#define DART_OPTIMIZER_IPOPT_IPOPTSOLVER_HPP_

//------------------------------------------------------------------------------
// Workaround for bug:
// (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684062)
// This is fixed at IpOpt 3.11.4-1
#define HAVE_CSTDDEF
#include <coin/IpTNLP.hpp>
#include <coin/IpIpoptApplication.hpp>
#undef HAVE_CSTDDEF
//------------------------------------------------------------------------------

#include <memory>

Expand Down
3 changes: 1 addition & 2 deletions dart/optimizer/pagmo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Dependency checks
dart_find_package(NLOPT)
dart_find_package(pagmo)
dart_check_optional_package(pagmo "dart-optimizer-pagmo" "pagmo" "2.8")
if(pagmo_FOUND)
Expand All @@ -21,7 +20,7 @@ set(component_name optimizer-pagmo)

# Add target
dart_add_library(${target_name} ${hdrs} ${srcs})
target_link_libraries(${target_name} PUBLIC dart Pagmo::pagmo NLOPT::nlopt)
target_link_libraries(${target_name} PUBLIC dart Pagmo::pagmo)

# Thread
if(THREADS_HAVE_PTHREAD_ARG)
Expand Down
4 changes: 4 additions & 0 deletions dart/optimizer/pagmo/PagmoMultiObjectiveSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ PagmoMultiObjectiveSolver::~PagmoMultiObjectiveSolver()
}

//==============================================================================
#ifdef PAGMO_WITH_NLOPT
static pagmo::algorithm createNloptCobyla(
const PagmoMultiObjectiveSolver::Properties& properties)
{
Expand All @@ -95,6 +96,7 @@ static pagmo::algorithm createNloptCobyla(

return alg;
}
#endif

//==============================================================================
static pagmo::algorithm createMoead(
Expand All @@ -120,10 +122,12 @@ static pagmo::algorithm createPagmoAlgorithm(
{
switch (properties.mAlgorithm)
{
#ifdef PAGMO_WITH_NLOPT
case PagmoMultiObjectiveSolver::Algorithm::Local_nlopt_COBYLA:
{
return createNloptCobyla(properties);
}
#endif
case PagmoMultiObjectiveSolver::Algorithm::Global_MOEAD:
{
return createMoead(properties);
Expand Down
2 changes: 2 additions & 0 deletions dart/optimizer/pagmo/PagmoMultiObjectiveSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ class PagmoMultiObjectiveSolver : public MultiObjectiveSolver
/// Reference: https://esa.github.io/pagmo2/docs/algorithm_list.html
enum class Algorithm
{
#ifdef PAGMO_WITH_NLOPT
Local_nlopt_COBYLA,
#endif
Global_MOEAD,
Global_NSGA2,
};
Expand Down
2 changes: 1 addition & 1 deletion dart/utils/VskParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ common::ResourceRetrieverPtr getRetriever(
newRetriever->addSchemaRetriever(
"dart", DartResourceRetriever::create());

return DartResourceRetriever::create();
return std::move(newRetriever);
}
}

Expand Down
1 change: 1 addition & 0 deletions unittests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ foreach(collision_engine
endforeach()

dart_format_add(test_Inertia.cpp)
dart_format_add(test_VskParser.cpp)
26 changes: 17 additions & 9 deletions unittests/unit/test_VskParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
#include <gtest/gtest.h>
#include "TestHelpers.hpp"

#include "dart/dynamics/SoftBodyNode.hpp"
#include "dart/dynamics/RevoluteJoint.hpp"
#include "dart/config.hpp"
#include "dart/dynamics/PlanarJoint.hpp"
#include "dart/dynamics/RevoluteJoint.hpp"
#include "dart/dynamics/Skeleton.hpp"
#include "dart/simulation/World.hpp"
#include "dart/dynamics/SoftBodyNode.hpp"
#include "dart/simulation/World.hpp"
#include "dart/utils/VskParser.hpp"

Expand All @@ -64,24 +64,32 @@ TEST(VskParser, EmptySkeleton)
world->step();
}

//==============================================================================
TEST(VskParser, LoadFromFileURI)
{
const std::string prefix = "file://" DART_DATA_LOCAL_PATH "vsk/";

EXPECT_EQ(VskParser::readSkeleton(prefix + "test/empty.vsk"), nullptr);
EXPECT_NE(VskParser::readSkeleton(prefix + "Nick01.vsk"), nullptr);
EXPECT_NE(VskParser::readSkeleton(prefix + "Yuting.vsk"), nullptr);
}

//==============================================================================
TEST(VskParser, SingleStepSimulations)
{
WorldPtr world = World::create();
EXPECT_NE(world , nullptr);
EXPECT_NE(world, nullptr);

SkeletonPtr nick
= VskParser::readSkeleton("dart://sample/vsk/Nick01.vsk");
EXPECT_NE(nick , nullptr);
SkeletonPtr nick = VskParser::readSkeleton("dart://sample/vsk/Nick01.vsk");
EXPECT_NE(nick, nullptr);
EXPECT_EQ(nick->getNumMarkers(), 53u);

SkeletonPtr sehoon
= VskParser::readSkeleton("dart://sample/vsk/SehoonVSK3.vsk");
EXPECT_NE(sehoon, nullptr);
EXPECT_EQ(nick->getNumMarkers(), 53u);

SkeletonPtr yuting
= VskParser::readSkeleton("dart://sample/vsk/Yuting.vsk");
SkeletonPtr yuting = VskParser::readSkeleton("dart://sample/vsk/Yuting.vsk");
EXPECT_NE(yuting, nullptr);
EXPECT_EQ(nick->getNumMarkers(), 53u);

Expand Down

0 comments on commit bc98c8f

Please sign in to comment.