diff --git a/.travis.yml b/.travis.yml index c140511f5cd7b..66ece4e2b46a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,16 +13,10 @@ compiler: - clang env: - - BUILD_CORE_ONLY=OFF BUILD_TYPE=Debug COVERALLS=OFF - - BUILD_CORE_ONLY=OFF BUILD_TYPE=Release COVERALLS=OFF - - BUILD_CORE_ONLY=ON BUILD_TYPE=Debug COVERALLS=OFF - - BUILD_CORE_ONLY=ON BUILD_TYPE=Release COVERALLS=OFF + - BUILD_TYPE=Debug COVERALLS=ON COVERALLS_REPO_TOKEN=FKh1HgwfV5uzNrYxIT6ZWjcFqybYZSUym + - BUILD_TYPE=Release COVERALLS=OFF matrix: - include: - - os: linux - compiler: gcc - env: BUILD_CORE_ONLY=OFF BUILD_TYPE=Debug COVERALLS=ON COVERALLS_REPO_TOKEN=FKh1HgwfV5uzNrYxIT6ZWjcFqybYZSUym exclude: - os: osx compiler: gcc @@ -33,10 +27,9 @@ install: script: - mkdir build && cd build - - cmake -DBUILD_CORE_ONLY=$BUILD_CORE_ONLY -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDART_COVERALLS=$COVERALLS .. - - make all - - if [ $BUILD_CORE_ONLY = OFF ]; then make tutorials examples tests test; fi - - if [ $COVERALLS = ON ]; then make coveralls; fi + - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDART_COVERALLS=$COVERALLS .. + - make -j4 all tutorials examples tests test + - if [ $COVERALLS = ON ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then make -j4 coveralls; fi after_failure: - cat Testing/Temporary/LastTest.log diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e514519bb494..e51eb2db060b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ set(DART_MINOR_VERSION "0") set(DART_PATCH_VERSION "0") set(DART_VERSION "${DART_MAJOR_VERSION}.${DART_MINOR_VERSION}.${DART_PATCH_VERSION}") set(DART_PKG_DESC "Dynamic Animation and Robotics Toolkit.") -set(DART_PKG_EXTERNAL_DEPS "flann, ccd, fcl") +set(DART_PKG_EXTERNAL_DEPS "eigen, ccd, fcl, assimp, boost") #=============================================================================== # Print intro @@ -62,7 +62,6 @@ message(STATUS "============================================") # Build options #=============================================================================== option(ENABLE_OPENMP "Build with OpenMP parallaization enabled" ON) -option(BUILD_CORE_ONLY "Build only the core of DART" OFF) if(MSVC) set(DART_RUNTIME_LIBRARY "/MD" CACHE STRING "BaseName chosen by the user at CMake configure time") set_property(CACHE DART_RUNTIME_LIBRARY PROPERTY STRINGS /MD /MT) @@ -107,357 +106,7 @@ endif() #=============================================================================== # Find dependencies #=============================================================================== -# -# If you add a dependency, please add the corresponding rosdep key as a -# dependency in package.xml. - -#------------------------ -# Mandatory dependencies -#------------------------ -message(STATUS "") -message(STATUS "[ Mandatory dependencies ]") - -# Eigen -find_package(EIGEN3 3.0.5 QUIET) -if(EIGEN3_FOUND) - message(STATUS "Looking for EIGEN3 - ${EIGEN3_VERSION} found") -else() - message(SEND_ERROR "Looking for EIGEN3 - NOT found, please install libeigen3-dev (>= 3.0.5)") -endif() - -# CCD -find_package(CCD 1.4.0 QUIET) -if(CCD_FOUND) - message(STATUS "Looking for CCD - ${CCD_VERSION} found") -else() - message(SEND_ERROR "Looking for CCD - NOT found, please install libccd-dev (>= 1.4.0)") -endif() - -# FCL -# TODO: We need to increate the minimum required fcl version to 0.4.0 for DART -# 5.0 once fcl 0.4.0 is released. -find_package(FCL 0.2.9 QUIET) -if(FCL_FOUND) - message(STATUS "Looking for FCL - ${FCL_VERSION} found") - if(FCL_VERSION) - if("${FCL_VERSION}" VERSION_LESS "0.4.0") - message(WARNING - "Found FCL version ${FCL_VERSION}, which is older than 0.4.0. FCL" - " versions predating 0.4.0 return incorrect contacts for" - " primitive-primitive collsions. You should use FCLMeshCollisionDetector" - " instead of FCLCollisionDetector if you need accurate contacts." - ) - set(DART_USE_FCLMESHCOLLISIONDETECTOR TRUE) - else() - set(DART_USE_FCLMESHCOLLISIONDETECTOR FALSE) - endif() - endif() -else() - message(SEND_ERROR "Looking for FCL - NOT found, please install libfcl-dev (>= 0.2.9)") -endif() - -# ASSIMP -find_package(ASSIMP 3.0.0 QUIET) -if(ASSIMP_FOUND) - message(STATUS "Looking for ASSIMP - ${ASSIMP_VERSION} found") - - # Check for missing symbols in ASSIMP (see #451) - include(CheckCXXSourceCompiles) - set(CMAKE_REQUIRED_DEFINITIONS "") - set(CMAKE_REQUIRED_FLAGS "") - set(CMAKE_REQUIRED_INCLUDES ${ASSIMP_INCLUDE_DIRS}) - set(CMAKE_REQUIRED_LIBRARIES ${ASSIMP_LIBRARIES}) - - check_cxx_source_compiles( - " - #include - int main() - { - aiScene* scene = new aiScene; - delete scene; - return 1; - } - " - ASSIMP_AISCENE_CTOR_DTOR_DEFINED) - - if(NOT ASSIMP_AISCENE_CTOR_DTOR_DEFINED) - message(WARNING "The installed version of ASSIMP (${ASSIMP_VERSION}) is " - "missing symbols for the constructor and/or destructor of " - "aiScene. DART will use its own implementations of these " - "functions. We recommend using a version of ASSIMP that " - "does not have this issue, once one becomes available.") - endif(NOT ASSIMP_AISCENE_CTOR_DTOR_DEFINED) - - check_cxx_source_compiles( - " - #include - int main() - { - aiMaterial* material = new aiMaterial; - delete material; - return 1; - } - " - ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) - - if(NOT ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) - message(WARNING "The installed version of ASSIMP (${ASSIMP_VERSION}) is " - "missing symbols for the constructor and/or destructor of " - "aiMaterial. DART will use its own implementations of " - "these functions. We recommend using a version of ASSIMP " - "that does not have this issue, once one becomes available.") - endif(NOT ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) - - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) - -else() - message(SEND_ERROR "Looking for ASSIMP - NOT found, please install libassimp-dev (>= 3.0.0)") -endif() - -# OpenGL -find_package(OpenGL QUIET) -if(OPENGL_FOUND) - message(STATUS "Looking for OpenGL - found") -else() - message(SEND_ERROR "Looking for OpenGL - NOT found, please install OpenGL") -endif() - -# Boost -set(DART_MIN_BOOST_VERSION 1.46.0 CACHE INTERNAL "Boost min version requirement" FORCE) -if(MSVC) - add_definitions(-DBOOST_ALL_NO_LIB) -endif() -add_definitions(-DBOOST_TEST_DYN_LINK) -set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME OFF) -find_package(Boost ${DART_MIN_BOOST_VERSION} COMPONENTS regex system QUIET) -if(Boost_FOUND) - message(STATUS "Looking for Boost - ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} found") -else() - message(SEND_ERROR "Please install system boost version ${DART_MIN_BOOST_VERSION} or higher.") -endif() - -if(NOT BUILD_CORE_ONLY) - - # GLUT - if(WIN32 AND NOT CYGWIN) - set(GLUT_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") - set(GLUT_LIBRARIES glut32) - else() - find_package(GLUT QUIET) - if(GLUT_FOUND) - message(STATUS "Looking for GLUT - found") - set(GLUT_LIBRARIES ${GLUT_glut_LIBRARY}) - else() - message(SEND_ERROR "Looking for GLUT - NOT found, Please install freeglut3-dev") - endif() - endif() - - # FLANN - find_package(FLANN 1.8.4 QUIET) - if(FLANN_FOUND) - message(STATUS "Looking for FLANN - ${FLANN_VERSION} found") - else() - message(SEND_ERROR "Looking for FLANN - NOT found, please install libflann-dev (>= 1.8.4)") - endif() - - # TINYXML - find_package(TINYXML 2.6.2 QUIET) - if(TINYXML_FOUND) - message(STATUS "Looking for TINYXML - ${TINYXML_VERSION} found") - else() - message(SEND_ERROR "Looking for TINYXML - NOT found, please install libtinyxml-dev (>= 2.6.2)") - endif() - - # TINYXML2 - find_package(TINYXML2 QUIET) - if(TINYXML2_FOUND) - message(STATUS "Looking for TINYXML2 - ${TINYXML2_VERSION} found") - else() - message(SEND_ERROR "Looking for TINYXML2 - NOT found, please install libtinyxml2-dev (>= 1.0.1)") - endif() - - # urdfdom - find_package(urdfdom QUIET) - if(urdfdom_FOUND) - message(STATUS "Looking for urdfdom - found") - else() - message(SEND_ERROR "Looking for urdfdom - NOT found, please install liburdfdom-dev") - endif() - if(MSVC) - set(urdfdom_LIBRARIES optimized urdfdom_sensor debug urdfdom_sensord - optimized urdfdom_model_state debug urdfdom_model_stated - optimized urdfdom_model debug urdfdom_modeld - optimized urdfdom_world debug urdfdom_worldd - optimized console_bridge debug console_bridged) - endif() - -endif() - -#----------------------- -# Optional dependencies -#----------------------- -message(STATUS "") -message(STATUS "[ Optional dependencies ]") - -# OpenSceneGraph -if(DART_BUILD_GUI_OSG) - - find_package(OpenSceneGraph 3.0 QUIET - COMPONENTS osg osgViewer osgManipulator osgGA osgDB) - if(OPENSCENEGRAPH_FOUND) - message(STATUS "Looking for OpenSceneGraph - ${OPENSCENEGRAPH_VERSION} found") - set(HAVE_OPENSCENEGRAPH TRUE) - else(OPENSCENEGRAPH_FOUND) - # dart-gui-osg requires both OSG and OpenThreads. This section attempts to - # identify which of those are missing from the building machine and offer - # advice to the user for getting dart-gui-osg to build. - find_package(OpenThreads QUIET) - if(OPENTHREADS_FOUND) - set(warning_msg "Could NOT find OpenSceneGraph") - else(OPENTHREADS_FOUND) - if(OSG_LIBRARY) - set(warning_msg "Could NOT find OpenThreads") - else(OSG_LIBRARY) - set(warning_msg "Could NOT find OpenSceneGraph nor OpenThreads") - endif(OSG_LIBRARY) - endif(OPENTHREADS_FOUND) - message(WARNING "${warning_msg} -- we will skip dart-gui-osg\n" - "If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR") - set(HAVE_OPENSCENEGRAPH FALSE) - endif(OPENSCENEGRAPH_FOUND) - -else() - - message(STATUS "Skipping OpenSceneGraph (DART_BUILD_GUI_OSG == ${DART_BUILD_GUI_OSG})") - set(HAVE_OPENSCENEGRAPH FALSE) - -endif(DART_BUILD_GUI_OSG) - -# OpenMP -if(ENABLE_OPENMP) - find_package(OpenMP QUIET) - if(OPENMP_FOUND) - message(STATUS "Looking for OpenMP - found") - else() - message(STATUS "Looking for OpenMP - NOT found") - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -endif() - -# NLOPT -find_package(NLOPT 2.4.1 QUIET) -if(NLOPT_FOUND) - message(STATUS "Looking for NLOPT - ${NLOPT_VERSION} found") - set(HAVE_NLOPT TRUE) -else() - message(STATUS "Looking for NLOPT - NOT found, please install libnlopt-dev (>= 2.4.1)") - set(HAVE_NLOPT FALSE) -endif() - -# IPOPT -find_package(IPOPT 3.11.4 QUIET) -if(IPOPT_FOUND) - message(STATUS "Looking for IPOPT - ${IPOPT_VERSION} found") - set(HAVE_IPOPT TRUE) -else() - message(STATUS "Looking for IPOPT - NOT found, please install coinor-libipopt-dev (>= 3.11.4)") - set(HAVE_IPOPT FALSE) -endif() - -# Shark -find_package(SHARK QUIET) -if(SHARK_FOUND) - message(STATUS "Looking for SHARK - ${SHARK_VERSION} found") - set(HAVE_SHARK TRUE) -else() - message(STATUS "Looking for SHARK - NOT found, please install SHARK (http://image.diku.dk/shark)") - set(HAVE_SHARK FALSE) -endif() - -# Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with -# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed -# with Bullet, which uses relative paths and may break transitive dependencies. -find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET) - -if(BULLET_FOUND) - # Test whether Bullet was built with double precision. If so, we need to - # define the BT_USE_DOUBLE_PRECISION pre-processor directive before including - # any Bullet headers. This is a workaround for the fact that Bullet does not - # add the definition to BULLET_DEFINITIONS or generate a #cmakedefine header. - include(CheckCXXSourceCompiles) - set(CMAKE_REQUIRED_FLAGS "") - set(CMAKE_REQUIRED_DEFINITIONS "-DBT_USE_DOUBLE_PRECISION") - set(CMAKE_REQUIRED_INCLUDES "${BULLET_INCLUDE_DIRS}") - set(CMAKE_REQUIRED_LIBRARIES "${BULLET_LIBRARIES}") - check_cxx_source_compiles( - " - #include - int main() - { - btVector3 v(0., 0., 1.); - btStaticPlaneShape planeShape(v, 0.); - return 0; - } - " - BT_USE_DOUBLE_PRECISION - ) - - if(BT_USE_DOUBLE_PRECISION) - message(STATUS "Looking for Bullet - found (double precision)") - else() - message(STATUS "Looking for Bullet - found (single precision)") - endif() - - set(HAVE_BULLET_COLLISION TRUE) -else() - message(STATUS "Looking for Bullet - NOT found, please install libbullet-dev") - set(HAVE_BULLET_COLLISION FALSE) -endif() - -# Perl modules -find_package(PerlModules COMPONENTS Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor QUIET) -if("${PERLMODULES_FOUND}" STREQUAL "TRUE") - message(STATUS "Looking for PerlModules - found") -else() - message(STATUS "Looking for PerlModules - NOT found, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)") -endif() - -# Doxygen -find_package(Doxygen QUIET) -if(DOXYGEN_FOUND) - message(STATUS "Looking for Doxygen - found") -else() - message(STATUS "Looking for Doxygen - NOT found, please install doxygen") -endif() - -#=============================================================================== -# DART dependency variable settings -#=============================================================================== -set(DART_CORE_DEPENDENCIES ${CCD_LIBRARIES} - ${FCL_LIBRARIES} - ${ASSIMP_LIBRARIES} - ${Boost_LIBRARIES} - ${OPENGL_LIBRARIES} - ${GLUT_LIBRARY} -) - -if(HAVE_BULLET_COLLISION) - set(DART_CORE_DEPENDENCIES ${DART_CORE_DEPENDENCIES} ${BULLET_LIBRARIES}) -endif() - -if(NOT BUILD_CORE_ONLY) - set(DART_DEPENDENCIES ${urdfdom_LIBRARIES} - ${TINYXML_LIBRARIES} - ${TINYXML2_LIBRARIES} - ) - - if(HAVE_BULLET_COLLISION) - set(DART_DEPENDENCIES ${DART_DEPENDENCIES} ${OPENSCENEGRAPH_LIBRARIES}) - endif() - -endif() +include(DARTFindDependencies) #=============================================================================== # Include directories @@ -468,37 +117,11 @@ include_directories(SYSTEM ${CCD_INCLUDE_DIRS}) include_directories(SYSTEM ${FCL_INCLUDE_DIRS}) include_directories(SYSTEM ${ASSIMP_INCLUDE_DIRS}) include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) -include_directories(SYSTEM ${OPENGL_INCLUDE_DIR}) -include_directories(SYSTEM ${GLUT_INCLUDE_DIR}) if(HAVE_BULLET_COLLISION) include_directories(SYSTEM ${BULLET_INCLUDE_DIRS}) endif() - -if(NOT BUILD_CORE_ONLY) - include_directories(SYSTEM ${FLANN_INCLUDE_DIRS}) - include_directories(SYSTEM ${urdfdom_INCLUDE_DIRS}) - include_directories(SYSTEM ${TINYXML_INCLUDE_DIRS}) - include_directories(SYSTEM ${TINYXML2_INCLUDE_DIRS}) - if(HAVE_NLOPT) - include_directories(SYSTEM ${NLOPT_INCLUDE_DIRS}) - endif() - if(HAVE_IPOPT) - include_directories(SYSTEM ${IPOPT_INCLUDE_DIRS}) - endif() - if(HAVE_SHARK) - include_directories(SYSTEM ${SHARK_INCLUDE_DIRS}) - endif() -endif() - include_directories("${CMAKE_BINARY_DIR}") -#=============================================================================== -# Link directories -#=============================================================================== -link_directories("${CMAKE_BINARY_DIR}/lib") -link_directories("${CMAKE_INSTALL_PREFIX}/lib") -link_directories(${Boost_LIBRARY_DIRS}) - #=============================================================================== # Check for non-case-sensitive filesystems #=============================================================================== @@ -570,7 +193,6 @@ message(STATUS "Compiler version : ${CXX_COMPILER_VERSION}") message(STATUS "Build type : ${CMAKE_BUILD_TYPE}") message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") message(STATUS "ENABLE_OPENMP : ${ENABLE_OPENMP}") -message(STATUS "Build core only : ${BUILD_CORE_ONLY}") message(STATUS "Build gui::osg : ${DART_BUILD_GUI_OSG}") message(STATUS "Install path : ${CMAKE_INSTALL_PREFIX}") message(STATUS "CXX_FLAGS : ${CMAKE_CXX_FLAGS}") @@ -602,22 +224,13 @@ install(FILES ${DART_CONFIG_OUT} DESTINATION include/dart) # Generate the DART CMake Config and version files include(WriteBasicConfigVersionFile) -set(DART_CORE_CONFIG_IN ${CMAKE_SOURCE_DIR}/cmake/DARTCoreConfig.cmake.in) -set(DART_CORE_CONFIG_OUT ${CMAKE_BINARY_DIR}/cmake/DARTCoreConfig.cmake) -message(STATUS ${DART_CORE_CONFIG_OUT}) +set(DART_CONFIG_IN ${CMAKE_SOURCE_DIR}/cmake/DARTConfig.cmake.in) +set(DART_CONFIG_OUT ${CMAKE_BINARY_DIR}/cmake/DARTConfig.cmake) +message(STATUS ${DART_CONFIG_OUT}) message(STATUS ${CMAKE_BINARY_DIR}/cmake/DARTConfigVersion.cmake) -configure_file(${DART_CORE_CONFIG_IN} ${DART_CORE_CONFIG_OUT} @ONLY) -write_basic_config_version_file(cmake/DARTCoreConfigVersion.cmake VERSION ${DART_VERSION} COMPATIBILITY SameMajorVersion) -install(FILES ${DART_CORE_CONFIG_OUT} ${CMAKE_BINARY_DIR}/cmake/DARTCoreConfigVersion.cmake DESTINATION share/dartcore) -if(NOT BUILD_CORE_ONLY) - set(DART_CONFIG_IN ${CMAKE_SOURCE_DIR}/cmake/DARTConfig.cmake.in) - set(DART_CONFIG_OUT ${CMAKE_BINARY_DIR}/cmake/DARTConfig.cmake) - message(STATUS ${DART_CONFIG_OUT}) - message(STATUS ${CMAKE_BINARY_DIR}/cmake/DARTConfigVersion.cmake) - configure_file(${DART_CONFIG_IN} ${DART_CONFIG_OUT} @ONLY) - write_basic_config_version_file(cmake/DARTConfigVersion.cmake VERSION ${DART_VERSION} COMPATIBILITY SameMajorVersion) - install(FILES ${DART_CONFIG_OUT} ${CMAKE_BINARY_DIR}/cmake/DARTConfigVersion.cmake DESTINATION share/dart) -endif() +configure_file(${DART_CONFIG_IN} ${DART_CONFIG_OUT} @ONLY) +write_basic_config_version_file(cmake/DARTConfigVersion.cmake VERSION ${DART_VERSION} COMPATIBILITY SameMajorVersion) +install(FILES ${DART_CONFIG_OUT} ${CMAKE_BINARY_DIR}/cmake/DARTConfigVersion.cmake DESTINATION share/dart) # Generate the DART pkg-config set(PC_CONFIG_IN ${CMAKE_SOURCE_DIR}/cmake/dart.pc.in) @@ -654,33 +267,29 @@ endfunction(dart_add_unittest) #=============================================================================== add_subdirectory(dart) +add_subdirectory(apps EXCLUDE_FROM_ALL) +add_subdirectory(tutorials EXCLUDE_FROM_ALL) -if(NOT BUILD_CORE_ONLY) - - add_subdirectory(apps EXCLUDE_FROM_ALL) - add_subdirectory(tutorials EXCLUDE_FROM_ALL) - - # Add a "tutorials" target to build tutorials. - get_property(tutorials GLOBAL PROPERTY DART_TUTORIALS) - add_custom_target(tutorials DEPENDS ${tutorials}) +# Add a "tutorials" target to build tutorials. +get_property(tutorials GLOBAL PROPERTY DART_TUTORIALS) +add_custom_target(tutorials DEPENDS ${tutorials}) - message(STATUS "") - message(STATUS "[ Tutorials ]") - foreach(tutorial ${tutorials}) - message(STATUS "Adding tutorial: ${tutorial}") - endforeach(tutorial ${tutorials}) +message(STATUS "") +message(STATUS "[ Tutorials ]") +foreach(tutorial ${tutorials}) + message(STATUS "Adding tutorial: ${tutorial}") +endforeach(tutorial ${tutorials}) - # Add an "examples" target to build examples. - get_property(examples GLOBAL PROPERTY DART_EXAMPLES) - add_custom_target(examples DEPENDS ${examples}) +# Add an "examples" target to build examples. +get_property(examples GLOBAL PROPERTY DART_EXAMPLES) +add_custom_target(examples DEPENDS ${examples}) - message(STATUS "") - message(STATUS "[ Examples ]") +message(STATUS "") +message(STATUS "[ Examples ]") - foreach(example ${examples}) - message(STATUS "Adding example: ${example}") - endforeach(example ${examples}) -endif(NOT BUILD_CORE_ONLY) +foreach(example ${examples}) + message(STATUS "Adding example: ${example}") +endforeach(example ${examples}) # Add a "tests" target to build unit tests. enable_testing() @@ -698,10 +307,7 @@ endforeach(unittest ${unittests}) #=============================================================================== # Export targets #=============================================================================== -install(EXPORT DARTCoreTargets DESTINATION share/dartcore) -if(NOT BUILD_CORE_ONLY) - install(EXPORT DARTTargets DESTINATION share/dart) -endif() +install(EXPORT DARTTargets DESTINATION share/dart) # Add an "uninstall" target # Ref: http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F diff --git a/apps/addDeleteSkels/CMakeLists.txt b/apps/addDeleteSkels/CMakeLists.txt index 1b0376a4c5d90..283f4ed6064dc 100644 --- a/apps/addDeleteSkels/CMakeLists.txt +++ b/apps/addDeleteSkels/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB addDeleteSkels_srcs "*.cpp") file(GLOB addDeleteSkels_hdrs "*.h") add_executable(addDeleteSkels ${addDeleteSkels_srcs} ${addDeleteSkels_hdrs}) -target_link_libraries(addDeleteSkels dart) +target_link_libraries(addDeleteSkels dart dart-gui) set_target_properties(addDeleteSkels PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/addDeleteSkels/MyWindow.h b/apps/addDeleteSkels/MyWindow.h index b605d57f63e5d..ca498eccac516 100644 --- a/apps/addDeleteSkels/MyWindow.h +++ b/apps/addDeleteSkels/MyWindow.h @@ -39,6 +39,7 @@ #define APPS_ADDDELETESKELS_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SimWindow { diff --git a/apps/atlasSimbicon/CMakeLists.txt b/apps/atlasSimbicon/CMakeLists.txt index 9057d840e506b..129ea9a0316f0 100644 --- a/apps/atlasSimbicon/CMakeLists.txt +++ b/apps/atlasSimbicon/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB atlasSimbicon_srcs "*.cpp") file(GLOB atlasSimbicon_hdrs "*.h") add_executable(atlasSimbicon ${atlasSimbicon_srcs} ${atlasSimbicon_hdrs}) -target_link_libraries(atlasSimbicon dart) +target_link_libraries(atlasSimbicon dart dart-gui dart-utils-urdf) set_target_properties(atlasSimbicon PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/atlasSimbicon/MyWindow.h b/apps/atlasSimbicon/MyWindow.h index 2e8694837509d..5f5d7549684eb 100644 --- a/apps/atlasSimbicon/MyWindow.h +++ b/apps/atlasSimbicon/MyWindow.h @@ -39,6 +39,7 @@ #define APPS_ATLASROBOT_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" #include "apps/atlasSimbicon/Controller.h" diff --git a/apps/atlasSimbicon/TerminalCondition.cpp b/apps/atlasSimbicon/TerminalCondition.cpp index 9d46a0da12e73..b215db4780eaa 100644 --- a/apps/atlasSimbicon/TerminalCondition.cpp +++ b/apps/atlasSimbicon/TerminalCondition.cpp @@ -113,7 +113,9 @@ bool BodyContactCondition::isSatisfied() } // TODO(JS): Need more elegant condition check method +DART_SUPPRESS_DEPRECATED_BEGIN if (mBodyNode->isColliding() > 0) +DART_SUPPRESS_DEPRECATED_END { // dtmsg << "BodyNode [" << mBodyNode->getName() << "] is in contact." // << std::endl; diff --git a/apps/bipedStand/CMakeLists.txt b/apps/bipedStand/CMakeLists.txt index 69004dddd0960..d19b01cb72e8e 100644 --- a/apps/bipedStand/CMakeLists.txt +++ b/apps/bipedStand/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB bipedStand_srcs "*.cpp") file(GLOB bipedStand_hdrs "*.h") add_executable(bipedStand ${bipedStand_srcs} ${bipedStand_hdrs}) -target_link_libraries(bipedStand dart) +target_link_libraries(bipedStand dart dart-gui) set_target_properties(bipedStand PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/bipedStand/MyWindow.h b/apps/bipedStand/MyWindow.h index c9c94d77f3d1a..a801c13661e7b 100644 --- a/apps/bipedStand/MyWindow.h +++ b/apps/bipedStand/MyWindow.h @@ -43,6 +43,7 @@ #include #include "dart/dart.h" +#include "dart/gui/gui.h" #include "apps/bipedStand/Controller.h" diff --git a/apps/hardcodedDesign/CMakeLists.txt b/apps/hardcodedDesign/CMakeLists.txt index 2e00dca56818f..1a76038462d1c 100644 --- a/apps/hardcodedDesign/CMakeLists.txt +++ b/apps/hardcodedDesign/CMakeLists.txt @@ -4,5 +4,5 @@ file(GLOB hardcodedDesign_srcs "*.cpp") file(GLOB hardcodedDesign_hdrs "*.h") add_executable(hardcodedDesign ${hardcodedDesign_srcs} ${hardcodedDesign_hdrs}) -target_link_libraries(hardcodedDesign dart) +target_link_libraries(hardcodedDesign dart dart-gui) set_target_properties(hardcodedDesign PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/hardcodedDesign/MyWindow.h b/apps/hardcodedDesign/MyWindow.h index 012fb4f5c34a0..8a6e708edf639 100644 --- a/apps/hardcodedDesign/MyWindow.h +++ b/apps/hardcodedDesign/MyWindow.h @@ -48,6 +48,7 @@ #include #include "dart/dart.h" +#include "dart/gui/gui.h" class MyWindow : public dart::gui::SimWindow { public: diff --git a/apps/hybridDynamics/CMakeLists.txt b/apps/hybridDynamics/CMakeLists.txt index ab4a26afaac8e..cb0b72e655732 100644 --- a/apps/hybridDynamics/CMakeLists.txt +++ b/apps/hybridDynamics/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB hybridDynamics_srcs "*.cpp") file(GLOB hybridDynamics_hdrs "*.h") add_executable(hybridDynamics ${hybridDynamics_srcs} ${hybridDynamics_hdrs}) -target_link_libraries(hybridDynamics dart) +target_link_libraries(hybridDynamics dart dart-gui) set_target_properties(hybridDynamics PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/hybridDynamics/MyWindow.h b/apps/hybridDynamics/MyWindow.h index e8c800e95a254..38fc9bc0f4e7b 100644 --- a/apps/hybridDynamics/MyWindow.h +++ b/apps/hybridDynamics/MyWindow.h @@ -38,6 +38,7 @@ #define APPS_HYBRIDDYNAMICS_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SimWindow diff --git a/apps/jointConstraints/CMakeLists.txt b/apps/jointConstraints/CMakeLists.txt index 98e457869abd0..76a2f2d6c2cfa 100644 --- a/apps/jointConstraints/CMakeLists.txt +++ b/apps/jointConstraints/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB jointConstraints_srcs "*.cpp") file(GLOB jointConstraints_hdrs "*.h") add_executable(jointConstraints ${jointConstraints_srcs} ${jointConstraints_hdrs}) -target_link_libraries(jointConstraints dart) +target_link_libraries(jointConstraints dart dart-gui) set_target_properties(jointConstraints PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/jointConstraints/Main.cpp b/apps/jointConstraints/Main.cpp index 67cdc3d5b0ec9..866916cab7159 100644 --- a/apps/jointConstraints/Main.cpp +++ b/apps/jointConstraints/Main.cpp @@ -39,6 +39,7 @@ #include #include "dart/dart.h" +#include "dart/gui/gui.h" using namespace dart; using namespace dynamics; diff --git a/apps/jointConstraints/MyWindow.h b/apps/jointConstraints/MyWindow.h index b75000e684224..98c25d07a0e37 100644 --- a/apps/jointConstraints/MyWindow.h +++ b/apps/jointConstraints/MyWindow.h @@ -43,6 +43,7 @@ #include "apps/jointConstraints/Controller.h" #include "dart/dart.h" +#include "dart/gui/gui.h" class MyWindow : public dart::gui::SimWindow { diff --git a/apps/mixedChain/CMakeLists.txt b/apps/mixedChain/CMakeLists.txt index f9a4767f987fd..97c2d83bf88db 100644 --- a/apps/mixedChain/CMakeLists.txt +++ b/apps/mixedChain/CMakeLists.txt @@ -4,5 +4,5 @@ set(APP_NAME mixedChain) file(GLOB ${APP_NAME}_srcs "*.cpp") file(GLOB ${APP_NAME}_hdrs "*.h") add_executable(${APP_NAME} ${${APP_NAME}_srcs} ${${APP_NAME}_hdrs}) -target_link_libraries(${APP_NAME} dart) +target_link_libraries(${APP_NAME} dart dart-gui) set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/mixedChain/MyWindow.h b/apps/mixedChain/MyWindow.h index 48c9a6161a650..e4cee8a50bfd0 100644 --- a/apps/mixedChain/MyWindow.h +++ b/apps/mixedChain/MyWindow.h @@ -44,6 +44,7 @@ #define APPS_TESTDROP_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SoftSimWindow diff --git a/apps/operationalSpaceControl/CMakeLists.txt b/apps/operationalSpaceControl/CMakeLists.txt index 5bb78453a0016..d7faed39593f2 100644 --- a/apps/operationalSpaceControl/CMakeLists.txt +++ b/apps/operationalSpaceControl/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB operationalSpaceControl_srcs "*.cpp") file(GLOB operationalSpaceControl_hdrs "*.h") add_executable(operationalSpaceControl ${operationalSpaceControl_srcs} ${operationalSpaceControl_hdrs}) -target_link_libraries(operationalSpaceControl dart) +target_link_libraries(operationalSpaceControl dart dart-gui dart-utils-urdf) set_target_properties(operationalSpaceControl PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/operationalSpaceControl/MyWindow.h b/apps/operationalSpaceControl/MyWindow.h index 3dbeb616d48c8..5b5fd1778f8db 100644 --- a/apps/operationalSpaceControl/MyWindow.h +++ b/apps/operationalSpaceControl/MyWindow.h @@ -38,6 +38,7 @@ #define APPS_OPERATIONALSPACECONTROL_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" #include "Controller.h" diff --git a/apps/rigidChain/CMakeLists.txt b/apps/rigidChain/CMakeLists.txt index c46ac37d24996..94393a6d58c55 100644 --- a/apps/rigidChain/CMakeLists.txt +++ b/apps/rigidChain/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB rigidChain_srcs "*.cpp") file(GLOB rigidChain_hdrs "*.h") add_executable(rigidChain ${rigidChain_srcs} ${rigidChain_hdrs}) -target_link_libraries(rigidChain dart) +target_link_libraries(rigidChain dart dart-gui) set_target_properties(rigidChain PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/rigidChain/MyWindow.h b/apps/rigidChain/MyWindow.h index 9591a0f9bfb1b..9eaebabbd73d7 100644 --- a/apps/rigidChain/MyWindow.h +++ b/apps/rigidChain/MyWindow.h @@ -39,6 +39,7 @@ #define APPS_FORWARDSIM_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" class MyWindow : public dart::gui::SimWindow { public: diff --git a/apps/rigidCubes/CMakeLists.txt b/apps/rigidCubes/CMakeLists.txt index 50adc99f7632c..fe231e4b0edfa 100644 --- a/apps/rigidCubes/CMakeLists.txt +++ b/apps/rigidCubes/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB rigidCubes_srcs "*.cpp") file(GLOB rigidCubes_hdrs "*.h") add_executable(rigidCubes ${rigidCubes_srcs} ${rigidCubes_hdrs}) -target_link_libraries(rigidCubes dart) +target_link_libraries(rigidCubes dart dart-gui) set_target_properties(rigidCubes PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/rigidCubes/MyWindow.h b/apps/rigidCubes/MyWindow.h index 254f34684fdfc..e59abd436ef9e 100644 --- a/apps/rigidCubes/MyWindow.h +++ b/apps/rigidCubes/MyWindow.h @@ -39,6 +39,7 @@ #define APPS_CUBES_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SimWindow { diff --git a/apps/rigidLoop/CMakeLists.txt b/apps/rigidLoop/CMakeLists.txt index 6ef9f0c7d5286..c1b0b31faac87 100644 --- a/apps/rigidLoop/CMakeLists.txt +++ b/apps/rigidLoop/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB rigidLoop_srcs "*.cpp") file(GLOB rigidLoop_hdrs "*.h") add_executable(rigidLoop ${rigidLoop_srcs} ${rigidLoop_hdrs}) -target_link_libraries(rigidLoop dart) +target_link_libraries(rigidLoop dart dart-gui) set_target_properties(rigidLoop PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/rigidLoop/MyWindow.h b/apps/rigidLoop/MyWindow.h index 5621a8ba1eb01..37a2233ae4c18 100644 --- a/apps/rigidLoop/MyWindow.h +++ b/apps/rigidLoop/MyWindow.h @@ -38,6 +38,7 @@ #define APPS_CLOSEDLOOP_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" class MyWindow : public dart::gui::SimWindow { diff --git a/apps/rigidShapes/CMakeLists.txt b/apps/rigidShapes/CMakeLists.txt index d9815c2e25cb7..3ecb6b7f372f9 100644 --- a/apps/rigidShapes/CMakeLists.txt +++ b/apps/rigidShapes/CMakeLists.txt @@ -4,5 +4,5 @@ set(APP_NAME rigidShapes) file(GLOB ${APP_NAME}_srcs "*.cpp") file(GLOB ${APP_NAME}_hdrs "*.h") add_executable(${APP_NAME} ${${APP_NAME}_srcs} ${${APP_NAME}_hdrs}) -target_link_libraries(${APP_NAME} dart) +target_link_libraries(${APP_NAME} dart dart-gui) set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/rigidShapes/MyWindow.h b/apps/rigidShapes/MyWindow.h index f1fbb50f4bdf9..45629de0e48b8 100644 --- a/apps/rigidShapes/MyWindow.h +++ b/apps/rigidShapes/MyWindow.h @@ -44,6 +44,7 @@ #define APPS_RIGIDSHAPES_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// MyWindow class MyWindow : public dart::gui::SimWindow diff --git a/apps/simpleFrames/CMakeLists.txt b/apps/simpleFrames/CMakeLists.txt index 62080979bab54..232b4c4c59ab1 100644 --- a/apps/simpleFrames/CMakeLists.txt +++ b/apps/simpleFrames/CMakeLists.txt @@ -4,5 +4,5 @@ set(APP_NAME simpleFrames) file(GLOB ${APP_NAME}_srcs "*.cpp") file(GLOB ${APP_NAME}_hdrs "*.h") add_executable(${APP_NAME} ${${APP_NAME}_srcs} ${${APP_NAME}_hdrs}) -target_link_libraries(${APP_NAME} dart) +target_link_libraries(${APP_NAME} dart dart-gui) set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/simpleFrames/Main.cpp b/apps/simpleFrames/Main.cpp index d02b29a69bfcc..7fd234a32648b 100644 --- a/apps/simpleFrames/Main.cpp +++ b/apps/simpleFrames/Main.cpp @@ -35,6 +35,7 @@ */ #include "dart/dart.h" +#include "dart/gui/gui.h" using namespace dart::dynamics; diff --git a/apps/softBodies/CMakeLists.txt b/apps/softBodies/CMakeLists.txt index c546afac4bad4..f1f3d40f30463 100644 --- a/apps/softBodies/CMakeLists.txt +++ b/apps/softBodies/CMakeLists.txt @@ -4,5 +4,5 @@ set(APP_NAME softBodies) file(GLOB ${APP_NAME}_srcs "*.cpp") file(GLOB ${APP_NAME}_hdrs "*.h") add_executable(${APP_NAME} ${${APP_NAME}_srcs} ${${APP_NAME}_hdrs}) -target_link_libraries(${APP_NAME} dart) +target_link_libraries(${APP_NAME} dart dart-gui) set_target_properties(${APP_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/softBodies/MyWindow.h b/apps/softBodies/MyWindow.h index df4ac092c7932..23f108bdc3e8b 100644 --- a/apps/softBodies/MyWindow.h +++ b/apps/softBodies/MyWindow.h @@ -44,6 +44,7 @@ #define APPS_SOFTBODIES_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SoftSimWindow diff --git a/apps/speedTest/CMakeLists.txt b/apps/speedTest/CMakeLists.txt index cf836cf0e3c2e..4f73e2967ae18 100644 --- a/apps/speedTest/CMakeLists.txt +++ b/apps/speedTest/CMakeLists.txt @@ -6,5 +6,5 @@ get_filename_component(app_name ${CMAKE_CURRENT_LIST_DIR} NAME) file(GLOB ${app_name}_srcs "*.cpp" "*.h" "*.hpp") add_executable(${app_name} ${${app_name}_srcs}) -target_link_libraries(${app_name} dart) +target_link_libraries(${app_name} dart dart-gui) set_target_properties(${app_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/speedTest/Main.cpp b/apps/speedTest/Main.cpp index fb07ebf69feb1..ef72aceb3ec7b 100644 --- a/apps/speedTest/Main.cpp +++ b/apps/speedTest/Main.cpp @@ -39,6 +39,7 @@ #include #include "dart/dart.h" +#include "dart/utils/utils.h" double testForwardKinematicSpeed(dart::dynamics::SkeletonPtr skel, bool position=true, diff --git a/apps/vehicle/CMakeLists.txt b/apps/vehicle/CMakeLists.txt index b8eb47fa5a555..2fc5753715964 100644 --- a/apps/vehicle/CMakeLists.txt +++ b/apps/vehicle/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB vehicle_srcs "*.cpp") file(GLOB vehicle_hdrs "*.h") add_executable(vehicle ${vehicle_srcs} ${vehicle_hdrs}) -target_link_libraries(vehicle dart) +target_link_libraries(vehicle dart dart-gui) set_target_properties(vehicle PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") diff --git a/apps/vehicle/MyWindow.h b/apps/vehicle/MyWindow.h index 6e73312342483..f5f3e8d49b548 100644 --- a/apps/vehicle/MyWindow.h +++ b/apps/vehicle/MyWindow.h @@ -39,6 +39,7 @@ #define APPS_VEHICLE_MYWINDOW_H_ #include "dart/dart.h" +#include "dart/gui/gui.h" /// \brief class MyWindow : public dart::gui::SimWindow { diff --git a/appveyor.yml b/appveyor.yml index b0fc562f9a00d..df5f698c38fb3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,9 +14,6 @@ environment: MSVC_DEFAULT_OPTIONS: ON BOOST_ROOT: C:\Libraries\boost_1_59_0 BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib32-msvc-14.0 - matrix: - - BUILD_CORE_ONLY: ON - - BUILD_CORE_ONLY: OFF # build configuration, i.e. Debug, Release, etc. configuration: @@ -53,7 +50,7 @@ before_build: # We generate project files for Visual Studio 12 because the boost binaries installed on the test server are for Visual Studio 12. - cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 - cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 Win64 - - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_CORE_ONLY="%BUILD_CORE_ONLY%" -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" .. + - cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" .. build: off #build: diff --git a/ci/install_linux.sh b/ci/install_linux.sh index fc16ea67eeeb5..b948ce5e6585f 100755 --- a/ci/install_linux.sh +++ b/ci/install_linux.sh @@ -3,16 +3,13 @@ sudo apt-add-repository --yes ppa:fcl-debs/ppa sudo apt-add-repository --yes ppa:dartsim/ppa sudo apt-get -qq update -APT_CORE=' +APT=' cmake libassimp-dev libboost-all-dev libccd-dev libeigen3-dev libfcl-dev -' - -APT=$APT_CORE' freeglut3-dev libxi-dev libxmu-dev @@ -27,11 +24,4 @@ liburdfdom-headers-dev libopenscenegraph-dev ' -if [ $BUILD_CORE_ONLY = OFF ]; then - sudo apt-get -qq --yes --force-yes install $APT -else - sudo apt-get -qq --yes --force-yes install $APT_CORE -fi - -sudo apt-get -qq --yes install lcov curl - +sudo apt-get -qq --yes --force-yes install $APT diff --git a/ci/install_osx.sh b/ci/install_osx.sh index e80330ad26dc9..1b15cc39e397b 100755 --- a/ci/install_osx.sh +++ b/ci/install_osx.sh @@ -20,7 +20,7 @@ ipopt ros/deps/urdfdom ros/deps/urdfdom_headers ros/deps/console_bridge -ros/deps/gtest +open-scene-graph ' brew install $PACKAGES | grep -v '%$' diff --git a/cmake/DARTCoreConfig.cmake.in b/cmake/DARTCoreConfig.cmake.in deleted file mode 100644 index b343fe5295000..0000000000000 --- a/cmake/DARTCoreConfig.cmake.in +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################### -# Config file for DARTCore -# -# This sets the following variables: -# DARTCore_INCLUDE_DIRS - Directories containing the DART include files. -# DARTCore_LIBRARIES - Libraries needed to use DART. -# DARTCore_LIBRARY_DIRS - Directories that contain the DART libraries. -# DARTCore_VERSION - DART version. - -#=============================================================================== -# DARTCore_INCLUDE_DIRS -#=============================================================================== -set(DARTCore_INCLUDE_DIRS - "@CMAKE_INSTALL_PREFIX@/include" - "@EIGEN3_INCLUDE_DIRS@" - "@BULLET_INCLUDE_DIRS@") - -#=============================================================================== -# DARTCore_LIBRARY_DIRS -#=============================================================================== -set(DARTCore_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/lib" "@Boost_LIBRARY_DIRS@") - -#=============================================================================== -# DARTCore_LIBRARIES -#=============================================================================== -get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -include("${CURRENT_DIR}/DARTCoreTargets.cmake") -# Return absolute path of the library instead of just library name as -# recommended in CMake documentation: -# http://www.cmake.org/cmake/help/v3.0/command/link_directories.html -find_library(dart_core_location - NAMES "dart-core" - PATHS "@CMAKE_INSTALL_PREFIX@/lib") -set(DARTCore_LIBRARIES "${dart_core_location}") - -#=============================================================================== -# DARTCore_VERSION -#=============================================================================== -set(DARTCore_VERSION @DART_VERSION@) diff --git a/cmake/DARTFindDependencies.cmake b/cmake/DARTFindDependencies.cmake new file mode 100644 index 0000000000000..fb6dd1aeb9737 --- /dev/null +++ b/cmake/DARTFindDependencies.cmake @@ -0,0 +1,330 @@ +# If you add a dependency, please add the corresponding rosdep key as a +# dependency in package.xml. + +#====================================== +# Mandatory dependencies for DART core +#====================================== +message(STATUS "") +message(STATUS "[ Mandatory dependencies for DART core ]") + +# Eigen +find_package(EIGEN3 3.0.5 QUIET) +if(EIGEN3_FOUND) + message(STATUS "Looking for EIGEN3 - ${EIGEN3_VERSION} found") +else() + message(SEND_ERROR "Looking for EIGEN3 - NOT found, please install libeigen3-dev (>= 3.0.5)") +endif() + +# CCD +find_package(CCD 1.4.0 QUIET) +if(CCD_FOUND) + message(STATUS "Looking for CCD - ${CCD_VERSION} found") +else() + message(SEND_ERROR "Looking for CCD - NOT found, please install libccd-dev (>= 1.4.0)") +endif() + +# FCL +find_package(FCL 0.2.9 QUIET) +if(FCL_FOUND) + message(STATUS "Looking for FCL - ${FCL_VERSION} found") +else() + message(SEND_ERROR "Looking for FCL - NOT found, please install libfcl-dev (>= 0.2.9)") +endif() + +# ASSIMP +find_package(ASSIMP 3.0.0 QUIET) +if(ASSIMP_FOUND) + message(STATUS "Looking for ASSIMP - ${ASSIMP_VERSION} found") + + # Check for missing symbols in ASSIMP (see #451) + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_DEFINITIONS "") + set(CMAKE_REQUIRED_FLAGS "") + set(CMAKE_REQUIRED_INCLUDES ${ASSIMP_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES ${ASSIMP_LIBRARIES}) + + check_cxx_source_compiles( + " + #include + int main() + { + aiScene* scene = new aiScene; + delete scene; + return 1; + } + " + ASSIMP_AISCENE_CTOR_DTOR_DEFINED) + + if(NOT ASSIMP_AISCENE_CTOR_DTOR_DEFINED) + message(WARNING "The installed version of ASSIMP (${ASSIMP_VERSION}) is " + "missing symbols for the constructor and/or destructor of " + "aiScene. DART will use its own implementations of these " + "functions. We recommend using a version of ASSIMP that " + "does not have this issue, once one becomes available.") + endif(NOT ASSIMP_AISCENE_CTOR_DTOR_DEFINED) + + check_cxx_source_compiles( + " + #include + int main() + { + aiMaterial* material = new aiMaterial; + delete material; + return 1; + } + " + ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) + + if(NOT ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) + message(WARNING "The installed version of ASSIMP (${ASSIMP_VERSION}) is " + "missing symbols for the constructor and/or destructor of " + "aiMaterial. DART will use its own implementations of " + "these functions. We recommend using a version of ASSIMP " + "that does not have this issue, once one becomes available.") + endif(NOT ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED) + + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) + +else() + message(SEND_ERROR "Looking for ASSIMP - NOT found, please install libassimp-dev (>= 3.0.0)") +endif() + +# Boost +set(DART_MIN_BOOST_VERSION 1.46.0 CACHE INTERNAL "Boost min version requirement" FORCE) +if(MSVC) + add_definitions(-DBOOST_ALL_NO_LIB) +endif() +add_definitions(-DBOOST_TEST_DYN_LINK) +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME OFF) +find_package(Boost ${DART_MIN_BOOST_VERSION} COMPONENTS regex system QUIET) +if(Boost_FOUND) + message(STATUS "Looking for Boost - ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} found") +else() + message(SEND_ERROR "Please install system boost version ${DART_MIN_BOOST_VERSION} or higher.") +endif() + +#=========================================== +# Optional dependencies for DART components +#=========================================== + +message(STATUS "") +message(STATUS "[ Optional dependencies for DART components ]") + +# OpenMP +if(ENABLE_OPENMP) + find_package(OpenMP QUIET) + if(OPENMP_FOUND) + message(STATUS "Looking for OpenMP - found") + else() + message(STATUS "Looking for OpenMP - NOT found") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") +endif() + +#--------------------------------- +# Dependencies for dart-optimizer +#--------------------------------- + +# NLOPT +find_package(NLOPT 2.4.1 QUIET) +if(NLOPT_FOUND) + message(STATUS "Looking for NLOPT - ${NLOPT_VERSION} found") + set(HAVE_NLOPT TRUE) +else() + message(STATUS "Looking for NLOPT - NOT found, to build dart-optimizer-nlopt, please install libnlopt-dev (>= 2.4.1)") + set(HAVE_NLOPT FALSE) +endif() + +# IPOPT +find_package(IPOPT 3.11.4 QUIET) +if(IPOPT_FOUND) + message(STATUS "Looking for IPOPT - ${IPOPT_VERSION} found") + set(HAVE_IPOPT TRUE) +else() + message(STATUS "Looking for IPOPT - NOT found, to build dart-optimizer-ipopt, please install coinor-libipopt-dev (>= 3.11.4)") + set(HAVE_IPOPT FALSE) +endif() + +# Shark +find_package(SHARK QUIET) +if(SHARK_FOUND) + message(STATUS "Looking for SHARK - ${SHARK_VERSION} found") + set(HAVE_SHARK TRUE) +else() + # message(STATUS "Looking for SHARK - NOT found, please install SHARK (http://image.diku.dk/shark)") + # TODO(JS): Disabled since not used anywhere for now + set(HAVE_SHARK FALSE) +endif() + +#--------------------------------- +# Dependencies for dart-collision +#--------------------------------- + +# Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with +# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed +# with Bullet, which uses relative paths and may break transitive dependencies. +find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET) + +if(BULLET_FOUND) + # Test whether Bullet was built with double precision. If so, we need to + # define the BT_USE_DOUBLE_PRECISION pre-processor directive before including + # any Bullet headers. This is a workaround for the fact that Bullet does not + # add the definition to BULLET_DEFINITIONS or generate a #cmakedefine header. + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_FLAGS "") + set(CMAKE_REQUIRED_DEFINITIONS "-DBT_USE_DOUBLE_PRECISION") + set(CMAKE_REQUIRED_INCLUDES "${BULLET_INCLUDE_DIRS}") + set(CMAKE_REQUIRED_LIBRARIES "${BULLET_LIBRARIES}") + check_cxx_source_compiles( + " + #include + int main() + { + btVector3 v(0., 0., 1.); + btStaticPlaneShape planeShape(v, 0.); + return 0; + } + " + BT_USE_DOUBLE_PRECISION + ) + + if(BT_USE_DOUBLE_PRECISION) + message(STATUS "Looking for Bullet - found (double precision)") + else() + message(STATUS "Looking for Bullet - found (single precision)") + endif() + + set(HAVE_BULLET_COLLISION TRUE) +else() + message(STATUS "Looking for Bullet - NOT found, to use BulletCollisionDetector, please install libbullet-dev") + set(HAVE_BULLET_COLLISION FALSE) +endif() + +#-------------------------------- +# Dependencies for dart-planning +#-------------------------------- + +# FLANN +find_package(FLANN 1.8.4 QUIET) +if(FLANN_FOUND) + message(STATUS "Looking for FLANN - ${FLANN_VERSION} found") +else() + message(STATUS "Looking for FLANN - NOT found, to build dart-planning, please install libflann-dev (>= 1.8.4)") +endif() + +#----------------------------- +# Dependencies for dart-utils +#----------------------------- + +# TINYXML +find_package(TINYXML 2.6.2 QUIET) +if(TINYXML_FOUND) + message(STATUS "Looking for TINYXML - ${TINYXML_VERSION} found") +else() + message(STATUS "Looking for TINYXML - NOT found, please install libtinyxml-dev (>= 2.6.2)") +endif() + +# TINYXML2 +find_package(TINYXML2 QUIET) +if(TINYXML2_FOUND) + message(STATUS "Looking for TINYXML2 - ${TINYXML2_VERSION} found") +else() + message(STATUS "Looking for TINYXML2 - NOT found, please install libtinyxml2-dev (>= 1.0.1)") +endif() + +# urdfdom +find_package(urdfdom QUIET) +if(urdfdom_FOUND) + message(STATUS "Looking for urdfdom - found") +else() + message(STATUS "Looking for urdfdom - NOT found, please install liburdfdom-dev") +endif() +if(MSVC) + set(urdfdom_LIBRARIES optimized urdfdom_sensor debug urdfdom_sensord + optimized urdfdom_model_state debug urdfdom_model_stated + optimized urdfdom_model debug urdfdom_modeld + optimized urdfdom_world debug urdfdom_worldd + optimized console_bridge debug console_bridged) +endif() + +#--------------------------- +# Dependencies for dart-gui +#--------------------------- + +# OpenGL +find_package(OpenGL QUIET) +if(OPENGL_FOUND) + message(STATUS "Looking for OpenGL - found") +else() + message(STATUS "Looking for OpenGL - NOT found, to build dart-gui, please install OpenGL") +endif() + +# GLUT +if(WIN32 AND NOT CYGWIN) + set(GLUT_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") + set(GLUT_LIBRARIES glut32) +else() + find_package(GLUT QUIET) + if(GLUT_FOUND) + message(STATUS "Looking for GLUT - found") + set(GLUT_LIBRARIES ${GLUT_glut_LIBRARY}) + else() + message(STATUS "Looking for GLUT - NOT found, to build dart-gui, please install freeglut3-dev") + endif() +endif() + +# OpenSceneGraph +if(DART_BUILD_GUI_OSG) + + find_package(OpenSceneGraph 3.0 QUIET + COMPONENTS osg osgViewer osgManipulator osgGA osgDB) + if(OPENSCENEGRAPH_FOUND) + message(STATUS "Looking for OpenSceneGraph - ${OPENSCENEGRAPH_VERSION} found") + set(HAVE_OPENSCENEGRAPH TRUE) + else(OPENSCENEGRAPH_FOUND) + # dart-gui-osg requires both OSG and OpenThreads. This section attempts to + # identify which of those are missing from the building machine and offer + # advice to the user for getting dart-gui-osg to build. + find_package(OpenThreads QUIET) + if(OPENTHREADS_FOUND) + set(warning_msg "Could NOT find OpenSceneGraph") + else(OPENTHREADS_FOUND) + if(OSG_LIBRARY) + set(warning_msg "Could NOT find OpenThreads") + else(OSG_LIBRARY) + set(warning_msg "Could NOT find OpenSceneGraph nor OpenThreads") + endif(OSG_LIBRARY) + endif(OPENTHREADS_FOUND) + message(WARNING "${warning_msg} -- we will skip dart-gui-osg\n" + "If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR") + set(HAVE_OPENSCENEGRAPH FALSE) + endif(OPENSCENEGRAPH_FOUND) + +else() + + message(STATUS "Skipping OpenSceneGraph (DART_BUILD_GUI_OSG == ${DART_BUILD_GUI_OSG})") + set(HAVE_OPENSCENEGRAPH FALSE) + +endif(DART_BUILD_GUI_OSG) + +#-------------------- +# Misc. dependencies +#-------------------- + +# Perl modules +find_package(PerlModules COMPONENTS Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor QUIET) +if("${PERLMODULES_FOUND}" STREQUAL "TRUE") + message(STATUS "Looking for PerlModules - found") +else() + message(STATUS "Looking for PerlModules - NOT found, to colorize gcc messages, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)") +endif() + +# Doxygen +find_package(Doxygen QUIET) +if(DOXYGEN_FOUND) + message(STATUS "Looking for Doxygen - ${DOXYGEN_VERSION} found") +else() + message(STATUS "Looking for Doxygen - NOT found, to generate the API documentation, please install doxygen") +endif() diff --git a/dart/CMakeLists.txt b/dart/CMakeLists.txt index c118755fed9b4..b5857112505f9 100644 --- a/dart/CMakeLists.txt +++ b/dart/CMakeLists.txt @@ -17,18 +17,12 @@ add_subdirectory(optimizer) add_subdirectory(integration) add_subdirectory(lcpsolver) add_subdirectory(math) -add_subdirectory(renderer) add_subdirectory(simulation) -if(NOT BUILD_CORE_ONLY) - add_subdirectory(gui) - add_subdirectory(planning) - add_subdirectory(utils) -endif() # Set header and source files -get_filename_component(dart_core_h "dart-core.h" ABSOLUTE) -set(dart_core_hdrs - ${dart_core_h} +get_filename_component(dart_h "dart.h" ABSOLUTE) +set(dart_hdrs + ${dart_h} ${dart_common_hdrs} ${dart_math_hdrs} ${dart_integration_hdrs} @@ -37,10 +31,9 @@ set(dart_core_hdrs ${dart_optimizer_hdrs} ${dart_collision_hdrs} ${dart_constraint_hdrs} - ${dart_renderer_hdrs} ${dart_simulation_hdrs} ) -set(dart_core_srcs +set(dart_srcs ${dart_common_srcs} ${dart_math_srcs} ${dart_integration_srcs} @@ -49,32 +42,17 @@ set(dart_core_srcs ${dart_optimizer_srcs} ${dart_collision_srcs} ${dart_constraint_srcs} - ${dart_renderer_srcs} ${dart_simulation_srcs} ) -if(NOT BUILD_CORE_ONLY) - get_filename_component(dart_h "dart.h" ABSOLUTE) - set(dart_hdrs - ${dart_h} - ${dart_gui_hdrs} - ${dart_planning_hdrs} - ${dart_utils_hdrs} - ) - set(dart_srcs - ${dart_gui_srcs} - ${dart_planning_srcs} - ${dart_utils_srcs} - ) -endif() - -# Library: dart-core -dart_add_library(dart-core ${dart_core_hdrs} ${dart_core_srcs}) -target_link_libraries(dart-core ${DART_CORE_DEPENDENCIES}) # Library: dart -if(NOT BUILD_CORE_ONLY) - dart_add_library(dart ${dart_hdrs} ${dart_srcs}) - target_link_libraries(dart dart-core ${DART_DEPENDENCIES}) +dart_add_library(dart ${dart_hdrs} ${dart_srcs}) +target_link_libraries(dart ${CCD_LIBRARIES} + ${FCL_LIBRARIES} + ${ASSIMP_LIBRARIES} + ${Boost_LIBRARIES}) +if(HAVE_BULLET_COLLISION) + target_link_libraries(dart ${BULLET_LIBRARIES}) endif() if(MSVC) @@ -84,22 +62,27 @@ if(MSVC) ) endif() -#install(FILES ${dart_core_hdrs} DESTINATION include/dart/ COMPONENT headers) -install(FILES dart-core.h DESTINATION include/dart/ COMPONENT headers) -install(TARGETS dart-core EXPORT DARTCoreTargets DESTINATION lib) -if(NOT BUILD_CORE_ONLY) -# install(FILES ${dart_hdrs} DESTINATION include/dart/ COMPONENT headers) - install(FILES dart.h DESTINATION include/dart/ COMPONENT headers) - install(TARGETS dart-core dart EXPORT DARTTargets DESTINATION lib) +install(FILES dart.h DESTINATION include/dart/ COMPONENT headers) +install(TARGETS dart EXPORT DARTTargets DESTINATION lib) + +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${dart_hdrs};${dart_srcs}" + CACHE INTERNAL "Files for coverage tests" FORCE) + +if(FLANN_FOUND) + add_subdirectory(planning) +endif() + +if(OPENGL_FOUND AND GLUT_FOUND) + add_subdirectory(gui) +endif() + +if(TINYXML_FOUND AND TINYXML2_FOUND AND urdfdom_FOUND) + add_subdirectory(utils) endif() # Setup the coveralls target and tell it to gather # coverage data for all the lib sources. if(DART_COVERALLS) - if(BUILD_CORE_ONLY) - message(SEND_ERROR "'BUILD_CORE_ONLY' option is 'on'. This option should be 'off' when 'DART_COVERALLS' option is 'on'.") - endif() - coveralls_setup("${dart_core_hdrs};${dart_core_srcs};${dart_hdrs};${dart_srcs}" ${DART_COVERALLS_UPLOAD}) + coveralls_setup("${dart_coveralls_files}" ${DART_COVERALLS_UPLOAD}) endif() - - diff --git a/dart/collision/CMakeLists.txt b/dart/collision/CMakeLists.txt index 9db930d4e0789..b305003972b91 100644 --- a/dart/collision/CMakeLists.txt +++ b/dart/collision/CMakeLists.txt @@ -14,20 +14,6 @@ endif() set(dart_collision_hdrs ${hdrs} "${dart_collision_hdrs};${detail_hdrs}" PARENT_SCOPE) set(dart_collision_srcs ${srcs} "${dart_collision_srcs};${detail_srcs}" PARENT_SCOPE) -# Library -#dart_add_library(dart_collision ${srcs} ${hdrs}) -#target_link_libraries( -# dart_collision -# dart_common -# dart_math -# dart_collision_dart -# dart_collision_fcl -# ${DART_CORE_DEPENDENCIES} -#) -#if(HAVE_BULLET_COLLISION) -# target_link_libraries(dart_collision dart_collision_bullet) -#endif() - # Generate header for this namespace dart_get_filename_components(header_names "collision headers" ${hdrs}) set( @@ -62,6 +48,3 @@ install( DESTINATION include/dart/collision/detail COMPONENT headers ) - -#install(TARGETS dart_collision EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_collision EXPORT DARTTargets DESTINATION lib) diff --git a/dart/collision/Contact.cpp b/dart/collision/Contact.cpp index 98f4269fbc0e8..d67ade9aed02f 100644 --- a/dart/collision/Contact.cpp +++ b/dart/collision/Contact.cpp @@ -2,7 +2,8 @@ * Copyright (c) 2016, Georgia Tech Research Corporation * All rights reserved. * - * Author(s): Jeongseok Lee + * Author(s): Jeongseok Lee , + * Michael X. Grey * * Georgia Tech Graphics Lab and Humanoid Robotics Lab * @@ -39,5 +40,21 @@ namespace dart { namespace collision { +//============================================================================== +Contact::Contact() + : point(Eigen::Vector3d::Zero()), + normal(Eigen::Vector3d::Zero()), + force(Eigen::Vector3d::Zero()), + collisionObject1(nullptr), + collisionObject2(nullptr), + penetrationDepth(0), + triID1(0), + triID2(0), + userData(nullptr) +{ + // TODO(MXG): Consider using NaN instead of zero for uninitialized quantities + // Do nothing +} + } // namespace collision } // namespace dart diff --git a/dart/collision/Contact.h b/dart/collision/Contact.h index 7d3f5a51f5c0b..5a7416377d850 100644 --- a/dart/collision/Contact.h +++ b/dart/collision/Contact.h @@ -47,6 +47,9 @@ namespace collision { /// Contact information struct Contact { + /// Default constructor + Contact(); + /// Contact point w.r.t. the world frame Eigen::Vector3d point; diff --git a/dart/collision/Result.cpp b/dart/collision/Result.cpp index 55333262fb879..e8e8d1ff65a3f 100644 --- a/dart/collision/Result.cpp +++ b/dart/collision/Result.cpp @@ -35,6 +35,11 @@ */ #include "dart/collision/Result.h" +#include "dart/collision/CollisionObject.h" + +#include "dart/dynamics/ShapeFrame.h" +#include "dart/dynamics/ShapeNode.h" +#include "dart/dynamics/BodyNode.h" namespace dart { namespace collision { @@ -43,6 +48,8 @@ namespace collision { void CollisionResult::addContact(const Contact& contact) { mContacts.push_back(contact); + addObject(contact.collisionObject1); + addObject(contact.collisionObject2); } //============================================================================== @@ -73,16 +80,72 @@ const std::vector& CollisionResult::getContacts() const return mContacts; } +//============================================================================== +const std::unordered_set& +CollisionResult::getCollidingBodyNodes() const +{ + return mCollidingBodyNodes; +} + +//============================================================================== +const std::unordered_set& +CollisionResult::getCollidingShapeFrames() const +{ + return mCollidingShapeFrames; +} + +//============================================================================== +bool CollisionResult::inCollision(const dynamics::BodyNode* bn) const +{ + return (mCollidingBodyNodes.find(bn) != mCollidingBodyNodes.end()); +} + +//============================================================================== +bool CollisionResult::inCollision(const dynamics::ShapeFrame* frame) const +{ + return (mCollidingShapeFrames.find(frame) != mCollidingShapeFrames.end()); +} + //============================================================================== bool CollisionResult::isCollision() const { return !mContacts.empty(); } +//============================================================================== +CollisionResult::operator bool() const +{ + return isCollision(); +} + //============================================================================== void CollisionResult::clear() { mContacts.clear(); + mCollidingShapeFrames.clear(); + mCollidingBodyNodes.clear(); +} + +//============================================================================== +void CollisionResult::addObject(CollisionObject* object) +{ + if(!object) + { + dterr << "[CollisionResult::addObject] Attempting to add a collision with " + << "a nullptr object to a CollisionResult instance. This is not " + << "allowed. Please report this as a bug!"; + assert(false); + return; + } + + const dynamics::ShapeFrame* frame = object->getShapeFrame(); + mCollidingShapeFrames.insert(frame); + + if(frame->isShapeNode()) + { + const dynamics::ShapeNode* node = frame->asShapeNode(); + mCollidingBodyNodes.insert(node->getBodyNodePtr()); + } } } // namespace collision diff --git a/dart/collision/Result.h b/dart/collision/Result.h index 4e3ded8970193..aad8149a2c30e 100644 --- a/dart/collision/Result.h +++ b/dart/collision/Result.h @@ -38,9 +38,18 @@ #define DART_COLLISION_RESULT_H_ #include +#include #include "dart/collision/Contact.h" namespace dart { + +namespace dynamics { + +class BodyNode; +class ShapeFrame; + +} // namespace dynamics + namespace collision { class CollisionResult @@ -62,17 +71,42 @@ class CollisionResult /// Return contacts const std::vector& getContacts() const; + /// Return the set of BodyNodes that are in collision + const std::unordered_set& + getCollidingBodyNodes() const; + + /// Return the set of ShapeFrames that are in collision + const std::unordered_set& + getCollidingShapeFrames() const; + + /// Returns true if the given BodyNode is in collision + bool inCollision(const dynamics::BodyNode* bn) const; + + /// Returns true if the given ShapeFrame is in collision + bool inCollision(const dynamics::ShapeFrame* frame) const; + /// Return binary collision result bool isCollision() const; + /// Implicitly converts this CollisionResult to the value of isCollision() + operator bool() const; + /// Clear all the contacts void clear(); protected: + void addObject(CollisionObject* object); + /// List of contact information for each contact std::vector mContacts; + /// Set of BodyNodes that are colliding + std::unordered_set mCollidingBodyNodes; + + /// Set of ShapeFrames that are colliding + std::unordered_set mCollidingShapeFrames; + }; } // namespace collision diff --git a/dart/collision/bullet/CMakeLists.txt b/dart/collision/bullet/CMakeLists.txt index 740f6a4e9ff7b..79e757aa74557 100644 --- a/dart/collision/bullet/CMakeLists.txt +++ b/dart/collision/bullet/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_collision_hdrs ${dart_collision_hdrs} ${hdrs} PARENT_SCOPE) set(dart_collision_srcs ${dart_collision_srcs} ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_collision_bullet ${srcs} ${hdrs}) -#target_link_libraries(dart_collision_bullet ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "collision_bullet headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/collision/bullet COMPONENT headers ) -#install(TARGETS dart_collision_bullet EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_collision_bullet EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/collision/dart/CMakeLists.txt b/dart/collision/dart/CMakeLists.txt index bb8971db1f137..fd07bf4083274 100644 --- a/dart/collision/dart/CMakeLists.txt +++ b/dart/collision/dart/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_collision_hdrs ${dart_collision_hdrs} ${hdrs} PARENT_SCOPE) set(dart_collision_srcs ${dart_collision_srcs} ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_collision_dart ${srcs} ${hdrs}) -#target_link_libraries(dart_collision_dart ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "collision_dart headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/collision/dart COMPONENT headers ) -#install(TARGETS dart_collision_dart EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_collision_dart EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/collision/dart/DARTCollide.cpp b/dart/collision/dart/DARTCollide.cpp index 9e7da65946a12..d9bc7ae8fae5c 100644 --- a/dart/collision/dart/DARTCollide.cpp +++ b/dart/collision/dart/DARTCollide.cpp @@ -35,6 +35,7 @@ */ #include "dart/collision/dart/DARTCollide.h" +#include "dart/collision/CollisionObject.h" #include @@ -417,7 +418,8 @@ void dClosestLineBoxPoints (const dVector3 p1, const dVector3 p2, // `contact' and `skip' are the contact array information provided to the // collision functions. this function only fills in the position and depth // fields. -int dBoxBox(const dVector3 p1, const dMatrix3 R1, const dVector3 side1, +int dBoxBox(CollisionObject* o1, CollisionObject* o2, + const dVector3 p1, const dMatrix3 R1, const dVector3 side1, const dVector3 p2, const dMatrix3 R2, const dVector3 side2, CollisionResult& result) { @@ -583,6 +585,8 @@ int dBoxBox(const dVector3 p1, const dMatrix3 R1, const dVector3 side1, penetration = -s; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point_vec; contact.normal = normal; contact.penetrationDepth = penetration; @@ -764,6 +768,8 @@ int dBoxBox(const dVector3 p1, const dMatrix3 R1, const dVector3 side1, point_vec << point[j*3+0] + pa[0], point[j*3+1] + pa[1], point[j*3+2] + pa[2]; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point_vec; contact.normal = normal; contact.penetrationDepth = dep[j]; @@ -791,6 +797,8 @@ int dBoxBox(const dVector3 p1, const dMatrix3 R1, const dVector3 side1, point_vec << point[iret[j]*3+0] + pa[0], point[iret[j]*3+1] + pa[1], point[iret[j]*3+2] + pa[2]; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point_vec; contact.normal = normal; contact.penetrationDepth = dep[iret[j]]; @@ -800,7 +808,8 @@ int dBoxBox(const dVector3 p1, const dMatrix3 R1, const dVector3 side1, return cnum; } -int collideBoxBox(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, +int collideBoxBox(CollisionObject* o1, CollisionObject* o2, + const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, const Eigen::Vector3d& size1, const Eigen::Isometry3d& T1, CollisionResult& result) { @@ -821,10 +830,11 @@ int collideBoxBox(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, convVector(T0.translation(), p0); convVector(T1.translation(), p1); - return dBoxBox(p1, R1, halfSize1, p0, R0, halfSize0, result); + return dBoxBox(o1, o2, p1, R1, halfSize1, p0, R0, halfSize0, result); } -int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, +int collideBoxSphere(CollisionObject* o1, CollisionObject* o2, + const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, const double& r1, const Eigen::Isometry3d& T1, CollisionResult& result) { @@ -874,6 +884,8 @@ int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, penetration = min + r1; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = c0; contact.normal = normal; contact.penetrationDepth = penetration; @@ -897,6 +909,8 @@ int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, normal *= (1.0/mag); Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = contactpt; contact.normal = normal; contact.penetrationDepth = penetration; @@ -925,6 +939,8 @@ int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, normal = T0.linear() * normal; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = contactpt; contact.normal = normal; contact.penetrationDepth = penetration; @@ -933,7 +949,8 @@ int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, return 1; } -int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, +int collideSphereBox(CollisionObject* o1, CollisionObject* o2, + const double& r0, const Eigen::Isometry3d& T0, const Eigen::Vector3d& size1, const Eigen::Isometry3d& T1, CollisionResult& result) { @@ -981,6 +998,8 @@ int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, penetration = min + r0; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = c0; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1004,10 +1023,13 @@ int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, normal *= (1.0/mag); Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = contactpt; contact.normal = normal; contact.penetrationDepth = penetration; - result.addContact(contact);} + result.addContact(contact); + } else { double min = size[0] - std::abs(p[0]); @@ -1030,6 +1052,8 @@ int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, normal = T1.linear() * normal; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = contactpt; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1038,7 +1062,7 @@ int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, return 1; } -int collideSphereSphere(const double& _r0, const Eigen::Isometry3d& c0, +int collideSphereSphere(CollisionObject* o1, CollisionObject* o2, const double& _r0, const Eigen::Isometry3d& c0, const double& _r1, const Eigen::Isometry3d& c1, CollisionResult& result) { @@ -1065,6 +1089,8 @@ int collideSphereSphere(const double& _r0, const Eigen::Isometry3d& c0, penetration = rsum; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1077,6 +1103,8 @@ int collideSphereSphere(const double& _r0, const Eigen::Isometry3d& c0, penetration = rsum - normal_sqr; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1085,7 +1113,7 @@ int collideSphereSphere(const double& _r0, const Eigen::Isometry3d& c0, } -int collideCylinderSphere(const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, +int collideCylinderSphere(CollisionObject* o1, CollisionObject* o2, const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, const double& sphere_rad, const Eigen::Isometry3d& T1, CollisionResult& result) { @@ -1096,6 +1124,8 @@ int collideCylinderSphere(const double& cyl_rad, const double& half_height, cons if ( dist < cyl_rad && std::abs(center[2]) < half_height + sphere_rad ) { Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.penetrationDepth = 0.5 * (half_height + sphere_rad - math::sign(center[2]) * center[2]); contact.point = T0 * Eigen::Vector3d(center[0], center[1], half_height - contact.penetrationDepth); contact.normal = T0.linear() * Eigen::Vector3d(0.0, 0.0, math::sign(center[2])); @@ -1120,6 +1150,8 @@ int collideCylinderSphere(const double& cyl_rad, const double& half_height, cons if (penetration > 0.0) { Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1136,6 +1168,8 @@ int collideCylinderSphere(const double& cyl_rad, const double& half_height, cons point = T0 * point; Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1147,7 +1181,7 @@ int collideCylinderSphere(const double& cyl_rad, const double& half_height, cons return 0; } -int collideCylinderPlane(const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, +int collideCylinderPlane(CollisionObject* o1, CollisionObject* o2, const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, const Eigen::Vector3d& plane_normal, const Eigen::Isometry3d& T1, CollisionResult& result) { @@ -1206,6 +1240,8 @@ int collideCylinderPlane(const double& cyl_rad, const double& half_height, const if (penetration > 0.0) { Contact contact; + contact.collisionObject1 = o1; + contact.collisionObject2 = o2; contact.point = point; contact.normal = normal; contact.penetrationDepth = penetration; @@ -1217,10 +1253,13 @@ int collideCylinderPlane(const double& cyl_rad, const double& half_height, const } //============================================================================== -int collide(dynamics::ConstShapePtr shape0, const Eigen::Isometry3d& T0, - dynamics::ConstShapePtr shape1, const Eigen::Isometry3d& T1, - CollisionResult& result) +int collide(CollisionObject* o1, CollisionObject* o2, CollisionResult& result) { + const dynamics::ConstShapePtr& shape0 = o1->getShape(); + const dynamics::ConstShapePtr& shape1 = o2->getShape(); + const Eigen::Isometry3d& T0 = o1->getTransform(); + const Eigen::Isometry3d& T1 = o2->getTransform(); + dynamics::Shape::ShapeType LeftType = shape0->getShapeType(); dynamics::Shape::ShapeType RightType = shape1->getShapeType(); @@ -1235,13 +1274,15 @@ int collide(dynamics::ConstShapePtr shape0, const Eigen::Isometry3d& T0, case dynamics::Shape::BOX: { const dynamics::BoxShape* box1 = static_cast(shape1.get()); - return collideBoxBox(box0->getSize(), T0, + return collideBoxBox(o1, o2, + box0->getSize(), T0, box1->getSize(), T1, result); } case dynamics::Shape::ELLIPSOID: { const dynamics::EllipsoidShape* ellipsoid1 = static_cast(shape1.get()); - return collideBoxSphere(box0->getSize(), T0, + return collideBoxSphere(o1, o2, + box0->getSize(), T0, ellipsoid1->getSize()[0] * 0.5, T1, result); } @@ -1264,14 +1305,16 @@ int collide(dynamics::ConstShapePtr shape0, const Eigen::Isometry3d& T0, case dynamics::Shape::BOX: { const dynamics::BoxShape* box1 = static_cast(shape1.get()); - return collideSphereBox(ellipsoid0->getSize()[0] * 0.5, T0, + return collideSphereBox(o1, o2, + ellipsoid0->getSize()[0] * 0.5, T0, box1->getSize(), T1, result); } case dynamics::Shape::ELLIPSOID: { const dynamics::EllipsoidShape* ellipsoid1 = static_cast(shape1.get()); - return collideSphereSphere(ellipsoid0->getSize()[0] * 0.5, T0, + return collideSphereSphere(o1, o2, + ellipsoid0->getSize()[0] * 0.5, T0, ellipsoid1->getSize()[0] * 0.5, T1, result); } @@ -1288,6 +1331,8 @@ int collide(dynamics::ConstShapePtr shape0, const Eigen::Isometry3d& T0, break; } + + return false; } } // namespace collision diff --git a/dart/collision/dart/DARTCollide.h b/dart/collision/dart/DARTCollide.h index 4a676c0c168a2..06ce1fb279cec 100644 --- a/dart/collision/dart/DARTCollide.h +++ b/dart/collision/dart/DARTCollide.h @@ -53,33 +53,38 @@ class Shape; namespace dart { namespace collision { -int collide(dart::dynamics::ConstShapePtr shape0, const Eigen::Isometry3d& T0, - dart::dynamics::ConstShapePtr shape1, const Eigen::Isometry3d& T1, +int collide(CollisionObject* o1, CollisionObject* o2, CollisionResult& result); -int collideBoxBox(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, +int collideBoxBox(CollisionObject* o1, CollisionObject* o2, + const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, const Eigen::Vector3d& size1, const Eigen::Isometry3d& T1, CollisionResult& result); -int collideBoxSphere(const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, +int collideBoxSphere(CollisionObject* o1, CollisionObject* o2, + const Eigen::Vector3d& size0, const Eigen::Isometry3d& T0, const double& r1, const Eigen::Isometry3d& T1, CollisionResult& result); -int collideSphereBox(const double& r0, const Eigen::Isometry3d& T0, +int collideSphereBox(CollisionObject* o1, CollisionObject* o2, + const double& r0, const Eigen::Isometry3d& T0, const Eigen::Vector3d& size1, const Eigen::Isometry3d& T1, CollisionResult& result); -int collideSphereSphere(const double& r0, const Eigen::Isometry3d& c0, +int collideSphereSphere(CollisionObject* o1, CollisionObject* o2, + const double& r0, const Eigen::Isometry3d& c0, const double& r1, const Eigen::Isometry3d& c1, CollisionResult& result); int collideCylinderSphere( + CollisionObject* o1, CollisionObject* o2, const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, const double& sphere_rad, const Eigen::Isometry3d& T1, CollisionResult& result); int collideCylinderPlane( + CollisionObject* o1, CollisionObject* o2, const double& cyl_rad, const double& half_height, const Eigen::Isometry3d& T0, const Eigen::Vector3d& plane_normal, const Eigen::Isometry3d& T1, diff --git a/dart/collision/dart/DARTCollisionDetector.cpp b/dart/collision/dart/DARTCollisionDetector.cpp index 56bf7aa4747e2..fa9590bf0ecab 100644 --- a/dart/collision/dart/DARTCollisionDetector.cpp +++ b/dart/collision/dart/DARTCollisionDetector.cpp @@ -261,9 +261,7 @@ bool checkPair(CollisionObject* o1, CollisionObject* o2, CollisionResult pairResult; // Perform narrow-phase detection - auto colliding = collide(o1->getShape(), o1->getTransform(), - o2->getShape(), o2->getTransform(), - pairResult); + auto colliding = collide(o1, o2, pairResult); postProcess(o1, o2, option, result, pairResult); diff --git a/dart/collision/fcl/CMakeLists.txt b/dart/collision/fcl/CMakeLists.txt index 2396884fc7ff5..453a8c0e72b1d 100644 --- a/dart/collision/fcl/CMakeLists.txt +++ b/dart/collision/fcl/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_collision_hdrs ${dart_collision_hdrs} ${hdrs} PARENT_SCOPE) set(dart_collision_srcs ${dart_collision_srcs} ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_collision_fcl ${srcs} ${hdrs}) -#target_link_libraries(dart_collision_fcl ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "collision_fcl headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/collision/fcl COMPONENT headers ) -#install(TARGETS dart_collision_fcl EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_collision_fcl EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/common/CMakeLists.txt b/dart/common/CMakeLists.txt index 616e3ee7b9c42..41c3c9ba32ff3 100644 --- a/dart/common/CMakeLists.txt +++ b/dart/common/CMakeLists.txt @@ -7,10 +7,6 @@ file(GLOB detail_hdrs "detail/*.h") set(dart_common_hdrs "${hdrs};${detail_hdrs}" PARENT_SCOPE) set(dart_common_srcs "${srcs};${detail_srcs}" PARENT_SCOPE) -# Library -#dart_add_library(dart_common ${srcs} ${hdrs}) -#target_link_libraries(dart_common ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "common headers" ${hdrs}) dart_generate_include_header_list( @@ -36,7 +32,3 @@ install( DESTINATION include/dart/common/detail COMPONENT headers ) - -#install(TARGETS dart_common EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_common EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/config.h.in b/dart/config.h.in index 9235c478b3fd3..21c7a3ca9b7b9 100644 --- a/dart/config.h.in +++ b/dart/config.h.in @@ -47,8 +47,6 @@ #cmakedefine01 HAVE_SNOPT #cmakedefine01 HAVE_BULLET_COLLISION -#cmakedefine01 DART_USE_FCLMESHCOLLISIONDETECTOR - #define DART_ROOT_PATH "@CMAKE_SOURCE_DIR@/" #define DART_DATA_PATH "@CMAKE_SOURCE_DIR@/data/" diff --git a/dart/constraint/CMakeLists.txt b/dart/constraint/CMakeLists.txt index 3f8e3ada0d7c3..0f4cb7e63c46f 100644 --- a/dart/constraint/CMakeLists.txt +++ b/dart/constraint/CMakeLists.txt @@ -5,15 +5,6 @@ file(GLOB hdrs "*.h") set(dart_constraint_hdrs ${hdrs} PARENT_SCOPE) set(dart_constraint_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_constraint ${srcs} ${hdrs}) -#target_link_libraries( -# dart_constraint -# dart_collision -# dart_lcpsolver -# ${DART_CORE_DEPENDENCIES} -#) - # Generate header for this namespace dart_get_filename_components(header_names "constraint headers" ${hdrs}) dart_generate_include_header_list( @@ -33,6 +24,3 @@ install( DESTINATION include/dart/constraint COMPONENT headers ) -#install(TARGETS dart_constraint EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_constraint EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/constraint/ConstraintSolver.cpp b/dart/constraint/ConstraintSolver.cpp index 6d2aaa5624d49..0ba8b795b35f2 100644 --- a/dart/constraint/ConstraintSolver.cpp +++ b/dart/constraint/ConstraintSolver.cpp @@ -291,7 +291,12 @@ LCPSolver* ConstraintSolver::getLCPSolver() const void ConstraintSolver::solve() { for (size_t i = 0; i < mSkeletons.size(); ++i) + { mSkeletons[i]->clearConstraintImpulses(); +DART_SUPPRESS_DEPRECATED_BEGIN + mSkeletons[i]->clearCollidingBodies(); +DART_SUPPRESS_DEPRECATED_END + } // Update constraints and collect active constraints updateConstraints(); @@ -394,6 +399,17 @@ void ConstraintSolver::updateConstraints() { auto& ct = mCollisionResult.getContact(i); + // Set colliding bodies + auto shapeFrame1 = const_cast( + ct.collisionObject1->getShapeFrame()); + auto shapeFrame2 = const_cast( + ct.collisionObject2->getShapeFrame()); + +DART_SUPPRESS_DEPRECATED_BEGIN + shapeFrame1->asShapeNode()->getBodyNodePtr()->setColliding(true); + shapeFrame2->asShapeNode()->getBodyNodePtr()->setColliding(true); +DART_SUPPRESS_DEPRECATED_END + if (isSoftContact(ct)) { mSoftContactConstraints.push_back( diff --git a/dart/constraint/SoftContactConstraint.cpp b/dart/constraint/SoftContactConstraint.cpp index 2af46a45b7618..b97d0be891984 100644 --- a/dart/constraint/SoftContactConstraint.cpp +++ b/dart/constraint/SoftContactConstraint.cpp @@ -109,6 +109,7 @@ SoftContactConstraint::SoftContactConstraint( { mPointMass1 = selectCollidingPointMass(mSoftBodyNode1, contact.point, contact.triID1); + mPointMass1->setColliding(true); } } if (mSoftBodyNode2) @@ -118,6 +119,7 @@ SoftContactConstraint::SoftContactConstraint( { mPointMass2 = selectCollidingPointMass(mSoftBodyNode2, contact.point, contact.triID2); + mPointMass2->setColliding(true); } } diff --git a/dart/dart-core.h b/dart/dart-core.h deleted file mode 100644 index db2a5e47d4531..0000000000000 --- a/dart/dart-core.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Georgia Tech Research Corporation - * All rights reserved. - * - * Author(s): Jeongseok Lee - * - * Georgia Tech Graphics Lab and Humanoid Robotics Lab - * - * Directed by Prof. C. Karen Liu and Prof. Mike Stilman - * - * - * This file is provided under the following "BSD-style" License: - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dart/config.h" -#include "dart/collision/collision.h" -#include "dart/common/common.h" -#include "dart/constraint/constraint.h" -#include "dart/dynamics/dynamics.h" -#include "dart/integration/integration.h" -#include "dart/lcpsolver/lcpsolver.h" -#include "dart/math/math.h" -#include "dart/renderer/renderer.h" -#include "dart/simulation/simulation.h" diff --git a/dart/dart.h b/dart/dart.h index d53f0c83a5e8f..75759b40a196a 100644 --- a/dart/dart.h +++ b/dart/dart.h @@ -34,8 +34,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/dart-core.h" -#include "dart/gui/gui.h" +#include "dart/config.h" +#include "dart/common/common.h" +#include "dart/math/math.h" +#include "dart/integration/integration.h" +#include "dart/collision/collision.h" +#include "dart/lcpsolver/lcpsolver.h" +#include "dart/constraint/constraint.h" #include "dart/optimizer/optimizer.h" -#include "dart/planning/planning.h" -#include "dart/utils/utils.h" +#include "dart/dynamics/dynamics.h" +#include "dart/simulation/simulation.h" diff --git a/dart/dynamics/BodyNode.cpp b/dart/dynamics/BodyNode.cpp index 26f3c245117c1..9fa3b9a3e8c66 100644 --- a/dart/dynamics/BodyNode.cpp +++ b/dart/dynamics/BodyNode.cpp @@ -180,6 +180,18 @@ BodyNode::~BodyNode() delete mParentJoint; } +//============================================================================== +SoftBodyNode* BodyNode::asSoftBodyNode() +{ + return nullptr; +} + +//============================================================================== +const SoftBodyNode* BodyNode::asSoftBodyNode() const +{ + return nullptr; +} + //============================================================================== void BodyNode::setProperties(const ExtendedProperties& _properties) { diff --git a/dart/dynamics/BodyNode.h b/dart/dynamics/BodyNode.h index d5b9a8d574939..c5812aa2377ca 100644 --- a/dart/dynamics/BodyNode.h +++ b/dart/dynamics/BodyNode.h @@ -103,6 +103,14 @@ class BodyNode : /// Destructor virtual ~BodyNode(); + /// Convert 'this' into a SoftBodyNode pointer if this BodyNode is a + /// SoftBodyNode, otherwise return nullptr + virtual SoftBodyNode* asSoftBodyNode(); + + /// Convert 'const this' into a SoftBodyNode pointer if this BodyNode is a + /// SoftBodyNode, otherwise return nullptr + virtual const SoftBodyNode* asSoftBodyNode() const; + /// Set the ExtendedProperties of this BodyNode void setProperties(const ExtendedProperties& _properties); @@ -699,13 +707,16 @@ class BodyNode : /// Return the velocity change due to the constraint impulse const Eigen::Vector6d& getBodyVelocityChange() const; - /// Set whether this body node is colliding with others. This is called by - /// collision detector. + /// Set whether this body node is colliding with other objects. Note that + /// this status is set by the constraint solver during dynamics simulation but + /// not by collision detector. /// \param[in] True if this body node is colliding. + DEPRECATED(6.0) void setColliding(bool _isColliding); - /// Return whether this body node is colliding with others + /// Return whether this body node is set to be colliding with other objects. /// \return True if this body node is colliding. + DEPRECATED(6.0) bool isColliding(); /// Add applying linear Cartesian forces to this node @@ -1024,6 +1035,7 @@ class BodyNode : UniqueProperties mBodyP; /// Whether the node is currently in collision with another node. + /// \deprecated DEPRECATED(6.0) See #670 for more detail. bool mIsColliding; //-------------------------------------------------------------------------- diff --git a/dart/dynamics/CMakeLists.txt b/dart/dynamics/CMakeLists.txt index a4b9c174ba4a2..21642c2866f3b 100644 --- a/dart/dynamics/CMakeLists.txt +++ b/dart/dynamics/CMakeLists.txt @@ -6,15 +6,6 @@ file(GLOB detail "detail/*.h") set(dart_dynamics_hdrs "${hdrs};${detail}" PARENT_SCOPE) set(dart_dynamics_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_dynamics ${srcs} ${hdrs}) -#target_link_libraries( -# dart_dynamics -# dart_common -# dart_math -# ${DART_CORE_DEPENDENCIES} -#) - # Generate header for this namespace dart_get_filename_components(header_names "dynamics headers" ${hdrs}) dart_generate_include_header_list( @@ -40,6 +31,3 @@ install( DESTINATION include/dart/dynamics/detail COMPONENT headers ) - -#install(TARGETS dart_dynamics EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_dynamics EXPORT DARTTargets DESTINATION lib) diff --git a/dart/dynamics/MetaSkeleton.h b/dart/dynamics/MetaSkeleton.h index 7d6041ea28ada..53e4aa36fce5c 100644 --- a/dart/dynamics/MetaSkeleton.h +++ b/dart/dynamics/MetaSkeleton.h @@ -537,6 +537,10 @@ class MetaSkeleton : public common::Subject /// Get the potential energy of this MetaSkeleton virtual double getPotentialEnergy() const = 0; + /// Clear collision flags of the BodyNodes in this MetaSkeleton + DEPRECATED(6.0) + virtual void clearCollidingBodies() = 0; + /// \} //---------------------------------------------------------------------------- diff --git a/dart/dynamics/PointMass.h b/dart/dynamics/PointMass.h index 6df83d7be6969..95fa3de38a0e7 100644 --- a/dart/dynamics/PointMass.h +++ b/dart/dynamics/PointMass.h @@ -156,11 +156,13 @@ class PointMass : public common::Subject const PointMass* getConnectedPointMass(size_t _idx) const; - /// Set whether this point mass is colliding with others. + /// Set whether this point mass is colliding with other objects. Note that + /// this status is set by the constraint solver during dynamics simulation but + /// not by collision detector. /// \param[in] True if this point mass is colliding. void setColliding(bool _isColliding); - /// Get whether this point mass is colliding with others. + /// Return whether this point mass is set to be colliding with other objects. /// \return True if this point mass is colliding. bool isColliding(); diff --git a/dart/dynamics/ReferentialSkeleton.cpp b/dart/dynamics/ReferentialSkeleton.cpp index daf6a25665e9e..9743a19742d5f 100644 --- a/dart/dynamics/ReferentialSkeleton.cpp +++ b/dart/dynamics/ReferentialSkeleton.cpp @@ -35,7 +35,10 @@ */ #include "dart/dynamics/ReferentialSkeleton.h" + +#include "dart/common/Deprecated.h" #include "dart/dynamics/BodyNode.h" +#include "dart/dynamics/SoftBodyNode.h" #include "dart/dynamics/Joint.h" #include "dart/dynamics/DegreeOfFreedom.h" @@ -785,6 +788,27 @@ double ReferentialSkeleton::getPotentialEnergy() const return PE; } +//============================================================================== +void ReferentialSkeleton::clearCollidingBodies() +{ + for (auto i = 0u; i < getNumBodyNodes(); ++i) + { + auto bodyNode = getBodyNode(i); +DART_SUPPRESS_DEPRECATED_BEGIN + bodyNode->setColliding(false); +DART_SUPPRESS_DEPRECATED_END + + auto softBodyNode = bodyNode->asSoftBodyNode(); + if (softBodyNode) + { + auto& pointMasses = softBodyNode->getPointMasses(); + + for (auto pointMass : pointMasses) + pointMass->setColliding(false); + } + } +} + //============================================================================== Eigen::Vector3d ReferentialSkeleton::getCOM(const Frame* _withRespectTo) const { diff --git a/dart/dynamics/ReferentialSkeleton.h b/dart/dynamics/ReferentialSkeleton.h index eda06c81ed04d..fc69bad483f07 100644 --- a/dart/dynamics/ReferentialSkeleton.h +++ b/dart/dynamics/ReferentialSkeleton.h @@ -273,6 +273,10 @@ class ReferentialSkeleton : public MetaSkeleton // Documentation inherited double getPotentialEnergy() const override; + // Documentation inherited + DEPRECATED(6.0) + void clearCollidingBodies() override; + /// \} //---------------------------------------------------------------------------- diff --git a/dart/dynamics/Shape.h b/dart/dynamics/Shape.h index 4ecfa28299a32..b5d62a454374d 100644 --- a/dart/dynamics/Shape.h +++ b/dart/dynamics/Shape.h @@ -46,7 +46,6 @@ #include "dart/common/Deprecated.h" #include "dart/common/Subject.h" #include "dart/dynamics/SmartPointer.h" -#include "dart/common/Deprecated.h" namespace dart { namespace dynamics { diff --git a/dart/dynamics/ShapeFrame.h b/dart/dynamics/ShapeFrame.h index c0b7c9a8279e5..6da6b95d77541 100644 --- a/dart/dynamics/ShapeFrame.h +++ b/dart/dynamics/ShapeFrame.h @@ -323,7 +323,10 @@ class ShapeFrame : virtual ShapeNode* asShapeNode(); /// Convert 'const this' into a ShapeNode pointer if ShapeFrame is a ShapeNode, - /// otherwise return nullptr + /// otherwise return nullptr. + /// + /// This should be preferred over performing a dynamic_cast when you want to + /// cast a ShapeFrame into a ShapeNode, because this method costs less. virtual const ShapeNode* asShapeNode() const; protected: diff --git a/dart/dynamics/ShapeNode.cpp b/dart/dynamics/ShapeNode.cpp index c3933fccc403b..82c194b87328d 100644 --- a/dart/dynamics/ShapeNode.cpp +++ b/dart/dynamics/ShapeNode.cpp @@ -337,6 +337,7 @@ ShapeNode::ShapeNode(BodyNode* bodyNode, const Properties& properties) onShapeUpdated(mShapeUpdatedSignal), onRelativeTransformUpdated(mRelativeTransformUpdatedSignal) { + mAmShapeNode = true; setProperties(properties); } @@ -354,6 +355,7 @@ ShapeNode::ShapeNode(BodyNode* bodyNode, onShapeUpdated(mShapeUpdatedSignal), onRelativeTransformUpdated(mRelativeTransformUpdatedSignal) { + mAmShapeNode = true; Properties prop; prop.mShape = shape; prop.mName = name; diff --git a/dart/dynamics/Skeleton.cpp b/dart/dynamics/Skeleton.cpp index bf51486babab8..dff047911c588 100644 --- a/dart/dynamics/Skeleton.cpp +++ b/dart/dynamics/Skeleton.cpp @@ -43,6 +43,7 @@ #include #include "dart/common/Console.h" +#include "dart/common/Deprecated.h" #include "dart/common/StlHelpers.h" #include "dart/math/Geometry.h" #include "dart/math/Helpers.h" @@ -3613,6 +3614,27 @@ double Skeleton::getPotentialEnergy() const return PE; } +//============================================================================== +void Skeleton::clearCollidingBodies() +{ + for (auto i = 0u; i < getNumBodyNodes(); ++i) + { + auto bodyNode = getBodyNode(i); +DART_SUPPRESS_DEPRECATED_BEGIN + bodyNode->setColliding(false); +DART_SUPPRESS_DEPRECATED_END + + auto softBodyNode = bodyNode->asSoftBodyNode(); + if (softBodyNode) + { + auto& pointMasses = softBodyNode->getPointMasses(); + + for (auto pointMass : pointMasses) + pointMass->setColliding(false); + } + } +} + //============================================================================== Eigen::Vector3d Skeleton::getCOM(const Frame* _withRespectTo) const { diff --git a/dart/dynamics/Skeleton.h b/dart/dynamics/Skeleton.h index 569a1fb1b259e..c65a5431f0512 100644 --- a/dart/dynamics/Skeleton.h +++ b/dart/dynamics/Skeleton.h @@ -878,6 +878,10 @@ class Skeleton : // Documentation inherited double getPotentialEnergy() const override; + // Documentation inherited + DEPRECATED(6.0) + void clearCollidingBodies() override; + /// \} //---------------------------------------------------------------------------- diff --git a/dart/dynamics/SoftBodyNode.cpp b/dart/dynamics/SoftBodyNode.cpp index 3e47a4e2f09f8..ad011c7799367 100644 --- a/dart/dynamics/SoftBodyNode.cpp +++ b/dart/dynamics/SoftBodyNode.cpp @@ -127,6 +127,18 @@ SoftBodyNode::~SoftBodyNode() delete mNotifier; } +//============================================================================== +SoftBodyNode* SoftBodyNode::asSoftBodyNode() +{ + return this; +} + +//============================================================================== +const SoftBodyNode* SoftBodyNode::asSoftBodyNode() const +{ + return this; +} + //============================================================================== void SoftBodyNode::setProperties(const Properties& _properties) { diff --git a/dart/dynamics/SoftBodyNode.h b/dart/dynamics/SoftBodyNode.h index cac06047f8b26..9be2fdc64a16d 100644 --- a/dart/dynamics/SoftBodyNode.h +++ b/dart/dynamics/SoftBodyNode.h @@ -121,6 +121,12 @@ class SoftBodyNode : public BodyNode /// \brief virtual ~SoftBodyNode(); + // Documentation inherited + SoftBodyNode* asSoftBodyNode() override; + + // Documentation inherited + const SoftBodyNode* asSoftBodyNode() const override; + /// Set the Properties of this SoftBodyNode void setProperties(const Properties& _properties); diff --git a/dart/gui/CMakeLists.txt b/dart/gui/CMakeLists.txt index 39dadcc3526db..754f735f79d79 100644 --- a/dart/gui/CMakeLists.txt +++ b/dart/gui/CMakeLists.txt @@ -2,22 +2,20 @@ file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +include_directories(SYSTEM ${OPENGL_INCLUDE_DIR}) +include_directories(SYSTEM ${GLUT_INCLUDE_DIR}) + # Add subdirectories if(HAVE_OPENSCENEGRAPH) add_subdirectory(osg) endif(HAVE_OPENSCENEGRAPH) -set(dart_gui_hdrs ${dart_gui_hdrs} ${hdrs} PARENT_SCOPE) -set(dart_gui_srcs ${dart_gui_srcs} ${srcs} PARENT_SCOPE) +set(dart_gui_hdrs ${dart_gui_hdrs} ${hdrs}) +set(dart_gui_srcs ${dart_gui_srcs} ${srcs}) # Library -#dart_add_library(dart_gui ${srcs} ${hdrs}) -#target_link_libraries( -# dart_gui -# dart_collision -# dart_simulation -# ${DART_DEPENDENCIES} -#) +dart_add_library(dart-gui ${srcs} ${hdrs}) +target_link_libraries(dart-gui dart-utils ${GLUT_LIBRARY} ${OPENGL_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "gui headers" ${hdrs}) @@ -41,5 +39,8 @@ install( DESTINATION include/dart/gui COMPONENT headers ) -#install(TARGETS dart_gui EXPORT DARTTargets DESTINATION lib) +install(TARGETS dart-gui EXPORT DARTTargets DESTINATION lib) +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/gui/GLFuncs.cpp b/dart/gui/GLFuncs.cpp index 0a774744eb878..0a10c829fb1d4 100644 --- a/dart/gui/GLFuncs.cpp +++ b/dart/gui/GLFuncs.cpp @@ -42,8 +42,8 @@ #include +#include "dart/gui/LoadOpengl.h" #include "dart/gui/LoadGlut.h" -#include "dart/renderer/LoadOpengl.h" namespace dart { namespace gui { diff --git a/dart/gui/GlutWindow.cpp b/dart/gui/GlutWindow.cpp index 526b8a724cbd2..8329d6d634971 100644 --- a/dart/gui/GlutWindow.cpp +++ b/dart/gui/GlutWindow.cpp @@ -53,7 +53,7 @@ #include "dart/common/Console.h" #include "dart/gui/LoadGlut.h" #include "dart/gui/GLFuncs.h" -#include "dart/renderer/OpenGLRenderInterface.h" +#include "dart/gui/OpenGLRenderInterface.h" namespace dart { namespace gui { @@ -101,7 +101,7 @@ void GlutWindow::initWindow(int _w, int _h, const char* _name) { glutPassiveMotionFunc(mouseMove); delete mRI; - mRI = new renderer::OpenGLRenderInterface(); + mRI = new gui::OpenGLRenderInterface(); mRI->initialize(); // glutTimerFunc(mDisplayTimeout, refreshTimer, 0); // glutTimerFunc(mDisplayTimeout, runTimer, 0); diff --git a/dart/gui/GlutWindow.h b/dart/gui/GlutWindow.h index 87f7eedfeb097..b9f9392aba776 100644 --- a/dart/gui/GlutWindow.h +++ b/dart/gui/GlutWindow.h @@ -40,8 +40,8 @@ #include -#include "dart/renderer/LoadOpengl.h" -#include "dart/renderer/RenderInterface.h" +#include "dart/gui/LoadOpengl.h" +#include "dart/gui/RenderInterface.h" #include "dart/gui/lodepng.h" namespace dart { @@ -93,7 +93,7 @@ class GlutWindow { bool mMouseDrag; bool mCapture; double mBackground[4]; - renderer::RenderInterface* mRI; + gui::RenderInterface* mRI; std::vector mScreenshotTemp; std::vector mScreenshotTemp2; }; diff --git a/dart/gui/Jitter.h b/dart/gui/Jitter.h index a4e4d163cdc02..0a2ba6a2edbaa 100644 --- a/dart/gui/Jitter.h +++ b/dart/gui/Jitter.h @@ -53,7 +53,7 @@ accwindow() routine. #ifndef DART_GUI_JITTER_H_ #define DART_GUI_JITTER_H_ -#include "dart/renderer/LoadOpengl.h" +#include "dart/gui/LoadOpengl.h" namespace dart { namespace gui { diff --git a/dart/renderer/LoadOpengl.h b/dart/gui/LoadOpengl.h similarity index 95% rename from dart/renderer/LoadOpengl.h rename to dart/gui/LoadOpengl.h index 7303d591cf79a..ca0e2e7850870 100644 --- a/dart/renderer/LoadOpengl.h +++ b/dart/gui/LoadOpengl.h @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DART_RENDERER_LOADOPENGL_H_ -#define DART_RENDERER_LOADOPENGL_H_ +#ifndef DART_GUI_LOADOPENGL_H_ +#define DART_GUI_LOADOPENGL_H_ #if defined(_WIN32) #ifdef NOMINMAX @@ -57,4 +57,4 @@ #error "Load OpenGL Error: What's your operating system?" #endif -#endif // DART_RENDERER_LOADOPENGL_H_ +#endif // DART_GUI_LOADOPENGL_H_ diff --git a/dart/renderer/OpenGLRenderInterface.cpp b/dart/gui/OpenGLRenderInterface.cpp similarity index 99% rename from dart/renderer/OpenGLRenderInterface.cpp rename to dart/gui/OpenGLRenderInterface.cpp index e6978918f0b15..244c91129c8a5 100644 --- a/dart/renderer/OpenGLRenderInterface.cpp +++ b/dart/gui/OpenGLRenderInterface.cpp @@ -47,8 +47,8 @@ #include "dart/dynamics/EllipsoidShape.h" #include "dart/dynamics/MeshShape.h" #include "dart/dynamics/LineSegmentShape.h" -#include "dart/renderer/LoadOpengl.h" -#include "dart/renderer/OpenGLRenderInterface.h" +#include "dart/gui/LoadOpengl.h" +#include "dart/gui/OpenGLRenderInterface.h" // Code taken from glut/lib/glut_shapes.c static GLUquadricObj *quadObj; @@ -65,7 +65,7 @@ static void initQuadObj(void) //glut/lib/glut_shapes.c namespace dart { -namespace renderer { +namespace gui { void OpenGLRenderInterface::initialize() { glMatrixMode(GL_MODELVIEW); @@ -539,5 +539,5 @@ void OpenGLRenderInterface::saveToImage(const char* /*_filename*/, DecoBufferTyp } -} // namespace renderer +} // namespace gui } // namespace dart diff --git a/dart/renderer/OpenGLRenderInterface.h b/dart/gui/OpenGLRenderInterface.h similarity index 94% rename from dart/renderer/OpenGLRenderInterface.h rename to dart/gui/OpenGLRenderInterface.h index 37035c7db9600..8ed2d431a1f7c 100644 --- a/dart/renderer/OpenGLRenderInterface.h +++ b/dart/gui/OpenGLRenderInterface.h @@ -34,14 +34,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DART_RENDERER_OPENGLRENDERINTERFACE_H -#define DART_RENDERER_OPENGLRENDERINTERFACE_H +#ifndef DART_GUI_OPENGLRENDERINTERFACE_H_ +#define DART_GUI_OPENGLRENDERINTERFACE_H_ #include #include #include "dart/common/Deprecated.h" -#include "dart/renderer/RenderInterface.h" -#include "dart/renderer/LoadOpengl.h" +#include "dart/gui/RenderInterface.h" +#include "dart/gui/LoadOpengl.h" namespace dart { @@ -52,7 +52,7 @@ class Shape; class ShapeFrame; } -namespace renderer { +namespace gui { class OpenGLRenderInterface : public RenderInterface { public: @@ -115,7 +115,7 @@ class OpenGLRenderInterface : public RenderInterface { EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; -} // namespace renderer +} // namespace gui } // namespace dart -#endif // #ifndef DART_RENDERER_OPENGLRENDERINTERFACE_H +#endif // #ifndef DART_GUI_OPENGLRENDERINTERFACE_H_ diff --git a/dart/renderer/RenderInterface.cpp b/dart/gui/RenderInterface.cpp similarity index 98% rename from dart/renderer/RenderInterface.cpp rename to dart/gui/RenderInterface.cpp index 22bdfbc1c4b48..4ce89d4848617 100644 --- a/dart/renderer/RenderInterface.cpp +++ b/dart/gui/RenderInterface.cpp @@ -37,7 +37,7 @@ #include "RenderInterface.h" namespace dart { -namespace renderer { +namespace gui { void RenderInterface::initialize() { @@ -164,5 +164,5 @@ void RenderInterface::readFrameBuffer(DecoBufferType /*_buffType*/, DecoColorCha } -} // namespace renderer +} // namespace gui } // namespace dart diff --git a/dart/renderer/RenderInterface.h b/dart/gui/RenderInterface.h similarity index 95% rename from dart/renderer/RenderInterface.h rename to dart/gui/RenderInterface.h index ac48bdb1a0f8f..7602d4039647a 100644 --- a/dart/renderer/RenderInterface.h +++ b/dart/gui/RenderInterface.h @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DART_RENDERER_RENDERINTERFACE_H -#define DART_RENDERER_RENDERINTERFACE_H +#ifndef DART_GUI_RENDERINTERFACE_H_ +#define DART_GUI_RENDERINTERFACE_H_ #include #include @@ -44,7 +44,7 @@ #include "dart/math/MathTypes.h" namespace dart { -namespace renderer { +namespace gui { enum DecoBufferType { BT_Front, @@ -115,7 +115,7 @@ class RenderInterface { virtual void readFrameBuffer(DecoBufferType _buffType, DecoColorChannel _ch, void* _pixels); }; -} // namespace renderer +} // namespace gui } // namespace dart -#endif // #ifndef DART_RENDERER_RENDERINTERFACE_H +#endif // #ifndef DART_GUI_RENDERINTERFACE_H_ diff --git a/dart/gui/Trackball.cpp b/dart/gui/Trackball.cpp index 067712d8a3235..1e95f15248c51 100644 --- a/dart/gui/Trackball.cpp +++ b/dart/gui/Trackball.cpp @@ -36,7 +36,7 @@ #include "dart/gui/Trackball.h" -#include "dart/renderer/LoadOpengl.h" +#include "dart/gui/LoadOpengl.h" namespace dart { namespace gui { diff --git a/dart/gui/gui.h.in b/dart/gui/gui.h.in index 3d277d4bde4b0..475eb5d51b177 100644 --- a/dart/gui/gui.h.in +++ b/dart/gui/gui.h.in @@ -1,3 +1,4 @@ // Automatically generated file by cmake +#include "dart/utils/utils.h" ${gui_headers} diff --git a/dart/gui/osg/CMakeLists.txt b/dart/gui/osg/CMakeLists.txt index dc70239ea474f..8d7334ad2b70b 100644 --- a/dart/gui/osg/CMakeLists.txt +++ b/dart/gui/osg/CMakeLists.txt @@ -4,10 +4,14 @@ include_directories(SYSTEM ${OPENSCENEGRAPH_INCLUDE_DIRS}) file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") +set(dart_gui_osg_hdrs ${hdrs}) +set(dart_gui_osg_srcs ${srcs}) + add_subdirectory(render) -set(dart_gui_hdrs ${dart_gui_hdrs} ${hdrs} PARENT_SCOPE) -set(dart_gui_srcs ${dart_gui_srcs} ${srcs} PARENT_SCOPE) +# Library +dart_add_library(dart-gui-osg ${dart_gui_osg_srcs} ${dart_gui_osg_hdrs}) +target_link_libraries(dart-gui-osg dart-gui ${OPENSCENEGRAPH_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "gui osg headers" ${hdrs}) @@ -30,4 +34,8 @@ install( DESTINATION include/dart/gui/osg COMPONENT headers ) -#install(TARGETS osgDart EXPORT osgDartTargets DESTINATION lib) +install(TARGETS dart-gui-osg EXPORT DARTTargets DESTINATION lib) + +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/gui/osg/examples/CMakeLists.txt b/dart/gui/osg/examples/CMakeLists.txt index 62c2ebfcfdb4b..ea80d2d054a72 100644 --- a/dart/gui/osg/examples/CMakeLists.txt +++ b/dart/gui/osg/examples/CMakeLists.txt @@ -5,7 +5,7 @@ foreach(example ${dart_gui_osg_examples_src}) get_filename_component(example_base ${example} NAME_WE) add_executable(${example_base} ${example}) - target_link_libraries(${example_base} dart) + target_link_libraries(${example_base} dart dart-gui-osg dart-utils-urdf) dart_add_example(${example_base}) endforeach(example) diff --git a/dart/gui/osg/examples/osgAtlasPuppet.cpp b/dart/gui/osg/examples/osgAtlasPuppet.cpp index 4cdc9f06815fd..03daf2acf6671 100644 --- a/dart/gui/osg/examples/osgAtlasPuppet.cpp +++ b/dart/gui/osg/examples/osgAtlasPuppet.cpp @@ -34,9 +34,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/gui/osg/osg.h" - -#include "dart/dart.h" +#include +#include +#include using namespace dart::common; using namespace dart::dynamics; diff --git a/dart/gui/osg/examples/osgDragAndDrop.cpp b/dart/gui/osg/examples/osgDragAndDrop.cpp index 9b9028e106570..7b3ab15a687e7 100644 --- a/dart/gui/osg/examples/osgDragAndDrop.cpp +++ b/dart/gui/osg/examples/osgDragAndDrop.cpp @@ -34,9 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/gui/osg/osg.h" - -#include "dart/dart.h" +#include +#include using namespace dart::dynamics; diff --git a/dart/gui/osg/examples/osgHuboPuppet.cpp b/dart/gui/osg/examples/osgHuboPuppet.cpp index 8b242d181e57d..58a5ade626477 100644 --- a/dart/gui/osg/examples/osgHuboPuppet.cpp +++ b/dart/gui/osg/examples/osgHuboPuppet.cpp @@ -35,6 +35,8 @@ */ #include +#include +#include using namespace dart::dynamics; using namespace dart::simulation; diff --git a/dart/gui/osg/examples/osgOperationalSpaceControl.cpp b/dart/gui/osg/examples/osgOperationalSpaceControl.cpp index c4aae41732707..f88ec1e03c324 100644 --- a/dart/gui/osg/examples/osgOperationalSpaceControl.cpp +++ b/dart/gui/osg/examples/osgOperationalSpaceControl.cpp @@ -35,9 +35,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/gui/osg/osg.h" - -#include "dart/dart.h" +#include +#include +#include using namespace dart::common; using namespace dart::dynamics; diff --git a/dart/gui/osg/examples/osgSoftBodies.cpp b/dart/gui/osg/examples/osgSoftBodies.cpp index 4698e5946466f..358be7fdb887d 100644 --- a/dart/gui/osg/examples/osgSoftBodies.cpp +++ b/dart/gui/osg/examples/osgSoftBodies.cpp @@ -35,12 +35,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "dart/dart.h" - -#include "dart/gui/osg/osg.h" - #include +#include +#include +#include + int main() { using namespace dart::dynamics; diff --git a/dart/gui/osg/render/CMakeLists.txt b/dart/gui/osg/render/CMakeLists.txt index 644c59c314537..929ec13cc1d1d 100644 --- a/dart/gui/osg/render/CMakeLists.txt +++ b/dart/gui/osg/render/CMakeLists.txt @@ -2,8 +2,8 @@ file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") -set(dart_gui_hdrs ${dart_gui_hdrs} ${hdrs} PARENT_SCOPE) -set(dart_gui_srcs ${dart_gui_srcs} ${srcs} PARENT_SCOPE) +set(dart_gui_osg_srcs ${dart_gui_osg_srcs} ${srcs} PARENT_SCOPE) +set(dart_gui_osg_hdrs ${dart_gui_osg_hdrs} ${hdrs} PARENT_SCOPE) dart_get_filename_components(header_names "gui osg render headers" ${hdrs}) dart_generate_include_header_list( @@ -18,7 +18,11 @@ configure_file( ) install( - FILES ${dart_gui_osg_hdrs} ${CMAKE_CURRENT_BINARY_DIR}/render.h + FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/render.h DESTINATION include/dart/gui/osg/render COMPONENT headers ) + +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/integration/CMakeLists.txt b/dart/integration/CMakeLists.txt index 0b9f2a33bdf13..0344f49f0a22d 100644 --- a/dart/integration/CMakeLists.txt +++ b/dart/integration/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_integration_hdrs ${hdrs} PARENT_SCOPE) set(dart_integration_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_integration ${srcs} ${hdrs}) -#target_link_libraries(dart_integration ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "integration headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/integration COMPONENT headers ) -#install(TARGETS dart_integration EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_integration EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/lcpsolver/CMakeLists.txt b/dart/lcpsolver/CMakeLists.txt index f9422270af334..14d889ffe40e3 100644 --- a/dart/lcpsolver/CMakeLists.txt +++ b/dart/lcpsolver/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_lcpsolver_hdrs ${hdrs} PARENT_SCOPE) set(dart_lcpsolver_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_lcpsolver ${srcs} ${hdrs}) -#target_link_libraries(dart_lcpsolver ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "lcpsolver headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/lcpsolver COMPONENT headers ) -#install(TARGETS dart_lcpsolver EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_lcpsolver EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/math/CMakeLists.txt b/dart/math/CMakeLists.txt index 31841b9f0c6e7..4f3f268d489e6 100644 --- a/dart/math/CMakeLists.txt +++ b/dart/math/CMakeLists.txt @@ -5,10 +5,6 @@ file(GLOB hdrs "*.h") set(dart_math_hdrs ${hdrs} PARENT_SCOPE) set(dart_math_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_math ${srcs} ${hdrs}) -#target_link_libraries(dart_math ${DART_CORE_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "math headers" ${hdrs}) dart_generate_include_header_list( @@ -28,6 +24,3 @@ install( DESTINATION include/dart/math COMPONENT headers ) -#install(TARGETS dart_math EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_math EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/optimizer/CMakeLists.txt b/dart/optimizer/CMakeLists.txt index 09944483e048a..b5145c8d0f173 100644 --- a/dart/optimizer/CMakeLists.txt +++ b/dart/optimizer/CMakeLists.txt @@ -16,24 +16,6 @@ endif() set(dart_optimizer_hdrs ${hdrs} ${dart_optimizer_hdrs} PARENT_SCOPE) set(dart_optimizer_srcs ${srcs} ${dart_optimizer_srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_optimizer ${srcs} ${hdrs}) -#target_link_libraries( -# dart_optimizer -# dart_common -# dart_math -# ${DART_DEPENDENCIES} -#) -#if(HAVE_IPOPT) -# target_link_libraries(dart_optimizer dart_optimizer_ipopt) -#endif() -#if(HAVE_NLOPT) -# target_link_libraries(dart_optimizer dart_optimizer_nlopt) -#endif() -#if(HAVE_SNOPT) -# target_link_libraries(dart_optimizer dart_optimizer_snopt) -#endif() - # Generate header for this namespace dart_get_filename_components(header_names "optimizer headers" ${hdrs}) if(HAVE_IPOPT) @@ -62,5 +44,3 @@ install( DESTINATION include/dart/optimizer COMPONENT headers ) -#install(TARGETS dart_optimizer EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/optimizer/ipopt/CMakeLists.txt b/dart/optimizer/ipopt/CMakeLists.txt index fb03d7fcfc3ac..3881412605082 100644 --- a/dart/optimizer/ipopt/CMakeLists.txt +++ b/dart/optimizer/ipopt/CMakeLists.txt @@ -2,9 +2,11 @@ file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +include_directories(SYSTEM ${NLOPT_INCLUDE_DIRS}) + # Library dart_add_library(dart-optimizer-ipopt ${srcs} ${hdrs}) -target_link_libraries(dart-optimizer-ipopt dart-core ${IPOPT_LIBRARIES}) +target_link_libraries(dart-optimizer-ipopt dart ${IPOPT_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "optimizer_ipopt headers" ${hdrs}) @@ -25,7 +27,8 @@ install( DESTINATION include/dart/optimizer/ipopt COMPONENT headers ) -install(TARGETS dart-optimizer-ipopt - EXPORT DARTTargets - DESTINATION lib -) +install(TARGETS dart-optimizer-ipopt EXPORT DARTTargets DESTINATION lib) + +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/optimizer/nlopt/CMakeLists.txt b/dart/optimizer/nlopt/CMakeLists.txt index 8a2ea47004a30..366e0cc66bded 100644 --- a/dart/optimizer/nlopt/CMakeLists.txt +++ b/dart/optimizer/nlopt/CMakeLists.txt @@ -2,9 +2,11 @@ file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +include_directories(SYSTEM ${NLOPT_INCLUDE_DIRS}) + # Library dart_add_library(dart-optimizer-nlopt ${srcs} ${hdrs}) -target_link_libraries(dart-optimizer-nlopt dart-core ${NLOPT_LIBRARIES}) +target_link_libraries(dart-optimizer-nlopt dart ${NLOPT_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "optimizer_nlopt headers" ${hdrs}) @@ -25,7 +27,8 @@ install( DESTINATION include/dart/optimizer/nlopt COMPONENT headers ) -install(TARGETS dart-optimizer-nlopt - EXPORT DARTTargets - DESTINATION lib -) +install(TARGETS dart-optimizer-nlopt EXPORT DARTTargets DESTINATION lib) + +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/planning/CMakeLists.txt b/dart/planning/CMakeLists.txt index 1e800018eeef2..a8a7705cfe001 100644 --- a/dart/planning/CMakeLists.txt +++ b/dart/planning/CMakeLists.txt @@ -2,12 +2,11 @@ file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") -set(dart_planning_hdrs ${hdrs} PARENT_SCOPE) -set(dart_planning_srcs ${srcs} PARENT_SCOPE) +include_directories(SYSTEM ${FLANN_INCLUDE_DIRS}) # Library -#dart_add_library(dart_planning ${srcs} ${hdrs}) -#target_link_libraries(dart_planning ${DART_DEPENDENCIES}) +dart_add_library(dart-planning ${srcs} ${hdrs}) +target_link_libraries(dart-planning dart ${FLANN_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "planning headers" ${hdrs}) @@ -28,5 +27,8 @@ install( DESTINATION include/dart/planning COMPONENT headers ) -#install(TARGETS dart_planning EXPORT DARTTargets DESTINATION lib) +install(TARGETS dart-planning EXPORT DARTTargets DESTINATION lib) +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/renderer/CMakeLists.txt b/dart/renderer/CMakeLists.txt deleted file mode 100644 index 7a3ca8275fe16..0000000000000 --- a/dart/renderer/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Search all header and source files -file(GLOB srcs "*.cpp") -file(GLOB hdrs "*.h") - -set(dart_renderer_hdrs ${hdrs} PARENT_SCOPE) -set(dart_renderer_srcs ${srcs} PARENT_SCOPE) - -# Library -#dart_add_library(dart_renderer ${srcs} ${hdrs}) -#target_link_libraries(dart_renderer ${DART_DEPENDENCIES}) - -# Generate header for this namespace -dart_get_filename_components(header_names "renderer headers" ${hdrs}) -dart_generate_include_header_list( - renderer_headers - "dart/renderer/" - "renderer headers" - ${header_names} -) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/renderer.h.in - ${CMAKE_CURRENT_BINARY_DIR}/renderer.h -) - -# Install -install( - FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/renderer.h - DESTINATION include/dart/renderer - COMPONENT headers -) -#install(TARGETS dart_renderer EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/renderer/renderer.h.in b/dart/renderer/renderer.h.in deleted file mode 100644 index faa5919df1abb..0000000000000 --- a/dart/renderer/renderer.h.in +++ /dev/null @@ -1,3 +0,0 @@ -// Automatically generated file by cmake - -${renderer_headers} diff --git a/dart/simulation/CMakeLists.txt b/dart/simulation/CMakeLists.txt index 8af31b4e686f4..8d7403e3d7ad0 100644 --- a/dart/simulation/CMakeLists.txt +++ b/dart/simulation/CMakeLists.txt @@ -5,15 +5,6 @@ file(GLOB hdrs "*.h") set(dart_simulation_hdrs ${hdrs} PARENT_SCOPE) set(dart_simulation_srcs ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_simulation ${srcs} ${hdrs}) -#target_link_libraries( -# dart_simulation -# dart_constraint -# dart_integration -# ${DART_CORE_DEPENDENCIES} -#) - # Generate header for this namespace dart_get_filename_components(header_names "simulation headers" ${hdrs}) dart_generate_include_header_list( @@ -33,6 +24,3 @@ install( DESTINATION include/dart/simulation COMPONENT headers ) -#install(TARGETS dart_simulation EXPORT DARTCoreTargets DESTINATION lib) -#install(TARGETS dart_simulation EXPORT DARTTargets DESTINATION lib) - diff --git a/dart/simulation/World.cpp b/dart/simulation/World.cpp index b91d2f98e187e..60bbccd1faa33 100644 --- a/dart/simulation/World.cpp +++ b/dart/simulation/World.cpp @@ -506,6 +506,12 @@ bool World::checkCollision(bool checkAllCollisions) return mConstraintSolver->getCollisionGroup()->collide(option, result); } +//============================================================================== +const collision::CollisionResult& World::getLastCollisionResult() const +{ + return mConstraintSolver->getLastCollisionResult(); +} + //============================================================================== constraint::ConstraintSolver* World::getConstraintSolver() const { diff --git a/dart/simulation/World.h b/dart/simulation/World.h index f43b23ba24ea6..66315383109ab 100644 --- a/dart/simulation/World.h +++ b/dart/simulation/World.h @@ -70,6 +70,10 @@ namespace constraint { class ConstraintSolver; } // namespace constraint +namespace collision { +class CollisionResult; +} // namespace collision + namespace simulation { /// class World @@ -174,6 +178,8 @@ class World : public virtual common::Subject /// Return whether there is any collision between bodies bool checkCollision(bool _checkAllCollisions = false); + const collision::CollisionResult& getLastCollisionResult() const; + //-------------------------------------------------------------------------- // Simulation //-------------------------------------------------------------------------- diff --git a/dart/utils/CMakeLists.txt b/dart/utils/CMakeLists.txt index f589064c8f4e7..31844599c64e2 100644 --- a/dart/utils/CMakeLists.txt +++ b/dart/utils/CMakeLists.txt @@ -1,33 +1,37 @@ # Search all header and source files -file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +file(GLOB srcs "*.cpp") + +set(dart_utils_hdrs ${hdrs}) +set(dart_utils_srcs ${srcs}) + +include_directories(SYSTEM ${TINYXML_INCLUDE_DIRS}) +include_directories(SYSTEM ${TINYXML2_INCLUDE_DIRS}) # Add subdirectories add_subdirectory(sdf) -add_subdirectory(urdf) - -set(dart_utils_hdrs ${hdrs} ${dart_utils_hdrs} PARENT_SCOPE) -set(dart_utils_srcs ${srcs} ${dart_utils_srcs} PARENT_SCOPE) +if(urdfdom_FOUND) + add_subdirectory(urdf) +endif() # Library -#dart_add_library(dart_utils ${srcs} ${hdrs}) -#target_link_libraries( -# dart_utils -# dart_utils_sdf -# dart_utils_urdf -# dart_collision -# dart_dynamics -# dart_simulation -# ${DART_DEPENDENCIES} -#) +dart_add_library(dart-utils ${dart_utils_srcs} ${dart_utils_hdrs}) +target_link_libraries( + dart-utils + dart + ${TINYXML_LIBRARIES} + ${TINYXML2_LIBRARIES} +) # Generate header for this namespace dart_get_filename_components(header_names "utils headers" ${hdrs}) +if(urdfdom_FOUND) + list(APPEND header_names "urdf/urdf.h") +endif() set( header_names ${header_names} sdf/sdf.h - urdf/urdf.h ) dart_generate_include_header_list( utils_headers @@ -46,5 +50,8 @@ install( DESTINATION include/dart/utils COMPONENT headers ) -#install(TARGETS dart_utils EXPORT DARTTargets DESTINATION lib) +install(TARGETS dart-utils EXPORT DARTTargets DESTINATION lib) +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/utils/SkelParser.cpp b/dart/utils/SkelParser.cpp index 99d29659fe4bd..145a47334bb12 100644 --- a/dart/utils/SkelParser.cpp +++ b/dart/utils/SkelParser.cpp @@ -1367,6 +1367,8 @@ void readJoint(tinyxml2::XMLElement* _jointElement, joint.properties = readPrismaticJoint(_jointElement, joint, name); else if (joint.type == std::string("revolute")) joint.properties = readRevoluteJoint(_jointElement, joint, name); + else if (joint.type == std::string("screw")) + joint.properties = readScrewJoint(_jointElement, joint, name); else if (joint.type == std::string("universal")) joint.properties = readUniversalJoint(_jointElement, joint, name); else if (joint.type == std::string("ball")) diff --git a/dart/utils/sdf/CMakeLists.txt b/dart/utils/sdf/CMakeLists.txt index edde1982d1d2d..0d730a8533532 100644 --- a/dart/utils/sdf/CMakeLists.txt +++ b/dart/utils/sdf/CMakeLists.txt @@ -1,14 +1,10 @@ # Search all header and source files -file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +file(GLOB srcs "*.cpp") set(dart_utils_hdrs ${dart_utils_hdrs} ${hdrs} PARENT_SCOPE) set(dart_utils_srcs ${dart_utils_srcs} ${srcs} PARENT_SCOPE) -# Library -#dart_add_library(dart_utils_sdf ${srcs} ${hdrs}) -#target_link_libraries(dart_utils_sdf ${DART_DEPENDENCIES}) - # Generate header for this namespace dart_get_filename_components(header_names "utils_sdf headers" ${hdrs}) dart_generate_include_header_list( @@ -28,5 +24,7 @@ install( DESTINATION include/dart/utils/sdf COMPONENT headers ) -#install(TARGETS dart_utils_sdf EXPORT DARTTargets DESTINATION lib) +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/dart/utils/sdf/SdfParser.cpp b/dart/utils/sdf/SdfParser.cpp index 8ad4e2dbdcbe1..789d402e6f74e 100644 --- a/dart/utils/sdf/SdfParser.cpp +++ b/dart/utils/sdf/SdfParser.cpp @@ -58,10 +58,8 @@ #include "dart/dynamics/PrismaticJoint.h" #include "dart/dynamics/RevoluteJoint.h" #include "dart/dynamics/ScrewJoint.h" -#include "dart/dynamics/TranslationalJoint.h" #include "dart/dynamics/BallJoint.h" #include "dart/dynamics/FreeJoint.h" -#include "dart/dynamics/EulerJoint.h" #include "dart/dynamics/UniversalJoint.h" #include "dart/dynamics/Skeleton.h" #include "dart/simulation/World.h" @@ -231,21 +229,6 @@ dynamics::BallJoint::Properties readBallJoint( const Eigen::Isometry3d& parentModelFrame, const std::string& name); -dart::dynamics::EulerJoint* readEulerJoint( - tinyxml2::XMLElement* jointElement, - const Eigen::Isometry3d& parentModelFrame, - const std::string& name); - -dart::dynamics::TranslationalJoint::Properties readTranslationalJoint( - tinyxml2::XMLElement* jointElement, - const Eigen::Isometry3d& parentModelFrame, - const std::string& name); - -dynamics::FreeJoint::Properties readFreeJoint( - tinyxml2::XMLElement* jointElement, - const Eigen::Isometry3d& parentModelFrame, - const std::string& name); - common::ResourceRetrieverPtr getRetriever( const common::ResourceRetrieverPtr& retriever); @@ -1184,6 +1167,10 @@ SDFJoint readJoint(tinyxml2::XMLElement* _jointElement, Eigen::Isometry3d parentModelFrame = (childWorld * childToJoint).inverse() * _skeletonFrame; + if (type == std::string("fixed")) + newJoint.properties = + Eigen::make_aligned_shared( + readWeldJoint(_jointElement, parentModelFrame, name)); if (type == std::string("prismatic")) newJoint.properties = Eigen::make_aligned_shared( @@ -1466,22 +1453,6 @@ dynamics::BallJoint::Properties readBallJoint( return dynamics::BallJoint::Properties(); } -dynamics::TranslationalJoint::Properties readTranslationalJoint( - tinyxml2::XMLElement* /*_jointElement*/, - const Eigen::Isometry3d&, - const std::string&) -{ - return dynamics::TranslationalJoint::Properties(); -} - -dynamics::FreeJoint::Properties readFreeJoint( - tinyxml2::XMLElement* /*_jointElement*/, - const Eigen::Isometry3d&, - const std::string&) -{ - return dynamics::FreeJoint::Properties(); -} - //============================================================================== common::ResourceRetrieverPtr getRetriever( const common::ResourceRetrieverPtr& retriever) diff --git a/dart/utils/urdf/CMakeLists.txt b/dart/utils/urdf/CMakeLists.txt index 012b8cff11a75..4c2e4be29c44a 100644 --- a/dart/utils/urdf/CMakeLists.txt +++ b/dart/utils/urdf/CMakeLists.txt @@ -1,13 +1,12 @@ # Search all header and source files -file(GLOB srcs "*.cpp") file(GLOB hdrs "*.h") +file(GLOB srcs "*.cpp") -set(dart_utils_hdrs ${dart_utils_hdrs} ${hdrs} PARENT_SCOPE) -set(dart_utils_srcs ${dart_utils_srcs} ${srcs} PARENT_SCOPE) +include_directories(SYSTEM ${urdfdom_INCLUDE_DIRS}) # Library -#dart_add_library(dart_utils_urdf ${srcs} ${hdrs}) -#target_link_libraries(dart_utils_urdf ${DART_DEPENDENCIES}) +dart_add_library(dart-utils-urdf ${hdrs} ${srcs}) +target_link_libraries(dart-utils-urdf dart-utils ${urdfdom_LIBRARIES}) # Generate header for this namespace dart_get_filename_components(header_names "utils_urdf headers" ${hdrs}) @@ -28,5 +27,8 @@ install( DESTINATION include/dart/utils/urdf COMPONENT headers ) -#install(TARGETS dart_utils_urdf EXPORT DARTTargets DESTINATION lib) +install(TARGETS dart-utils-urdf EXPORT DARTTargets DESTINATION lib) +# Coverage test files +set(dart_coveralls_files "${dart_coveralls_files};${hdrs};${srcs}" + CACHE INTERNAL "files for coverage tests") diff --git a/debian/control b/debian/control index 1ae442ca3a304..3c31333c12700 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,10 @@ Build-Depends: debhelper (>= 9), cmake, libeigen3-dev, libfcl-dev (>= 0.2.7), + libbullet-dev, libassimp-dev (>= 3), + libnlopt-dev, + coinor-libipopt-dev, freeglut3-dev, libxi-dev, libxmu-dev, @@ -24,16 +27,17 @@ Homepage: http://dartsim.github.io/ Vcs-Git: git://github.com/dartsim/dart.git Vcs-Browser: https://github.com/dartsim/dart -Package: libdart-core5-dev +Package: libdart6-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} -Conflicts: libdart-core3-dev, libdart-core4-dev +Conflicts: libdart-core3-dev, libdart-core4-dev, libdart-core5-dev Depends: ${misc:Depends}, - libdart-core5.1 (= ${binary:Version}), + libdart6.0 (= ${binary:Version}), libeigen3-dev, libassimp-dev (>= 3), libfcl-dev, + libbullet-dev, libboost-all-dev (>= 1.54.0.1ubuntu1) Description: Dynamic Animation and Robotics Toolkit, core development files DART is a collaborative, cross-platform, open source library created by the @@ -59,21 +63,237 @@ Description: Dynamic Animation and Robotics Toolkit, core development files Multibody dynamic simulation in DART is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libdart5-dev +Package: libdart6.0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-planning6-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + libdart6-dev, + libdart-planning6.0 (= ${binary:Version}), + libflann-dev +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-planning6.0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-utils6-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + libdart6-dev, + libdart-utils6.0 (= ${binary:Version}), + libtinyxml-dev, + libtinyxml2-dev, + liburdfdom-dev +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-utils6.0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-gui6-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, - libdart-core5-dev, - libdart5.1 (= ${binary:Version}), + libdart6-dev, + libdart-utils6-dev, + libdart-gui6.0 (= ${binary:Version}), freeglut3-dev, libxi-dev, - libxmu-dev, - libtinyxml2-dev, + libxmu-dev +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-gui6.0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-gui-osg6-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + libdart-gui6-dev, + libdart-gui-osg6.0 (= ${binary:Version}), libopenthreads-dev, - libopenscenegraph-dev, - liburdfdom-dev -Description: Dynamic Animation and Robotics Toolkit, development files + libopenscenegraph-dev +Description: Dynamic Animation and Robotics Toolkit, core library files DART is a collaborative, cross-platform, open source library created by the Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data structures and algorithms for kinematic and dynamic applications in robotics @@ -97,8 +317,69 @@ Description: Dynamic Animation and Robotics Toolkit, development files Multibody dynamic simulation in DART is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. +Package: libdart-gui-osg6.0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-optimizer-nlopt6-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + libdart6-dev, + libdart-optimizer-nlopt6.0 (= ${binary:Version}), + libnlopt-dev +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. -Package: libdart-core5.1 +Package: libdart-optimizer-nlopt6.0 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} @@ -128,13 +409,45 @@ Description: Dynamic Animation and Robotics Toolkit, core library files Multibody dynamic simulation in DART is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libdart5.1 +Package: libdart-optimizer-ipopt6-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + libdart6-dev, + libdart-optimizer-ipopt6.0 (= ${binary:Version}), + coinor-libipopt-dev +Description: Dynamic Animation and Robotics Toolkit, core library files + DART is a collaborative, cross-platform, open source library created by the + Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data + structures and algorithms for kinematic and dynamic applications in robotics + and computer animation. + DART is distinguished by it's accuracy and stability due to its use of + generalized coordinates to represent articulated rigid body systems and + computation of Lagrange's equations derived from D.Alembert's principle to + describe the dynamics of motion. + For developers, in contrast to many popular physics engines which view the + simulator as a black box, DART gives full access to internal kinematic and + dynamic quantities, such as the mass matrix, Coriolis and centrifugal forces, + transformation matrices and their derivatives. DART also provides efficient + computation of Jacobian matrices for arbitrary body points and coordinate + frames. Contact and collision are handled using an implicit time-stepping, + velocity-based LCP (linear-complementarity problem) to guarantee + non-penetration, directional friction, and approximated Coulomb friction cone + conditions. For collision detection, DART uses FCL developed by Willow Garage + and the UNC Gamma Lab. + DART has applications in robotics and computer animation because it features a + multibody dynamic simulator and tools for control and motion planning. + Multibody dynamic simulation in DART is an extension of RTQL8, an open source + software created by the Georgia Tech Graphics Lab. + +Package: libdart-optimizer-ipopt6.0 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: Dynamic Animation and Robotics Toolkit, library files +Description: Dynamic Animation and Robotics Toolkit, core library files DART is a collaborative, cross-platform, open source library created by the Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data structures and algorithms for kinematic and dynamic applications in robotics diff --git a/debian/copyright b/debian/copyright index 8e440a5a76052..de522a71d086d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,7 +3,7 @@ Upstream-Name: DART Source: http://github.com/dartsim/dart Files: * -Copyright: Copyright 2008-2015 Georgia Tech Research Corporation +Copyright: Copyright 2008-2016 Georgia Tech Research Corporation License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/debian/libdart-core5.1.install b/debian/libdart-core5.1.install deleted file mode 100644 index 160e0e5825234..0000000000000 --- a/debian/libdart-core5.1.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/libdart-core.so.* diff --git a/debian/libdart-gui-osg0-dev.install b/debian/libdart-gui-osg0-dev.install new file mode 100644 index 0000000000000..333a8986d82d2 --- /dev/null +++ b/debian/libdart-gui-osg0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/gui/osg/* +usr/lib/libdart-gui-osg.so diff --git a/debian/libdart-gui-osg0.1.install b/debian/libdart-gui-osg0.1.install new file mode 100644 index 0000000000000..3ab0e669399a4 --- /dev/null +++ b/debian/libdart-gui-osg0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-gui-osg.so.* diff --git a/debian/libdart-gui0-dev.install b/debian/libdart-gui0-dev.install new file mode 100644 index 0000000000000..c426c2f76db86 --- /dev/null +++ b/debian/libdart-gui0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/gui/*.* +usr/lib/libdart-gui.so diff --git a/debian/libdart-gui0.1.install b/debian/libdart-gui0.1.install new file mode 100644 index 0000000000000..10382218f6525 --- /dev/null +++ b/debian/libdart-gui0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-gui.so.* diff --git a/debian/libdart-optimizer-ipopt0-dev.install b/debian/libdart-optimizer-ipopt0-dev.install new file mode 100644 index 0000000000000..4134a2e33e711 --- /dev/null +++ b/debian/libdart-optimizer-ipopt0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/optimizer/ipopt/* +usr/lib/libdart-optimizer-ipopt.so diff --git a/debian/libdart-optimizer-ipopt0.1.install b/debian/libdart-optimizer-ipopt0.1.install new file mode 100644 index 0000000000000..29b2194ab4ad7 --- /dev/null +++ b/debian/libdart-optimizer-ipopt0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-optimizer-ipopt.so.* diff --git a/debian/libdart-optimizer-nlopt0-dev.install b/debian/libdart-optimizer-nlopt0-dev.install new file mode 100644 index 0000000000000..362a0ec48d4ab --- /dev/null +++ b/debian/libdart-optimizer-nlopt0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/optimizer/nlopt/* +usr/lib/libdart-optimizer-nlopt.so diff --git a/debian/libdart-optimizer-nlopt0.1.install b/debian/libdart-optimizer-nlopt0.1.install new file mode 100644 index 0000000000000..9698d205dfbc6 --- /dev/null +++ b/debian/libdart-optimizer-nlopt0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-optimizer-nlopt.so.* diff --git a/debian/libdart-planning0-dev.install b/debian/libdart-planning0-dev.install new file mode 100644 index 0000000000000..62a151c9849f8 --- /dev/null +++ b/debian/libdart-planning0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/planning/* +usr/lib/libdart-planning.so diff --git a/debian/libdart-planning0.1.install b/debian/libdart-planning0.1.install new file mode 100644 index 0000000000000..401dbd3bdba24 --- /dev/null +++ b/debian/libdart-planning0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-planning.so.* diff --git a/debian/libdart-utils0-dev.install b/debian/libdart-utils0-dev.install new file mode 100644 index 0000000000000..8ff9df2af0fcf --- /dev/null +++ b/debian/libdart-utils0-dev.install @@ -0,0 +1,2 @@ +usr/include/dart/utils/* +usr/lib/libdart-utils.so diff --git a/debian/libdart-utils0.1.install b/debian/libdart-utils0.1.install new file mode 100644 index 0000000000000..1bb725f83910a --- /dev/null +++ b/debian/libdart-utils0.1.install @@ -0,0 +1 @@ +usr/lib/libdart-utils.so.* diff --git a/debian/libdart5-dev.install b/debian/libdart5-dev.install deleted file mode 100644 index ef992b5fe6edb..0000000000000 --- a/debian/libdart5-dev.install +++ /dev/null @@ -1,10 +0,0 @@ -usr/include/dart/dart.h -usr/include/dart/planning/* -usr/include/dart/utils/* -usr/include/dart/gui/* -usr/include/osgDart/* -usr/share/dart/DARTConfig.cmake -usr/share/dart/DARTConfigVersion.cmake -usr/share/dart/DARTTargets*.cmake -usr/lib/libdart.so -usr/lib/libosgDart.so diff --git a/debian/libdart5.1.install b/debian/libdart5.1.install deleted file mode 100644 index 139dd80dfa42d..0000000000000 --- a/debian/libdart5.1.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/libdart.so.* -usr/lib/libosgDart.so.* diff --git a/debian/libdart-core5-dev.install b/debian/libdart6-dev.install similarity index 51% rename from debian/libdart-core5-dev.install rename to debian/libdart6-dev.install index 5dda48f9d8fbf..e4b1376bc30ed 100644 --- a/debian/libdart-core5-dev.install +++ b/debian/libdart6-dev.install @@ -1,4 +1,4 @@ -usr/include/dart/dart-core.h +usr/include/dart/dart.h usr/include/dart/config.h usr/include/dart/collision/* usr/include/dart/common/* @@ -7,10 +7,9 @@ usr/include/dart/dynamics/* usr/include/dart/integration/* usr/include/dart/lcpsolver/* usr/include/dart/math/* -usr/include/dart/optimizer/* -usr/include/dart/renderer/* +usr/include/dart/optimizer/*.* usr/include/dart/simulation/* -usr/share/dartcore/DARTCoreConfig.cmake -usr/share/dartcore/DARTCoreConfigVersion.cmake -usr/share/dartcore/DARTCoreTargets*.cmake -usr/lib/libdart-core.so +usr/share/dart/DARTConfig.cmake +usr/share/dart/DARTConfigVersion.cmake +usr/share/dart/DARTTargets.cmake +usr/lib/libdart.so diff --git a/debian/libdart6.0.install b/debian/libdart6.0.install new file mode 100644 index 0000000000000..5b286642bf955 --- /dev/null +++ b/debian/libdart6.0.install @@ -0,0 +1 @@ +usr/lib/libdart.so.* diff --git a/debian/rules b/debian/rules index f3b8eb95844e5..55e1c946d1368 100755 --- a/debian/rules +++ b/debian/rules @@ -13,5 +13,8 @@ override_dh_auto_configure: dh_auto_configure -- \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +override_dh_auto_build: + dh_auto_build -- tests + %: dh $@ diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index e00c5c645624b..9b9cebdc4f4d1 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -5,7 +5,7 @@ foreach(tutorial ${tutorials_src}) get_filename_component(tutorial_base ${tutorial} NAME_WE) add_executable(${tutorial_base} ${tutorial}) - target_link_libraries(${tutorial_base} dart) + target_link_libraries(${tutorial_base} dart dart-gui dart-utils-urdf) dart_add_tutorial(${tutorial_base}) endforeach(tutorial) diff --git a/tutorials/tutorialBiped-Finished.cpp b/tutorials/tutorialBiped-Finished.cpp index abcc872716cba..0d4c8738edd15 100644 --- a/tutorials/tutorialBiped-Finished.cpp +++ b/tutorials/tutorialBiped-Finished.cpp @@ -43,6 +43,7 @@ const double default_force = 50.0; // N const int default_countdown = 100; // Number of timesteps for applying force #include "dart/dart.h" +#include "dart/gui/gui.h" using namespace dart::common; using namespace dart::dynamics; diff --git a/tutorials/tutorialBiped.cpp b/tutorials/tutorialBiped.cpp index 69ef3e2d16687..26eb4da85a9a0 100644 --- a/tutorials/tutorialBiped.cpp +++ b/tutorials/tutorialBiped.cpp @@ -43,6 +43,7 @@ const double default_force = 50.0; // N const int default_countdown = 100; // Number of timesteps for applying force #include "dart/dart.h" +#include "dart/gui/gui.h" using namespace dart::common; using namespace dart::dynamics; diff --git a/tutorials/tutorialCollisions-Finished.cpp b/tutorials/tutorialCollisions-Finished.cpp index d8e43562fca58..3a1adb41eebdd 100644 --- a/tutorials/tutorialCollisions-Finished.cpp +++ b/tutorials/tutorialCollisions-Finished.cpp @@ -35,7 +35,9 @@ */ #include + #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_shape_density = 1000; // kg/m^3 const double default_shape_height = 0.1; // m diff --git a/tutorials/tutorialCollisions.cpp b/tutorials/tutorialCollisions.cpp index 41bbbdfdb3ce9..37b6d6231ca83 100644 --- a/tutorials/tutorialCollisions.cpp +++ b/tutorials/tutorialCollisions.cpp @@ -35,7 +35,9 @@ */ #include + #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_shape_density = 1000; // kg/m^3 const double default_shape_height = 0.1; // m diff --git a/tutorials/tutorialDominoes-Finished.cpp b/tutorials/tutorialDominoes-Finished.cpp index 9803c6d9b3df7..c41d67a2946ae 100644 --- a/tutorials/tutorialDominoes-Finished.cpp +++ b/tutorials/tutorialDominoes-Finished.cpp @@ -35,6 +35,7 @@ */ #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_domino_height = 0.3; const double default_domino_width = 0.4 * default_domino_height; diff --git a/tutorials/tutorialDominoes.cpp b/tutorials/tutorialDominoes.cpp index c229a4fefbce4..be54d5cc015b2 100644 --- a/tutorials/tutorialDominoes.cpp +++ b/tutorials/tutorialDominoes.cpp @@ -35,6 +35,7 @@ */ #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_domino_height = 0.3; const double default_domino_width = 0.4 * default_domino_height; diff --git a/tutorials/tutorialMultiPendulum-Finished.cpp b/tutorials/tutorialMultiPendulum-Finished.cpp index 36dae47af0607..699d023b8f0f7 100644 --- a/tutorials/tutorialMultiPendulum-Finished.cpp +++ b/tutorials/tutorialMultiPendulum-Finished.cpp @@ -35,6 +35,7 @@ */ #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_height = 1.0; // m const double default_width = 0.2; // m diff --git a/tutorials/tutorialMultiPendulum.cpp b/tutorials/tutorialMultiPendulum.cpp index ec46f8bbf95ee..5238a02038b06 100644 --- a/tutorials/tutorialMultiPendulum.cpp +++ b/tutorials/tutorialMultiPendulum.cpp @@ -35,6 +35,7 @@ */ #include "dart/dart.h" +#include "dart/gui/gui.h" const double default_height = 1.0; // m const double default_width = 0.2; // m diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 60954415c7e75..5de8239a4318c 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -63,14 +63,13 @@ foreach(test ${tests}) get_filename_component(base ${test} NAME_WE) list(APPEND all_tests ${base}) - link_directories(${DARTExt_LIBRARY_DIRS}) add_executable(${base} ${test}) dart_add_unittest(${base}) if(MSVC) - target_link_libraries(${base} dart optimized gtest debug gtestd) + target_link_libraries(${base} dart dart-utils dart-utils-urdf optimized gtest debug gtestd) else() - target_link_libraries(${base} dart gtest) + target_link_libraries(${base} dart dart-utils dart-utils-urdf gtest) endif() set_target_properties(${base} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") diff --git a/unittests/testCollision.cpp b/unittests/testCollision.cpp index ade51d056e526..d37d442979dc2 100644 --- a/unittests/testCollision.cpp +++ b/unittests/testCollision.cpp @@ -802,6 +802,30 @@ void testCreateCollisionGroups(const std::shared_ptr& cd) EXPECT_TRUE(skeletonGroup1->collide(skeletonGroup2.get(), option, result)); EXPECT_TRUE(bodyNodeGroup1->collide(bodyNodeGroup2.get(), option, result)); EXPECT_TRUE(shapeNodeGroup1->collide(shapeNodeGroup2.get(), option, result)); + + // Regression test for #666 + auto world = common::make_unique(); + world->getConstraintSolver()->setCollisionDetector(cd); + world->addSkeleton(boxSkeleton1); + world->addSkeleton(boxSkeleton2); +DART_SUPPRESS_DEPRECATED_BEGIN + EXPECT_FALSE(boxBodyNode1->isColliding()); + EXPECT_FALSE(boxBodyNode2->isColliding()); +DART_SUPPRESS_DEPRECATED_END + + const collision::CollisionResult& result1 = world->getLastCollisionResult(); + EXPECT_FALSE(result1.inCollision(boxBodyNode1)); + EXPECT_FALSE(result1.inCollision(boxBodyNode2)); + + world->step(); +DART_SUPPRESS_DEPRECATED_BEGIN + EXPECT_TRUE(boxBodyNode1->isColliding()); + EXPECT_TRUE(boxBodyNode2->isColliding()); +DART_SUPPRESS_DEPRECATED_END + + const collision::CollisionResult& result2 = world->getLastCollisionResult(); + EXPECT_TRUE(result2.inCollision(boxBodyNode1)); + EXPECT_TRUE(result2.inCollision(boxBodyNode2)); } //==============================================================================