New upstream version 1.3.3+ds1

parent 8d86e3d8
......@@ -37,4 +37,4 @@ after_build:
# - cmd: ctest -C %configuration%
artifacts:
- path: 'build\omplapp*.zip'
- path: 'build\ompl*.zip'
......@@ -20,17 +20,16 @@ matrix:
apt: true
directories:
- ${HOME}/castxml
- /usr/local
# On OS X, exclude test_machine_specs; fails due to "lazy" memory freeing in Release mode
# (test passes in Debug builds).
# On OS X, exclude test_random; fails due to bug in Boost.Random in 1.56.
- os: osx
osx_image: xcode7.2
osx_image: xcode9.1
compiler: clang
env: JOBS=2 TEST_EXCLUDE='test_(machine_specs|random)'
cache:
apt: true
directories:
- ${HOME}/castxml
- /usr/local
- os: linux
sudo: required
......@@ -42,30 +41,25 @@ matrix:
services:
- docker
env: DOCKERFILE="ubuntu-xenial" JOBS=4 TEST_EXCLUDE='test_(machine_specs|random)'
allow_failures:
- os: osx
install:
- if [ -n "$DOCKERFILE" ]; then
docker build -t "$DOCKERFILE" -f "scripts/docker/$DOCKERFILE" .;
fi
- if [ -z "$DOCKERFILE" -a "$TRAVIS_OS_NAME" = "osx" ]; then
brew install boost-python ode eigen python cmake;
if [ ! -e ${HOME}/castxml ]; then
curl https://midas3.kitware.com/midas/download/item/318762/castxml-macosx.tar.gz | tar zxf - -C ${HOME};
fi;
brew update;
brew install boost-python ode eigen castxml;
fi
- if [ -z "$DOCKERFILE" -a "$TRAVIS_OS_NAME" = "linux" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
sudo apt-get -y update;
sudo apt-get -y install g++-5;
export CXX=g++-5;
if [ ! -e ${HOME}/castxml ]; then
wget -O - https://midas3.kitware.com/midas/download/item/318227/castxml-linux.tar.gz | tar zxf - -C ${HOME};
fi;
wget -O - https://midas3.kitware.com/midas/download/item/318227/castxml-linux.tar.gz | tar zxf - -C ${HOME};
fi
- if [ -z "$DOCKERFILE" ]; then
sudo -H pip -v install pygccxml pyplusplus;
fi
- sudo -H pip -v install pygccxml https://bitbucket.org/ompl/pyplusplus/get/1.7.0.tar.gz
script:
......@@ -74,11 +68,10 @@ script:
else
mkdir -p build &&
cd build &&
cmake -DOMPL_REGISTRATION=OFF -DCMAKE_INSTALL_PREFIX=tmp .. &&
cmake -DOMPL_REGISTRATION=OFF -DCMAKE_INSTALL_PREFIX=tmp -DCASTXML=${HOME}/castxml/bin/castxml .. &&
make -j $JOBS &&
ctest -E "$TEST_EXCLUDE";
fi
# TIMES OUT BECAUSE IT DOES NOT PRODUCE OUTPUT FOR MORE THAN 10 MINUTES
# generate python bindings
# make -j $JOBS update_bindings
# disabled because this takes several hours to complete:
#make -j $JOBS update_bindings &&
{
"variant": null,
"activeEnvironments": [],
"codeModel": null
}
\ No newline at end of file
{
"configurations": [
{
"name": "Mac",
"browse": {
"path": [
"${workspaceFolder}",
"/opt/local/include"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}",
"/opt/local/include"
],
"defines": [],
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
\ No newline at end of file
{
"files.associations": {
"iterator": "cpp",
"chrono": "cpp",
"__bit_reference": "cpp",
"__hash_table": "cpp",
"__split_buffer": "cpp",
"__tree": "cpp",
"array": "cpp",
"bitset": "cpp",
"deque": "cpp",
"initializer_list": "cpp",
"list": "cpp",
"map": "cpp",
"memory": "cpp",
"queue": "cpp",
"set": "cpp",
"stack": "cpp",
"string": "cpp",
"string_view": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"ios": "cpp",
"valarray": "cpp",
"functional": "cpp",
"random": "cpp",
"utility": "cpp",
"__config": "cpp",
"__nullptr": "cpp",
"cstddef": "cpp",
"exception": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"algorithm": "cpp",
"cctype": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"*.tcc": "cpp",
"cmath": "cpp",
"complex": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"__locale": "cpp",
"__functional_03": "cpp"
}
}
\ No newline at end of file
......@@ -24,12 +24,6 @@ if(MSVC OR MSVC90 OR MSVC10)
set(MSVC ON)
endif (MSVC OR MSVC90 OR MSVC10)
# 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"
......@@ -45,19 +39,11 @@ set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib")
set(OMPL_CMAKE_UTIL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules"
CACHE FILEPATH "Path to directory with auxiliary CMake scripts for OMPL")
set(OMPL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(OMPL_DEMO_INSTALL_DIR "share/ompl${OMPL_INSTALL_SUFFIX}/demos"
set(OMPL_DEMO_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/ompl/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}")
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
......@@ -70,7 +56,15 @@ else(IS_ICPC)
endif(IS_ICPC)
find_package(Boost 1.54 COMPONENTS serialization filesystem system program_options REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIR})
# 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()
# on OS X we need to check whether to use libc++ or libstdc++ with clang++
if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
......@@ -96,7 +90,23 @@ find_package(Threads QUIET)
enable_testing()
find_package(Python QUIET)
find_package(Boost COMPONENTS python QUIET)
find_boost_python()
if(PYTHON_FOUND)
# PyPy is more than an order of magnitude faster in generating the Python
# bindings than CPython, so use it if available.
find_program(PYPY NAMES pypy${PYTHON_VERSION_MAJOR} pypy)
if(PYPY)
option(OMPL_USE_PYPY "Use PyPy for generating Python bindings" ON)
else()
option(OMPL_USE_PYPY "Use PyPy for generating Python bindings" OFF)
endif()
if(OMPL_USE_PYPY)
set(PYTHON_BINDING_EXEC "${PYPY}")
else()
set(PYTHON_BINDING_EXEC "${PYTHON_EXEC}")
endif()
endif()
# Eigen is needed for the InformedStateSampler
find_package(Eigen3 QUIET)
......@@ -114,20 +124,20 @@ find_package(OpenDE QUIET)
set(OMPL_EXTENSION_OPENDE ${OPENDE_FOUND})
if (OPENDE_FOUND)
add_definitions(${OPENDE_DEFINITIONS})
include_directories(SYSTEM ${OPENDE_INCLUDE_DIR})
include_directories(${OPENDE_INCLUDE_DIR})
endif()
find_package(Triangle QUIET)
set(OMPL_EXTENSION_TRIANGLE ${TRIANGLE_FOUND})
if (TRIANGLE_FOUND)
include_directories(SYSTEM ${TRIANGLE_INCLUDE_DIR})
include_directories(${TRIANGLE_INCLUDE_DIR})
endif()
# If FLANN is installed, a wrapper for its nearest neighbor data structures can be used
find_package(flann 1.8.3 QUIET)
if (FLANN_FOUND)
set(OMPL_HAVE_FLANN 1)
include_directories(SYSTEM "${FLANN_INCLUDE_DIRS}")
include_directories("${FLANN_INCLUDE_DIRS}")
link_directories(${FLANN_LIBRARY_DIRS})
endif()
......@@ -151,15 +161,29 @@ 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)
RENAME "ompl.pc")
if (NOT ${CMAKE_VERSION} VERSION_LESS 2.8.8)
include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
configure_package_config_file(omplConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/OMPLConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake
PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/OMPLConfigVersion.cmake
VERSION ${OMPL_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OMPLConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/OMPLConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake
COMPONENT ompl)
endif()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ompl.conf"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl${OMPL_INSTALL_SUFFIX}"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl"
COMPONENT ompl)
# script to install ompl on Ubuntu
......@@ -174,21 +198,6 @@ configure_file(
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
if (OMPL_VERSIONED_INSTALL)
# script to create sym links
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/create_symlinks.sh.in"
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/create_symlinks.sh" @ONLY)
execute_process(COMMAND
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/create_symlinks.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.symlinks/" DESTINATION .)
# script to uninstall sym links
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/uninstall_symlinks.sh.in"
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/uninstall_symlinks.sh" @ONLY)
add_custom_target(uninstall_links COMMAND
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/uninstall_symlinks.sh")
add_dependencies(uninstall uninstall_links)
endif()
include(CPackSettings)
option(OMPL_REGISTRATION "Enable one-time registration of OMPL" ON)
......
# force C++11 mode (MS Visual Studio doesn't know about this flag)
if(NOT MSVC)
if (CMAKE_VERSION VERSION_LESS "3.1")
# force C++11 mode (MS Visual Studio doesn't know about this flag)
if(NOT MSVC)
add_definitions(-std=c++11)
endif()
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# this next line shouldn't be necessary, but doesn't always get added by cmake (e.g., for clang++-5)
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
-Winit-self -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function)
-Wno-unused-parameter -Wno-unused-function
-fext-numeric-literals)
# prepend optimizion flag (in case the default setting doesn't include one)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
endif(CMAKE_COMPILER_IS_GNUCXX)
......@@ -52,11 +62,14 @@ if((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
add_definitions(-fPIC)
endif((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
# Set rpath http://www.paraview.org/Wiki/CMake_RPATH_handling
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(OMPL_SKIP_RPATH "Don't set RPATH to the OMPL library" OFF)
if(NOT OMPL_SKIP_RPATH)
# Set rpath http://www.paraview.org/Wiki/CMake_RPATH_handling
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
# no prefix needed for python modules
set(CMAKE_SHARED_MODULE_PREFIX "")
......@@ -165,6 +165,26 @@ function(find_python_module module)
find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper})
endfunction(find_python_module)
# macro to attempt to find the *correct* Boost.Python library (i.e., the
# one that matches the version number of the python interpreter that was
# found).
macro(find_boost_python)
if (PYTHON_FOUND)
foreach(_bp_libname
"python-py${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}"
"python${PYTHON_VERSION_MAJOR}" "python")
string(TOUPPER ${_bp_libname} _bp_upper)
set(_Boost_${_bp_upper}_HEADERS "boost/python.hpp")
find_package(Boost COMPONENTS ${_bp_libname} QUIET)
set(_bplib "${Boost_${_bp_upper}_LIBRARY}")
if (_bplib)
set(Boost_PYTHON_LIBRARY "${_bplib}")
break()
endif()
endforeach()
endif()
endmacro(find_boost_python)
set(PYTHON_ARCH "unknown")
if(APPLE)
set(PYTHON_ARCH "darwin")
......
......@@ -76,9 +76,7 @@ function(target_link_flags)
set(${ARGV0}_PKG_DEPS "${_pkg_dep_str}" PARENT_SCOPE)
endfunction()
option(OMPL_VERSIONED_INSTALL "Append version suffix to binaries, libraries, and include dir." OFF)
option(OMPL_VERSIONED_INSTALL "Install header files in include/ompl-X.Y/ompl, where X and Y are the major and minor version numbers" OFF)
if (OMPL_VERSIONED_INSTALL)
set(OMPL_INSTALL_SUFFIX "-${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}")
else()
set(OMPL_INSTALL_SUFFIX "")
set(CMAKE_INSTALL_INCLUDEDIR "include/ompl-${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}")
endif()
# set the version in a way CMake can use
set(OMPL_MAJOR_VERSION 1)
set(OMPL_MINOR_VERSION 3)
set(OMPL_PATCH_VERSION 0)
set(OMPL_PATCH_VERSION 3)
set(OMPL_VERSION "${OMPL_MAJOR_VERSION}.${OMPL_MINOR_VERSION}.${OMPL_PATCH_VERSION}")
# increment this when we have ABI changes
set(OMPL_ABI_VERSION 13)
set(OMPL_ABI_VERSION 14)
find_package(Boost COMPONENTS python)
# The python version needs to match the one used to build Boost.Python.
# You can optionally specify the desired version like so:
# find_package(Python 2.6)
find_package(Python QUIET)
find_boost_python()
find_python_module(pyplusplus 1.6.0)
find_python_module(pygccxml 1.7.2)
find_package(castxml)
......@@ -33,6 +34,10 @@ if(PYTHON_FOUND AND Boost_PYTHON_LIBRARY AND PY_PYPLUSPLUS
set(PY_OMPL_GENERATE ON CACHE BOOL
"Whether the C++ code for the OMPL Python module can be generated")
mark_as_advanced(PY_OMPL_GENERATE)
get_filename_component(PY_PYPLUSPLUS_DIR "${PY_PYPLUSPLUS}" DIRECTORY)
get_filename_component(PY_PYGCCXML_DIR "${PY_PYGCCXML}" DIRECTORY)
set(PYTHONPATH "${PY_PYPLUSPLUS_DIR}:${PY_PYGCCXML_DIR}:$ENV{PYTHONPATH}" CACHE STRING "Python path for pyplusplus and pygccxml")
endif()
function(create_module_header_file_target module)
......@@ -58,7 +63,7 @@ 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 ${PYTHON_EXEC}
COMMAND env PYTHONPATH=\"${PYTHONPATH}\" ${PYTHON_BINDING_EXEC}
"${CMAKE_CURRENT_SOURCE_DIR}/generate_bindings.py" "${module}"
"2>&1" | tee "${CMAKE_BINARY_DIR}/pyplusplus_${module}.log"
COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR}
......
#!/bin/sh
if [ ! -d .symlinks ]; then
prefix=`pwd`
mkdir -p .symlinks/@CMAKE_INSTALL_DATAROOTDIR@
cd .symlinks/@CMAKE_INSTALL_DATAROOTDIR@
ln -s ompl@OMPL_INSTALL_SUFFIX@ ompl
cd ${prefix}
mkdir -p .symlinks/@CMAKE_INSTALL_LIBDIR@/pkgconfig
cd .symlinks/@CMAKE_INSTALL_LIBDIR@/pkgconfig
ln -s ompl@OMPL_INSTALL_SUFFIX@.pc ompl.pc
cd ${prefix}
mkdir -p .symlinks/@CMAKE_INSTALL_INCLUDEDIR@
cd .symlinks/include
ln -s ompl@OMPL_INSTALL_SUFFIX@ ompl
if [ $1 ]; then
ln -s omplapp@OMPL_INSTALL_SUFFIX@ omplapp
fi
fi
#!/bin/sh
cd @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@
rm -f ompl
cd @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig
rm -f ompl.pc
cd @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
rm -f ompl omplext_odeint omplapp
{
"variant": null,
"activeEnvironments": [],
"codeModel": null
}
\ No newline at end of file
......@@ -50,7 +50,7 @@ namespace po = boost::program_options;
bool isStateValid(double radiusSquared, const ob::State *state)
{
const ob::SE2StateSpace::StateType *s = state->as<ob::SE2StateSpace::StateType>();
const auto *s = state->as<ob::SE2StateSpace::StateType>();
double x=s->getX(), y=s->getY();
x = std::abs(x - std::floor(x));
y = std::abs(y - std::floor(y));
......@@ -85,17 +85,17 @@ int main(int argc, char **argv)
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("help"))
if (vm.count("help") != 0u)
{
std::cout << desc << "\n";
return 1;
}
if (vm.count("dubins"))
if (vm.count("dubins") != 0u)
space = std::make_shared<ob::DubinsStateSpace>(turningRadius);
if (vm.count("dubinssym"))
if (vm.count("dubinssym") != 0u)
space = std::make_shared<ob::DubinsStateSpace>(turningRadius, true);
if (vm.count("reedsshepp"))
if (vm.count("reedsshepp") != 0u)
space = std::make_shared<ob::ReedsSheppStateSpace>(turningRadius);
// set the bounds for the R^2 part of SE(2)
......
......@@ -51,7 +51,7 @@ namespace po = boost::program_options;
bool isStateValidEasy(const ob::SpaceInformation *si, const ob::State *state)
{
const ob::SE2StateSpace::StateType *s = state->as<ob::SE2StateSpace::StateType>();
const auto *s = state->as<ob::SE2StateSpace::StateType>();
double x=s->getX(), y=s->getY();
return si->satisfiesBounds(s) && (x<5 || x>13 || (y>8.5 && y<9.5));
}
......@@ -193,7 +193,7 @@ int main(int argc, char* argv[])
po::command_line_style::unix_style ^ po::command_line_style::allow_short), vm);
po::notify(vm);
if (vm.count("help") || argc==1)
if ((vm.count("help") != 0u) || argc==1)
{
std::cout << desc << "\n";
return 1;
......@@ -201,17 +201,17 @@ int main(int argc, char* argv[])
ob::StateSpacePtr space(std::make_shared<ob::ReedsSheppStateSpace>());
if (vm.count("dubins"))
if (vm.count("dubins") != 0u)
space = std::make_shared<ob::DubinsStateSpace>();
if (vm.count("dubinssym"))
if (vm.count("dubinssym") != 0u)
space = std::make_shared<ob::DubinsStateSpace>(1., true);
if (vm.count("easyplan"))
if (vm.count("easyplan") != 0u)
plan(space, true);
if (vm.count("hardplan"))
if (vm.count("hardplan") != 0u)
plan(space, false);
if (vm.count("trajectory"))
if (vm.count("trajectory") != 0u)
printTrajectory(space, vm["trajectory"].as<std::vector<double> >());
if (vm.count("distance"))
if (vm.count("distance") != 0u)
printDistanceGrid(space);
}
catch(std::exception& e) {
......
......@@ -85,13 +85,13 @@ void propagate(const oc::SpaceInformation *si, const ob::State *state,
// To make the turn, the car will have to downshift.
bool isStateValid(const oc::SpaceInformation *si, const ob::State *state)
{
const ob::SE2StateSpace::StateType *se2 =
const auto *se2 =
state->as<ob::CompoundState>()->as<ob::SE2StateSpace::StateType>(0);
return si->satisfiesBounds(state) && (se2->getX() < -80. || se2->getY() > 80.);
}
int main(int, char**)
int main(int /*argc*/, char** /*argv*/)
{
// plan for hybrid car in SE(2) with discrete gears
auto SE2(std::make_shared<ob::SE2StateSpace>());
......@@ -168,11 +168,11 @@ int main(int, char**)
for(unsigned int i=0; i<path.getStateCount(); ++i)
{
const ob::State* state = path.getState(i);
const ob::SE2StateSpace::StateType *se2 =