diff -Nru ompl-1.1.0+ds1/.appveyor.yml ompl-1.3.0+ds2/.appveyor.yml --- ompl-1.1.0+ds1/.appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/.appveyor.yml 2016-06-19 03:38:14.000000000 +0000 @@ -0,0 +1,40 @@ +# AppVeyor file +# http://www.appveyor.com/docs/appveyor-yml + +version: "{build}" +os: Visual Studio 2015 + +clone_folder: C:\projects\ompl +clone_depth: 1 + +branches: + only: + - master +platform: x64 + +environment: + CTEST_OUTPUT_ON_FAILURE: 1 + BOOST_ROOT: C:\Libraries\boost_1_59_0 + BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0 + +configuration: Release + +before_build: + - cmd: set + - cmd: mkdir build + - cmd: cd build + - cmd: cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=%configuration% -DOMPL_REGISTRATION=OFF -DOMPL_BUILD_DEMOS=OFF -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" .. + +build: + project: C:\projects\ompl\build\ompl.sln + parallel: true + +after_build: + - cmd: cmake --build . --target package --config %configuration% + +# tests seem to hang +#test_script: +# - cmd: ctest -C %configuration% + +artifacts: + - path: 'build\omplapp*.zip' diff -Nru ompl-1.1.0+ds1/appveyor.yml ompl-1.3.0+ds2/appveyor.yml --- ompl-1.1.0+ds1/appveyor.yml 2015-08-11 14:23:31.000000000 +0000 +++ ompl-1.3.0+ds2/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -# AppVeyor file -# http://www.appveyor.com/docs/appveyor-yml - -version: "{build}" -os: unstable - -clone_folder: C:\projects\ompl -clone_depth: 1 - -branches: - only: - - master -platform: x64 - -environment: - CTEST_OUTPUT_ON_FAILURE: 1 - BOOST_ROOT: C:\Libraries\boost - BOOST_LIBRARYDIR: C:\Libraries\boost\lib64-msvc-12.0 - -configuration: Release - -before_build: - - cmd: set - - cmd: mkdir build - - cmd: cd build - - cmd: cmake -G "Visual Studio 12 Win64" -DCMAKE_BUILD_TYPE=%configuration% -DOMPL_REGISTRATION=OFF -DOMPL_BUILD_DEMOS=OFF -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" .. - -build: - project: C:\projects\ompl\build\ompl.sln - parallel: true - -# after_build: -# - cmd: cmake --build . --target package --config %configuration% - -# no time to run tests -# test_script: -# - cmd: cd build -# - cmd: ctest -C %configuration% - -# artifacts: -# - path: ompl\*.zip diff -Nru ompl-1.1.0+ds1/.clang-format ompl-1.3.0+ds2/.clang-format --- ompl-1.1.0+ds1/.clang-format 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/.clang-format 2017-01-12 16:44:35.000000000 +0000 @@ -0,0 +1,49 @@ +--- +BasedOnStyle: Google +AccessModifierOffset: -4 +ConstructorInitializerIndentWidth: 2 +AlignEscapedNewlinesLeft: false +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: true +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: false +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: true +BinPackParameters: true +ColumnLimit: 120 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +PointerAlignment: Right +DerivePointerBinding: false +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: true +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: All +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 60 +PenaltyBreakString: 1 +PenaltyBreakFirstLessLess: 1000 +PenaltyExcessCharacter: 1000 +PenaltyReturnTypeOnItsOwnLine: 90 +PointerBindsToType: false +SpacesBeforeTrailingComments: 2 +Cpp11BracedListStyle: true +Standard: Cpp11 +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +BreakBeforeBraces: Allman +IndentFunctionDeclarationAfterType: false +SpacesInParentheses: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterControlStatementKeyword: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +... diff -Nru ompl-1.1.0+ds1/CMakeLists.txt ompl-1.3.0+ds2/CMakeLists.txt --- ompl-1.1.0+ds1/CMakeLists.txt 2015-10-26 18:15:07.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeLists.txt 2017-02-28 22:47:16.000000000 +0000 @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 2.8) +cmake_policy(SET CMP0017 NEW) if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0) - cmake_policy(SET CMP0042 OLD) + cmake_policy(SET CMP0042 NEW) endif() project(ompl CXX C) @@ -23,7 +24,16 @@ set(MSVC ON) endif (MSVC OR MSVC90 OR MSVC10) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") +# add "${prefix}/share/cmake/Modules", which is where Eigen3's module is in MacPorts. +if(${CMAKE_VERSION} VERSION_LESS 2.8.12) + get_filename_component(CMAKE_ROOT_DIR "${CMAKE_ROOT}" PATH) +else() + get_filename_component(CMAKE_ROOT_DIR "${CMAKE_ROOT}" DIRECTORY) +endif() +set(CMAKE_MODULE_PATH + "${CMAKE_MODULE_PATH}" + "${CMAKE_ROOT_DIR}/cmake/Modules" + "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") include(GNUInstallDirs) include(CompilerSettings) include(OMPLVersion) @@ -38,6 +48,13 @@ set(OMPL_DEMO_INSTALL_DIR "share/ompl${OMPL_INSTALL_SUFFIX}/demos" CACHE STRING "Relative path to directory where demos will be installed") +# Add support in Boost::Python for std::shared_ptr +# This is a hack that replaces boost::shared_ptr related code with std::shared_ptr. +# Proper support for std::shared_ptr was added in Boost 1.63. +if(Boost_VERSION VERSION_LESS "106300") + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/external") +endif() + include_directories("${OMPL_INCLUDE_DIR}") @@ -52,36 +69,9 @@ add_definitions(-DBOOST_TEST_DYN_LINK) endif(IS_ICPC) -# Do one quiet find_package on Boost to see if it is recent enough to -# have the try_join_for call -find_package(Boost QUIET 1.50) - -# If Boost is not found at all, the check for version 1.50 below will die in -# the most ungraceful manner because Boost_VERSION is not defined. Define the -# variable here for a more useful error. -if (NOT ${Boost_FOUND}) - set(Boost_VERSION 0) -endif() - -# try_join_for requires the chrono library, so if we will use -# try_join_for, we need to include the chrono component -# Must recheck the Boost version, since update_bindings will re-run CMake -# and this will pass for versions of Boost < 1.50 -if (${Boost_FOUND} AND ${Boost_VERSION} GREATER 104900) # Boost version is at least 1.50 - # we're using chrono - find_package(Boost COMPONENTS date_time thread serialization filesystem system program_options unit_test_framework chrono REQUIRED) -else() - # don't use chrono - find_package(Boost COMPONENTS date_time thread serialization filesystem system program_options unit_test_framework REQUIRED) -endif() +find_package(Boost 1.54 COMPONENTS serialization filesystem system program_options REQUIRED) include_directories(SYSTEM ${Boost_INCLUDE_DIR}) -if(${Boost_VERSION} LESS 105300) - # Include bundled version of boost::odeint if it isn't installed natively - set(ODEINT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/external") - include_directories(SYSTEM "${ODEINT_INCLUDE_DIR}") -endif() - # on OS X we need to check whether to use libc++ or libstdc++ with clang++ if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") include(GetPrerequisites) @@ -112,7 +102,7 @@ find_package(Eigen3 QUIET) if (EIGEN3_FOUND) set(OMPL_HAVE_EIGEN3 1) - include_directories("${EIGEN3_INCLUDE_DIRS}") + include_directories("${EIGEN3_INCLUDE_DIR}") endif() # MORSE is only needed for Modular OpenRobots Simulation Engine bindings @@ -138,20 +128,12 @@ if (FLANN_FOUND) set(OMPL_HAVE_FLANN 1) include_directories(SYSTEM "${FLANN_INCLUDE_DIRS}") + link_directories(${FLANN_LIBRARY_DIRS}) endif() # R is needed for running Planner Arena locally find_program(R_EXEC R) -option(OMPL_LOCAL_PYPLUSPLUS_INSTALL "Whether Py++ and dependencies should be installed in the build directory" OFF) -set(SUDO "sudo") -set(CMAKE_GCCXML_ARGS "") -if(OMPL_LOCAL_PYPLUSPLUS_INSTALL) - set(SUDO "") - set(CMAKE_GCCXML_ARGS "-DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/pyplusplus") - set(DISTUTILS_ARGS "--prefix=${PROJECT_BINARY_DIR}/pyplusplus") -endif() - add_subdirectory(py-bindings) add_subdirectory(src) add_subdirectory(tests) @@ -159,27 +141,30 @@ add_subdirectory(scripts) add_subdirectory(doc) -if (NOT MSVC) - target_link_flags(ompl) - set(PKG_NAME "ompl") - set(PKG_DESC "The Open Motion Planning Library") - set(PKG_OMPL_LIBS "-lompl ${ompl_LINK_FLAGS}") - set(pkg_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/ompl.pc") - configure_file("${pkg_conf_file}.in" "${pkg_conf_file}" @ONLY) - install(FILES "${pkg_conf_file}" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ - COMPONENT ompl - RENAME "ompl${OMPL_INSTALL_SUFFIX}.pc") - - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/markdown/FindOMPL.cmake" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl${OMPL_INSTALL_SUFFIX}" - COMPONENT ompl - RENAME ompl-config.cmake) - - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ompl.conf" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl${OMPL_INSTALL_SUFFIX}" - COMPONENT ompl) -endif() +target_link_flags(ompl) +set(PKG_NAME "ompl") +set(PKG_DESC "The Open Motion Planning Library") +set(PKG_EXTERNAL_DEPS "${ompl_PKG_DEPS}") +set(PKG_OMPL_LIBS "-lompl ${ompl_LINK_FLAGS}") +set(pkg_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/ompl.pc") +configure_file("${pkg_conf_file}.in" "${pkg_conf_file}" @ONLY) +install(FILES "${pkg_conf_file}" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ + COMPONENT ompl + RENAME "ompl${OMPL_INSTALL_SUFFIX}.pc") + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/markdown/FindOMPL.cmake" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl${OMPL_INSTALL_SUFFIX}" + COMPONENT ompl + RENAME ompl-config.cmake) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ompl.conf" + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl${OMPL_INSTALL_SUFFIX}" + COMPONENT ompl) + +# script to install ompl on Ubuntu +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/install-ompl-ubuntu.sh.in" + "${CMAKE_CURRENT_SOURCE_DIR}/install-ompl-ubuntu.sh" @ONLY) # uninstall target configure_file( diff -Nru ompl-1.1.0+ds1/CMakeModules/CompilerSettings.cmake ompl-1.3.0+ds2/CMakeModules/CompilerSettings.cmake --- ompl-1.1.0+ds1/CMakeModules/CompilerSettings.cmake 2015-10-28 23:25:56.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/CompilerSettings.cmake 2016-06-19 03:38:14.000000000 +0000 @@ -1,3 +1,8 @@ +# force C++11 mode (MS Visual Studio doesn't know about this flag) +if(NOT MSVC) + add_definitions(-std=c++11) +endif() + if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-W -Wall -Wextra #-Wconversion -Wcast-qual -Wwrite-strings -Wunreachable-code -Wpointer-arith @@ -7,13 +12,13 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}") endif(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_definitions(-W -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-unused-parameter -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual -Wno-unknown-pragmas -Qunused-arguments -Wno-c++11-extensions) + add_definitions(-W -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-unused-parameter -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual -Wno-unknown-pragmas -Qunused-arguments -Wno-deprecated-register -Wno-mismatched-tags) # prepend optimizion flag (in case the default setting doesn't include one) set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}") endif() if(MSVC OR MSVC90 OR MSVC10) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 /D_ITERATOR_DEBUG_LEVEL=0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 -DNOMINMAX") endif(MSVC OR MSVC90 OR MSVC10) if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") diff -Nru ompl-1.1.0+ds1/CMakeModules/CPackSettings.cmake ompl-1.3.0+ds2/CMakeModules/CPackSettings.cmake --- ompl-1.1.0+ds1/CMakeModules/CPackSettings.cmake 2015-08-11 14:23:31.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/CPackSettings.cmake 2016-06-30 18:19:45.000000000 +0000 @@ -35,10 +35,7 @@ "/html/" "/bindings/" "TODO" - "exposed_decl.pypp.txt" "ompl.pc$" - "installPyPlusPlus.bat$" - "installPyPlusPlus.sh$" "create_symlinks.sh$" "uninstall_symlinks.sh$" "config.h$" diff -Nru ompl-1.1.0+ds1/CMakeModules/create_symlinks.sh.in ompl-1.3.0+ds2/CMakeModules/create_symlinks.sh.in --- ompl-1.1.0+ds1/CMakeModules/create_symlinks.sh.in 2015-02-26 18:58:06.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/create_symlinks.sh.in 2016-06-19 03:38:14.000000000 +0000 @@ -12,9 +12,6 @@ mkdir -p .symlinks/@CMAKE_INSTALL_INCLUDEDIR@ cd .symlinks/include ln -s ompl@OMPL_INSTALL_SUFFIX@ ompl - if [[ @Boost_VERSION@ < 105300 ]]; then - ln -s omplext_odeint@OMPL_INSTALL_SUFFIX@ omplext_odeint - fi if [ $1 ]; then ln -s omplapp@OMPL_INSTALL_SUFFIX@ omplapp fi diff -Nru ompl-1.1.0+ds1/CMakeModules/Findcastxml.cmake ompl-1.3.0+ds2/CMakeModules/Findcastxml.cmake --- ompl-1.1.0+ds1/CMakeModules/Findcastxml.cmake 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/Findcastxml.cmake 2017-01-12 16:44:35.000000000 +0000 @@ -0,0 +1,65 @@ +include(FindPackageHandleStandardArgs) + +if(NOT CASTXML) + find_program(CASTXML NAMES castxml) +endif() + +if (CASTXML) + set(CASTXMLCFLAGS "-std=c++11") + + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CASTXMLCOMPILER "g++") + else() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CASTXMLCOMPILER "clang++") + else() + if (MSVC) + set(CASTXMLCOMPILER "msvc8") + endif() + endif() + endif() + + set(CASTXMLCONFIG "[xml_generator] +xml_generator=castxml +xml_generator_path=${CASTXML} +compiler=${CASTXMLCOMPILER} +compiler_path=${CMAKE_CXX_COMPILER} +") + + set(_candidate_include_path + "${OMPL_INCLUDE_DIR}" + "${OMPLAPP_INCLUDE_DIR}" + "${PYTHON_INCLUDE_DIRS}" + "${Boost_INCLUDE_DIR}" + "${ASSIMP_INCLUDE_DIRS}" + "${ODEINT_INCLUDE_DIR}" + "${EIGEN3_INCLUDE_DIR}" + "${OMPL_INCLUDE_DIR}/../py-bindings") + if(MINGW) + execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpversion" + OUTPUT_VARIABLE _version OUTPUT_STRIP_TRAILING_WHITESPACE) + get_filename_component(_path "${CMAKE_CXX_COMPILER}" DIRECTORY) + get_filename_component(_path "${_path}" DIRECTORY) + list(APPEND _candidate_include_path + "${_path}/include" + "${_path}/lib/gcc/mingw32/${_version}/include" + "${_path}/lib/gcc/mingw32/${_version}/include/c++" + "${_path}/lib/gcc/mingw32/${_version}/include/c++/mingw32") + endif() + list(REMOVE_DUPLICATES _candidate_include_path) + set(CASTXMLINCLUDEPATH ".") + foreach(dir ${_candidate_include_path}) + if(EXISTS ${dir}) + set(CASTXMLINCLUDEPATH "${CASTXMLINCLUDEPATH};${dir}") + endif() + endforeach() + set(CASTXMLCONFIG "${CASTXMLCONFIG}include_paths=${CASTXMLINCLUDEPATH}\n") + if(CASTXMLCFLAGS) + set(CASTXMLCONFIG "${CASTXMLCONFIG}cflags=${CASTXMLCFLAGS}\n") + endif() + set(CASTXMLCONFIGPATH "${PROJECT_BINARY_DIR}/castxml.cfg") + file(WRITE "${CASTXMLCONFIGPATH}" "${CASTXMLCONFIG}") + set(CASTXMLCONFIGPATH "${CASTXMLCONFIGPATH}" PARENT_SCOPE) +endif() + +find_package_handle_standard_args(castxml DEFAULT_MSG CASTXML) diff -Nru ompl-1.1.0+ds1/CMakeModules/FindEigen3.cmake ompl-1.3.0+ds2/CMakeModules/FindEigen3.cmake --- ompl-1.1.0+ds1/CMakeModules/FindEigen3.cmake 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/FindEigen3.cmake 2016-06-17 11:42:29.000000000 +0000 @@ -1,8 +1,81 @@ -include(FindPackageHandleStandardArgs) +# - Try to find Eigen3 lib +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen3 3.1.2) +# to require version 3.1.2 or newer of Eigen3. +# +# Once done this will define +# +# EIGEN3_FOUND - system has eigen lib with correct version +# EIGEN3_INCLUDE_DIR - the eigen include directory +# EIGEN3_VERSION - eigen version -find_package(PkgConfig) -if(PKG_CONFIG_FOUND) - pkg_check_modules(EIGEN3 eigen3) -endif() +# Copyright (c) 2006, 2007 Montel Laurent, +# Copyright (c) 2008, 2009 Gael Guennebaud, +# Copyright (c) 2009 Benoit Jacob +# Redistribution and use is allowed according to the terms of the 2-clause BSD license. + +if(NOT Eigen3_FIND_VERSION) + if(NOT Eigen3_FIND_VERSION_MAJOR) + set(Eigen3_FIND_VERSION_MAJOR 2) + endif(NOT Eigen3_FIND_VERSION_MAJOR) + if(NOT Eigen3_FIND_VERSION_MINOR) + set(Eigen3_FIND_VERSION_MINOR 91) + endif(NOT Eigen3_FIND_VERSION_MINOR) + if(NOT Eigen3_FIND_VERSION_PATCH) + set(Eigen3_FIND_VERSION_PATCH 0) + endif(NOT Eigen3_FIND_VERSION_PATCH) + + set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") +endif(NOT Eigen3_FIND_VERSION) + +macro(_eigen3_check_version) + file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") + set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") + set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") + set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) + if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK FALSE) + else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN3_VERSION_OK TRUE) + endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + + if(NOT EIGEN3_VERSION_OK) + + message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " + "but at least version ${Eigen3_FIND_VERSION} is required") + endif(NOT EIGEN3_VERSION_OK) +endmacro(_eigen3_check_version) + +if (EIGEN3_INCLUDE_DIR) + + # in cache already + _eigen3_check_version() + set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) + +else (EIGEN3_INCLUDE_DIR) + + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + PATHS + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + + if(EIGEN3_INCLUDE_DIR) + _eigen3_check_version() + endif(EIGEN3_INCLUDE_DIR) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + + mark_as_advanced(EIGEN3_INCLUDE_DIR) + +endif(EIGEN3_INCLUDE_DIR) -find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIRS) diff -Nru ompl-1.1.0+ds1/CMakeModules/Findflann.cmake ompl-1.3.0+ds2/CMakeModules/Findflann.cmake --- ompl-1.1.0+ds1/CMakeModules/Findflann.cmake 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/Findflann.cmake 2017-02-28 22:42:36.000000000 +0000 @@ -2,13 +2,11 @@ include(FindPackageHandleStandardArgs) -find_path(FLANN_INCLUDE_DIR flann.hpp PATH_SUFFIXES flann) -if (FLANN_INCLUDE_DIR) - file(READ "${FLANN_INCLUDE_DIR}/config.h" FLANN_CONFIG) - string(REGEX REPLACE ".*FLANN_VERSION_ \"([0-9.]+)\".*" "\\1" FLANN_VERSION ${FLANN_CONFIG}) - if(NOT FLANN_VERSION VERSION_LESS flann_FIND_VERSION) - string(REGEX REPLACE "/flann$" "" FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR}) +find_package(PkgConfig) +if(PKGCONFIG_FOUND) + pkg_check_modules(FLANN flann) + if(FLANN_LIBRARIES AND NOT FLANN_INCLUDE_DIRS) + set(FLANN_INCLUDE_DIRS "/usr/include") endif() endif() - -find_package_handle_standard_args(flann DEFAULT_MSG FLANN_INCLUDE_DIRS) +find_package_handle_standard_args(FLANN DEFAULT_MSG FLANN_LIBRARIES FLANN_INCLUDE_DIRS) diff -Nru ompl-1.1.0+ds1/CMakeModules/FindGCCXML.cmake ompl-1.3.0+ds2/CMakeModules/FindGCCXML.cmake --- ompl-1.1.0+ds1/CMakeModules/FindGCCXML.cmake 2015-10-26 16:37:27.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/FindGCCXML.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -# - Find the GCC-XML front-end executable. -# -# This module will define the following variables: -# GCCXML - the GCC-XML front-end executable. - -#============================================================================= -# Copyright 2001-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# added extra path, to check for gccxml installed in build directory -find_program(GCCXML NAMES gccxml - PATHS "${PROJECT_BINARY_DIR}/pyplusplus/bin" - [HKEY_CURRENT_USER\\Software\\Kitware\\GCC_XML;loc] - "$ENV{ProgramFiles}/GCC_XML" - "C:/Program Files/GCC_XML") - -mark_as_advanced(GCCXML) diff -Nru ompl-1.1.0+ds1/CMakeModules/FindPython.cmake ompl-1.3.0+ds2/CMakeModules/FindPython.cmake --- ompl-1.1.0+ds1/CMakeModules/FindPython.cmake 2015-06-30 01:35:01.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/FindPython.cmake 2016-06-19 03:38:14.000000000 +0000 @@ -140,17 +140,24 @@ RESULT_VARIABLE _status OUTPUT_VARIABLE _verloc ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - list(GET _verloc 1 _location) - list(GET _verloc 0 _version) - message("${_status} ${_verloc} ${_version}") if(NOT _status) + list(LENGTH _verloc _verloclength) + if(_verloclength GREATER 1) + list(GET _verloc 1 _location) + list(GET _verloc 0 _version) + else() + set(_version "0") + endif() + # get rid of version prefixes and suffixes so that + # "v1.0rc2" becomes "1.0" + string(REGEX MATCH "[0-9.]+" _version "${_version}") if (NOT ${_version} VERSION_LESS ${_minversion}) set(PY_${module_upper} ${_location} CACHE STRING "Location of Python module ${module}") set(PY_${module_upper}_VERSION ${_version} CACHE STRING "Version of Python module ${module}") else() - message(SEND_ERROR "Module '${module}' version ${_version} found, but minimum version ${_minversion} required.") + message(WARNING "Module '${module}' version ${_version} found, but minimum version ${_minversion} required.") endif() endif(NOT _status) endif (_minversion STREQUAL "") diff -Nru ompl-1.1.0+ds1/CMakeModules/generate_header.cmake ompl-1.3.0+ds2/CMakeModules/generate_header.cmake --- ompl-1.1.0+ds1/CMakeModules/generate_header.cmake 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/generate_header.cmake 2016-06-19 03:38:14.000000000 +0000 @@ -1,10 +1,10 @@ -file(READ "headers_${module}.txt" headers_string) +file(READ "${dir}/py-bindings/headers_${module}.txt" headers_string) separate_arguments(headers UNIX_COMMAND "${headers_string}") set(module_header "bindings/${module}.h") file(WRITE "${module_header}" "") foreach(header ${headers}) if(NOT exclude OR NOT header MATCHES "${exclude}") - file(READ "${header}" _header_txt) + file(READ "${dir}/${header}" _header_txt) file(APPEND "${module_header}" "${_header_txt}") endif() endforeach(header) diff -Nru ompl-1.1.0+ds1/CMakeModules/ompl.pc.in ompl-1.3.0+ds2/CMakeModules/ompl.pc.in --- ompl-1.1.0+ds1/CMakeModules/ompl.pc.in 2013-07-10 00:54:58.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/ompl.pc.in 2016-06-19 03:38:14.000000000 +0000 @@ -1,8 +1,8 @@ # This file was generated by CMake for @PROJECT_NAME@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: @PKG_NAME@ Description: @PKG_DESC@ diff -Nru ompl-1.1.0+ds1/CMakeModules/OMPLUtils.cmake ompl-1.3.0+ds2/CMakeModules/OMPLUtils.cmake --- ompl-1.1.0+ds1/CMakeModules/OMPLUtils.cmake 2015-10-12 18:47:42.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/OMPLUtils.cmake 2016-06-19 03:38:14.000000000 +0000 @@ -2,7 +2,6 @@ add_executable(${ARGV}) target_link_libraries(${test_name} ompl - ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} @@ -16,16 +15,49 @@ add_test(${test_name} "${PYTHON_EXEC}" "${CMAKE_CURRENT_SOURCE_DIR}/${test_file}" "-v") endmacro(add_ompl_python_test) +# Computes the link flags and package dependencies for a list of targets. This command: +# +# target_link_flags(target1 target2 ...) +# +# sets the following variables in the calling context: +# +# target1_LINK_FLAGS +# target1_PKG_DEPS +# +# Note that the link flags for *all* targets are combined into two variables. +# The second variable is used for libraries that were found with pkg-config. +# This function is intended for generating pkg-config *.pc files. function(target_link_flags) set(_link_flags "") + set(_pkg_deps "") foreach(_target ${ARGV}) get_target_property(_link_libs ${_target} LINK_LIBRARIES) foreach(_lib ${_link_libs}) get_filename_component(_basename ${_lib} NAME_WE) get_filename_component(_ext ${_lib} EXT) - if(_ext STREQUAL ${CMAKE_SHARED_LIBRARY_SUFFIX}) - string(REPLACE ${CMAKE_SHARED_LIBRARY_PREFIX} "" _libname ${_basename}) - list(APPEND _link_flags "-l${_libname}") + # add -lfoo to link flags + if (_lib MATCHES "-l.+") + list(APPEND _link_flags "${_lib}") + else() + # add link flags for dynamic libraries + if(_ext STREQUAL ${CMAKE_SHARED_LIBRARY_SUFFIX}) + string(REPLACE ${CMAKE_SHARED_LIBRARY_PREFIX} "" _libname ${_basename}) + list(APPEND _link_flags "-l${_libname}") + else() + # OS X frameworks, which are also dynamic libraries + if (_ext STREQUAL ".framework") + list(APPEND _link_flags "-framework ${_basename}") + else() + # libraries found by pkg-config are just returned as "foo", + # not "libfoo.so". + if(NOT _ext) + list(FIND ARGV ${_basename} _index) + if (_index EQUAL -1) + list(APPEND _pkg_deps "${_basename}") + endif() + endif() + endif() + endif() endif() endforeach() endforeach() @@ -35,6 +67,13 @@ endforeach() string(STRIP "${_link_flags_str}" _link_flags_str) set(${ARGV0}_LINK_FLAGS "${_link_flags_str}" PARENT_SCOPE) + + list(REMOVE_DUPLICATES _pkg_deps) + foreach(_dep ${_pkg_deps}) + set(_pkg_dep_str "${_pkg_dep_str} ${_dep}") + endforeach() + string(STRIP "${_pkg_dep_str}" _pkg_dep_str) + set(${ARGV0}_PKG_DEPS "${_pkg_dep_str}" PARENT_SCOPE) endfunction() option(OMPL_VERSIONED_INSTALL "Append version suffix to binaries, libraries, and include dir." OFF) diff -Nru ompl-1.1.0+ds1/CMakeModules/OMPLVersion.cmake ompl-1.3.0+ds2/CMakeModules/OMPLVersion.cmake --- ompl-1.1.0+ds1/CMakeModules/OMPLVersion.cmake 2015-10-27 21:57:29.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/OMPLVersion.cmake 2017-02-28 22:10:16.000000000 +0000 @@ -1,8 +1,8 @@ # set the version in a way CMake can use set(OMPL_MAJOR_VERSION 1) -set(OMPL_MINOR_VERSION 1) +set(OMPL_MINOR_VERSION 3) set(OMPL_PATCH_VERSION 0) set(OMPL_VERSION "${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}.${OMPL_PATCH_VERSION}") # increment this when we have ABI changes -set(OMPL_ABI_VERSION 11) +set(OMPL_ABI_VERSION 13) diff -Nru ompl-1.1.0+ds1/CMakeModules/PythonBindingsUtils.cmake ompl-1.3.0+ds2/CMakeModules/PythonBindingsUtils.cmake --- ompl-1.1.0+ds1/CMakeModules/PythonBindingsUtils.cmake 2015-10-12 18:47:42.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/PythonBindingsUtils.cmake 2017-01-12 16:44:35.000000000 +0000 @@ -3,28 +3,9 @@ # You can optionally specify the desired version like so: # find_package(Python 2.6) find_package(Python QUIET) -set(ENV{PYTHONPATH} "${PROJECT_BINARY_DIR}/pyplusplus/lib/python${PYTHON_VERSION}/site-packages:$ENV{PYTHONPATH}") -find_python_module(pyplusplus QUIET) -find_python_module(pygccxml QUIET) -find_package(GCCXML QUIET) - -if(APPLE) - # The latest gccxml can be *compiled* with clang, but cannot *simulate* - # clang. If you compiled gccxml with clang, then you have to specify a - # g++ compiler by adding the following to PYOMPL_EXTRA_CFLAGS: - # --gccxml-compiler /opt/local/bin/g++-mp-4.8 - # (You can use other versions of g++ as well.) Note that /usr/bin/g++ - # is actually clang++ in Xcode 5.0, so that won't work. - # - # Gccxml mistakenly thinks that OS X is a 32-bit architecture. - set(PYOMPL_EXTRA_CFLAGS "-m64") -endif(APPLE) - -# Trick gccxml to ignore some compiler intrinsics that are used in Boost.Atomic -# in Boost 1.55. -if(CMAKE_COMPILER_IS_GNUCXX AND Boost_VERSION VERSION_GREATER "105400") - set(PYOMPL_EXTRA_CFLAGS "${PYOMPL_EXTRA_CFLAGS} -DBOOST_INTEL_CXX_VERSION") -endif() +find_python_module(pyplusplus 1.6.0) +find_python_module(pygccxml 1.7.2) +find_package(castxml) if(PYTHON_FOUND AND Boost_PYTHON_LIBRARY) include_directories(${PYTHON_INCLUDE_DIRS}) @@ -41,7 +22,7 @@ endif() if(PYTHON_FOUND AND Boost_PYTHON_LIBRARY AND PY_PYPLUSPLUS - AND PY_PYGCCXML AND GCCXML) + AND PY_PYGCCXML AND CASTXML) # make sure targets are defined only once if(NOT TARGET generate_headers) # top-level target for updating all-in-one header file for each module @@ -54,59 +35,55 @@ mark_as_advanced(PY_OMPL_GENERATE) endif() -function(create_module_header_file_target module dir) +function(create_module_header_file_target module) # create list of absolute paths to header files, which we # will add as a list of dependencies for the target file(READ "headers_${module}.txt" headers_string) separate_arguments(rel_headers UNIX_COMMAND "${headers_string}") set(headers "") foreach(header ${rel_headers}) + get_filename_component(header "../${header}" ABSOLUTE) list(APPEND headers "${header}") endforeach(header) # target for all-in-one header for module add_custom_target(${module}.h - COMMAND ${CMAKE_COMMAND} -D module=${module} -D exclude=${ARGV2} + COMMAND ${CMAKE_COMMAND} -D dir="${CMAKE_CURRENT_SOURCE_DIR}/.." -D module=${module} -D exclude=${ARGV1} -P "${OMPL_CMAKE_UTIL_DIR}/generate_header.cmake" - DEPENDS ${headers} WORKING_DIRECTORY "${dir}" + DEPENDS ${headers} COMMENT "Preparing C++ header file for Python binding generation for module ${module}") add_dependencies(generate_headers ${module}.h) endfunction(create_module_header_file_target) -function(create_module_code_generation_target module dir) +function(create_module_code_generation_target module) # target for regenerating code. Cmake is run so that the list of # sources for the py_ompl_${module} target (see below) is updated. add_custom_target(update_${module}_bindings - COMMAND env - PYTHONPATH="${PROJECT_BINARY_DIR}/pyplusplus/lib/python${PYTHON_VERSION}/site-packages:$ENV{PYTHONPATH}" - ${PYTHON_EXEC} + COMMAND ${PYTHON_EXEC} "${CMAKE_CURRENT_SOURCE_DIR}/generate_bindings.py" "${module}" - "1>${CMAKE_BINARY_DIR}/pyplusplus_${module}.log" "2>&1" - COMMAND ${CMAKE_COMMAND} -D "PATH=${dir}/bindings/${module}" - -P "${OMPL_CMAKE_UTIL_DIR}/workaround_for_gccxml_bug.cmake" + "2>&1" | tee "${CMAKE_BINARY_DIR}/pyplusplus_${module}.log" COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR} - WORKING_DIRECTORY ${dir} COMMENT "Creating C++ code for Python module ${module} (see pyplusplus_${module}.log)") add_dependencies(update_${module}_bindings ${module}.h) add_dependencies(update_bindings update_${module}_bindings) endfunction(create_module_code_generation_target) -function(create_module_generation_targets module dir) - create_module_header_file_target("${module}" "${dir}" "${ARGV2}") - create_module_code_generation_target("${module}" "${dir}") +function(create_module_generation_targets module) + create_module_header_file_target("${module}" "${ARGV1}") + create_module_code_generation_target("${module}") endfunction(create_module_generation_targets) -function(create_module_target module dir) +function(create_module_target module) # target for each python module - aux_source_directory("${dir}/bindings/${module}" PY${module}BINDINGS) + aux_source_directory("${CMAKE_CURRENT_BINARY_DIR}/bindings/${module}" PY${module}BINDINGS) list(LENGTH PY${module}BINDINGS NUM_SOURCE_FILES) if(NUM_SOURCE_FILES GREATER 0) - if(ARGC GREATER 2) - set(_dest_dir "${ARGV2}") - if(ARGC GREATER 3) - set(_extra_libs "${ARGV3}") + if(ARGC GREATER 1) + set(_dest_dir "${ARGV1}") + if(ARGC GREATER 2) + set(_extra_libs "${ARGV2}") endif() else() - set(_dest_dir "${dir}/ompl") + set(_dest_dir "${CMAKE_CURRENT_SOURCE_DIR}/ompl") endif() if(WIN32) # If this is built as a 'module', the compiler complains upon link, @@ -149,7 +126,7 @@ install(TARGETS py_ompl_${module} DESTINATION "${OMPL_PYTHON_INSTALL_DIR}/ompl/${module}/" COMPONENT ${_component}) - include_directories("${dir}/bindings/${module}" "${dir}") + include_directories("${CMAKE_CURRENT_BINARY_DIR}/bindings/${module}" "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") else(NUM_SOURCE_FILES GREATER 0) if(PY_OMPL_GENERATE) message(STATUS "Code for module ${module} not found; type \"make update_bindings\"") diff -Nru ompl-1.1.0+ds1/CMakeModules/workaround_for_gccxml_bug.cmake ompl-1.3.0+ds2/CMakeModules/workaround_for_gccxml_bug.cmake --- ompl-1.1.0+ds1/CMakeModules/workaround_for_gccxml_bug.cmake 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/CMakeModules/workaround_for_gccxml_bug.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# Function to work around a gccxml bug that results in a code that cannot be compiled -# -# For some boost::function's it generates code like this: boost::function -# This script fixes that, albeit in a very fragile way. This could probably be improved -# by someone with better regexp writing skills. -file(GLOB fnames "${PATH}/*.pypp.*") -foreach(fname ${fnames}) - file(READ ${fname} _text) - string(REPLACE " ()(" " (" _new_text "${_text}") - file(WRITE "${fname}" "${_new_text}") -endforeach(fname) diff -Nru ompl-1.1.0+ds1/debian/changelog ompl-1.3.0+ds2/debian/changelog --- ompl-1.1.0+ds1/debian/changelog 2016-09-19 08:49:08.000000000 +0000 +++ ompl-1.3.0+ds2/debian/changelog 2017-03-30 06:39:35.000000000 +0000 @@ -1,3 +1,26 @@ +ompl (1.3.0+ds2-1~urp14+1) trusty; urgency=medium + + * New upstream version. Closes: #835030 + * Upgrading to the new version of ompl + * Updating patches + * Update copyright. Thx decopy + * Drop old file + * New package. ompl-plannerarena to test planners. + * ds2 version because ds1 contained dubious licensed file. + * New nomenclature for ubuntu: urp+yearLTS + + -- Leopold Palomo-Avellaneda Wed, 15 Mar 2017 13:25:04 +0100 + +ompl (1.2.1+ds1-1) unstable; urgency=medium + + * New upstream version + * Rebase patches and simplified them. + * Dropped dbg package and move Readme to -dev. + Now it's autogenerated + * Copyright Updated. Thx decopy + + -- Leopold Palomo-Avellaneda Fri, 27 Jan 2017 12:44:35 +0100 + ompl (1.1.0+ds1-1~urp8+3) trusty; urgency=medium * Typo in the patch @@ -17,6 +40,18 @@ -- Leopold Palomo-Avellaneda Thu, 28 Apr 2016 14:59:37 +0200 +ompl (1.1.0+ds1-2) unstable; urgency=medium + + * Added flann patches + * Bump Standards-Version to 3.9.8 (no changes) + * Added pkg-config as build dependency + * Flann patches added to series + * Added DEB_CXXFLAGS_MAINT_APPEND to rules to compile with + gcc-6. Thanks Adrian Bunk (Closes: #831074) + * Added hardening=+bindnow to DEB_BUILD_MAINT_OPTIONS + + -- Leopold Palomo-Avellaneda Tue, 30 Aug 2016 12:03:54 +0200 + ompl (1.1.0+ds1-1) unstable; urgency=medium * New upstream version. diff -Nru ompl-1.1.0+ds1/debian/control ompl-1.3.0+ds2/debian/control --- ompl-1.1.0+ds1/debian/control 2016-09-19 08:40:57.000000000 +0000 +++ ompl-1.3.0+ds2/debian/control 2017-03-29 21:13:59.000000000 +0000 @@ -14,8 +14,10 @@ libboost-program-options-dev (>= 1.50.0), libboost-test-dev (>= 1.50.0), libode-dev (>= 0.14.1), - libflann-dev (>= 1.8.3) -Standards-Version: 3.9.7 + libflann-dev (>= 1.8.3), + pkg-config, + r-base-core +Standards-Version: 3.9.8 Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/ompl.git Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/ompl.git Homepage: http://ompl.kavrakilab.org @@ -24,7 +26,7 @@ Multi-Arch: same Architecture: any Section: libdevel -Depends: libompl11 (= ${binary:Version}), +Depends: libompl13 (= ${binary:Version}), pkg-config, ${misc:Depends}, libboost-dev @@ -39,7 +41,7 @@ additional components. This package contains the development files needed to use the library. -Package: libompl11 +Package: libompl13 Multi-Arch: same Architecture: any Depends: ${shlibs:Depends}, @@ -70,19 +72,21 @@ needed components. This package contains a set of demos of the library. -Package: libompl11-dbg -Multi-Arch: same -Architecture: any -Section: debug -Priority: extra -Depends: ${misc:Depends}, - libompl11 (= ${binary:Version}), - libompl-dev -Description: Open Motion Planning Library (OMPL) debug symbols - The Open Motion Planning Library is a set of sampling-based motion +Package: ompl-plannerarena +Multi-Arch: foreign +Architecture: all +Section: science +Depends: ${misc:Depends}, r-base-core, r-cran-shiny, r-cran-dplyr, + r-cran-tidyr, r-cran-ggplot2, r-cran-hmisc, r-cran-rsqlite, + r-cran-markdown +Description: Open Motion Planning Library (OMPL) plannerarena + The Open Motion Planning Library is a set of sampling-based motion planning algorithms. The content of the library is limited to these - algorithms, which means there is no environment specification, no + algorithms, which means there is no environment specification, no collision detection or visualization. The library is designed so it can be easily integrated into systems that provide the additional - needed components. This package contains the debug symbols for the - library. + needed components. + . + This package contains an script that launches a web server locally + to analyze SQLite3 benchmark databases. The benchmark databases are + created with ompl_benchmark_statistics library. diff -Nru ompl-1.1.0+ds1/debian/copyright ompl-1.3.0+ds2/debian/copyright --- ompl-1.1.0+ds1/debian/copyright 2016-04-28 12:39:32.000000000 +0000 +++ ompl-1.3.0+ds2/debian/copyright 2017-03-29 14:03:09.000000000 +0000 @@ -2,13 +2,70 @@ Upstream-Name: ompl Upstream-Contact: Mark Moll , Ioan Sucan Source: http://ompl.kavrakilab.org/ -Files-Excluded: src/external/* doc/js/bootstrap.min.js doc/js/jquery.js doc/js/jquery.powertip.min.js -Comment: js files are in other debian packages. +Files-Excluded: src/external/* + doc/js/bootstrap.min.js + doc/js/jquery.js + doc/js/jquery.powertip.min.js + doc/js/gen_validatorv31.js +Comment: js files are in other debian packages and gen_validatorv31 has + license problem. Files: * -Copyright: 2010-2014 Rice University +Copyright: 2013, Autonomous Systems Laboratory, Stanford University + 2015, Caleb Voss and Wilson Beebe + 2010-2015, Rice University + 2013, Rutgers the State University of New Jersey, New Brunswick + 2015, Tel Aviv University + 2014, University of Toronto + 2011-2012, Willow Garage + 2008-2012, Willow Garage, Inc License: BSD-3-clause +Files: CMakeModules/FindEigen3.cmake +Copyright: 2009, Benoit Jacob + 2008-2009, Gael Guennebaud + 2006-2007, Montel Laurent +License: BSD-2-clause + +Files: debian/* +Copyright: 2013-2017, Leopold Palomo-Avellaneda +License: BSD-3-clause +Comment: the Debian packaging is licensed under the same terms as the original package. + +Files: doc/css/bootstrap-theme.min.css + doc/css/bootstrap.min.css +Copyright: 2011-2014, Twitter Inc +License: Expat + +Files: tests/BoostTestTeamCityReporter.h.in +Copyright: 2011, CopyrightJetBrains s.r.o +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License v2.0. See `/usr/share/common-licenses/Apache-2.0'. + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + . + 2. 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. + License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -34,107 +91,6 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Files: debian/* -Copyright: 2013-2015 Leopold Palomo-Avellaneda -License: BSD-3-clause -Comment: the Debian packaging is licensed under the same terms as the original package. - -Files: - src/ompl/datastructures/BinaryHeap.h - src/ompl/datastructures/NearestNeighborsLinear.h - src/ompl/datastructures/GridB.h - src/ompl/datastructures/NearestNeighborsSqrtApprox.h - src/ompl/datastructures/NearestNeighbors.h - src/ompl/geometric/src/* - src/ompl/geometric/planners/*/LBKPIECE1.* - src/ompl/geometric/planners/*/KPIECE1.* - src/ompl/geometric/planners/prm/src/LazyPRM.cpp - src/ompl/geometric/planners/prm/src/PRMstar.cpp - src/ompl/geometric/planners/est/* - src/ompl/geometric/planners/sbl/* - src/ompl/geometric/planners/rrt/* - src/ompl/geometric/planners/stride/src/STRIDE.cpp - src/ompl/geometric/PathSimplifier.h - src/ompl/*/PathHybridization.* - src/ompl/*/GeneticSearch.* - src/ompl/*/HillClimbing.* - src/ompl/*/PathGeometric.* - src/ompl/base/src/ProjectionEvaluator.cpp - src/ompl/base/StateValidityChecker.h - src/ompl/*/GoalRegion.* - src/ompl/*/GoalState.* - src/ompl/*/StateStorage.* - src/ompl/*/GenericParam.* - src/ompl/*/PrecomputedStateSampler.* - src/ompl/*/OptimizationObjective.* - src/ompl/base/Path.h - src/ompl/base/Cost.h - src/ompl/base/Goal.h - src/ompl/*/RRT.* - src/ompl/*/SimpleDirectedControlSampler.* - src/ompl/*/DiscreteControlSpace.* - src/ompl/control/DirectedControlSampler.h - src/ompl/control/ControlSpaceTypes.h - src/ompl/*/Console.* - src/ompl/*/RandomNumbers.* - src/ompl/*/Profiler.* - src/ompl/tools/multiplan/* - tests/base/ptc.cpp - tests/base/state_storage.cpp - tests/control/2dmap/2dmap.cpp - tests/datastructures/grid.cpp - tests/datastructures/gridb.cpp - tests/datastructures/heap.cpp - tests/geometric/2d/2DcirclesSetup.h - tests/geometric/2d/2dcircles_optimize.cpp - tests/geometric/2d/2denvs.cpp - tests/geometric/2d/2dmap_simple.cpp - tests/resources/environment2D.h - tests/resources/circles2D.h - tests/util/random/random.cpp -Copyright: 2008,2011,2012,2013 Willow Garage, Inc. -License: BSD-3-Clause - -Files: - src/ompl/geometric/src/PathSimplifier.cpp - src/ompl/geometric/src/SimpleSetup.cpp - src/ompl/geometric/planners/stride/STRIDE.h - src/ompl/geometric/planners/rrt/RRTstar.h - src/ompl/geometric/planners/rrt/src/RRTstar.cpp -Copyright: 2010-2014 Rice University -License: BSD-3-Clause - - -Files: tests/BoostTestTeamCityReporter* -Copyright: Copyright 2011 JetBrains s.r.o. -License: Apache-2.0 - -Files: src/*/LBTRRT.h - src/*/LBTRRT.cpp -Copyright: 2013 Oren Salzman -License: BSD-3-Clause - -Files: src/*/SPARS.* - src/*/SPARStwo.* -Copyright: 2013 Rutgers the State University of New Jersey, New Brunswick -License: BSD-3-Clause - -Files: src/*/FMT.h - src/*/FMT.cpp -Copyright: 2013 Autonomous Systems Laboratory, Stanford University -License: BSD-3-Clause - -Files: doc/css/bootstrap*.css -Copyright: 2011-2014 Twitter Inc -License: Expat - -Files: CMakeModules/FindGCCXML.cmake -Copyright: 2001-2009 Kitware, Inc -License: BSD-3-clause - -License: Apache-2.0 - Licensed under the Apache License v2.0. See `/usr/share/common-licenses/Apache-2.0'. - License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -153,4 +109,5 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff -Nru ompl-1.1.0+ds1/debian/libompl11-dbg.install ompl-1.3.0+ds2/debian/libompl11-dbg.install --- ompl-1.1.0+ds1/debian/libompl11-dbg.install 2016-04-28 12:43:04.000000000 +0000 +++ ompl-1.3.0+ds2/debian/libompl11-dbg.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/share/doc/libompl11-dbg/* diff -Nru ompl-1.1.0+ds1/debian/libompl11.install ompl-1.3.0+ds2/debian/libompl11.install --- ompl-1.1.0+ds1/debian/libompl11.install 2016-04-28 12:43:05.000000000 +0000 +++ ompl-1.3.0+ds2/debian/libompl11.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/*/lib*.so.* - diff -Nru ompl-1.1.0+ds1/debian/libompl13.install ompl-1.3.0+ds2/debian/libompl13.install --- ompl-1.1.0+ds1/debian/libompl13.install 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/debian/libompl13.install 2017-03-29 14:03:11.000000000 +0000 @@ -0,0 +1,2 @@ +usr/lib/*/lib*.so.* + diff -Nru ompl-1.1.0+ds1/debian/libompl-dev.docs ompl-1.3.0+ds2/debian/libompl-dev.docs --- ompl-1.1.0+ds1/debian/libompl-dev.docs 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/debian/libompl-dev.docs 2017-03-29 14:03:09.000000000 +0000 @@ -0,0 +1 @@ +debian/README.Debug \ No newline at end of file diff -Nru ompl-1.1.0+ds1/debian/ompl-demos.install ompl-1.3.0+ds2/debian/ompl-demos.install --- ompl-1.1.0+ds1/debian/ompl-demos.install 2016-04-28 12:39:32.000000000 +0000 +++ ompl-1.3.0+ds2/debian/ompl-demos.install 2017-03-29 14:03:09.000000000 +0000 @@ -2,4 +2,3 @@ usr/share/ompl/demos/* usr/bin/ompl_benchmark_statistics.py => usr/bin/ompl_benchmark_statistics usr/share/man/man1/ompl_benchmark_statistics.1 - diff -Nru ompl-1.1.0+ds1/debian/ompl-plannerarena.install ompl-1.3.0+ds2/debian/ompl-plannerarena.install --- ompl-1.1.0+ds1/debian/ompl-plannerarena.install 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/debian/ompl-plannerarena.install 2017-03-29 14:03:09.000000000 +0000 @@ -0,0 +1,4 @@ +usr/bin/plannerarena +usr/share/ompl/plannerarena/* +usr/share/man/man1/plannerarena.1 +usr/share/ompl/ompl.conf diff -Nru ompl-1.1.0+ds1/debian/patches/0001-Disabling-installPyPlusPlus.sh-stuff.patch ompl-1.3.0+ds2/debian/patches/0001-Disabling-installPyPlusPlus.sh-stuff.patch --- ompl-1.1.0+ds1/debian/patches/0001-Disabling-installPyPlusPlus.sh-stuff.patch 2016-09-19 08:44:16.000000000 +0000 +++ ompl-1.3.0+ds2/debian/patches/0001-Disabling-installPyPlusPlus.sh-stuff.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From: Leopold Palomo-Avellaneda -Date: Wed, 27 Apr 2016 08:44:13 +0200 -Subject: Disabling installPyPlusPlus.sh stuff - ---- - src/CMakeLists.txt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4cf8ab7..cffbd5f 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -37,8 +37,8 @@ if(WIN32) - add_custom_target(installpyplusplus - COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.bat" VERBATIM) - else(WIN32) -- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh.in" -- "${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh" @ONLY) -- add_custom_target(installpyplusplus -- COMMAND "sh" "${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh") -+# configure_file("${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh.in" -+# "${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh" @ONLY) -+# add_custom_target(installpyplusplus -+# COMMAND "sh" "${CMAKE_CURRENT_SOURCE_DIR}/external/installPyPlusPlus.sh") - endif(WIN32) diff -Nru ompl-1.1.0+ds1/debian/patches/0002-Added-FLANN_LIBRARIES-dependency.patch ompl-1.3.0+ds2/debian/patches/0002-Added-FLANN_LIBRARIES-dependency.patch --- ompl-1.1.0+ds1/debian/patches/0002-Added-FLANN_LIBRARIES-dependency.patch 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/debian/patches/0002-Added-FLANN_LIBRARIES-dependency.patch 2017-03-29 14:03:09.000000000 +0000 @@ -0,0 +1,22 @@ +From: Leopold Palomo-Avellaneda +Date: Tue, 30 Aug 2016 12:18:55 +0200 +Subject: Added FLANN_LIBRARIES dependency + +--- + CMakeModules/OMPLUtils.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeModules/OMPLUtils.cmake b/CMakeModules/OMPLUtils.cmake +index 6296cd7..beb7988 100644 +--- a/CMakeModules/OMPLUtils.cmake ++++ b/CMakeModules/OMPLUtils.cmake +@@ -6,7 +6,8 @@ macro(add_ompl_test test_name) + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} +- ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) ++ ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ++ ${FLANN_LIBRARIES}) + add_test(NAME ${test_name} COMMAND $) + endmacro(add_ompl_test) + diff -Nru ompl-1.1.0+ds1/debian/patches/0002-Fixup-pkgconfig-for-multiarch.patch ompl-1.3.0+ds2/debian/patches/0002-Fixup-pkgconfig-for-multiarch.patch --- ompl-1.1.0+ds1/debian/patches/0002-Fixup-pkgconfig-for-multiarch.patch 2016-09-19 08:46:36.000000000 +0000 +++ ompl-1.3.0+ds2/debian/patches/0002-Fixup-pkgconfig-for-multiarch.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -From: Debian Science Maintainers -Date: Wed, 27 Apr 2016 08:44:13 +0200 -Subject: Fixup-pkgconfig-for-multiarch - -=================================================================== ---- - CMakeModules/ompl.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeModules/ompl.pc.in b/CMakeModules/ompl.pc.in -index 04fd20c..291380c 100644 ---- a/CMakeModules/ompl.pc.in -+++ b/CMakeModules/ompl.pc.in -@@ -1,7 +1,7 @@ - # This file was generated by CMake for @PROJECT_NAME@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${prefix}/lib -+libdir=${prefix}/lib/@CMAKE_LIBRARY_ARCHITECTURE@ - includedir=${prefix}/include - - Name: @PKG_NAME@ diff -Nru ompl-1.1.0+ds1/debian/patches/series ompl-1.3.0+ds2/debian/patches/series --- ompl-1.1.0+ds1/debian/patches/series 2016-09-19 08:45:44.000000000 +0000 +++ ompl-1.3.0+ds2/debian/patches/series 2017-03-29 21:13:20.000000000 +0000 @@ -1,3 +1 @@ -0001-Disabling-installPyPlusPlus.sh-stuff.patch -0002-Fixup-pkgconfig-for-multiarch.patch -0003-Backport-of-ompl_benchmark_statistics-from-1.2.1.patch +0002-Added-FLANN_LIBRARIES-dependency.patch diff -Nru ompl-1.1.0+ds1/debian/rules ompl-1.3.0+ds2/debian/rules --- ompl-1.1.0+ds1/debian/rules 2016-09-19 08:40:57.000000000 +0000 +++ ompl-1.3.0+ds2/debian/rules 2017-03-29 14:03:09.000000000 +0000 @@ -8,6 +8,7 @@ DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_BUILD_OPTIONS += nocheck +export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) @@ -22,7 +23,7 @@ CMAKE_FLAGS = \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \ + -DCMAKE_INSTALL_LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_C_FLAGS_RELEASE="$(CFLAGS)" \ -DCMAKE_CXX_FLAGS_RELEASE="$(CXXFLAGS)" \ @@ -71,15 +72,10 @@ dh_auto_install --builddirectory=build override_dh_install: - mkdir -p debian/tmp/usr/share/doc/libompl11-dbg && cp debian/README.Debug debian/tmp/usr/share/doc/libompl11-dbg/ - dh_install --list-missing override_dh_auto_test: echo "Supressing upstream tests" -override_dh_strip: - dh_strip --dbg-package=libompl11-dbg - diff -Nru ompl-1.1.0+ds1/demos/CForestCircleGridBenchmark.cpp ompl-1.3.0+ds2/demos/CForestCircleGridBenchmark.cpp --- ompl-1.1.0+ds1/demos/CForestCircleGridBenchmark.cpp 2015-02-26 18:58:06.000000000 +0000 +++ ompl-1.3.0+ds2/demos/CForestCircleGridBenchmark.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -48,11 +48,6 @@ namespace ot = ompl::tools; namespace po = boost::program_options; -ompl::base::OptimizationObjectivePtr getPathLengthObjective(const ompl::base::SpaceInformationPtr& si) -{ - return ompl::base::OptimizationObjectivePtr(new ompl::base::PathLengthOptimizationObjective(si)); -} - bool isStateValid(double radiusSquared, const ob::State *state) { const ob::SE2StateSpace::StateType *s = state->as(); @@ -69,7 +64,7 @@ int distance, gridLimit, runCount; double obstacleRadius, turningRadius, runtimeLimit; - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); po::options_description desc("Options"); @@ -97,23 +92,28 @@ } if (vm.count("dubins")) - space = ob::StateSpacePtr(new ob::DubinsStateSpace(turningRadius)); + space = std::make_shared(turningRadius); if (vm.count("dubinssym")) - space = ob::StateSpacePtr(new ob::DubinsStateSpace(turningRadius, true)); + space = std::make_shared(turningRadius, true); if (vm.count("reedsshepp")) - space = ob::StateSpacePtr(new ob::ReedsSheppStateSpace(turningRadius)); + space = std::make_shared(turningRadius); // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-.5 * gridLimit); bounds.setHigh(.5 * gridLimit); - space->as()->setBounds(bounds); + space->setBounds(bounds); // define a simple setup class og::SimpleSetup ss(space); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, obstacleRadius*obstacleRadius, _1)); + double radiusSquared = obstacleRadius * obstacleRadius; + ss.setStateValidityChecker( + [radiusSquared](const ob::State *state) + { + return isStateValid(radiusSquared, state); + }); // define start & goal states ob::ScopedState start(space), goal(space); @@ -125,15 +125,16 @@ // setting collision checking resolution to 0.05 (absolute) ss.getSpaceInformation()->setStateValidityCheckingResolution(0.05 / gridLimit); - ss.getProblemDefinition()->setOptimizationObjective(getPathLengthObjective(ss.getSpaceInformation())); + ss.getProblemDefinition()->setOptimizationObjective( + std::make_shared(ss.getSpaceInformation())); // by default, use the Benchmark class double memoryLimit = 4096; ot::Benchmark::Request request(runtimeLimit, memoryLimit, runCount); ot::Benchmark b(ss, "CircleGrid"); - b.addPlanner(ob::PlannerPtr(new og::RRTstar(ss.getSpaceInformation()))); - b.addPlanner(ob::PlannerPtr(new og::CForest(ss.getSpaceInformation()))); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); b.benchmark(request); b.saveResultsToFile("circleGrid.log"); diff -Nru ompl-1.1.0+ds1/demos/CMakeLists.txt ompl-1.3.0+ds2/demos/CMakeLists.txt --- ompl-1.1.0+ds1/demos/CMakeLists.txt 2015-10-12 18:47:42.000000000 +0000 +++ ompl-1.3.0+ds2/demos/CMakeLists.txt 2017-01-12 16:44:35.000000000 +0000 @@ -8,8 +8,6 @@ ompl ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) endmacro(add_ompl_demo) @@ -33,6 +31,13 @@ add_ompl_demo(demo_PlannerProgressProperties PlannerProgressProperties.cpp) add_ompl_demo(demo_CForestCircleGridBenchmark CForestCircleGridBenchmark.cpp) + add_ompl_demo(demo_Diagonal Diagonal.cpp) + + if(OMPL_HAVE_EIGEN3) + add_ompl_demo(demo_VectorFieldConservative VFRRT/VectorFieldConservative.cpp) + add_ompl_demo(demo_VectorFieldNonconservative VFRRT/VectorFieldNonconservative.cpp) + endif() + if (OMPL_EXTENSION_OPENDE) add_ompl_demo(demo_OpenDERigidBodyPlanning OpenDERigidBodyPlanning.cpp) endif() @@ -53,3 +58,6 @@ install(DIRECTORY Koules DESTINATION "${OMPL_DEMO_INSTALL_DIR}" COMPONENT ompl) +install(DIRECTORY VFRRT + DESTINATION "${OMPL_DEMO_INSTALL_DIR}" + COMPONENT ompl) diff -Nru ompl-1.1.0+ds1/demos/Diagonal.cpp ompl-1.3.0+ds2/demos/Diagonal.cpp --- ompl-1.1.0+ds1/demos/Diagonal.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Diagonal.cpp 2017-02-28 03:26:33.000000000 +0000 @@ -0,0 +1,155 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2016, Georgia Institute of Technology +* All rights reserved. +* +* 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. +* * Neither the name of the Rice University nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* 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 OWNER 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. +*********************************************************************/ + +/* Author: Florian Hauer */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +class ValidityChecker : public ompl::base::StateValidityChecker +{ +public: + ValidityChecker(const ompl::base::SpaceInformationPtr &si) : ompl::base::StateValidityChecker(si) + { + } + + bool isValid(const ompl::base::State *state) const override + { + const auto *state2D = state->as(); + + double sum = 0; + for (unsigned i = 0; i < si_->getStateSpace()->getDimension(); ++i) + sum += state2D->values[i] * state2D->values[i]; + + return sqrt(sum) > 0.1; + } +}; + +int main(int argc, char **argv) +{ + if (argc != 2) + { + std::cout << "Usage: " << argv[0] << " dimensionOfTheProblem" << std::endl; + exit(0); + } + int dim = atoi(argv[1]); + + auto space(std::make_shared(dim)); + ompl::geometric::SimpleSetup ss(space); + const ompl::base::SpaceInformationPtr &si = ss.getSpaceInformation(); + space->setBounds(-1, 1); + + ss.setStateValidityChecker(std::make_shared(si)); + + ompl::base::ScopedState<> start(space), goal(space); + for (int i = 0; i < dim; ++i) + { + start[i] = -1; + goal[i] = 1; + } + + ss.setStartAndGoalStates(start, goal); + + // by default, use the Benchmark class + double runtime_limit = 5, memory_limit = 1024; + int run_count = 100; + ompl::tools::Benchmark::Request request(runtime_limit, memory_limit, run_count, 0.05, true, true, false, false); + ompl::tools::Benchmark b(ss, "Diagonal"); + + double range = 0.1 * sqrt(dim); + + auto lengthObj(std::make_shared(si)); + ompl::base::OptimizationObjectivePtr oop((0.5 / sqrt(dim)) * lengthObj); + + ss.setOptimizationObjective(oop); + + bool knn = true; + + auto rrtstar(std::make_shared(si)); + rrtstar->setName("RRT*"); + rrtstar->setDelayCC(true); + // rrtstar->setFocusSearch(true); + rrtstar->setRange(range); + rrtstar->setKNearest(knn); + b.addPlanner(rrtstar); + auto rrtsh(std::make_shared(si)); + rrtsh->setRange(range); + rrtsh->setKNearest(knn); + b.addPlanner(rrtsh); + /*auto rrtsh3(std::make_shared(si)); + rrtsh3->setName("RRT#v3"); + rrtsh3->setRange(range); + rrtsh3->setKNearest(knn); + rrtsh3->setVariant(3); + b.addPlanner(rrtsh3); + auto rrtsh2(std::make_shared(si)); + rrtsh2->setName("RRT#v2"); + rrtsh2->setRange(range); + rrtsh2->setKNearest(knn); + rrtsh2->setVariant(2); + b.addPlanner(rrtsh2);*/ + auto rrtX1(std::make_shared(si)); + rrtX1->setName("RRTX0.1"); + rrtX1->setEpsilon(0.1); + rrtX1->setRange(range); + // rrtX1->setVariant(3); + rrtX1->setKNearest(knn); + b.addPlanner(rrtX1); + auto rrtX2(std::make_shared(si)); + rrtX2->setName("RRTX0.01"); + rrtX2->setEpsilon(0.01); + rrtX2->setRange(range); + // rrtX2->setVariant(3); + rrtX2->setKNearest(knn); + b.addPlanner(rrtX2); + auto rrtX3(std::make_shared(si)); + rrtX3->setName("RRTX0.001"); + rrtX3->setEpsilon(0.001); + rrtX3->setRange(range); + // rrtX3->setVariant(3); + rrtX3->setKNearest(knn); + b.addPlanner(rrtX3); + b.benchmark(request); + b.saveResultsToFile(boost::str(boost::format("Diagonal.log")).c_str()); + + exit(0); +} diff -Nru ompl-1.1.0+ds1/demos/GeometricCarPlanning.cpp ompl-1.3.0+ds2/demos/GeometricCarPlanning.cpp --- ompl-1.1.0+ds1/demos/GeometricCarPlanning.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/GeometricCarPlanning.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -61,7 +61,7 @@ return si->satisfiesBounds(state); } -void plan(ob::StateSpacePtr space, bool easy) +void plan(const ob::StateSpacePtr& space, bool easy) { ob::ScopedState<> start(space), goal(space); ob::RealVectorBounds bounds(2); @@ -79,9 +79,12 @@ og::SimpleSetup ss(space); // set state validity checking for this space - ob::SpaceInformationPtr si(ss.getSpaceInformation()); - ss.setStateValidityChecker(boost::bind( - easy ? &isStateValidEasy : &isStateValidHard, si.get(), _1)); + const ob::SpaceInformation *si = ss.getSpaceInformation().get(); + auto isStateValid = easy ? isStateValidEasy : isStateValidHard; + ss.setStateValidityChecker([isStateValid, si](const ob::State *state) + { + return isStateValid(si, state); + }); // set the start and goal states if (easy) @@ -118,7 +121,7 @@ std::cout << "No solution found" << std::endl; } -void printTrajectory(ob::StateSpacePtr space, const std::vector& pt) +void printTrajectory(const ob::StateSpacePtr& space, const std::vector& pt) { if (pt.size()!=3) throw ompl::Exception("3 arguments required for trajectory option"); const unsigned int num_pts = 50; @@ -140,7 +143,7 @@ } } -void printDistanceGrid(ob::StateSpacePtr space) +void printDistanceGrid(const ob::StateSpacePtr& space) { // print the distance for (x,y,theta) for all points in a 3D grid in SE(2) // over [-5,5) x [-5, 5) x [-pi,pi). @@ -196,12 +199,12 @@ return 1; } - ob::StateSpacePtr space(new ob::ReedsSheppStateSpace); + ob::StateSpacePtr space(std::make_shared()); if (vm.count("dubins")) - space = ob::StateSpacePtr(new ob::DubinsStateSpace); + space = std::make_shared(); if (vm.count("dubinssym")) - space = ob::StateSpacePtr(new ob::DubinsStateSpace(1., true)); + space = std::make_shared(1., true); if (vm.count("easyplan")) plan(space, true); if (vm.count("hardplan")) diff -Nru ompl-1.1.0+ds1/demos/HybridSystemPlanning.cpp ompl-1.3.0+ds2/demos/HybridSystemPlanning.cpp --- ompl-1.1.0+ds1/demos/HybridSystemPlanning.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/HybridSystemPlanning.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -94,23 +94,23 @@ int main(int, char**) { // plan for hybrid car in SE(2) with discrete gears - ob::StateSpacePtr SE2(new ob::SE2StateSpace()); - ob::StateSpacePtr velocity(new ob::RealVectorStateSpace(1)); + auto SE2(std::make_shared()); + auto velocity(std::make_shared(1)); // set the range for gears: [-1,3] inclusive - ob::StateSpacePtr gear(new ob::DiscreteStateSpace(-1,3)); + auto gear(std::make_shared(-1,3)); ob::StateSpacePtr stateSpace = SE2 + velocity + gear; // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-100); bounds.setHigh(100); - SE2->as()->setBounds(bounds); + SE2->setBounds(bounds); // set the bounds for the velocity ob::RealVectorBounds velocityBound(1); velocityBound.setLow(0); velocityBound.setHigh(60); - velocity->as()->setBounds(velocityBound); + velocity->setBounds(velocityBound); // create start and goal states ob::ScopedState<> start(stateSpace); @@ -129,7 +129,7 @@ goal[3] = 40.; // velocity goal->as()->as(2)->value = 3; // gear - oc::ControlSpacePtr cmanifold(new oc::RealVectorControlSpace(stateSpace, 2)); + oc::ControlSpacePtr cmanifold(std::make_shared(stateSpace, 2)); // set the bounds for the control manifold ob::RealVectorBounds cbounds(2); @@ -142,11 +142,17 @@ cmanifold->as()->setBounds(cbounds); oc::SimpleSetup setup(cmanifold); + const oc::SpaceInformation *si = setup.getSpaceInformation().get(); setup.setStartAndGoalStates(start, goal, 5.); - setup.setStateValidityChecker(boost::bind( - &isStateValid, setup.getSpaceInformation().get(), _1)); - setup.setStatePropagator(boost::bind( - &propagate, setup.getSpaceInformation().get(), _1, _2, _3, _4)); + setup.setStateValidityChecker([si](const ob::State *state) + { + return isStateValid(si, state); + }); + setup.setStatePropagator([si](const ob::State *state, const oc::Control* control, + const double duration, ob::State *result) + { + propagate(si, state, control, duration, result); + }); setup.getSpaceInformation()->setPropagationStepSize(.1); setup.getSpaceInformation()->setMinMaxControlDuration(2, 3); diff -Nru ompl-1.1.0+ds1/demos/HypercubeBenchmark.cpp ompl-1.3.0+ds2/demos/HypercubeBenchmark.cpp --- ompl-1.1.0+ds1/demos/HypercubeBenchmark.cpp 2015-10-21 00:28:12.000000000 +0000 +++ ompl-1.3.0+ds2/demos/HypercubeBenchmark.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -70,11 +70,11 @@ return true; } -void addPlanner(ompl::tools::Benchmark& benchmark, ompl::base::PlannerPtr planner, double range) +void addPlanner(ompl::tools::Benchmark& benchmark, const ompl::base::PlannerPtr& planner, double range) { ompl::base::ParamSet& params = planner->params(); if (params.hasParam(std::string("range"))) - params.setParam(std::string("range"), boost::lexical_cast(range)); + params.setParam(std::string("range"), std::to_string(range)); benchmark.addPlanner(planner); } @@ -84,14 +84,14 @@ ndim = boost::lexical_cast(argv[1]); double range = edgeWidth * 0.5; - ompl::base::StateSpacePtr space(new ompl::base::RealVectorStateSpace(ndim)); + auto space(std::make_shared(ndim)); ompl::base::RealVectorBounds bounds(ndim); ompl::geometric::SimpleSetup ss(space); ompl::base::ScopedState<> start(space), goal(space); bounds.setLow(0.); bounds.setHigh(1.); - space->as()->setBounds(bounds); + space->setBounds(bounds); ss.setStateValidityChecker(&isStateValid); ss.getSpaceInformation()->setStateValidityCheckingResolution(0.001); for(unsigned int i = 0; i < ndim; ++i) @@ -106,13 +106,13 @@ int run_count = 20; ompl::tools::Benchmark::Request request(runtime_limit, memory_limit, run_count); ompl::tools::Benchmark b(ss, "HyperCube"); - b.addExperimentParameter("num_dims", "INTEGER", boost::lexical_cast(ndim)); + b.addExperimentParameter("num_dims", "INTEGER", std::to_string(ndim)); - addPlanner(b, ompl::base::PlannerPtr(new ompl::geometric::STRIDE(ss.getSpaceInformation())), range); - addPlanner(b, ompl::base::PlannerPtr(new ompl::geometric::EST(ss.getSpaceInformation())), range); - addPlanner(b, ompl::base::PlannerPtr(new ompl::geometric::KPIECE1(ss.getSpaceInformation())), range); - addPlanner(b, ompl::base::PlannerPtr(new ompl::geometric::RRT(ss.getSpaceInformation())), range); - addPlanner(b, ompl::base::PlannerPtr(new ompl::geometric::PRM(ss.getSpaceInformation())), range); + addPlanner(b, std::make_shared(ss.getSpaceInformation()), range); + addPlanner(b, std::make_shared(ss.getSpaceInformation()), range); + addPlanner(b, std::make_shared(ss.getSpaceInformation()), range); + addPlanner(b, std::make_shared(ss.getSpaceInformation()), range); + addPlanner(b, std::make_shared(ss.getSpaceInformation()), range); b.benchmark(request); b.saveResultsToFile(boost::str(boost::format("hypercube_%i.log") % ndim).c_str()); diff -Nru ompl-1.1.0+ds1/demos/KinematicChainBenchmark.cpp ompl-1.3.0+ds2/demos/KinematicChainBenchmark.cpp --- ompl-1.1.0+ds1/demos/KinematicChainBenchmark.cpp 2015-10-21 00:21:39.000000000 +0000 +++ ompl-1.3.0+ds2/demos/KinematicChainBenchmark.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -57,7 +57,7 @@ }; // the robot and environment are modeled both as a vector of segments. -typedef std::vector Environment; +using Environment = std::vector; // simply use a random projection class KinematicChainProjector : public ompl::base::ProjectionEvaluator @@ -69,11 +69,11 @@ int dimension = std::max(2, (int)ceil(log((double) space->getDimension()))); projectionMatrix_.computeRandom(space->getDimension(), dimension); } - virtual unsigned int getDimension(void) const + unsigned int getDimension() const override { return projectionMatrix_.mat.size1(); } - void project(const ompl::base::State *state, ompl::base::EuclideanProjection &projection) const + void project(const ompl::base::State *state, ompl::base::EuclideanProjection &projection) const override { std::vector v(space_->getDimension()); space_->copyToReals(v, state); @@ -87,21 +87,20 @@ class KinematicChainSpace : public ompl::base::CompoundStateSpace { public: - KinematicChainSpace(unsigned int numLinks, double linkLength, Environment *env = NULL) + KinematicChainSpace(unsigned int numLinks, double linkLength, Environment *env = nullptr) : ompl::base::CompoundStateSpace(), linkLength_(linkLength), environment_(env) { for (unsigned int i = 0; i < numLinks; ++i) - addSubspace(ompl::base::StateSpacePtr(new ompl::base::SO2StateSpace()), 1.); + addSubspace(std::make_shared(), 1.); lock(); } - void registerProjections() + void registerProjections() override { - registerDefaultProjection(ompl::base::ProjectionEvaluatorPtr( - new KinematicChainProjector(this))); + registerDefaultProjection(std::make_shared(this)); } - double distance(const ompl::base::State *state1, const ompl::base::State *state2) const + double distance(const ompl::base::State *state1, const ompl::base::State *state2) const override { const StateType *cstate1 = state1->as(); const StateType *cstate2 = state2->as(); @@ -140,7 +139,7 @@ { } - bool isValid(const ompl::base::State *state) const + bool isValid(const ompl::base::State *state) const override { const KinematicChainSpace* space = si_->getStateSpace()->as(); const KinematicChainSpace::StateType *s = state->as(); @@ -155,13 +154,13 @@ theta += s->as(i)->value; xN = x + cos(theta) * linkLength; yN = y + sin(theta) * linkLength; - segments.push_back(Segment(x, y, xN, yN)); + segments.emplace_back(x, y, xN, yN); x = xN; y = yN; } xN = x + cos(theta) * 0.001; yN = y + sin(theta) * 0.001; - segments.push_back(Segment(x, y, xN, yN)); + segments.emplace_back(x, y, xN, yN); return selfIntersectionTest(segments) && environmentIntersectionTest(segments, *space->environment()); } @@ -179,9 +178,9 @@ // return true iff no segment in env0 intersects any segment in env1 bool environmentIntersectionTest(const Environment& env0, const Environment& env1) const { - for (unsigned int i = 0; i < env0.size(); ++i) - for (unsigned int j = 0; j < env1.size(); ++j) - if (intersectionTest(env0[i], env1[j])) + for (const auto & i : env0) + for (const auto & j : env1) + if (intersectionTest(i, j)) return false; return true; } @@ -228,7 +227,7 @@ theta += boost::math::constants::pi() / (double) d; xN = x + cos(theta) * scale; yN = y + sin(theta) * scale; - env.push_back(Segment(x, y, xN, yN)); + env.emplace_back(x, y, xN, yN); x = xN; y = yN; envFile << x << " " << y << std::endl; @@ -244,7 +243,7 @@ theta += boost::math::constants::pi() / d; xN = x + cos(theta) * scale; yN = y + sin(theta) * scale; - env.push_back(Segment(x, y, xN, yN)); + env.emplace_back(x, y, xN, yN); x = xN; y = yN; envFile << x << " " << y << std::endl; @@ -264,11 +263,10 @@ unsigned int numLinks = boost::lexical_cast(std::string(argv[1])); Environment env = createHornEnvironment(numLinks, log((double)numLinks) / (double)numLinks); - ompl::base::StateSpacePtr chain(new KinematicChainSpace(numLinks, 1. / (double)numLinks, &env)); + auto chain(std::make_shared(numLinks, 1. / (double)numLinks, &env)); ompl::geometric::SimpleSetup ss(chain); - ss.setStateValidityChecker(ompl::base::StateValidityCheckerPtr( - new KinematicChainValidityChecker(ss.getSpaceInformation()))); + ss.setStateValidityChecker(std::make_shared(ss.getSpaceInformation())); ompl::base::ScopedState<> start(chain), goal(chain); std::vector startVec(numLinks, boost::math::constants::pi() / (double)numLinks); @@ -286,7 +284,7 @@ // problem just once with STRIDE and print out the solution path. if (argc > 2) { - ss.setPlanner(ompl::base::PlannerPtr(new ompl::geometric::STRIDE(ss.getSpaceInformation()))); + ss.setPlanner(std::make_shared(ss.getSpaceInformation())); ss.setup(); ss.print(); ss.solve(3600); @@ -308,13 +306,13 @@ int run_count = 20; ompl::tools::Benchmark::Request request(runtime_limit, memory_limit, run_count, 0.5); ompl::tools::Benchmark b(ss, "KinematicChain"); - b.addExperimentParameter("num_links", "INTEGER", boost::lexical_cast(numLinks)); + b.addExperimentParameter("num_links", "INTEGER", std::to_string(numLinks)); - b.addPlanner(ompl::base::PlannerPtr(new ompl::geometric::STRIDE(ss.getSpaceInformation()))); - b.addPlanner(ompl::base::PlannerPtr(new ompl::geometric::EST(ss.getSpaceInformation()))); - b.addPlanner(ompl::base::PlannerPtr(new ompl::geometric::KPIECE1(ss.getSpaceInformation()))); - b.addPlanner(ompl::base::PlannerPtr(new ompl::geometric::RRT(ss.getSpaceInformation()))); - b.addPlanner(ompl::base::PlannerPtr(new ompl::geometric::PRM(ss.getSpaceInformation()))); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); + b.addPlanner(std::make_shared(ss.getSpaceInformation())); b.benchmark(request); b.saveResultsToFile(boost::str(boost::format("kinematic_%i.log") % numLinks).c_str()); diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesControlSpace.cpp ompl-1.3.0+ds2/demos/Koules/KoulesControlSpace.cpp --- ompl-1.1.0+ds1/demos/Koules/KoulesControlSpace.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesControlSpace.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -79,7 +79,7 @@ KoulesControlSpace::KoulesControlSpace(unsigned int numKoules) : ompl::control::RealVectorControlSpace( - ompl::base::StateSpacePtr(new KoulesStateSpace(numKoules)), 2) + std::make_shared(numKoules), 2) { bounds_.setLow(shipVmin); bounds_.setHigh(shipVmax); diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesControlSpace.h ompl-1.3.0+ds2/demos/Koules/KoulesControlSpace.h --- ompl-1.1.0+ds1/demos/Koules/KoulesControlSpace.h 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesControlSpace.h 2017-01-12 16:44:35.000000000 +0000 @@ -70,9 +70,9 @@ public: KoulesControlSpace(unsigned int numKoules); - virtual ompl::control::ControlSamplerPtr allocDefaultControlSampler(void) const + virtual ompl::control::ControlSamplerPtr allocDefaultControlSampler() const { - return ompl::control::ControlSamplerPtr(new KoulesControlSampler(this)); + return std::make_shared(this); } }; diff -Nru ompl-1.1.0+ds1/demos/Koules/Koules.cpp ompl-1.3.0+ds2/demos/Koules/Koules.cpp --- ompl-1.1.0+ds1/demos/Koules/Koules.cpp 2015-10-21 20:28:19.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/Koules.cpp 2016-06-19 03:38:14.000000000 +0000 @@ -131,7 +131,7 @@ { // Create a benchmark class ompl::tools::Benchmark b(ks, "Koules"); - b.addExperimentParameter("num_koules", "INTEGER", boost::lexical_cast( + b.addExperimentParameter("num_koules", "INTEGER", std::to_string( (ks.getStateSpace()->getDimension() - 5) / 4)); // Add the planner to evaluate b.addPlanner(ks.getConfiguredPlannerInstance(plannerName)); diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesGoal.h ompl-1.3.0+ds2/demos/Koules/KoulesGoal.h --- ompl-1.1.0+ds1/demos/Koules/KoulesGoal.h 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesGoal.h 2017-01-12 16:44:35.000000000 +0000 @@ -53,7 +53,7 @@ virtual double distanceGoal(const ompl::base::State *st) const; // pick a random state where each koule is on the edge of the workspace virtual void sampleGoal(ompl::base::State *st) const; - virtual unsigned int maxSampleCount(void) const + virtual unsigned int maxSampleCount() const { return 100; } diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesProjection.h ompl-1.3.0+ds2/demos/Koules/KoulesProjection.h --- ompl-1.1.0+ds1/demos/Koules/KoulesProjection.h 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesProjection.h 2017-01-12 16:44:35.000000000 +0000 @@ -53,11 +53,11 @@ numDimensions_ = 3; } - virtual unsigned int getDimension(void) const + virtual unsigned int getDimension() const { return numDimensions_; } - virtual void defaultCellSizes(void) + virtual void defaultCellSizes() { cellSizes_.resize(numDimensions_, .05); } diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesSetup.cpp ompl-1.3.0+ds2/demos/Koules/KoulesSetup.cpp --- ompl-1.1.0+ds1/demos/Koules/KoulesSetup.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesSetup.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -57,7 +57,7 @@ { } - virtual bool isValid(const ob::State *state) const + bool isValid(const ob::State *state) const override { return si_->satisfiesBounds(state); } @@ -67,19 +67,19 @@ ompl::control::DirectedControlSamplerPtr KoulesDirectedControlSamplerAllocator( const ompl::control::SpaceInformation *si, const ompl::base::GoalPtr &goal, bool propagateMax) { - return ompl::control::DirectedControlSamplerPtr(new KoulesDirectedControlSampler(si, goal, propagateMax)); + return std::make_shared(si, goal, propagateMax); } KoulesSetup::KoulesSetup(unsigned int numKoules, const std::string& plannerName, const std::vector& stateVec) - : ompl::control::SimpleSetup(ompl::control::ControlSpacePtr(new KoulesControlSpace(numKoules))) + : ompl::control::SimpleSetup(std::make_shared(numKoules)) { initialize(numKoules, plannerName, stateVec); } KoulesSetup::KoulesSetup(unsigned int numKoules, const std::string& plannerName, double kouleVel) - : ompl::control::SimpleSetup(ompl::control::ControlSpacePtr(new KoulesControlSpace(numKoules))) + : ompl::control::SimpleSetup(std::make_shared(numKoules)) { initialize(numKoules, plannerName); double* state = getProblemDefinition()->getStartState(0)->as()->values; @@ -122,38 +122,43 @@ } setStartState(start); // set goal - setGoal(ob::GoalPtr(new KoulesGoal(si_))); + setGoal(std::make_shared(si_)); // set propagation step size si_->setPropagationStepSize(propagationStepSize); // set min/max propagation steps si_->setMinMaxControlDuration(propagationMinSteps, propagationMaxSteps); // set directed control sampler; when using the PDST planner, propagate as long as possible + bool isPDST = plannerName == "pdst"; + const ompl::base::GoalPtr& goal = getGoal(); si_->setDirectedControlSamplerAllocator( - boost::bind(&KoulesDirectedControlSamplerAllocator, _1, getGoal(), plannerName == "pdst")); + [&goal, isPDST](const ompl::control::SpaceInformation *si) + { + return KoulesDirectedControlSamplerAllocator(si, goal, isPDST); + }); // set planner setPlanner(getConfiguredPlannerInstance(plannerName)); // set validity checker - setStateValidityChecker(ob::StateValidityCheckerPtr(new KoulesStateValidityChecker(si_))); + setStateValidityChecker(std::make_shared(si_)); // set state propagator - setStatePropagator(oc::StatePropagatorPtr(new KoulesStatePropagator(si_))); + setStatePropagator(std::make_shared(si_)); } ob::PlannerPtr KoulesSetup::getConfiguredPlannerInstance(const std::string& plannerName) { if (plannerName == "rrt") { - ob::PlannerPtr rrtplanner(new oc::RRT(si_)); - rrtplanner->as()->setIntermediateStates(true); + auto rrtplanner(std::make_shared(si_)); + rrtplanner->setIntermediateStates(true); return rrtplanner; } else if (plannerName == "est") - return ob::PlannerPtr(new oc::EST(si_)); + return std::make_shared(si_); else if (plannerName == "kpiece") - return ob::PlannerPtr(new oc::KPIECE1(si_)); + return std::make_shared(si_); else { - ob::PlannerPtr pdstplanner(new oc::PDST(si_)); - pdstplanner->as()->setProjectionEvaluator( + auto pdstplanner(std::make_shared(si_)); + pdstplanner->setProjectionEvaluator( si_->getStateSpace()->getProjection("PDSTProjection")); return pdstplanner; } diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesSimulator.cpp ompl-1.3.0+ds2/demos/Koules/KoulesSimulator.cpp --- ompl-1.1.0+ds1/demos/Koules/KoulesSimulator.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesSimulator.cpp 2016-06-19 03:38:14.000000000 +0000 @@ -247,7 +247,7 @@ } t += time_; if (t >= time_ && t <= endTime_) - collisionEvents_.push(boost::make_tuple(t, i, j)); + collisionEvents_.push(std::make_tuple(t, i, j)); } void KoulesSimulator::elasticCollision(unsigned int i, unsigned int j) @@ -329,8 +329,8 @@ while (!collisionEvents_.empty()) { CollisionEvent event = collisionEvents_.top(); - double ct = event.get<0>(); - unsigned int i = event.get<1>(), j = event.get<2>(); + double ct = std::get<0>(event); + unsigned int i = std::get<1>(event), j = std::get<2>(event); collisionEvents_.pop(); advance(ct); diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesSimulator.h ompl-1.3.0+ds2/demos/Koules/KoulesSimulator.h --- ompl-1.1.0+ds1/demos/Koules/KoulesSimulator.h 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesSimulator.h 2017-01-12 16:44:35.000000000 +0000 @@ -39,8 +39,7 @@ #include "KoulesConfig.h" #include -#include -#include +#include #include // State propagator for KoulesSetup. @@ -55,15 +54,15 @@ protected: // A tuple containing the time and id's of two objects colliding - typedef boost::tuple CollisionEvent; + using CollisionEvent = std::tuple; // A priority queue of events, s.t. the top element is the collision // that will happen first. - typedef std::priority_queue, - std::greater > CollisionEventQueue; + using CollisionEventQueue = std::priority_queue, std::greater>; // Compute the collision events based on current positions and velocities. // Push objects apart if they are slightly overlapping. - void initCollisionEvents(void); + void initCollisionEvents(); // Return time when i will return with horizontal (dim==0) or vertical // (dim==1) walls. double wallCollideEvent(unsigned int i, int dim); diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesStateSpace.cpp ompl-1.3.0+ds2/demos/Koules/KoulesStateSpace.cpp --- ompl-1.1.0+ds1/demos/Koules/KoulesStateSpace.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesStateSpace.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -46,7 +46,7 @@ { mass_[0] = shipMass; radius_[0] = shipRadius; - setName("Koules" + boost::lexical_cast(numKoules) + getName()); + setName("Koules" + std::to_string(numKoules) + getName()); // layout: (x_s y_s vx_s vy_s theta_s ... x_i y_i vx_i vy_i ... ), // where (x_i, y_i) is the position of koule i (i=1,..,numKoules), // (vx_i, vy_i) its velocity, (x_s, y_s) the position of the ship, @@ -82,11 +82,10 @@ } } -void KoulesStateSpace::registerProjections(void) +void KoulesStateSpace::registerProjections() { - registerDefaultProjection(ob::ProjectionEvaluatorPtr(new KoulesProjection(this, (getDimension() - 1) / 4 + 1))); - registerProjection("PDSTProjection", ob::ProjectionEvaluatorPtr( - new KoulesProjection(this, (getDimension() - 1) / 2 + 1))); + registerDefaultProjection(std::make_shared(this, (getDimension() - 1) / 4 + 1)); + registerProjection("PDSTProjection", std::make_shared(this, (getDimension() - 1) / 2 + 1)); } bool KoulesStateSpace::isDead(const ompl::base::State* state, unsigned int i) const diff -Nru ompl-1.1.0+ds1/demos/Koules/KoulesStateSpace.h ompl-1.3.0+ds2/demos/Koules/KoulesStateSpace.h --- ompl-1.1.0+ds1/demos/Koules/KoulesStateSpace.h 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Koules/KoulesStateSpace.h 2017-01-12 16:44:35.000000000 +0000 @@ -46,7 +46,7 @@ public: KoulesStateSpace(unsigned int numKoules); - virtual void registerProjections(void); + virtual void registerProjections(); double getMass(unsigned int i) const { diff -Nru ompl-1.1.0+ds1/demos/LTLWithTriangulation.cpp ompl-1.3.0+ds2/demos/LTLWithTriangulation.cpp --- ompl-1.1.0+ds1/demos/LTLWithTriangulation.cpp 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/demos/LTLWithTriangulation.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -52,8 +52,8 @@ namespace ob = ompl::base; namespace oc = ompl::control; -typedef oc::PropositionalTriangularDecomposition::Polygon Polygon; -typedef oc::PropositionalTriangularDecomposition::Vertex Vertex; +using Polygon = oc::PropositionalTriangularDecomposition::Polygon; +using Vertex = oc::PropositionalTriangularDecomposition::Vertex; // a decomposition is only needed for SyclopRRT and SyclopEST // use TriangularDecomp @@ -62,27 +62,24 @@ public: MyDecomposition(const ob::RealVectorBounds& bounds) : oc::PropositionalTriangularDecomposition(bounds) { } - virtual ~MyDecomposition() { } + ~MyDecomposition() override = default; - virtual void project(const ob::State* s, std::vector& coord) const + void project(const ob::State* s, std::vector& coord) const override { coord.resize(2); coord[0] = s->as()->getX(); coord[1] = s->as()->getY(); } - virtual void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const + void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const override { sampler->sampleUniform(s); ob::SE2StateSpace::StateType* ws = s->as(); ws->setXY(coord[0], coord[1]); } - -private: - ompl::RNG rng_; }; -void addObstaclesAndPropositions(oc::PropositionalTriangularDecomposition* decomp) +void addObstaclesAndPropositions(std::shared_ptr &decomp) { Polygon obstacle(4); obstacle.pts[0] = Vertex(0.,.9); @@ -127,23 +124,23 @@ This is to prevent us from having to redefine the obstacles in multiple places. */ bool isStateValid( const oc::SpaceInformation *si, - const oc::PropositionalTriangularDecomposition* decomp, + const std::shared_ptr &decomp, const ob::State *state) { if (!si->satisfiesBounds(state)) return false; const ob::SE2StateSpace::StateType* se2 = state->as(); - double x = se2->getX(); - double y = se2->getY(); + double x = se2->getX(); + double y = se2->getY(); const std::vector& obstacles = decomp->getHoles(); - typedef std::vector::const_iterator ObstacleIter; - for (ObstacleIter o = obstacles.begin(); o != obstacles.end(); ++o) + using ObstacleIter = std::vector::const_iterator; + for (const auto & obstacle : obstacles) { - if (polyContains(*o, x, y)) + if (polyContains(obstacle, x, y)) return false; } - return true; + return true; } void propagate(const ob::State *start, const oc::Control *control, const double duration, ob::State *result) @@ -164,38 +161,41 @@ SO2.enforceBounds (so2out); } -void plan(void) +void plan() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(0); bounds.setHigh(2); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create triangulation that ignores obstacle and respects propositions - MyDecomposition* ptd = new MyDecomposition(bounds); + std::shared_ptr ptd = std::make_shared(bounds); // helper method that adds an obstacle, as well as three propositions p0,p1,p2 addObstaclesAndPropositions(ptd); ptd->setup(); - oc::PropositionalDecompositionPtr pd(ptd); // create a control space - oc::ControlSpacePtr cspace(new oc::RealVectorControlSpace(space, 2)); + auto cspace(std::make_shared(space, 2)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-.5); cbounds.setHigh(.5); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); - oc::SpaceInformationPtr si(new oc::SpaceInformation(space, cspace)); - si->setStateValidityChecker(boost::bind(&isStateValid, si.get(), ptd, _1)); - si->setStatePropagator(boost::bind(&propagate, _1, _2, _3, _4)); + oc::SpaceInformationPtr si(std::make_shared(space, cspace)); + si->setStateValidityChecker( + [&si, ptd](const ob::State *state) + { + return isStateValid(si.get(), ptd, state); + }); + si->setStatePropagator(propagate); si->setPropagationStepSize(0.025); //LTL co-safety sequencing formula: visit p2,p0 in that order @@ -210,7 +210,7 @@ oc::AutomatonPtr safety = oc::Automaton::AvoidanceAutomaton(3, toAvoid); //construct product graph (propDecomp x A_{cosafety} x A_{safety}) - oc::ProductGraphPtr product(new oc::ProductGraph(pd, cosafety, safety)); + auto product(std::make_shared(ptd, cosafety, safety)); // LTLSpaceInformation creates a hybrid space of robot state space x product graph. // It takes the validity checker from SpaceInformation and expands it to one that also @@ -220,11 +220,11 @@ // and automaton states accordingly. // // The robot state space, given by SpaceInformation, is referred to as the "lower space". - oc::LTLSpaceInformationPtr ltlsi(new oc::LTLSpaceInformation(si, product)); + auto ltlsi(std::make_shared(si, product)); // LTLProblemDefinition creates a goal in hybrid space, corresponding to any // state in which both automata are accepting - oc::LTLProblemDefinitionPtr pdef(new oc::LTLProblemDefinition(ltlsi)); + auto pdef(std::make_shared(ltlsi)); // create a start state ob::ScopedState start(space); @@ -238,13 +238,13 @@ pdef->addLowerStartState(start.get()); //LTL planner (input: LTL space information, product automaton) - oc::LTLPlanner* ltlPlanner = new oc::LTLPlanner(ltlsi, product); - ltlPlanner->setProblemDefinition(pdef); + oc::LTLPlanner ltlPlanner(ltlsi, product); + ltlPlanner.setProblemDefinition(pdef); // attempt to solve the problem within thirty seconds of planning time // considering the above cosafety/safety automata, a solution path is any // path that visits p2 followed by p0 while avoiding obstacles and avoiding p1. - ob::PlannerStatus solved = ltlPlanner->as()->solve(30.0); + ob::PlannerStatus solved = ltlPlanner.ob::Planner::solve(30.0); if (solved) { @@ -256,8 +256,6 @@ } else std::cout << "No solution found" << std::endl; - - delete ltlPlanner; } int main(int, char **) diff -Nru ompl-1.1.0+ds1/demos/OpenDERigidBodyPlanning.cpp ompl-1.3.0+ds2/demos/OpenDERigidBodyPlanning.cpp --- ompl-1.1.0+ds1/demos/OpenDERigidBodyPlanning.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/OpenDERigidBodyPlanning.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -50,12 +50,12 @@ { public: - RigidBodyEnvironment(void) : oc::OpenDEEnvironment() + RigidBodyEnvironment() : oc::OpenDEEnvironment() { createWorld(); } - virtual ~RigidBodyEnvironment(void) + ~RigidBodyEnvironment() override { destroyWorld(); } @@ -64,12 +64,12 @@ * Implementation of functions needed by planning * **************************************************/ - virtual unsigned int getControlDimension(void) const + unsigned int getControlDimension() const override { return 3; } - virtual void getControlBounds(std::vector &lower, std::vector &upper) const + void getControlBounds(std::vector &lower, std::vector &upper) const override { static double maxForce = 0.2; lower.resize(3); @@ -83,17 +83,17 @@ upper[2] = maxForce; } - virtual void applyControl(const double *control) const + void applyControl(const double *control) const override { dBodyAddForce(boxBody, control[0], control[1], control[2]); } - virtual bool isValidCollision(dGeomID /*geom1*/, dGeomID /*geom2*/, const dContact& /*contact*/) const + bool isValidCollision(dGeomID /*geom1*/, dGeomID /*geom2*/, const dContact& /*contact*/) const override { return false; } - virtual void setupContact(dGeomID /*geom1*/, dGeomID /*geom2*/, dContact &contact) const + void setupContact(dGeomID /*geom1*/, dGeomID /*geom2*/, dContact &contact) const override { contact.surface.mode = dContactSoftCFM | dContactApprox1; contact.surface.mu = 0.9; @@ -108,14 +108,14 @@ // simulation environment. At the end of the function, there is a // call to setPlanningParameters(), which configures members of // the base class needed by planners. - void createWorld(void); + void createWorld(); // Clear all OpenDE objects - void destroyWorld(void); + void destroyWorld(); // Set parameters needed by the base class (such as the bodies // that make up to state of the system we are planning for) - void setPlanningParameters(void); + void setPlanningParameters(); // the simulation world dWorldID bodyWorld; @@ -145,7 +145,7 @@ threshold_ = 0.5; } - virtual double distanceGoal(const ob::State *st) const + double distanceGoal(const ob::State *st) const override { const double *pos = st->as()->getBodyPosition(0); double dx = fabs(pos[0] - 30); @@ -166,12 +166,12 @@ { } - virtual unsigned int getDimension(void) const + unsigned int getDimension() const override { return 3; } - virtual void defaultCellSizes(void) + void defaultCellSizes() override { cellSizes_.resize(3); cellSizes_[0] = 1; @@ -179,7 +179,7 @@ cellSizes_[2] = 1; } - virtual void project(const ob::State *state, ob::EuclideanProjection &projection) const + void project(const ob::State *state, ob::EuclideanProjection &projection) const override { const double *pos = state->as()->getBodyPosition(0); projection[0] = pos[0]; @@ -198,7 +198,7 @@ { } - virtual double distance(const ob::State *s1, const ob::State *s2) const + double distance(const ob::State *s1, const ob::State *s2) const override { const double *p1 = s1->as()->getBodyPosition(0); const double *p2 = s2->as()->getBodyPosition(0); @@ -208,9 +208,10 @@ return sqrt(dx * dx + dy * dy + dz * dz); } - virtual void registerProjections(void) + void registerProjections() override { - registerDefaultProjection(ob::ProjectionEvaluatorPtr(new RigidBodyStateProjectionEvaluator(this))); + registerDefaultProjection( + std::make_shared(this)); } }; @@ -223,17 +224,16 @@ dInitODE2(0); // create the OpenDE environment - oc::OpenDEEnvironmentPtr env(new RigidBodyEnvironment()); + oc::OpenDEEnvironmentPtr env(std::make_shared()); // create the state space and the control space for planning - RigidBodyStateSpace *stateSpace = new RigidBodyStateSpace(env); - ob::StateSpacePtr stateSpacePtr = ob::StateSpacePtr(stateSpace); + auto stateSpace = std::make_shared(env); // this will take care of setting a proper collision checker and the starting state for the planner as the initial OpenDE state - oc::OpenDESimpleSetup ss(stateSpacePtr); + oc::OpenDESimpleSetup ss(stateSpace); // set the goal we would like to reach - ss.setGoal(ob::GoalPtr(new RigidBodyGoal(ss.getSpaceInformation()))); + ss.setGoal(std::make_shared(ss.getSpaceInformation())); ob::RealVectorBounds bounds(3); bounds.setLow(-200); @@ -269,13 +269,13 @@ * Member function implementations * ***********************************************/ -void RigidBodyEnvironment::createWorld(void) +void RigidBodyEnvironment::createWorld() { // BEGIN SETTING UP AN OPENDE ENVIRONMENT // *********************************** bodyWorld = dWorldCreate(); - space = dHashSpaceCreate(0); + space = dHashSpaceCreate(nullptr); dWorldSetGravity(bodyWorld, 0, 0, -0.981); @@ -296,13 +296,13 @@ setPlanningParameters(); } -void RigidBodyEnvironment::destroyWorld(void) +void RigidBodyEnvironment::destroyWorld() { dSpaceDestroy(space); dWorldDestroy(bodyWorld); } -void RigidBodyEnvironment::setPlanningParameters(void) +void RigidBodyEnvironment::setPlanningParameters() { // Fill in parameters for OMPL: world_ = bodyWorld; diff -Nru ompl-1.1.0+ds1/demos/OptimalPlanning.cpp ompl-1.3.0+ds2/demos/OptimalPlanning.cpp --- ompl-1.1.0+ds1/demos/OptimalPlanning.cpp 2015-10-23 21:01:57.000000000 +0000 +++ ompl-1.3.0+ds2/demos/OptimalPlanning.cpp 2017-02-10 02:47:59.000000000 +0000 @@ -46,17 +46,19 @@ #include #include #include -#include +#include #include +#include #include +#include // For boost program options #include // For string comparison (boost::iequals) #include -// For boost::make_shared -#include +// For std::make_shared +#include #include @@ -68,12 +70,14 @@ // An enum of supported optimal planners, alphabetical order enum optimalPlanner { + PLANNER_BFMTSTAR, PLANNER_BITSTAR, PLANNER_CFOREST, PLANNER_FMTSTAR, PLANNER_INF_RRTSTAR, PLANNER_PRMSTAR, - PLANNER_RRTSTAR + PLANNER_RRTSTAR, + PLANNER_SORRTSTAR, }; // An enum of the supported optimization objectives, alphabetical order @@ -100,14 +104,14 @@ // Returns whether the given state's position overlaps the // circular obstacle - bool isValid(const ob::State* state) const + bool isValid(const ob::State* state) const override { return this->clearance(state) > 0.0; } // Returns the distance from the given state's position to the // boundary of the circular obstacle. - double clearance(const ob::State* state) const + double clearance(const ob::State* state) const override { // We know we're working with a RealVectorStateSpace in this // example, so we downcast state into the specific type. @@ -140,34 +144,44 @@ { switch (plannerType) { + case PLANNER_BFMTSTAR: + { + return std::make_shared(si); + break; + } case PLANNER_BITSTAR: { - return boost::make_shared(si); + return std::make_shared(si); break; } case PLANNER_CFOREST: { - return boost::make_shared(si); + return std::make_shared(si); break; } case PLANNER_FMTSTAR: { - return boost::make_shared(si); + return std::make_shared(si); break; } case PLANNER_INF_RRTSTAR: { - return boost::make_shared(si); + return std::make_shared(si); break; } case PLANNER_PRMSTAR: { - return boost::make_shared(si); + return std::make_shared(si); break; } case PLANNER_RRTSTAR: { - return boost::make_shared(si); + return std::make_shared(si); + break; + } + case PLANNER_SORRTSTAR: + { + return std::make_shared(si); break; } default: @@ -179,7 +193,7 @@ } } -ob::OptimizationObjectivePtr allocateObjective(ob::SpaceInformationPtr si, planningObjective objectiveType) +ob::OptimizationObjectivePtr allocateObjective(const ob::SpaceInformationPtr& si, planningObjective objectiveType) { switch (objectiveType) { @@ -202,20 +216,20 @@ } } -void plan(double runTime, optimalPlanner plannerType, planningObjective objectiveType, std::string outputFile) +void plan(double runTime, optimalPlanner plannerType, planningObjective objectiveType, const std::string& outputFile) { // Construct the robot state space in which we're planning. We're // planning in [0,1]x[0,1], a subset of R^2. - ob::StateSpacePtr space(new ob::RealVectorStateSpace(2)); + auto space(std::make_shared(2)); // Set the bounds of space to be in [0,1]. - space->as()->setBounds(0.0, 1.0); + space->setBounds(0.0, 1.0); // Construct a space information instance for this state space - ob::SpaceInformationPtr si(new ob::SpaceInformation(space)); + auto si(std::make_shared(space)); // Set the object used to check which states in the space are valid - si->setStateValidityChecker(ob::StateValidityCheckerPtr(new ValidityChecker(si))); + si->setStateValidityChecker(std::make_shared(si)); si->setup(); @@ -232,7 +246,7 @@ goal->as()->values[1] = 1.0; // Create a problem instance - ob::ProblemDefinitionPtr pdef(new ob::ProblemDefinition(si)); + auto pdef(std::make_shared(si)); // Set the start and goal states pdef->setStartAndGoalStates(start, goal); @@ -267,7 +281,7 @@ if (!outputFile.empty()) { std::ofstream outFile(outputFile.c_str()); - boost::static_pointer_cast(pdef->getSolutionPath())-> + std::static_pointer_cast(pdef->getSolutionPath())-> printAsMatrix(outFile); outFile.close(); } @@ -306,7 +320,7 @@ computed paths. */ ob::OptimizationObjectivePtr getPathLengthObjective(const ob::SpaceInformationPtr& si) { - return ob::OptimizationObjectivePtr(new ob::PathLengthOptimizationObjective(si)); + return std::make_shared(si); } /** Returns an optimization objective which attempts to minimize path @@ -314,7 +328,7 @@ is found. */ ob::OptimizationObjectivePtr getThresholdPathLengthObj(const ob::SpaceInformationPtr& si) { - ob::OptimizationObjectivePtr obj(new ob::PathLengthOptimizationObjective(si)); + auto obj(std::make_shared(si)); obj->setCostThreshold(ob::Cost(1.51)); return obj; } @@ -344,7 +358,7 @@ // minimization. Therefore, we set each state's cost to be the // reciprocal of its clearance, so that as state clearance // increases, the state cost decreases. - ob::Cost stateCost(const ob::State* s) const + ob::Cost stateCost(const ob::State* s) const override { return ob::Cost(1 / si_->getStateValidityChecker()->clearance(s)); } @@ -354,7 +368,7 @@ away from obstacles. */ ob::OptimizationObjectivePtr getClearanceObjective(const ob::SpaceInformationPtr& si) { - return ob::OptimizationObjectivePtr(new ClearanceObjective(si)); + return std::make_shared(si); } /** Create an optimization objective which attempts to optimize both @@ -371,10 +385,9 @@ */ ob::OptimizationObjectivePtr getBalancedObjective1(const ob::SpaceInformationPtr& si) { - ob::OptimizationObjectivePtr lengthObj(new ob::PathLengthOptimizationObjective(si)); - ob::OptimizationObjectivePtr clearObj(new ClearanceObjective(si)); - - ob::MultiOptimizationObjective* opt = new ob::MultiOptimizationObjective(si); + auto lengthObj(std::make_shared(si)); + auto clearObj(std::make_shared(si)); + auto opt(std::make_shared(si)); opt->addObjective(lengthObj, 10.0); opt->addObjective(clearObj, 1.0); @@ -386,8 +399,8 @@ */ ob::OptimizationObjectivePtr getBalancedObjective2(const ob::SpaceInformationPtr& si) { - ob::OptimizationObjectivePtr lengthObj(new ob::PathLengthOptimizationObjective(si)); - ob::OptimizationObjectivePtr clearObj(new ClearanceObjective(si)); + auto lengthObj(std::make_shared(si)); + auto clearObj(std::make_shared(si)); return 10.0*lengthObj + clearObj; } @@ -397,7 +410,7 @@ problem. */ ob::OptimizationObjectivePtr getPathLengthObjWithCostToGo(const ob::SpaceInformationPtr& si) { - ob::OptimizationObjectivePtr obj(new ob::PathLengthOptimizationObjective(si)); + auto obj(std::make_shared(si)); obj->setCostToGoHeuristic(&ob::goalRegionCostToGo); return obj; } @@ -412,7 +425,7 @@ desc.add_options() ("help,h", "produce help message") ("runtime,t", bpo::value()->default_value(1.0), "(Optional) Specify the runtime in seconds. Defaults to 1 and must be greater than 0.") - ("planner,p", bpo::value()->default_value("RRTstar"), "(Optional) Specify the optimal planner to use, defaults to RRTstar if not given. Valid options are BITstar, CForest, FMTstar, InformedRRTstar, PRMstar, and RRTstar.") //Alphabetical order + ("planner,p", bpo::value()->default_value("RRTstar"), "(Optional) Specify the optimal planner to use, defaults to RRTstar if not given. Valid options are BFMTstar, BITstar, CForest, FMTstar, InformedRRTstar, PRMstar, RRTstar, and SORRTstar.") //Alphabetical order ("objective,o", bpo::value()->default_value("PathLength"), "(Optional) Specify the optimization objective, defaults to PathLength if not given. Valid options are PathClearance, PathLength, ThresholdPathLength, and WeightedLengthAndClearanceCombo.") //Alphabetical order ("file,f", bpo::value()->default_value(""), "(Optional) Specify an output path for the found solution path.") ("info,i", bpo::value()->default_value(0u), "(Optional) Set the OMPL log level. 0 for WARN, 1 for INFO, 2 for DEBUG. Defaults to WARN."); @@ -463,7 +476,11 @@ std::string plannerStr = vm["planner"].as(); // Map the string to the enum - if (boost::iequals("BITstar", plannerStr)) + if (boost::iequals("BFMTstar", plannerStr)) + { + *plannerPtr = PLANNER_BFMTSTAR; + } + else if (boost::iequals("BITstar", plannerStr)) { *plannerPtr = PLANNER_BITSTAR; } @@ -487,6 +504,10 @@ { *plannerPtr = PLANNER_RRTSTAR; } + else if (boost::iequals("SORRTstar", plannerStr)) + { + *plannerPtr = PLANNER_SORRTSTAR; + } else { std::cout << "Invalid planner string." << std::endl << std::endl << desc << std::endl; diff -Nru ompl-1.1.0+ds1/demos/OptimalPlanning.py ompl-1.3.0+ds2/demos/OptimalPlanning.py --- ompl-1.1.0+ds1/demos/OptimalPlanning.py 2015-10-23 21:01:57.000000000 +0000 +++ ompl-1.3.0+ds2/demos/OptimalPlanning.py 2017-02-10 02:47:59.000000000 +0000 @@ -166,7 +166,9 @@ # Keep these in alphabetical order and all lower case def allocatePlanner(si, plannerType): - if plannerType.lower() == "bitstar": + if plannerType.lower() == "bfmtstar": + return og.BFMT(si) + elif plannerType.lower() == "bitstar": return og.BITstar(si) elif plannerType.lower() == "fmtstar": return og.FMT(si) @@ -176,6 +178,8 @@ return og.PRMstar(si) elif plannerType.lower() == "rrtstar": return og.RRTstar(si) + elif plannerType.lower() == "sorrtstar": + return og.SORRTstar(si) else: OMPL_ERROR("Planner-type is not implemented in allocation function."); @@ -263,7 +267,7 @@ # Add a filename argument parser.add_argument('-t', '--runtime', type=float, default=1.0, help='(Optional) Specify the runtime in seconds. Defaults to 1 and must be greater than 0.') - parser.add_argument('-p', '--planner', default='RRTstar', choices=['BITstar', 'FMTstar', 'InformedRRTstar', 'PRMstar', 'RRTstar'], help='(Optional) Specify the optimal planner to use, defaults to RRTstar if not given.') # Alphabetical order + parser.add_argument('-p', '--planner', default='RRTstar', choices=['BFMTstar', 'BITstar', 'FMTstar', 'InformedRRTstar', 'PRMstar', 'RRTstar', 'SORRTstar'], help='(Optional) Specify the optimal planner to use, defaults to RRTstar if not given.') # Alphabetical order parser.add_argument('-o', '--objective', default='PathLength', choices=['PathClearance', 'PathLength', 'ThresholdPathLength', 'WeightedLengthAndClearanceCombo'], help='(Optional) Specify the optimization objective, defaults to PathLength if not given.') # Alphabetical order parser.add_argument('-f', '--file', default=None, help='(Optional) Specify an output path for the found solution path.') parser.add_argument('-i', '--info', type=int, default=0, choices=[0, 1, 2], help='(Optional) Set the OMPL log level. 0 for WARN, 1 for INFO, 2 for DEBUG. Defaults to WARN.') diff -Nru ompl-1.1.0+ds1/demos/PlannerData.cpp ompl-1.3.0+ds2/demos/PlannerData.cpp --- ompl-1.1.0+ds1/demos/PlannerData.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/PlannerData.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -66,23 +66,23 @@ return (const void*)rot != (const void*)pos; } -void planWithSimpleSetup(void) +void planWithSimpleSetup() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE3StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^3 part of SE(3) ob::RealVectorBounds bounds(3); bounds.setLow(-10); bounds.setHigh(10); - space->as()->setBounds(bounds); + space->setBounds(bounds); // define a simple setup class og::SimpleSetup ss(space); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, _1)); + ss.setStateValidityChecker([](const ob::State *state) { return isStateValid(state); }); // create a random start state ob::ScopedState<> start(space); @@ -130,14 +130,14 @@ return ob::Cost(obj->costToGo(plannerDataVertices[v1]->getState(), goal)); } -void readPlannerData(void) +void readPlannerData() { std::cout << std::endl; std::cout << "Reading PlannerData from './myPlannerData'" << std::endl; // Recreating the space information from the stored planner data instance - ob::StateSpacePtr space(new ob::SE3StateSpace()); - ob::SpaceInformationPtr si(new ob::SpaceInformation(space)); + auto space(std::make_shared()); + auto si(std::make_shared(space)); ob::PlannerDataStorage dataStorage; ob::PlannerData data(si); @@ -163,7 +163,7 @@ // create a predecessor map to store A* results in boost::vector_property_map prev(data.numVertices()); - // Retieve a property map with the PlannerDataVertex object pointers for quick lookup + // Retrieve a property map with the PlannerDataVertex object pointers for quick lookup boost::property_map::type vertices = get(vertex_type_t(), graph); // Run A* search over our planner data @@ -171,14 +171,12 @@ goal.setState(data.getGoalVertex(0).getState()); ob::PlannerData::Graph::Vertex start = boost::vertex(data.getStartIndex(0), graph); boost::astar_search(graph, start, - boost::bind(&distanceHeuristic, _1, &goal, &opt, vertices), - boost::predecessor_map(prev). - distance_compare(boost::bind(&ob::OptimizationObjective:: - isCostBetterThan, &opt, _1, _2)). - distance_combine(boost::bind(&ob::OptimizationObjective:: - combineCosts, &opt, _1, _2)). - distance_inf(opt.infiniteCost()). - distance_zero(opt.identityCost())); + [&goal, &opt, &vertices](ob::PlannerData::Graph::Vertex v1) { return distanceHeuristic(v1, &goal, &opt, vertices); }, + boost::predecessor_map(prev). + distance_compare([&opt](ob::Cost c1, ob::Cost c2) { return opt.isCostBetterThan(c1, c2); }). + distance_combine([&opt](ob::Cost c1, ob::Cost c2) { return opt.combineCosts(c1, c2); }). + distance_inf(opt.infiniteCost()). + distance_zero(opt.identityCost())); // Extracting the path og::PathGeometric path(si); diff -Nru ompl-1.1.0+ds1/demos/PlannerProgressProperties.cpp ompl-1.3.0+ds2/demos/PlannerProgressProperties.cpp --- ompl-1.1.0+ds1/demos/PlannerProgressProperties.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/PlannerProgressProperties.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -60,8 +60,8 @@ // runs. int main(int argc, char** argv) { - ob::StateSpacePtr space(new ob::RealVectorStateSpace(2)); - space->as()->setBounds(0, 1); + auto space(std::make_shared(2)); + space->setBounds(0, 1); og::SimpleSetup ss(space); // Set our robot's starting state to be the bottom-left corner of @@ -84,7 +84,7 @@ // RRTstar algorithm reports interesting planner progress // properties. ompl::tools::Benchmark b(ss, "my experiment"); - og::RRTstar* rrt = new og::RRTstar(ss.getSpaceInformation()); + auto rrt(std::make_shared(ss.getSpaceInformation())); rrt->setName("rrtstar"); // We disable goal biasing so that the straight-line path doesn't @@ -92,7 +92,7 @@ // downward trend in path cost that characterizes RRTstar. rrt->setGoalBias(0.0); - b.addPlanner(ob::PlannerPtr(rrt)); + b.addPlanner(rrt); // Here we specify options for this benchmark. Maximum time spent // per planner execution is 2.0 seconds, maximum memory is 100MB, diff -Nru ompl-1.1.0+ds1/demos/Point2DPlanning.cpp ompl-1.3.0+ds2/demos/Point2DPlanning.cpp --- ompl-1.1.0+ds1/demos/Point2DPlanning.cpp 2015-07-24 16:56:25.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Point2DPlanning.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -67,18 +67,18 @@ } if (ok) { - ob::RealVectorStateSpace *space = new ob::RealVectorStateSpace(); + auto space(std::make_shared()); space->addDimension(0.0, ppm_.getWidth()); space->addDimension(0.0, ppm_.getHeight()); maxWidth_ = ppm_.getWidth() - 1; maxHeight_ = ppm_.getHeight() - 1; - ss_.reset(new og::SimpleSetup(ob::StateSpacePtr(space))); + ss_ = std::make_shared(space); // set state validity checking for this space - ss_->setStateValidityChecker(boost::bind(&Plane2DEnvironment::isStateValid, this, _1)); + ss_->setStateValidityChecker([this](const ob::State *state) { return isStateValid(state); }); space->setup(); ss_->getSpaceInformation()->setStateValidityCheckingResolution(1.0 / space->getMaximumExtent()); - // ss_->setPlanner(ob::PlannerPtr(new og::RRTConnect(ss_->getSpaceInformation()))); + // ss_->setPlanner(std::make_shared(ss_->getSpaceInformation())); } } diff -Nru ompl-1.1.0+ds1/demos/Point2DPlanning.py ompl-1.3.0+ds2/demos/Point2DPlanning.py --- ompl-1.1.0+ds1/demos/Point2DPlanning.py 2015-04-01 19:42:48.000000000 +0000 +++ ompl-1.3.0+ds2/demos/Point2DPlanning.py 2016-06-19 11:21:58.000000000 +0000 @@ -43,12 +43,12 @@ except: # if the ompl module is not in the PYTHONPATH assume it is installed in a # subdirectory of the parent directory called "py-bindings." - from os.path import abspath, dirname, join - import sys sys.path.insert(0, join(dirname(dirname(abspath(__file__))),'py-bindings')) from ompl import util as ou from ompl import base as ob from ompl import geometric as og +from os.path import abspath, dirname, join +import sys from functools import partial class Plane2DEnvironment: diff -Nru ompl-1.1.0+ds1/demos/RandomWalkPlanner.py ompl-1.3.0+ds2/demos/RandomWalkPlanner.py --- ompl-1.1.0+ds1/demos/RandomWalkPlanner.py 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RandomWalkPlanner.py 2016-06-19 03:38:14.000000000 +0000 @@ -45,11 +45,10 @@ # subdirectory of the parent directory called "py-bindings." from os.path import abspath, dirname, join import sys - sys.path.insert(0, join(dirname(dirname(abspath(__file__))),'py-bindings')) + sys.path.insert(0, join(dirname(dirname(abspath(__file__))), "py-bindings")) from ompl import util as ou from ompl import base as ob from ompl import geometric as og -from random import choice ## @cond IGNORE diff -Nru ompl-1.1.0+ds1/demos/RigidBodyPlanning.cpp ompl-1.3.0+ds2/demos/RigidBodyPlanning.cpp --- ompl-1.1.0+ds1/demos/RigidBodyPlanning.cpp 2015-10-27 20:56:19.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RigidBodyPlanning.cpp 2017-02-26 23:25:35.000000000 +0000 @@ -63,23 +63,23 @@ return (const void*)rot != (const void*)pos; } -void plan(void) +void plan() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE3StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^3 part of SE(3) ob::RealVectorBounds bounds(3); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // construct an instance of space information from this state space - ob::SpaceInformationPtr si(new ob::SpaceInformation(space)); + auto si(std::make_shared(space)); // set state validity checking for this space - si->setStateValidityChecker(boost::bind(&isStateValid, _1)); + si->setStateValidityChecker(isStateValid); // create a random start state ob::ScopedState<> start(space); @@ -90,13 +90,13 @@ goal.random(); // create a problem instance - ob::ProblemDefinitionPtr pdef(new ob::ProblemDefinition(si)); + auto pdef(std::make_shared(si)); // set the start and goal states pdef->setStartAndGoalStates(start, goal); // create a planner for the defined space - ob::PlannerPtr planner(new og::RRTConnect(si)); + auto planner(std::make_shared(si)); // set the problem we are trying to solve for the planner planner->setProblemDefinition(pdef); @@ -112,7 +112,7 @@ pdef->print(std::cout); // attempt to solve the problem within one second of planning time - ob::PlannerStatus solved = planner->solve(1.0); + ob::PlannerStatus solved = planner->ob::Planner::solve(1.0); if (solved) { @@ -128,23 +128,23 @@ std::cout << "No solution found" << std::endl; } -void planWithSimpleSetup(void) +void planWithSimpleSetup() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE3StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^3 part of SE(3) ob::RealVectorBounds bounds(3); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // define a simple setup class og::SimpleSetup ss(space); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, _1)); + ss.setStateValidityChecker([](const ob::State *state) { return isStateValid(state); }); // create a random start state ob::ScopedState<> start(space); diff -Nru ompl-1.1.0+ds1/demos/RigidBodyPlanningWithControls.cpp ompl-1.3.0+ds2/demos/RigidBodyPlanningWithControls.cpp --- ompl-1.1.0+ds1/demos/RigidBodyPlanningWithControls.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RigidBodyPlanningWithControls.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -60,14 +60,14 @@ : GridDecomposition(length, 2, bounds) { } - virtual void project(const ob::State* s, std::vector& coord) const + void project(const ob::State* s, std::vector& coord) const override { coord.resize(2); coord[0] = s->as()->getX(); coord[1] = s->as()->getY(); } - virtual void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const + void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const override { sampler->sampleUniform(s); s->as()->setXY(coord[0], coord[1]); @@ -107,37 +107,38 @@ rot + ctrl[1] * duration); } -void plan(void) +void plan() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create a control space - oc::ControlSpacePtr cspace(new oc::RealVectorControlSpace(space, 2)); + auto cspace(std::make_shared(space, 2)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-0.3); cbounds.setHigh(0.3); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); // construct an instance of space information from this control space - oc::SpaceInformationPtr si(new oc::SpaceInformation(space, cspace)); + auto si(std::make_shared(space, cspace)); // set state validity checking for this space - si->setStateValidityChecker(boost::bind(&isStateValid, si.get(), _1)); + si->setStateValidityChecker( + [&si](const ob::State *state) { return isStateValid(si.get(), state); }); // set the state propagation routine - si->setStatePropagator(boost::bind(&propagate, _1, _2, _3, _4)); + si->setStatePropagator(propagate); // create a start state ob::ScopedState start(space); @@ -150,18 +151,18 @@ goal->setX(0.5); // create a problem instance - ob::ProblemDefinitionPtr pdef(new ob::ProblemDefinition(si)); + auto pdef(std::make_shared(si)); // set the start and goal states pdef->setStartAndGoalStates(start, goal, 0.1); // create a planner for the defined space - //ob::PlannerPtr planner(new oc::RRT(si)); - //ob::PlannerPtr planner(new oc::EST(si)); - //ob::PlannerPtr planner(new oc::KPIECE1(si)); - oc::DecompositionPtr decomp(new MyDecomposition(32, bounds)); - ob::PlannerPtr planner(new oc::SyclopEST(si, decomp)); - //ob::PlannerPtr planner(new oc::SyclopRRT(si, decomp)); + //auto planner(std::make_shared(si)); + //auto planner(std::make_shared(si)); + //auto planner(std::make_shared(si)); + auto decomp(std::make_shared(32, bounds)); + auto planner(std::make_shared(si, decomp)); + //auto planner(std::make_shared(si, decomp)); // set the problem we are trying to solve for the planner planner->setProblemDefinition(pdef); @@ -177,7 +178,7 @@ pdef->print(std::cout); // attempt to solve the problem within one second of planning time - ob::PlannerStatus solved = planner->solve(10.0); + ob::PlannerStatus solved = planner->ob::Planner::solve(10.0); if (solved) { @@ -194,36 +195,37 @@ } -void planWithSimpleSetup(void) +void planWithSimpleSetup() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create a control space - oc::ControlSpacePtr cspace(new oc::RealVectorControlSpace(space, 2)); + auto cspace(std::make_shared(space, 2)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-0.3); cbounds.setHigh(0.3); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); // define a simple setup class oc::SimpleSetup ss(cspace); // set the state propagation routine - ss.setStatePropagator(boost::bind(&propagate, _1, _2, _3, _4)); + ss.setStatePropagator(propagate); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, ss.getSpaceInformation().get(), _1)); + ss.setStateValidityChecker( + [&ss](const ob::State *state) { return isStateValid(ss.getSpaceInformation().get(), state); }); // create a start state ob::ScopedState start(space); @@ -241,7 +243,7 @@ // set the start and goal states ss.setStartAndGoalStates(start, goal, 0.05); - // ss.setPlanner(ob::PlannerPtr(new oc::PDST(ss.getSpaceInformation()))); + // ss.setPlanner(std::make_shared(ss.getSpaceInformation())); // ss.getSpaceInformation()->setMinMaxControlDuration(1,100); // attempt to solve the problem within one second of planning time ob::PlannerStatus solved = ss.solve(10.0); diff -Nru ompl-1.1.0+ds1/demos/RigidBodyPlanningWithIK.cpp ompl-1.3.0+ds2/demos/RigidBodyPlanningWithIK.cpp --- ompl-1.1.0+ds1/demos/RigidBodyPlanningWithIK.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RigidBodyPlanningWithIK.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -56,7 +56,7 @@ setThreshold(1e-2); } - virtual double distanceGoal(const ob::State *state) const + double distanceGoal(const ob::State *state) const override { // goal region is given by states where x + y = z and orientation is close to identity double d = fabs(state->as()->getX() @@ -99,17 +99,17 @@ return cont && gls->maxSampleCount() < 3 && !pd->hasSolution(); } -void planWithIK(void) +void planWithIK() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE3StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^3 part of SE(3) ob::RealVectorBounds bounds(3); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // define a simple setup class og::SimpleSetup ss(space); @@ -123,12 +123,18 @@ // define our goal region MyGoalRegion region(ss.getSpaceInformation()); - // bind a sampling function that fills its argument with a sampled state and returns true while it can produce new samples - // we don't need to check if new samples are different from ones previously computed as this is pefromed automatically by GoalLazySamples - ob::GoalSamplingFn samplingFunction = boost::bind(®ionSamplingWithGS, ss.getSpaceInformation(), ss.getProblemDefinition(), ®ion, _1, _2); + // bind a sampling function that fills its argument with a sampled state + // and returns true while it can produce new samples we don't need to + // check if new samples are different from ones previously computed as + // this is pefromed automatically by GoalLazySamples + ob::GoalSamplingFn samplingFunction = [&ss, ®ion](const ob::GoalLazySamples *gls, ob::State *result) + { + return regionSamplingWithGS(ss.getSpaceInformation(), ss.getProblemDefinition(), ®ion, + gls, result); + }; // create an instance of GoalLazySamples: - ob::GoalPtr goal(new ob::GoalLazySamples(ss.getSpaceInformation(), samplingFunction)); + auto goal(std::make_shared(ss.getSpaceInformation(), samplingFunction)); // we set a goal that is sampleable, but it in fact corresponds to a region that is not sampleable by default ss.setGoal(goal); diff -Nru ompl-1.1.0+ds1/demos/RigidBodyPlanningWithIntegrationAndControls.cpp ompl-1.3.0+ds2/demos/RigidBodyPlanningWithIntegrationAndControls.cpp --- ompl-1.1.0+ds1/demos/RigidBodyPlanningWithIntegrationAndControls.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RigidBodyPlanningWithIntegrationAndControls.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -117,7 +117,7 @@ } } - double getTimeStep(void) const + double getTimeStep() const { return timeStep_; } @@ -168,12 +168,12 @@ { public: - DemoStatePropagator(const oc::SpaceInformationPtr &si) : oc::StatePropagator(si), - integrator_(si->getStateSpace().get(), 0.0) + DemoStatePropagator(oc::SpaceInformation *si) : oc::StatePropagator(si), + integrator_(si->getStateSpace().get(), 0.0) { } - virtual void propagate(const ob::State *state, const oc::Control* control, const double duration, ob::State *result) const + void propagate(const ob::State *state, const oc::Control* control, const double duration, ob::State *result) const override { integrator_.propagate(state, control, duration, result); } @@ -183,7 +183,7 @@ integrator_.setTimeStep(timeStep); } - double getIntegrationTimeStep(void) const + double getIntegrationTimeStep() const { return integrator_.getTimeStep(); } @@ -193,36 +193,39 @@ /// @endcond -void planWithSimpleSetup(void) +void planWithSimpleSetup() { /// construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); /// set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create a control space - oc::ControlSpacePtr cspace(new DemoControlSpace(space)); + auto cspace(std::make_shared(space)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-0.3); cbounds.setHigh(0.3); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); // define a simple setup class oc::SimpleSetup ss(cspace); /// set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, ss.getSpaceInformation().get(), _1)); + oc::SpaceInformation *si = ss.getSpaceInformation().get(); + ss.setStateValidityChecker( + [si](const ob::State *state) { return isStateValid(si, state); }); /// set the propagation routine for this space - ss.setStatePropagator(oc::StatePropagatorPtr(new DemoStatePropagator(ss.getSpaceInformation()))); + auto propagator(std::make_shared(si)); + ss.setStatePropagator(propagator); /// create a start state ob::ScopedState start(space); @@ -241,7 +244,7 @@ /// we want to have a reasonable value for the propagation step size ss.setup(); - static_cast(ss.getStatePropagator().get())->setIntegrationTimeStep(ss.getSpaceInformation()->getPropagationStepSize()); + propagator->setIntegrationTimeStep(si->getPropagationStepSize()); /// attempt to solve the problem within one second of planning time ob::PlannerStatus solved = ss.solve(10.0); diff -Nru ompl-1.1.0+ds1/demos/RigidBodyPlanningWithODESolverAndControls.cpp ompl-1.3.0+ds2/demos/RigidBodyPlanningWithODESolverAndControls.cpp --- ompl-1.1.0+ds1/demos/RigidBodyPlanningWithODESolverAndControls.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/RigidBodyPlanningWithODESolverAndControls.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -58,7 +58,7 @@ timeStep_ = 0.01; } - virtual void propagate(const ob::State *state, const oc::Control* control, const double duration, ob::State *result) const + void propagate(const ob::State *state, const oc::Control* control, const double duration, ob::State *result) const override { EulerIntegration(state, control, duration, result); } @@ -131,7 +131,7 @@ { // Normalize orientation between 0 and 2*pi ob::SO2StateSpace SO2; - SO2.enforceBounds (result->as()->as(1)); + SO2.enforceBounds(result->as()->as(1)); } bool isStateValid(const oc::SpaceInformation *si, const ob::State *state) @@ -164,41 +164,43 @@ }; /// @endcond -void planWithSimpleSetup(void) +void planWithSimpleSetup() { /// construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); /// set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create a control space - oc::ControlSpacePtr cspace(new DemoControlSpace(space)); + auto cspace(std::make_shared(space)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-0.3); cbounds.setHigh(0.3); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); // define a simple setup class oc::SimpleSetup ss(cspace); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, ss.getSpaceInformation().get(), _1)); + oc::SpaceInformation *si = ss.getSpaceInformation().get(); + ss.setStateValidityChecker( + [si](const ob::State *state) { return isStateValid(si, state); }); // Setting the propagation routine for this space: // KinematicCarModel does NOT use ODESolver - //ss.setStatePropagator(oc::StatePropagatorPtr(new KinematicCarModel(ss.getSpaceInformation()))); + //ss.setStatePropagator(std::make_shared(ss.getSpaceInformation())); // Use the ODESolver to propagate the system. Call KinematicCarPostIntegration // when integration has finished to normalize the orientation values. - oc::ODESolverPtr odeSolver(new oc::ODEBasicSolver<> (ss.getSpaceInformation(), &KinematicCarODE)); + auto odeSolver(std::make_shared>(ss.getSpaceInformation(), &KinematicCarODE)); ss.setStatePropagator(oc::ODESolver::getStatePropagator(odeSolver, &KinematicCarPostIntegration)); /// create a start state diff -Nru ompl-1.1.0+ds1/demos/StateSampling.cpp ompl-1.3.0+ds2/demos/StateSampling.cpp --- ompl-1.1.0+ds1/demos/StateSampling.cpp 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/demos/StateSampling.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -41,8 +41,8 @@ #include #include -#include #include +#include namespace ob = ompl::base; namespace og = ompl::geometric; @@ -67,7 +67,7 @@ // Valid states satisfy the following constraints: // -1<= x,y,z <=1 // if .25 <= z <= .5, then |x|>.8 and |y|>.8 - virtual bool sample(ob::State *state) + bool sample(ob::State *state) override { double* val = static_cast(state)->values; double z = rng_.uniformReal(-1,1); @@ -93,7 +93,7 @@ return true; } // We don't need this in the example below. - virtual bool sampleNear(ob::State*, const ob::State*, const double) + bool sampleNear(ob::State*, const ob::State*, const double) override { throw ompl::Exception("MyValidStateSampler::sampleNear", "not implemented"); return false; @@ -112,7 +112,7 @@ // Let's pretend that the validity check is computationally relatively // expensive to emphasize the benefit of explicitly generating valid // samples - boost::this_thread::sleep(ompl::time::seconds(.0005)); + std::this_thread::sleep_for(ompl::time::seconds(.0005)); // Valid states satisfy the following constraints: // -1<= x,y,z <=1 // if .25 <= z <= .5, then |x|>.8 and |y|>.8 @@ -124,32 +124,32 @@ { // we can perform any additional setup / configuration of a sampler here, // but there is nothing to tweak in case of the ObstacleBasedValidStateSampler. - return ob::ValidStateSamplerPtr(new ob::ObstacleBasedValidStateSampler(si)); + return std::make_shared(si); } // return an instance of my sampler ob::ValidStateSamplerPtr allocMyValidStateSampler(const ob::SpaceInformation *si) { - return ob::ValidStateSamplerPtr(new MyValidStateSampler(si)); + return std::make_shared(si); } void plan(int samplerIndex) { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::RealVectorStateSpace(3)); + auto space(std::make_shared(3)); // set the bounds ob::RealVectorBounds bounds(3); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // define a simple setup class og::SimpleSetup ss(space); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, _1)); + ss.setStateValidityChecker(isStateValid); // create a start state ob::ScopedState<> start(space); @@ -172,7 +172,7 @@ ss.getSpaceInformation()->setValidStateSamplerAllocator(allocMyValidStateSampler); // create a planner for the defined space - ob::PlannerPtr planner(new og::PRM(ss.getSpaceInformation())); + auto planner(std::make_shared(ss.getSpaceInformation())); ss.setPlanner(planner); // attempt to solve the problem within ten seconds of planning time diff -Nru ompl-1.1.0+ds1/demos/ThunderLightning.cpp ompl-1.3.0+ds2/demos/ThunderLightning.cpp --- ompl-1.1.0+ds1/demos/ThunderLightning.cpp 2015-09-08 03:29:43.000000000 +0000 +++ ompl-1.3.0+ds2/demos/ThunderLightning.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -67,32 +67,32 @@ } if (ok) { - ob::RealVectorStateSpace *space = new ob::RealVectorStateSpace(); + auto space(std::make_shared()); space->addDimension(0.0, ppm_.getWidth()); space->addDimension(0.0, ppm_.getHeight()); maxWidth_ = ppm_.getWidth() - 1; maxHeight_ = ppm_.getHeight() - 1; if (useThunder) { - expPlanner_.reset(new ot::Thunder(ob::StateSpacePtr(space))); + expPlanner_ = std::make_shared(space); expPlanner_->setFilePath("thunder.db"); } else { - expPlanner_.reset(new ot::Lightning(ob::StateSpacePtr(space))); + expPlanner_ = std::make_shared(space); expPlanner_->setFilePath("lightning.db"); } // set state validity checking for this space - expPlanner_->setStateValidityChecker(boost::bind(&Plane2DEnvironment::isStateValid, this, _1)); + expPlanner_->setStateValidityChecker([this](const ob::State *state) + { return isStateValid(state); }); space->setup(); expPlanner_->getSpaceInformation()->setStateValidityCheckingResolution(1.0 / space->getMaximumExtent()); vss_ = expPlanner_->getSpaceInformation()->allocValidStateSampler(); // DTC - //experience_setup_->setPlanner(ob::PlannerPtr(new og::RRTConnect( si_ ))); + //experience_setup_->setPlanner(std::make_shared(si_)); // Set the repair planner - // boost::shared_ptr repair_planner( new og::RRTConnect( si_ ) ); - // experience_setup_->setRepairPlanner(ob::PlannerPtr( repair_planner )); + // experience_setup_->setRepairPlanner(std::make_shared(si_)); } } diff -Nru ompl-1.1.0+ds1/demos/TriangulationDemo.cpp ompl-1.3.0+ds2/demos/TriangulationDemo.cpp --- ompl-1.1.0+ds1/demos/TriangulationDemo.cpp 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/demos/TriangulationDemo.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -24,14 +24,14 @@ { setup(); } - virtual void project(const ob::State* s, std::vector& coord) const + void project(const ob::State* s, std::vector& coord) const override { coord.resize(2); coord[0] = s->as()->getX(); coord[1] = s->as()->getY(); } - virtual void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const + void sampleFullState(const ob::StateSamplerPtr& sampler, const std::vector& coord, ob::State* s) const override { sampler->sampleUniform(s); s->as()->setXY(coord[0], coord[1]); @@ -108,36 +108,38 @@ } -void planWithSimpleSetup(void) +void planWithSimpleSetup() { // construct the state space we are planning in - ob::StateSpacePtr space(new ob::SE2StateSpace()); + auto space(std::make_shared()); // set the bounds for the R^2 part of SE(2) ob::RealVectorBounds bounds(2); bounds.setLow(-1); bounds.setHigh(1); - space->as()->setBounds(bounds); + space->setBounds(bounds); // create a control space - oc::ControlSpacePtr cspace(new oc::RealVectorControlSpace(space, 2)); + auto cspace(std::make_shared(space, 2)); // set the bounds for the control space ob::RealVectorBounds cbounds(2); cbounds.setLow(-0.3); cbounds.setHigh(0.3); - cspace->as()->setBounds(cbounds); + cspace->setBounds(cbounds); // define a simple setup class oc::SimpleSetup ss(cspace); // set the state propagation routine - ss.setStatePropagator(boost::bind(&propagate, _1, _2, _3, _4)); + ss.setStatePropagator(propagate); // set state validity checking for this space - ss.setStateValidityChecker(boost::bind(&isStateValid, ss.getSpaceInformation().get(), _1)); + oc::SpaceInformation *si = ss.getSpaceInformation().get(); + ss.setStateValidityChecker( + [si](const ob::State *state) { return isStateValid(si, state); }); // create a start state ob::ScopedState start(space); @@ -151,12 +153,12 @@ // set the start and goal states ss.setStartAndGoalStates(start, goal, 0.05); - oc::TriangularDecomposition* td = new MyTriangularDecomposition(bounds); + auto td(std::make_shared(bounds)); // print the triangulation to stdout td->print(std::cout); // hand the triangulation to SyclopEST - ob::PlannerPtr planner(new oc::SyclopEST(ss.getSpaceInformation(), oc::DecompositionPtr(td))); + auto planner(std::make_shared(ss.getSpaceInformation(), td)); // hand the SyclopEST planner to SimpleSetup ss.setPlanner(planner); diff -Nru ompl-1.1.0+ds1/demos/VFRRT/plotConservative.py ompl-1.3.0+ds2/demos/VFRRT/plotConservative.py --- ompl-1.1.0+ds1/demos/VFRRT/plotConservative.py 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/demos/VFRRT/plotConservative.py 2016-06-19 03:38:14.000000000 +0000 @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +###################################################################### +# Software License Agreement (BSD License) +# +# Copyright (c) 2015, Caleb Voss and Wilson Beebe +# All rights reserved. +# +# 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. +# * Neither the name of the Rice University nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# 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 OWNER 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. +###################################################################### + +# Authors: Caleb Voss, Wilson Beebe + + +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +from pylab import * +from matplotlib import cm + +def potential(x, y): + return 1 + np.sin(x) * np.sin(y) + +def potentialSurface(): + X = np.arange(-8, 8, 0.25) + Y = np.arange(-8, 8, 0.25) + X, Y = np.meshgrid(X, Y) + Z = potential(X, Y) + return X, Y, Z + +fig = plt.figure() +ax = fig.gca(projection='3d', aspect='equal') +X, Y, Z = potentialSurface() +ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm, linewidth=0) + +x = np.loadtxt("vfrrt-conservative.path") +ax.plot(x[:,0], x[:,1], potential(x[:,0], x[:,1]), color='b') + +x = np.loadtxt("trrt-conservative.path") +ax.plot(x[:,0], x[:,1], potential(x[:,0], x[:,1]), color='r') + +x = np.loadtxt("rrtstar-conservative.path") +ax.plot(x[:,0], x[:,1], potential(x[:,0], x[:,1]), color='g') + +plt.show() diff -Nru ompl-1.1.0+ds1/demos/VFRRT/plotNonconservative.py ompl-1.3.0+ds2/demos/VFRRT/plotNonconservative.py --- ompl-1.1.0+ds1/demos/VFRRT/plotNonconservative.py 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/demos/VFRRT/plotNonconservative.py 2016-06-19 03:38:14.000000000 +0000 @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +###################################################################### +# Software License Agreement (BSD License) +# +# Copyright (c) 2015, Caleb Voss and Wilson Beebe +# All rights reserved. +# +# 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. +# * Neither the name of the Rice University nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# 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 OWNER 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. +###################################################################### + +# Authors: Caleb Voss, Wilson Beebe + +import matplotlib.pyplot as plt +from pylab import * +from matplotlib import cm + +def makeVectorField(f, xmin, xmax, ymin, ymax, step): + X,Y = meshgrid(arange(xmin,xmax,step),arange(ymin,ymax,step)) + U,V = zip(*map(lambda xx: f(*xx), zip(X,Y))) + Q = quiver( X, Y, U, V, units='width') + quiverkey(Q, 0, 0, 4, '', coordinates='figure', labelpos='W') + +fig = plt.figure() +ax = fig.gca(aspect='equal') +x = np.loadtxt("vfrrt-nonconservative.path") +makeVectorField(lambda x,y: (y/sqrt(x*x+y*y),-x/sqrt(x*x+y*y)), -6, 6, -6, 6, 0.5) +ax.plot(x[:,0], x[:,1]) +plt.show() diff -Nru ompl-1.1.0+ds1/demos/VFRRT/VectorFieldConservative.cpp ompl-1.3.0+ds2/demos/VFRRT/VectorFieldConservative.cpp --- ompl-1.1.0+ds1/demos/VFRRT/VectorFieldConservative.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/demos/VFRRT/VectorFieldConservative.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -0,0 +1,174 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2015, Caleb Voss and Wilson Beebe +* All rights reserved. +* +* 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. +* * Neither the name of the Willow Garage nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* 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 OWNER 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. +*********************************************************************/ + +/* Authors: Caleb Voss, Wilson Beebe */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ob = ompl::base; +namespace og = ompl::geometric; + +enum PlannerType { VFRRT = 0, TRRT, RRTSTAR }; + +/** Gradient of the potential function 1 + sin(x[0]) * sin(x[1]). */ +Eigen::VectorXd field(const ob::State *state) +{ + const ob::RealVectorStateSpace::StateType &x = *state->as(); + Eigen::VectorXd v(2); + v[0] = std::cos(x[0]) * std::sin(x[1]); + v[1] = std::sin(x[0]) * std::cos(x[1]); + return -v; +} + +/** Make a problem using a conservative vector field. */ +og::SimpleSetupPtr setupProblem(PlannerType plannerType) +{ + // construct the state space we are planning in + auto space(std::make_shared(2)); + auto si(std::make_shared(space)); + + ob::RealVectorBounds bounds(2); + bounds.setLow(-10); + bounds.setHigh(10); + + space->setBounds(bounds); + + // define a simple setup class + auto ss(std::make_shared(space)); + + // set state validity checking for this space + ss->setStateValidityChecker(std::make_shared(si)); + + // create a start state + ob::ScopedState<> start(space); + start[0] = -5; + start[1] = -2; + + // create a goal state + ob::ScopedState<> goal(space); + goal[0] = 5; + goal[1] = 3; + + // set the start and goal states + ss->setStartAndGoalStates(start, goal, 0.1); + + // make the optimization objectives for TRRT and RRT*, and set the planner + if (plannerType == TRRT) + { + ss->setOptimizationObjective( + std::make_shared(si, field)); + ss->setPlanner(std::make_shared(ss->getSpaceInformation())); + } + else if (plannerType == RRTSTAR) + { + ss->setOptimizationObjective( + std::make_shared(si, field)); + ss->setPlanner(std::make_shared(ss->getSpaceInformation())); + } + else if (plannerType == VFRRT) + { + double explorationSetting = 0.7; + double lambda = 1; + unsigned int update_freq = 100; + ss->setPlanner(std::make_shared(ss->getSpaceInformation(), field, explorationSetting, lambda, update_freq)); + } + else + { + std::cout << "Bad problem number.\n"; + exit(-1); + } + + ss->setup(); + + return ss; +} + +/** Get the filename to write the path to. */ +std::string problemName(PlannerType plannerType) +{ + if (plannerType == VFRRT) + return std::string("vfrrt-conservative.path"); + else if (plannerType == TRRT) + return std::string("trrt-conservative.path"); + else if (plannerType == RRTSTAR) + return std::string("rrtstar-conservative.path"); + else + { + std::cout << "Bad problem number.\n"; + exit(-1); + } +} + +int main(int argc, char **argv) +{ + // Run all three problems + for (unsigned int n = 0; n < 3; n++) + { + // initialize the planner + og::SimpleSetupPtr ss = setupProblem(PlannerType(n)); + + // attempt to solve the problem + ob::PlannerStatus solved = ss->solve(10.0); + + if (solved) + { + if (solved == ob::PlannerStatus::EXACT_SOLUTION) + std::cout << "Found solution.\n"; + else + std::cout << "Found approximate solution.\n"; + + // Set up to write the path + std::ofstream f(problemName(PlannerType(n)).c_str()); + ompl::geometric::PathGeometric p = ss->getSolutionPath(); + p.interpolate(); + auto upstream(std::make_shared( + ss->getSpaceInformation(), field)); + p.printAsMatrix(f); + std::cout << "Total upstream cost: " << p.cost(upstream) << "\n"; + } + else + std::cout << "No solution found.\n"; + } + + return 0; +} diff -Nru ompl-1.1.0+ds1/demos/VFRRT/VectorFieldNonconservative.cpp ompl-1.3.0+ds2/demos/VFRRT/VectorFieldNonconservative.cpp --- ompl-1.1.0+ds1/demos/VFRRT/VectorFieldNonconservative.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ompl-1.3.0+ds2/demos/VFRRT/VectorFieldNonconservative.cpp 2017-01-12 16:44:35.000000000 +0000 @@ -0,0 +1,124 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2015, Caleb Voss and Wilson Beebe +* All rights reserved. +* +* 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. +* * Neither the name of the Willow Garage nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* 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 OWNER 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. +*********************************************************************/ + +/* Authors: Caleb Voss, Wilson Beebe */ + +#include + +#include +#include +#include +#include +#include +#include + +namespace ob = ompl::base; +namespace og = ompl::geometric; + + +/** Basic unit-norm rotation field. */ +Eigen::VectorXd field(const ob::State *state) +{ + const ob::RealVectorStateSpace::StateType &x = *state->as(); + Eigen::VectorXd v(2); + v[0] = x[1]; + v[1] = -x[0]; + v.normalize(); + return v; +} + +int main(int argc, char **argv) +{ + // construct the state space we are planning in + auto space(std::make_shared(2)); + auto si(std::make_shared(space)); + + ob::RealVectorBounds bounds(2); + bounds.setLow(-10); + bounds.setHigh(10); + + space->as()->setBounds(bounds); + + // define a simple setup class + og::SimpleSetup ss(space); + + // set state validity checking for this space + ss.setStateValidityChecker( + std::make_shared(si)); + + // create a start state + ob::ScopedState<> start(space); + start[0] = -5; + start[1] = -2; + + // create a goal state + ob::ScopedState<> goal(space); + goal[0] = 5; + goal[1] = 2; + + // set the start and goal states + ss.setStartAndGoalStates(start, goal, 0.1); + + // initialize the planner + double explorationSetting = 0.7; + double lambda = 1; + unsigned int update_freq = 100; + ss.setPlanner(std::make_shared( + ss.getSpaceInformation(), field, explorationSetting, lambda, update_freq)); + ss.setup(); + + // attempt to solve the problem + ob::PlannerStatus solved = ss.solve(10.0); + + if (solved) + { + if (solved == ob::PlannerStatus::EXACT_SOLUTION) + std::cout << "Found solution.\n"; + else + std::cout << "Found approximate solution.\n"; + + // Set up to write the path + std::ofstream f("vfrrt-nonconservative.path"); + ompl::geometric::PathGeometric p = ss.getSolutionPath(); + p.interpolate(); + auto upstream(std::make_shared( + ss.getSpaceInformation(), field)); + p.printAsMatrix(f); + std::cout << "Total upstream cost: " << p.cost(upstream) << "\n"; + } + else + std::cout << "No solution found.\n"; + + return 0; +} diff -Nru ompl-1.1.0+ds1/doc/css/ompl.css ompl-1.3.0+ds2/doc/css/ompl.css --- ompl-1.1.0+ds1/doc/css/ompl.css 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/doc/css/ompl.css 2016-06-27 14:36:10.000000000 +0000 @@ -75,6 +75,7 @@ .navbar .nav > li > a { color: #ddd; padding: 10px 10px; } .navbar { min-height: 40px; margin-bottom: 10px; } .navbar-inverse .navbar-brand { height: 40px; padding: 10px 10px; color: #ddd; } +.nav-tabs + .tab-content { margin-top: 20px; } input[type="text"]:focus, select:focus { -webkit-box-shadow: none; @@ -172,3 +173,6 @@ top: -42px; visibility: hidden; } + +.btn-group a:visited { color: #333; } +.modal-body pre { font-size: 12px; } diff -Nru ompl-1.1.0+ds1/doc/Doxyfile ompl-1.3.0+ds2/doc/Doxyfile --- ompl-1.1.0+ds1/doc/Doxyfile 2015-06-14 15:21:45.000000000 +0000 +++ ompl-1.3.0+ds2/doc/Doxyfile 2016-06-19 03:38:14.000000000 +0000 @@ -1996,7 +1996,7 @@ # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = html/ompl.tag # If the ALLEXTERNALS tag is set to YES all external class will be listed in the # class index. If set to NO only the inherited external classes will be listed. diff -Nru ompl-1.1.0+ds1/doc/header.html ompl-1.3.0+ds2/doc/header.html --- ompl-1.1.0+ds1/doc/header.html 2015-10-29 01:18:11.000000000 +0000 +++ ompl-1.3.0+ds2/doc/header.html 2017-03-01 15:59:47.000000000 +0000 @@ -46,8 +46,7 @@
  • Installation
  • Tutorials
  • Demos
  • -
  • OMPL.app GUI
  • OMPL web app
  • -
  • Benchmarking
  • +
  • Python Bindings
  • Available Planners
  • Benchmarking Planners
  • diff -Nru ompl-1.1.0+ds1/doc/header.html.in ompl-1.3.0+ds2/doc/header.html.in --- ompl-1.1.0+ds1/doc/header.html.in 2015-10-26 18:25:08.000000000 +0000 +++ ompl-1.3.0+ds2/doc/header.html.in 2016-06-19 03:38:14.000000000 +0000 @@ -47,7 +47,6 @@
  • Tutorials
  • Demos
  • @OMPLAPP_MENU@ -
  • Benchmarking
  • Python Bindings
  • Available Planners
  • Benchmarking Planners
  • diff -Nru ompl-1.1.0+ds1/doc/js/gen_validatorv31.js ompl-1.3.0+ds2/doc/js/gen_validatorv31.js --- ompl-1.1.0+ds1/doc/js/gen_validatorv31.js 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/doc/js/gen_validatorv31.js 1970-01-01 00:00:00.000000000 +0000 @@ -1,808 +0,0 @@ -/* - ------------------------------------------------------------------------- - JavaScript Form Validator (gen_validatorv31.js) - Version 3.1.2 - Copyright (C) 2003-2008 JavaScript-Coder.com. All rights reserved. - You can freely use this script in your Web pages. - You may adapt this script for your own needs, provided these opening credit - lines are kept intact. - - The Form validation script is distributed free from JavaScript-Coder.com - For updates, please visit: - http://www.javascript-coder.com/html-form/javascript-form-validation.phtml - - Questions & comments please send to form.val at javascript-coder.com - ------------------------------------------------------------------------- -*/ -function Validator(frmname) -{ - this.formobj=document.forms[frmname]; - if(!this.formobj) - { - alert("Error: couldnot get Form object "+frmname); - return; - } - if(this.formobj.onsubmit) - { - this.formobj.old_onsubmit = this.formobj.onsubmit; - this.formobj.onsubmit=null; - } - else - { - this.formobj.old_onsubmit = null; - } - this.formobj._sfm_form_name=frmname; - this.formobj.onsubmit=form_submit_handler; - this.addValidation = add_validation; - this.setAddnlValidationFunction=set_addnl_vfunction; - this.clearAllValidations = clear_all_validations; - this.disable_validations = false;//new - document.error_disp_handler = new sfm_ErrorDisplayHandler(); - this.EnableOnPageErrorDisplay=validator_enable_OPED; - this.EnableOnPageErrorDisplaySingleBox=validator_enable_OPED_SB; - this.show_errors_together=true; - this.EnableMsgsTogether=sfm_enable_show_msgs_together; - document.set_focus_onerror=true; - this.EnableFocusOnError=sfm_validator_enable_focus; - -} - -function sfm_validator_enable_focus(enable) -{ - document.set_focus_onerror = enable; -} - -function set_addnl_vfunction(functionname) -{ - this.formobj.addnlvalidation = functionname; -} - -function sfm_set_focus(objInput) -{ - if(document.set_focus_onerror) - { - objInput.focus(); - } -} - -function sfm_enable_show_msgs_together() -{ - this.show_errors_together=true; - this.formobj.show_errors_together=true; -} -function clear_all_validations() -{ - for(var itr=0;itr < this.formobj.elements.length;itr++) - { - this.formobj.elements[itr].validationset = null; - } -} - -function form_submit_handler() -{ - var bRet = true; - document.error_disp_handler.clear_msgs(); - for(var itr=0;itr < this.elements.length;itr++) - { - if(this.elements[itr].validationset && - !this.elements[itr].validationset.validate()) - { - bRet = false; - } - if(!bRet && !this.show_errors_together) - { - break; - - } - } - - if(this.addnlvalidation) - { - str =" var ret = "+this.addnlvalidation+"()"; - eval(str); - - if(!ret) - { - bRet=false; - } - - } - - if(!bRet) - { - document.error_disp_handler.FinalShowMsg(); - return false; - } - return true; -} - -function add_validation(itemname,descriptor,errstr) -{ - var condition = null; - if(arguments.length > 3) - { - condition = arguments[3]; - } - if(!this.formobj) - { - alert("Error: The form object is not set properly"); - return; - }//if - var itemobj = this.formobj[itemname]; - if(itemobj.length && isNaN(itemobj.selectedIndex) ) - //for radio button; don't do for 'select' item - { - itemobj = itemobj[0]; - } - if(!itemobj) - { - alert("Error: Couldnot get the input object named: "+itemname); - return; - } - if(!itemobj.validationset) - { - itemobj.validationset = new ValidationSet(itemobj,this.show_errors_together); - } - itemobj.validationset.add(descriptor,errstr,condition); - itemobj.validatorobj=this; -} -function validator_enable_OPED() -{ - document.error_disp_handler.EnableOnPageDisplay(false); -} - -function validator_enable_OPED_SB() -{ - document.error_disp_handler.EnableOnPageDisplay(true); -} -function sfm_ErrorDisplayHandler() -{ - this.msgdisplay = new AlertMsgDisplayer(); - this.EnableOnPageDisplay= edh_EnableOnPageDisplay; - this.ShowMsg=edh_ShowMsg; - this.FinalShowMsg=edh_FinalShowMsg; - this.all_msgs=new Array(); - this.clear_msgs=edh_clear_msgs; -} -function edh_clear_msgs() -{ - this.msgdisplay.clearmsg(this.all_msgs); - this.all_msgs = new Array(); -} -function edh_FinalShowMsg() -{ - this.msgdisplay.showmsg(this.all_msgs); -} -function edh_EnableOnPageDisplay(single_box) -{ - if(true == single_box) - { - this.msgdisplay = new SingleBoxErrorDisplay(); - } - else - { - this.msgdisplay = new DivMsgDisplayer(); - } -} -function edh_ShowMsg(msg,input_element) -{ - - var objmsg = new Array(); - objmsg["input_element"] = input_element; - objmsg["msg"] = msg; - this.all_msgs.push(objmsg); -} -function AlertMsgDisplayer() -{ - this.showmsg = alert_showmsg; - this.clearmsg=alert_clearmsg; -} -function alert_clearmsg(msgs) -{ - -} -function alert_showmsg(msgs) -{ - var whole_msg=""; - var first_elmnt=null; - for(var m=0;m < msgs.length;m++) - { - if(null == first_elmnt) - { - first_elmnt = msgs[m]["input_element"]; - } - whole_msg += msgs[m]["msg"] + "\n"; - } - - alert(whole_msg); - - if(null != first_elmnt) - { - sfm_set_focus(first_elmnt); - } -} -function sfm_show_error_msg(msg,input_elmt) -{ - document.error_disp_handler.ShowMsg(msg,input_elmt); -} -function SingleBoxErrorDisplay() -{ - this.showmsg=sb_div_showmsg; - this.clearmsg=sb_div_clearmsg; -} - -function sb_div_clearmsg(msgs) -{ - var divname = form_error_div_name(msgs); - show_div_msg(divname,""); -} - -function sb_div_showmsg(msgs) -{ - var whole_msg="
      \n"; - for(var m=0;m < msgs.length;m++) - { - whole_msg += "
    • " + msgs[m]["msg"] + "
    • \n"; - } - whole_msg += "
    "; - var divname = form_error_div_name(msgs); - show_div_msg(divname,whole_msg); -} -function form_error_div_name(msgs) -{ - var input_element= null; - - for(var m in msgs) - { - input_element = msgs[m]["input_element"]; - if(input_element){break;} - } - - var divname =""; - if(input_element) - { - divname = input_element.form._sfm_form_name + "_errorloc"; - } - - return divname; -} -function DivMsgDisplayer() -{ - this.showmsg=div_showmsg; - this.clearmsg=div_clearmsg; -} -function div_clearmsg(msgs) -{ - for(var m in msgs) - { - var divname = element_div_name(msgs[m]["input_element"]); - show_div_msg(divname,""); - } -} -function element_div_name(input_element) -{ - var divname = input_element.form._sfm_form_name + "_" + - input_element.name + "_errorloc"; - - divname = divname.replace(/[\[\]]/gi,""); - - return divname; -} -function div_showmsg(msgs) -{ - var whole_msg; - var first_elmnt=null; - for(var m in msgs) - { - if(null == first_elmnt) - { - first_elmnt = msgs[m]["input_element"]; - } - var divname = element_div_name(msgs[m]["input_element"]); - show_div_msg(divname,msgs[m]["msg"]); - } - if(null != first_elmnt) - { - sfm_set_focus(first_elmnt); - } -} -function show_div_msg(divname,msgstring) -{ - if(divname.length<=0) return false; - - if(document.layers) - { - divlayer = document.layers[divname]; - if(!divlayer){return;} - divlayer.document.open(); - divlayer.document.write(msgstring); - divlayer.document.close(); - } - else - if(document.all) - { - divlayer = document.all[divname]; - if(!divlayer){return;} - divlayer.innerHTML=msgstring; - } - else - if(document.getElementById) - { - divlayer = document.getElementById(divname); - if(!divlayer){return;} - divlayer.innerHTML =msgstring; - } - divlayer.style.visibility="visible"; -} - -function ValidationDesc(inputitem,desc,error,condition) -{ - this.desc=desc; - this.error=error; - this.itemobj = inputitem; - this.condition = condition; - this.validate=vdesc_validate; -} -function vdesc_validate() -{ - if(this.condition != null ) - { - if(!eval(this.condition)) - { - return true; - } - } - if(!validateInput(this.desc,this.itemobj,this.error)) - { - this.itemobj.validatorobj.disable_validations=true; - - sfm_set_focus(this.itemobj); - - return false; - } - return true; -} -function ValidationSet(inputitem,msgs_together) -{ - this.vSet=new Array(); - this.add= add_validationdesc; - this.validate= vset_validate; - this.itemobj = inputitem; - this.msgs_together = msgs_together; -} -function add_validationdesc(desc,error,condition) -{ - this.vSet[this.vSet.length]= - new ValidationDesc(this.itemobj,desc,error,condition); -} -function vset_validate() -{ - var bRet = true; - for(var itr=0;itr= 0) - { - if(objcheck[idxchk].checked=="1") - { - selected=true; - } - }//if - } - else - { - if(objValue.checked == "1") - { - selected=true; - }//if - }//else - - return selected; -} -function TestDontSelectChk(objValue,chkValue,strError) -{ - var pass = true; - pass = IsCheckSelected(objValue,chkValue)?false:true; - - if(pass==false) - { - if(!strError || strError.length ==0) - { - strError = "Can't Proceed as you selected "+objValue.name; - }//if - sfm_show_error_msg(strError,objValue); - - } - return pass; -} -function TestShouldSelectChk(objValue,chkValue,strError) -{ - var pass = true; - - pass = IsCheckSelected(objValue,chkValue)?true:false; - - if(pass==false) - { - if(!strError || strError.length ==0) - { - strError = "You should select "+objValue.name; - }//if - sfm_show_error_msg(strError,objValue); - - } - return pass; -} -function TestRequiredInput(objValue,strError) -{ - var ret = true; - var val = objValue.value; - val = val.replace(/^\s+|\s+$/g,"");//trim - if(eval(val.length) == 0) - { - if(!strError || strError.length ==0) - { - strError = objValue.name + " : Required Field"; - }//if - sfm_show_error_msg(strError,objValue); - ret=false; - }//if -return ret; -} -function TestMaxLen(objValue,strMaxLen,strError) -{ - var ret = true; - if(eval(objValue.value.length) > eval(strMaxLen)) - { - if(!strError || strError.length ==0) - { - strError = objValue.name + " : "+ strMaxLen +" characters maximum "; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestMinLen(objValue,strMinLen,strError) -{ - var ret = true; - if(eval(objValue.value.length) < eval(strMinLen)) - { - if(!strError || strError.length ==0) - { - strError = objValue.name + " : " + strMinLen + " characters minimum "; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestInputType(objValue,strRegExp,strError,strDefaultError) -{ - var ret = true; - - var charpos = objValue.value.search(strRegExp); - if(objValue.value.length > 0 && charpos >= 0) - { - if(!strError || strError.length ==0) - { - strError = strDefaultError; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if - return ret; -} -function TestEmail(objValue,strError) -{ -var ret = true; - if(objValue.value.length > 0 && !validateEmail(objValue.value) ) - { - if(!strError || strError.length ==0) - { - strError = objValue.name+": Enter a valid Email address "; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestLessThan(objValue,strLessThan,strError) -{ -var ret = true; - if(isNaN(objValue.value)) - { - sfm_show_error_msg(objValue.name +": Should be a number ",objValue); - ret = false; - }//if - else - if(eval(objValue.value) >= eval(strLessThan)) - { - if(!strError || strError.length ==0) - { - strError = objValue.name + " : value should be less than "+ strLessThan; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestGreaterThan(objValue,strGreaterThan,strError) -{ -var ret = true; - if(isNaN(objValue.value)) - { - sfm_show_error_msg(objValue.name+": Should be a number ",objValue); - ret = false; - }//if - else - if(eval(objValue.value) <= eval(strGreaterThan)) - { - if(!strError || strError.length ==0) - { - strError = objValue.name + " : value should be greater than "+ strGreaterThan; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestRegExp(objValue,strRegExp,strError) -{ -var ret = true; - if( objValue.value.length > 0 && - !objValue.value.match(strRegExp) ) - { - if(!strError || strError.length ==0) - { - strError = objValue.name+": Invalid characters found "; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - }//if -return ret; -} -function TestDontSelect(objValue,dont_sel_index,strError) -{ -var ret = true; - if(objValue.selectedIndex == null) - { - sfm_show_error_msg("ERROR: dontselect command for non-select Item"); - ret = false; - } - if(objValue.selectedIndex == eval(dont_sel_index)) - { - if(!strError || strError.length ==0) - { - strError = objValue.name+": Please Select one option "; - }//if - sfm_show_error_msg(strError,objValue); - ret = false; - } -return ret; -} -function TestSelectOneRadio(objValue,strError) -{ - var objradio = objValue.form.elements[objValue.name]; - var one_selected=false; - for(var r=0;r < objradio.length;r++) - { - if(objradio[r].checked) - { - one_selected=true; - break; - } - } - if(false == one_selected) - { - if(!strError || strError.length ==0) - { - strError = "Please select one option from "+objValue.name; - } - sfm_show_error_msg(strError,objValue); - } -return one_selected; -} - -function validateInput(strValidateStr,objValue,strError) -{ - var ret = true; - var epos = strValidateStr.search("="); - var command = ""; - var cmdvalue = ""; - if(epos >= 0) - { - command = strValidateStr.substring(0,epos); - cmdvalue = strValidateStr.substr(epos+1); - } - else - { - command = strValidateStr; - } - switch(command) - { - case "req": - case "required": - { - ret = TestRequiredInput(objValue,strError) - break; - }//case required - case "maxlength": - case "maxlen": - { - ret = TestMaxLen(objValue,cmdvalue,strError) - break; - }//case maxlen - case "minlength": - case "minlen": - { - ret = TestMinLen(objValue,cmdvalue,strError) - break; - }//case minlen - case "alnum": - case "alphanumeric": - { - ret = TestInputType(objValue,"[^A-Za-z0-9]",strError, - objValue.name+": Only alpha-numeric characters allowed "); - break; - } - case "alnum_s": - case "alphanumeric_space": - { - ret = TestInputType(objValue,"[^A-Za-z0-9\\s]",strError, - objValue.name+": Only alpha-numeric characters and space allowed "); - break; - } - case "num": - case "numeric": - { - ret = TestInputType(objValue,"[^0-9]",strError, - objValue.name+": Only digits allowed "); - break; - } - case "dec": - case "decimal": - { - ret = TestInputType(objValue,"[^0-9\.]",strError, - objValue.name+": Only numbers allowed "); - break; - } - case "alphabetic": - case "alpha": - { - ret = TestInputType(objValue,"[^A-Za-z]",strError, - objValue.name+": Only alphabetic characters allowed "); - break; - } - case "alphabetic_space": - case "alpha_s": - { - ret = TestInputType(objValue,"[^A-Za-z\\s]",strError, - objValue.name+": Only alphabetic characters and space allowed "); - break; - } - case "email": - { - ret = TestEmail(objValue,strError); - break; - } - case "lt": - case "lessthan": - { - ret = TestLessThan(objValue,cmdvalue,strError); - break; - } - case "gt": - case "greaterthan": - { - ret = TestGreaterThan(objValue,cmdvalue,strError); - break; - }//case greaterthan - case "regexp": - { - ret = TestRegExp(objValue,cmdvalue,strError); - break; - } - case "dontselect": - { - ret = TestDontSelect(objValue,cmdvalue,strError) - break; - } - case "dontselectchk": - { - ret = TestDontSelectChk(objValue,cmdvalue,strError) - break; - } - case "shouldselchk": - { - ret = TestShouldSelectChk(objValue,cmdvalue,strError) - break; - } - case "selone_radio": - { - ret = TestSelectOneRadio(objValue,strError); - break; - } - }//switch - return ret; -} -function VWZ_IsListItemSelected(listname,value) -{ - for(var i=0;i < listname.options.length;i++) - { - if(listname.options[i].selected == true && - listname.options[i].value == value) - { - return true; - } - } - return false; -} -function VWZ_IsChecked(objcheck,value) -{ - if(objcheck.length) - { - for(var c=0;c < objcheck.length;c++) - { - if(objcheck[c].checked == "1" && - objcheck[c].value == value) - { - return true; - } - } - } - else - { - if(objcheck.checked == "1" ) - { - return true; - } - } - return false; -} -/* - Copyright (C) 2003-2009 JavaScript-Coder.com . All rights reserved. -*/ \ No newline at end of file diff -Nru ompl-1.1.0+ds1/doc/markdown/api_overview.md ompl-1.3.0+ds2/doc/markdown/api_overview.md --- ompl-1.1.0+ds1/doc/markdown/api_overview.md 2015-08-27 14:41:06.000000000 +0000 +++ ompl-1.3.0+ds2/doc/markdown/api_overview.md 2017-03-01 01:38:44.000000000 +0000 @@ -282,7 +282,7 @@ \endhtmlonly -The class ownership diagram above shows the relationship between the essential base classes in OMPL. For example, __SpaceInformation__ owns a __StateSpace__; __Planner__ does _not_ own __SpaceInformation__, although a __Planner__ does know about the __SpaceInformation__, and uses provided functionality. Users are encouraged to use the __SimpleSetup__ class (ompl::geometric::SimpleSetup or ompl::control::SimpleSetup). With this class, it is only necessary to instantiate a ompl::base::StateSpace object, a ompl::control::ControlSpace object (when planning with differential constraints, i.e, planning with controls), and a ompl::base::StateValidityChecker object. Many common state spaces have already been implemented as derived __StateSpace__ classes. See a list [here](spaces.html). +The class ownership diagram above shows the relationship between the essential base classes in OMPL. For example, __SpaceInformation__ owns a __StateSpace__; __Planner__ does _not_ own __SpaceInformation__, although a __Planner__ does know about the __SpaceInformation__, and uses provided functionality. Users are encouraged to use the __SimpleSetup__ class (ompl::geometric::SimpleSetup or ompl::control::SimpleSetup). With this class, it is only necessary to instantiate a ompl::base::StateSpace object, a ompl::control::ControlSpace object (when planning with differential constraints, i.e., planning with controls), and a ompl::base::StateValidityChecker object. Many common state spaces have already been implemented as derived __StateSpace__ classes. See a list [here](spaces.html). The ompl::base::StateValidityChecker is problem-specific, so no default implementation is available. See [this document](stateValidation.html) for more information on state validity checking. For more advanced definitions of goals, see [this document](goalRepresentation.html). @@ -296,11 +296,11 @@ #### Memory management -For all base classes __Class__, a __ClassPtr__ type is defined as well. __ClassPtr__ is in fact a [boost shared pointer](http://wiki.inkscape.org/wiki/index.php/Boost_shared_pointers) for __Class__: +For all base classes __Class__, a __ClassPtr__ type is defined as well. __ClassPtr__ is in fact a [shared pointer](http://en.cppreference.com/w/cpp/memory/shared_ptr) for __Class__: ~~~{.cpp} class Class; -typedef boost::shared_ptr ClassPtr; +typedef std::shared_ptr ClassPtr; ~~~ The code above is generated by the OMPL_CLASS_FORWARD macro defined in ompl/util/ClassForward.h: diff -Nru ompl-1.1.0+ds1/doc/markdown/api_overview.md.in ompl-1.3.0+ds2/doc/markdown/api_overview.md.in --- ompl-1.1.0+ds1/doc/markdown/api_overview.md.in 2015-08-27 00:22:54.000000000 +0000 +++ ompl-1.3.0+ds2/doc/markdown/api_overview.md.in 2016-06-19 03:38:14.000000000 +0000 @@ -4,7 +4,7 @@ @OMPLSVG@ \endhtmlonly -The class ownership diagram above shows the relationship between the essential base classes in OMPL. For example, __SpaceInformation__ owns a __StateSpace__; __Planner__ does _not_ own __SpaceInformation__, although a __Planner__ does know about the __SpaceInformation__, and uses provided functionality. Users are encouraged to use the __SimpleSetup__ class (ompl::geometric::SimpleSetup or ompl::control::SimpleSetup). With this class, it is only necessary to instantiate a ompl::base::StateSpace object, a ompl::control::ControlSpace object (when planning with differential constraints, i.e, planning with controls), and a ompl::base::StateValidityChecker object. Many common state spaces have already been implemented as derived __StateSpace__ classes. See a list [here](spaces.html). +The class ownership diagram above shows the relationship between the essential base classes in OMPL. For example, __SpaceInformation__ owns a __StateSpace__; __Planner__ does _not_ own __SpaceInformation__, although a __Planner__ does know about the __SpaceInformation__, and uses provided functionality. Users are encouraged to use the __SimpleSetup__ class (ompl::geometric::SimpleSetup or ompl::control::SimpleSetup). With this class, it is only necessary to instantiate a ompl::base::StateSpace object, a ompl::control::ControlSpace object (when planning with differential constraints, i.e., planning with controls), and a ompl::base::StateValidityChecker object. Many common state spaces have already been implemented as derived __StateSpace__ classes. See a list [here](spaces.html). The ompl::base::StateValidityChecker is problem-specific, so no default implementation is available. See [this document](stateValidation.html) for more information on state validity checking. For more advanced definitions of goals, see [this document](goalRepresentation.html). @@ -18,11 +18,11 @@ #### Memory management -For all base classes __Class__, a __ClassPtr__ type is defined as well. __ClassPtr__ is in fact a [boost shared pointer](http://wiki.inkscape.org/wiki/index.php/Boost_shared_pointers) for __Class__: +For all base classes __Class__, a __ClassPtr__ type is defined as well. __ClassPtr__ is in fact a [shared pointer](http://en.cppreference.com/w/cpp/memory/shared_ptr) for __Class__: ~~~{.cpp} class Class; -typedef boost::shared_ptr ClassPtr; +typedef std::shared_ptr ClassPtr; ~~~ The code above is generated by the OMPL_CLASS_FORWARD macro defined in ompl/util/ClassForward.h: diff -Nru ompl-1.1.0+ds1/doc/markdown/benchmark.md ompl-1.3.0+ds2/doc/markdown/benchmark.md --- ompl-1.1.0+ds1/doc/markdown/benchmark.md 2015-10-20 02:45:55.000000000 +0000 +++ ompl-1.3.0+ds2/doc/markdown/benchmark.md 2017-02-28 03:41:45.000000000 +0000 @@ -163,7 +163,7 @@ // For planners that we want to configure in specific ways, // the ompl::base::PlannerAllocator should be used: -b.addPlannerAllocator(boost::bind(&myConfiguredPlanner, _1)); +b.addPlannerAllocator(std::bind(&myConfiguredPlanner, std::placeholders::_1)); // etc. // Now we can benchmark: 5 second time limit for each plan computation, @@ -208,8 +208,8 @@ } // After the Benchmark class is defined, the events can be optionally registered: -b.setPreRunEvent(boost::bind(&optionalPreRunEvent, _1)); -b.setPostRunEvent(boost::bind(&optionalPostRunEvent, _1, _2)); +b.setPreRunEvent(std::bind(&optionalPreRunEvent, std::placeholders::_1)); +b.setPostRunEvent(std::bind(&optionalPostRunEvent, std::placeholders::_1, std::placeholders::_2)); ~~~ @@ -269,7 +269,7 @@ Planning algorithms can also register callback functions that the Benchmark class will use to measure progress properties at regular intervals during a run of the planning algorithm. Currently only RRT* uses this functionality. The RRT* constructor registers, among others, a function that returns the cost of the best path found so far: - addPlannerProgressProperty("best cost REAL", boost::bind(&RRTstar::getBestCost, this)); + addPlannerProgressProperty("best cost REAL", std::bind(&RRTstar::getBestCost, this)); With the Benchmark class one can thus measure how the cost is decreasing over time. The ompl_benchmark_statistics.py script will automatically generate plots of progress properties as a function of time. @@ -300,16 +300,19 @@ ~~~ logfile ::= preamble planners_data; -preamble ::= [version] experiment hostname date setup [cpuinfo] +preamble ::= [version] experiment [exp_property_count exp_properties] hostname date setup [cpuinfo] random_seed time_limit memory_limit [num_runs] total_time [num_enums enums] num_planners; version ::= library_name " version " version_number EOL; experiment ::= "Experiment " experiment_name EOL; +exp_property_count ::= int " experiment properties" EOL; +exp_properties ::= exp_property | exp_property exp_properties; +exp_property ::= name property_type "=" num EOL; hostname ::= "Running on " host EOL; date ::= "Starting at " date_string EOL; setup ::= multi_line_string; cpuinfo ::= multi_line_string; -multi_line_string ::= "<<<|" EOL strings "|>>>" EOL +multi_line_string ::= "<<<|" EOL strings "|>>>" EOL; strings ::= string EOL | string EOL strings random_seed ::= int " is the random seed" EOL; time_limit ::= float " seconds per run" EOL; diff -Nru ompl-1.1.0+ds1/doc/markdown/boost.md ompl-1.3.0+ds2/doc/markdown/boost.md --- ompl-1.1.0+ds1/doc/markdown/boost.md 2015-02-26 18:58:06.000000000 +0000 +++ ompl-1.3.0+ds2/doc/markdown/boost.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -# Boost Structures Used in OMPL - -[Boost](http://www.boost.org) provides an extension to the C++ standard template library, supplying the user with many generic, cross-platform concepts that are easily included in the developer's program. For users that are unfamiliar with Boost, this page will briefly describe the constructs from the Boost library used in OMPL. This tutorial makes no attempt to fully educate the user on the usage and API of the Boost library, only to give a high level overview of these components and why they were chosen for OMPL. For further detail on Boost, please consult the extensive [Boost documentation](http://www.boost.org/doc/libs/) directly. - -\attention -OMPL requires Boost __version 1.48__ or greater. - - -# Shared Pointer (boost/shared_ptr.hpp) - -The [shared pointer from Boost](http://www.boost.org/libs/smart_ptr/shared_ptr.htm) provides intelligent memory -management for dynamically allocated objects created with the _new_ command. In short, the templated shared_ptr object will -delete (free) the allocated memory when the pointer goes out of scope. Since these pointers utilize [reference counting](http://en.wikipedia.org/wiki/Reference_counting), it is safe to pass them into functions or copy them; -the object referenced by the pointer will only be destroyed when the reference count goes to zero. - -~~~{.cpp} -class MyClass -{ - /* ... */ - void myClassMethod (void) { /* ... */ } - /* ... */ -}; - -void performComputation () -{ - // Create an instance of MyClass using a shared_ptr - boost::shared_ptr myClassPtr (new MyClass ()); - - // Invoke methods on the object as normal - myClassPtr->myClassMethod (); - -} // myClassPtr goes out of scope here. The instance of MyClass will be deallocated at this point. -~~~ - -In the example above, the function performComputation creates a new instance of MyClass but instantiates it using a shared_ptr. Once the object is created, the pointer can be used like normal (using -> or the * operators). When the function has finished execution, the object does not have to be specifically deleted; the reference count on myClassPtr will decrement to zero when the shared_ptr goes out of scope, triggering the automatic destruction the MyClass object. - -The shared_ptr is used in OMPL in nearly all instances where an object is created from the heap in order to mitigate memory leaks. Most classes in OMPL already have a typedef for a shared_ptr object using the _OMPL_CLASS_FORWARD_ macro. For example, ompl::base::Planner utilizes the macro just before the class declaration: - -~~~{.cpp} -OMPL_CLASS_FORWARD(Planner); -~~~ - -which when expanded creates a forward declaration of the class _Planner_, and defines the type _PlannerPtr_: - -~~~{.cpp} -class Planner; -typedef boost::shared_ptr PlannerPtr; -~~~ - - -# Function and Bind (boost/function.hpp and boost/bind.hpp) - -[Boost's Function library](http://www.boost.org/libs/function) provides a templated wrapper for function pointers and a generalized framework for [callbacks](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29). It is very easy to encapsulate a function pointer into a single object using Boost. Function objects are templated with the first argument being the return type for the function, and subsequent arguments corresponding to the function's arguments. For example, assume we have a function called _computeMin_ that returns the minimum of two integers: - -~~~{.cpp} -int computeMin (int x, int y) -{ - return x < y ? x : y; -} -~~~ - -We could create a function pointer called _minFuncPtr_ to the _computeMin_ function using C++ syntax like this: - -~~~{.cpp} -int (*minFuncPtr)(int, int) = computeMin; -~~~ - -The same object type using Boost looks like this: - -~~~{.cpp} -boost::function minFuncPtr(computeMin); -~~~ - -In addition to improved readability and flexibility, we can also take advantage of the [Bind library](http://www.boost.org/libs/bind) from Boost to create function pointers to class members (not nearly as easy with standard C++ syntax), and fix one or more variables of our function pointer. In a more complex example, assume we have the class Math: - -~~~{.cpp} -class Math -{ - /* ... */ - - // Return the minimum of x and y. If x or y is below a lower bound, - // return the lower bound instead. - int boundedMin (int x, int y, int lowerBound = 0) - { - if (x > lowerBound && y > lowerBound) - return (x < y) ? x : y; - else - return lowerBound; - } - - /* ... */ -}; -~~~ - -If we wanted to create standard C++ function pointer to _Math::boundedMin_, the code gets a little crazy: - -~~~{.cpp} -// Create a function pointer called minFuncPtr -int (Math::*minFuncPtr)(int, int, int); - -// Assign the function pointer to the boundedMin method in the Math class. -minFuncPtr = &Math::boundedMin; -~~~ - -Calling the boundedMin function through the function pointer we just created is equally as obfuscated: - -~~~{.cpp} -// Create the Math object so that we have a method to invoke -Math math; - -// Wait, what? -int theMin = (math.*minFuncPtr)(1, 2, 0); -~~~ - -Note that the function pointer and the corresponding invocation had to include ALL arguments to the boundedMin method, even the default arguments. Since the function pointer is a type, all of the arguments supplied to the function are part of the type and we cannot use the default value of 0 for the lowerBound argument. We can get around all of this by using Boost Functions in conjunction with Boost's Bind library: - -~~~{.cpp} -// Create the Math object so that we have a method to invoke -Math math; - -// Setup the Boost function pointer as a function that returns an int, and takes two integer arguments -boost::function minFuncPtr; - -// Initializing the function pointer to the boundedMin method of the math -// instance, and binding the lowerBound argument to zero. -minFuncPtr = boost::bind (&Math::boundedMin, math, _1, _2, 0); - -// Invoking the function. Much better. -int theMin = minFuncPtr (1, 2); -~~~ - -In a nutshell, boost::bind returns a function pointer to the method given in the first argument, using the instance (“math”) supplied in the second argument. _1 and _2 indicate that the first and second arguments of the boundedMin function will be supplied when the function is called. The zero is permanently bound to the function pointer as the third argument (the default value for “lowerBound”). - -[boost::function](http://www.boost.org/libs/function) and [boost::bind](http://www.boost.org/libs/bind) are used in OMPL whenever a callback function is used to invoke methods on a global function or specific instance. These are used to improve readability of the code, as well as to simplify the use of callback functions across object barriers. Also, if an uninitialized Boost function pointer is accessed, a _bad_function_call_ exception is thrown, which is far more desirable than attempting to debug the segmentation fault that would occur with a standard uninitialized C++ function pointer. - - -# NonCopyable (boost/noncopyable.hpp) - -Boost provides a base class called [noncopyable](http://www.boost.org/libs/utility/utility.htm) that classes can derive from in order to prevent them from being copied. noncopyable has a private copy constructor and assignment operator. Therefore, classes deriving from noncopyable are prohibited from invoking these copy operations. Fully utilizing noncopyable is as simple as: - -~~~{.cpp} -class MyClass : boost::noncopyable -{ - ... -}; -~~~ - -OMPL derives several classes from boost::noncopyable. The rationale behind -this is that these classes should never be copied anyway, either because -the copy mechanism is highly non-trivial, copying such an object would be -prohibitive in terms of memory, or both. - - -# Thread (boost/thread.hpp) - -OMPL is designed to be thread-safe, meaning that most of the common API is reentrant (in general, any function marked as _const_ is thread-safe). However, since OMPL is not limited to a single operating system, the creation and management of threads poses a complication since operating systems are free to choose how a developer creates and manages threads. Thankfully, Boost provides a cross-platform [Threading library](http://www.boost.org/libs/thread) to take care of the operating system specific code behind the scenes. boost::thread provides classes for threads and mutexes that allow for multi-threaded computing and synchronization. - -It is very easy to create Threads in boost. Simply create an object of type boost::thread, and supply it the handle to a "callable" object, or function: - -~~~{.cpp} -void threadFunction (void) { ... } - -// Threads start automatically on creation -boost::thread myThread (threadFunction); -// Wait until the thread has finished execution -myThread.join (); -~~~ - -~~~{.cpp} -void threadFunction (int someNumber, const char *aString) { ... } - -// Create a thread for threadFunction, and pass in some parameters -boost::thread myThread (threadFunction, 42, "A good number"); -~~~ - -~~~{.cpp} -// Create an object for the Thread to operate in. Thread calls operator () to start. -struct ThreadStruct -{ - void operator () (int param1, const char *param2, const std::vector ¶m3) - { - ... - } -}; - -// Create threaded object. -ThreadStruct tStruct; -// Create Thread. Pass in three parameters. -boost::thread myThread (tStruct, 1, "Two", std::vector ()); -~~~ - -By using [Boost thread](http://www.boost.org/libs/thread), OMPL is able to remain operating system independent in multi-threaded applications, as long as the operating system employed by the user is supported by Boost. diff -Nru ompl-1.1.0+ds1/doc/markdown/buildOptions.md ompl-1.3.0+ds2/doc/markdown/buildOptions.md --- ompl-1.1.0+ds1/doc/markdown/buildOptions.md 2014-09-28 17:42:24.000000000 +0000 +++ ompl-1.3.0+ds2/doc/markdown/buildOptions.md 2016-06-19 03:38:14.000000000 +0000 @@ -1,6 +1,6 @@ # Build Options -If you are building OMPL from source, there are several options that you can use to configure how OMPL is compiled. The options can be set via the command line like so: `cmake -D