├── rrtstar-standalone ├── pod-build │ ├── CMakeFiles │ │ ├── progress.marks │ │ ├── tmp.dir │ │ │ ├── progress.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── DependInfo.cmake │ │ │ └── build.make │ │ ├── CMakeRuleHashes.txt │ │ ├── cmake.check_cache │ │ ├── 2.8.12.2 │ │ │ ├── CompilerIdC │ │ │ │ ├── a.out │ │ │ │ └── CMakeCCompilerId.c │ │ │ ├── CompilerIdCXX │ │ │ │ ├── a.out │ │ │ │ └── CMakeCXXCompilerId.cpp │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CMakeCCompiler.cmake │ │ │ └── CMakeCXXCompiler.cmake │ │ ├── TargetDirectories.txt │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── Makefile.cmake │ │ └── Makefile2 │ ├── src │ │ ├── CMakeFiles │ │ │ ├── progress.marks │ │ │ ├── rrtstar.dir │ │ │ │ ├── progress.make │ │ │ │ ├── kdtree.c.o │ │ │ │ ├── rrts_main.cpp.o │ │ │ │ ├── system_single_integrator.cpp.o │ │ │ │ ├── link.txt │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── flags.make │ │ │ │ ├── C.includecache │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── CXX.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ └── build.make │ │ │ └── CMakeDirectoryInformation.cmake │ │ ├── cmake_install.cmake │ │ └── Makefile │ ├── build_prefix │ ├── install_manifest.txt │ ├── bin │ │ └── rrtstar │ ├── lib │ │ └── pkgconfig │ │ │ └── rrtstar-standalone.pc │ ├── cmake_install.cmake │ ├── Makefile │ └── CMakeCache.txt ├── CMakeLists.txt ├── src │ ├── CMakeLists.txt │ ├── rrts_main.cpp │ ├── kdtree.h │ ├── system.h │ ├── rrts.h │ ├── system_single_integrator.cpp │ └── system_single_integrator.h └── Makefile ├── lcmtypes ├── lcmtypes │ ├── lcmtypes_vertex_t.lcm │ ├── lcmtypes_region_3d_t.lcm │ ├── lcmtypes_state_t.lcm │ ├── lcmtypes_trajectory_t.lcm │ ├── lcmtypes_edge_t.lcm │ ├── lcmtypes_environment_t.lcm │ └── lcmtypes_graph_t.lcm ├── pod.xml ├── CMakeLists.txt └── Makefile ├── tobuild.txt ├── rrtstar ├── CMakeLists.txt ├── src │ ├── CMakeLists.txt~ │ ├── CMakeLists.txt │ ├── kdtree.h │ ├── system.h │ ├── rrts.h │ ├── system_single_integrator.cpp │ ├── system_single_integrator.h │ └── rrts_main.cpp └── Makefile ├── README.md ├── viewer ├── README ├── src │ ├── renderers │ │ ├── graph_renderer.h │ │ ├── CMakeLists.txt │ │ └── graph_renderer.cpp │ ├── CMakeLists.txt │ └── main_viewer.cpp ├── CMakeLists.txt └── Makefile ├── README ├── Makefile └── License.txt /rrtstar-standalone/pod-build/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/tmp.dir/progress.make: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/build_prefix: -------------------------------------------------------------------------------- 1 | /home/ahmed/r/rrtstar-standalone/../build 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/install_manifest.txt: -------------------------------------------------------------------------------- 1 | /home/ahmed/r/build/lib/pkgconfig/rrtstar-standalone.pc 2 | -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_vertex_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct vertex_t { 4 | 5 | state_t state; 6 | } -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/bin/rrtstar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/bin/rrtstar -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_region_3d_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct region_3d_t { 4 | double center[3]; 5 | double size[3]; 6 | } -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_state_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct state_t { 4 | 5 | double x; 6 | double y; 7 | double z; 8 | } -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/CMakeRuleHashes.txt: -------------------------------------------------------------------------------- 1 | # Hashes of file build rules. 2 | f66288746915435dd112757af930852c CMakeFiles/tmp 3 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | 5 | -------------------------------------------------------------------------------- /tobuild.txt: -------------------------------------------------------------------------------- 1 | # list of collections to build, one one each line. Empty lines 2 | # and lines starting with '#' are ignored 3 | lcmtypes 4 | viewer 5 | rrtstar 6 | -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_trajectory_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct trajectory_t { 4 | 5 | int32_t num_states; 6 | state_t states[num_states]; 7 | } -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_edge_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct edge_t { 4 | 5 | vertex_t vertex_src; 6 | vertex_t vertex_dst; 7 | trajectory_t trajectory; 8 | } -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdC/a.out -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/kdtree.c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/kdtree.c.o -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir 2 | /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles/tmp.dir 3 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahq1993/p-rrtstar/HEAD/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_environment_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct environment_t { 4 | region_3d_t operating; 5 | region_3d_t goal; 6 | 7 | int32_t num_obstacles; 8 | region_3d_t obstacles[num_obstacles]; 9 | } -------------------------------------------------------------------------------- /lcmtypes/lcmtypes/lcmtypes_graph_t.lcm: -------------------------------------------------------------------------------- 1 | package lcmtypes; 2 | 3 | struct graph_t { 4 | 5 | int32_t num_vertices; 6 | vertex_t vertices[num_vertices]; 7 | 8 | int32_t num_edges; 9 | edge_t edges[num_edges]; 10 | } -------------------------------------------------------------------------------- /lcmtypes/pod.xml: -------------------------------------------------------------------------------- 1 | 2 | racecar_lcmtypes 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/tmp.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | FILE(REMOVE_RECURSE 2 | "CMakeFiles/tmp" 3 | ) 4 | 5 | # Per-language clean rules from dependency scanning. 6 | FOREACH(lang) 7 | INCLUDE(CMakeFiles/tmp.dir/cmake_clean_${lang}.cmake OPTIONAL) 8 | ENDFOREACH(lang) 9 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -O3 -DNDEBUG CMakeFiles/rrtstar.dir/rrts_main.cpp.o CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o CMakeFiles/rrtstar.dir/kdtree.c.o -o ../bin/rrtstar -L/home/ahmed/r/build/lib -L/home/ahmed/r/rrtstar-standalone/pod-build/lib -rdynamic 2 | -------------------------------------------------------------------------------- /rrtstar-standalone/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.0) 2 | 3 | # pull in the pods macros. See cmake/pods.cmake for documentation 4 | set(POD_NAME rrtstar-standalone) 5 | include(cmake/pods.cmake) 6 | 7 | find_package(PkgConfig REQUIRED) 8 | 9 | #tell cmake to build these subdirectories 10 | add_subdirectory(src) 11 | 12 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/lib/pkgconfig/rrtstar-standalone.pc: -------------------------------------------------------------------------------- 1 | prefix=/home/ahmed/r/build 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: rrtstar-standalone 7 | Description: rrtstar-standalone 8 | Requires: 9 | Version: 0.0.1 10 | Libs: -L${exec_prefix}/lib -lrrtstar-standalone 11 | Cflags: 12 | -------------------------------------------------------------------------------- /rrtstar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.0) 2 | 3 | # pull in the pods macros. See cmake/pods.cmake for documentation 4 | set(POD_NAME rrtstar) 5 | include(cmake/pods.cmake) 6 | 7 | find_package(PkgConfig REQUIRED) 8 | 9 | pkg_check_modules(LCM REQUIRED lcm) 10 | 11 | #tell cmake to build these subdirectories 12 | add_subdirectory(src) 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Artificial potential fields based directionalized sampling heuristic 2 | 3 | The code by Sertac Karaman (https://svn.csail.mit.edu/rrtstar) has been modified and adapted for the implementation of P-RRT* [1]. 4 | 5 | [1] Ahmed Hussain Qureshi and Yasar Ayaz. "Potential functions based sampling heuristic for optimal path planning." Autonomous Robots 40.6 (2016): 1079-1093. 6 | https://arxiv.org/abs/1704.00264 7 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | FILE(REMOVE_RECURSE 2 | "CMakeFiles/rrtstar.dir/rrts_main.cpp.o" 3 | "CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o" 4 | "CMakeFiles/rrtstar.dir/kdtree.c.o" 5 | "../bin/rrtstar.pdb" 6 | "../bin/rrtstar" 7 | ) 8 | 9 | # Per-language clean rules from dependency scanning. 10 | FOREACH(lang C CXX) 11 | INCLUDE(CMakeFiles/rrtstar.dir/cmake_clean_${lang}.cmake OPTIONAL) 12 | ENDFOREACH(lang) 13 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | pods_install_pkg_config_file(rrtstar-standalone 4 | CFLAGS 5 | LIBS -lrrtstar-standalone 6 | VERSION 0.0.1) 7 | 8 | 9 | 10 | add_executable(rrtstar rrts_main.cpp system_single_integrator.cpp kdtree.c) 11 | 12 | pods_use_pkg_config_packages(rrtstar-standalone) 13 | 14 | pods_install_executables(rrtstar-standalone) -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-3.19.0-33-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "3.19.0-33-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-3.19.0-33-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "3.19.0-33-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # compile C with /usr/bin/cc 5 | # compile CXX with /usr/bin/c++ 6 | C_FLAGS = -O3 -DNDEBUG -I/home/ahmed/r/build/include -I/home/ahmed/r/rrtstar-standalone/pod-build/include 7 | 8 | C_DEFINES = 9 | 10 | CXX_FLAGS = -O3 -DNDEBUG -I/home/ahmed/r/build/include -I/home/ahmed/r/rrtstar-standalone/pod-build/include 11 | 12 | CXX_DEFINES = 13 | 14 | -------------------------------------------------------------------------------- /viewer/README: -------------------------------------------------------------------------------- 1 | This is a default README file, please replace its contents with information 2 | relevant to your project. 3 | 4 | This software is constructed according to the Pods software policies and 5 | templates. The policies and templates can be found at: 6 | 7 | http://sourceforge.net/projects/pods 8 | 9 | ==== 10 | 11 | Name: rrtstar-planner 12 | Maintainers: FILL-ME-IN 13 | Summary: FILL-ME-IN 14 | Description: 15 | FILL-ME-IN 16 | 17 | Requirements: 18 | FILL-ME-IN 19 | 20 | License: FILL-ME-IN 21 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/C.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /home/ahmed/r/rrtstar-standalone/src/kdtree.c 10 | stdio.h 11 | - 12 | stdlib.h 13 | - 14 | string.h 15 | - 16 | math.h 17 | - 18 | kdtree.h 19 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 20 | malloc.h 21 | - 22 | pthread.h 23 | - 24 | 25 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 26 | 27 | -------------------------------------------------------------------------------- /rrtstar/src/CMakeLists.txt~: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | pods_install_pkg_config_file(rrtstar 4 | CFLAGS 5 | LIBS -lrrtstar 6 | REQUIRES lcmtypes 7 | VERSION 0.0.1) 8 | 9 | include_directories( 10 | ${LCM_INCLUDE_DIRS}) 11 | 12 | add_executable(rrtstar rrts_main.cpp system_single_integrator.cpp kdtree.c) 13 | 14 | pods_use_pkg_config_packages(rrtstar 15 | bot2-core 16 | lcmtypes) 17 | 18 | pods_install_executables(rrtstar) -------------------------------------------------------------------------------- /rrtstar/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | pods_install_pkg_config_file(rrtstar 4 | CFLAGS 5 | LIBS -lrrtstar 6 | REQUIRES lcmtypes 7 | VERSION 0.0.1) 8 | 9 | include_directories( 10 | ${LCM_INCLUDE_DIRS}) 11 | 12 | add_executable(rrtstar rrts_main.cpp system_single_integrator.cpp kdtree.c) 13 | 14 | pods_use_pkg_config_packages(rrtstar 15 | bot2-core 16 | lcmtypes) 17 | 18 | pods_install_executables(rrtstar) 19 | 20 | target_link_libraries(rrtstar -llcm) 21 | -------------------------------------------------------------------------------- /lcmtypes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | cmake_minimum_required(VERSION 2.6.0) 4 | 5 | set(POD_NAME lcmtypes) 6 | include(cmake/pods.cmake) 7 | 8 | # automatically build LCM types. This also defines a number of CMake 9 | # variables, see cmake/lcmtypes.cmake for details 10 | include(cmake/lcmtypes.cmake) 11 | lcmtypes_build() 12 | 13 | include_directories(${LCMTYPES_INCLUDE_DIRS}) 14 | 15 | pods_install_pkg_config_file(lcmtypes 16 | CFLAGS 17 | LIBS -llcmtypes_lcmtypes 18 | VERSION 0.0.1) 19 | -------------------------------------------------------------------------------- /viewer/src/renderers/graph_renderer.h: -------------------------------------------------------------------------------- 1 | #ifndef RACECAR_ROAD_RENDERER_H_ 2 | #define RACECAR_ROAD_RENDERER_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #ifdef __APPLE__ 15 | #include 16 | #else 17 | #include 18 | #endif 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | void add_graph_renderer_to_viewer (BotViewer* viewer, int render_priority, lcm_t* lcm); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /viewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.0) 2 | 3 | # pull in the pods macros. See cmake/pods.cmake for documentation 4 | set(POD_NAME viewer) 5 | include(cmake/pods.cmake) 6 | 7 | find_package(PkgConfig REQUIRED) 8 | find_package(OpenGL REQUIRED) 9 | 10 | list(APPEND OPENGL_LIBRARIES GL ) 11 | set(GLUT_CFLAGS "") 12 | set(GLUT_LIBRARIES -lglut) 13 | set(ZLIB_LIBRARIES -lz) 14 | 15 | pkg_check_modules(LCM REQUIRED lcm) 16 | pkg_check_modules(GTK2 REQUIRED gtk+-2.0) 17 | pkg_check_modules(BOT2_VIS REQUIRED bot2-vis) 18 | 19 | 20 | 21 | #tell cmake to build these subdirectories 22 | add_subdirectory(src/renderers) 23 | add_subdirectory(src) 24 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | To install with libbot2: 2 | 3 | 1. Check out libbot2 from 4 | https://svn.csail.mit.edu/libbot2/ 5 | 6 | 2. Make sure all dependencies of libbot2 (e.g., lcm) are installed. 7 | 8 | 3. Install libbot2 with the local installation procedure. 9 | 10 | 4. Run "make" in the folder where this README file is located. 11 | 12 | 13 | 14 | 15 | To install standalone rrtstar: 16 | 17 | 1. Run "make -C ./rrtstar-standalone" 18 | 19 | 20 | 21 | 22 | To generate the rrtstar documentation: 23 | 24 | 1. Make sure doxygen is installed. 25 | 26 | 2. Go into ./rrtstar 27 | 28 | 3. Run "doxygen ./doxy/doxy.conf" 29 | 30 | 4. Find the documentation in ./rrtstar/doc/ -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/tmp.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | SET(CMAKE_DEPENDS_LANGUAGES 3 | ) 4 | # The set of files for implicit dependencies of each language: 5 | 6 | # Targets to which this target links. 7 | SET(CMAKE_TARGET_LINKED_INFO_FILES 8 | ) 9 | 10 | # The include file search paths: 11 | SET(CMAKE_C_TARGET_INCLUDE_PATH 12 | "/home/ahmed/r/build/include" 13 | "include" 14 | ) 15 | SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 16 | SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 17 | SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 18 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Relative path conversion top directories. 5 | SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/ahmed/r/rrtstar-standalone") 6 | SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/ahmed/r/rrtstar-standalone/pod-build") 7 | 8 | # Force unix paths in dependencies. 9 | SET(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Relative path conversion top directories. 5 | SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/ahmed/r/rrtstar-standalone") 6 | SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/ahmed/r/rrtstar-standalone/pod-build") 7 | 8 | # Force unix paths in dependencies. 9 | SET(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | src/CMakeFiles/rrtstar.dir/kdtree.c.o 5 | /home/ahmed/r/rrtstar-standalone/src/kdtree.c 6 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 7 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o 8 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 9 | /home/ahmed/r/rrtstar-standalone/src/rrts.h 10 | /home/ahmed/r/rrtstar-standalone/src/rrts.hpp 11 | /home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp 12 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.h 13 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o 14 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp 15 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.h 16 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | src/CMakeFiles/rrtstar.dir/kdtree.c.o: ../src/kdtree.c 5 | src/CMakeFiles/rrtstar.dir/kdtree.c.o: ../src/kdtree.h 6 | 7 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/kdtree.h 8 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/rrts.h 9 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/rrts.hpp 10 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/rrts_main.cpp 11 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/system_single_integrator.h 12 | 13 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o: ../src/system_single_integrator.cpp 14 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o: ../src/system_single_integrator.h 15 | 16 | -------------------------------------------------------------------------------- /viewer/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | pods_install_pkg_config_file(viewer 4 | CFLAGS 5 | LIBS 6 | REQUIRES ${REQUIRED_PACKAGES} 7 | VERSION 0.0.1) 8 | 9 | include_directories(${PROJECT_SOURCE_DIR}/src 10 | ${GTK2_INCLUDE_DIRS} 11 | ${OPENGL_INCLUDE_DIR} 12 | ${GLUT_INCLUDE_DIR} 13 | ${LCM_INCLUDE_DIRS} 14 | ${BOT2_VIS_INCLUDE_DIRS}) 15 | 16 | add_executable(viewer main_viewer.cpp) 17 | 18 | pods_use_pkg_config_packages(viewer viewer 19 | bot2-core 20 | bot2-vis 21 | bot2-lcmgl-client 22 | renderers) 23 | 24 | target_link_libraries(viewer 25 | ${GTK2_LDFLAGS} 26 | ${OPENGL_LIBRARIES} 27 | ${GLUT_LIBRARIES} 28 | ${LCM_LDFLAGS} 29 | ${BOT2_VIS_LDFLAGS}) 30 | 31 | pods_install_executables(viewer) 32 | -------------------------------------------------------------------------------- /viewer/src/renderers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:/usr/local/share/pkgconfig") 2 | 3 | 4 | add_library(renderers SHARED 5 | graph_renderer.cpp) 6 | 7 | pods_use_pkg_config_packages(renderers bot2-vis lcmtypes) 8 | 9 | pods_install_headers(graph_renderer.h DESTINATION renderers) 10 | 11 | # make the library public 12 | pods_install_libraries(renderers) 13 | 14 | target_link_libraries(renderers 15 | ${GTK2_LDFLAGS} 16 | ${OPENGL_LIBRARIES} 17 | ${GLUT_LIBRARIES} 18 | ${LCM_LDFLAGS} 19 | ${BOT2_VIS_LDFLAGS}) 20 | 21 | # create a pkg-config file for the library, to make it easier for other 22 | # software to use. 23 | pods_install_pkg_config_file(renderers 24 | CFLAGS 25 | LIBS -lrenderers 26 | REQUIRES bot2-core bot2-vis lcmtypes 27 | VERSION 0.0.1) 28 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default_target: all 2 | 3 | # get a list of subdirs to build by reading tobuild.txt 4 | SUBDIRS:=$(shell grep -v "^\#" tobuild.txt) 5 | 6 | #force to build on the top level build dir 7 | BUILD_PREFIX=`pwd`/build 8 | 9 | 10 | # build quietly by default. For a verbose build, run "make VERBOSE=1" 11 | $(VERBOSE).SILENT: 12 | 13 | all: 14 | @[ -d $(BUILD_PREFIX) ] || mkdir -p $(BUILD_PREFIX) || exit 1 15 | @for subdir in $(SUBDIRS); do \ 16 | echo "\n-------------------------------------------"; \ 17 | echo "-- $$subdir"; \ 18 | echo "-------------------------------------------"; \ 19 | $(MAKE) -C $$subdir all || exit 2; \ 20 | done 21 | @# Place additional commands here if you have any 22 | 23 | clean: 24 | @for subdir in $(SUBDIRS); do \ 25 | echo "\n-------------------------------------------"; \ 26 | echo "-- $$subdir"; \ 27 | echo "-------------------------------------------"; \ 28 | $(MAKE) -C $$subdir clean; \ 29 | done 30 | rm -rf build/bin 31 | rm -rf build/include 32 | rm -rf build/lib 33 | rm -rf build/share 34 | @# Place additional commands here if you have any 35 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 10 | 11 | /home/ahmed/r/rrtstar-standalone/src/rrts.h 12 | kdtree.h 13 | /home/ahmed/r/rrtstar-standalone/src/kdtree.h 14 | list 15 | - 16 | set 17 | - 18 | vector 19 | - 20 | 21 | /home/ahmed/r/rrtstar-standalone/src/rrts.hpp 22 | iostream 23 | - 24 | cfloat 25 | - 26 | cmath 27 | - 28 | algorithm 29 | - 30 | rrts.h 31 | /home/ahmed/r/rrtstar-standalone/src/rrts.h 32 | 33 | /home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp 34 | iostream 35 | - 36 | ctime 37 | - 38 | rrts.hpp 39 | /home/ahmed/r/rrtstar-standalone/src/rrts.hpp 40 | system_single_integrator.h 41 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.h 42 | 43 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp 44 | system_single_integrator.h 45 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.h 46 | cmath 47 | - 48 | cstdlib 49 | - 50 | iostream 51 | - 52 | 53 | /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.h 54 | list 55 | - 56 | 57 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Copyright <2017> 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 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. 8 | 9 | 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. -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | SET(CMAKE_DEPENDS_LANGUAGES 3 | "C" 4 | "CXX" 5 | ) 6 | # The set of files for implicit dependencies of each language: 7 | SET(CMAKE_DEPENDS_CHECK_C 8 | "/home/ahmed/r/rrtstar-standalone/src/kdtree.c" "/home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/kdtree.c.o" 9 | ) 10 | SET(CMAKE_C_COMPILER_ID "GNU") 11 | SET(CMAKE_DEPENDS_CHECK_CXX 12 | "/home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp" "/home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o" 13 | "/home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp" "/home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o" 14 | ) 15 | SET(CMAKE_CXX_COMPILER_ID "GNU") 16 | 17 | # Targets to which this target links. 18 | SET(CMAKE_TARGET_LINKED_INFO_FILES 19 | ) 20 | 21 | # The include file search paths: 22 | SET(CMAKE_C_TARGET_INCLUDE_PATH 23 | "/home/ahmed/r/build/include" 24 | "include" 25 | ) 26 | SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 27 | SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 28 | SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH}) 29 | -------------------------------------------------------------------------------- /viewer/src/main_viewer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | //#include 5 | 6 | #include 7 | #include 8 | 9 | #ifdef __APPLE__ 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #include 16 | 17 | using namespace std; 18 | 19 | 20 | typedef struct { 21 | BotViewer *viewer; 22 | lcm_t *lcm; 23 | } viewer_app_t; 24 | 25 | 26 | 27 | int main(int argc, char *argv[]) 28 | { 29 | 30 | gtk_init(&argc, &argv); 31 | glutInit(&argc, argv); 32 | g_thread_init(NULL); 33 | 34 | setlinebuf(stdout); 35 | 36 | viewer_app_t app; 37 | memset(&app, 0, sizeof(app)); 38 | 39 | 40 | BotViewer *viewer = bot_viewer_new("Viewer"); 41 | app.viewer = viewer; 42 | app.lcm = lcm_create(NULL); 43 | bot_glib_mainloop_attach_lcm(app.lcm); 44 | 45 | // setup renderers 46 | bot_viewer_add_stock_renderer(viewer, BOT_VIEWER_STOCK_RENDERER_GRID, 1); 47 | add_graph_renderer_to_viewer (viewer, 1, app.lcm); 48 | 49 | 50 | // run the main loop 51 | gtk_main(); 52 | 53 | // cleanup 54 | bot_viewer_unref(viewer); 55 | 56 | cout << "RRTstar is alive" << endl; 57 | 58 | return 1; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /lcmtypes/Makefile: -------------------------------------------------------------------------------- 1 | # Default makefile distributed with pods version: 11.02.09 2 | 3 | default_target: all 4 | 5 | # Default to a less-verbose build. If you want all the gory compiler output, 6 | # run "make VERBOSE=1" 7 | $(VERBOSE).SILENT: 8 | 9 | # Figure out where to build the software. 10 | # Use BUILD_PREFIX if it was passed in. 11 | # If not, search up to four parent directories for a 'build' directory. 12 | # Otherwise, use ./build. 13 | ifeq "$(BUILD_PREFIX)" "" 14 | BUILD_PREFIX:=$(shell for pfx in .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build;\ 15 | if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build) 16 | endif 17 | # create the build directory if needed, and normalize its path name 18 | BUILD_PREFIX:=$(shell mkdir -p $(BUILD_PREFIX) && cd $(BUILD_PREFIX) && echo `pwd`) 19 | 20 | # Default to a release build. If you want to enable debugging flags, run 21 | # "make BUILD_TYPE=Debug" 22 | ifeq "$(BUILD_TYPE)" "" 23 | BUILD_TYPE="Release" 24 | endif 25 | 26 | all: pod-build/Makefile 27 | $(MAKE) -C pod-build all install 28 | 29 | pod-build/Makefile: 30 | $(MAKE) configure 31 | 32 | .PHONY: configure 33 | configure: 34 | @echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n" 35 | 36 | # create the temporary build directory if needed 37 | @mkdir -p pod-build 38 | 39 | # run CMake to generate and configure the build scripts 40 | @cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \ 41 | -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. 42 | 43 | clean: 44 | -if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi 45 | -if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi 46 | -------------------------------------------------------------------------------- /rrtstar/Makefile: -------------------------------------------------------------------------------- 1 | # Default makefile distributed with pods version: 10.11.18 2 | 3 | default_target: all 4 | 5 | # Default to a less-verbose build. If you want all the gory compiler output, 6 | # run "make VERBOSE=1" 7 | $(VERBOSE).SILENT: 8 | 9 | # Figure out where to build the software. 10 | # Use BUILD_PREFIX if it was passed in. 11 | # If not, search up to four parent directories for a 'build' directory. 12 | # Otherwise, use ./build. 13 | ifeq "$(BUILD_PREFIX)" "" 14 | BUILD_PREFIX=$(shell for pfx in .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build; \ 15 | if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build) 16 | endif 17 | 18 | # Default to a release build. If you want to enable debugging flags, run 19 | # "make BUILD_TYPE=Debug" 20 | ifeq "$(BUILD_TYPE)" "" 21 | BUILD_TYPE="Release" 22 | endif 23 | 24 | all: pod-build/Makefile 25 | $(MAKE) -C pod-build all install 26 | 27 | pod-build/Makefile: 28 | $(MAKE) configure 29 | 30 | .PHONY: configure 31 | configure: 32 | @echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n" 33 | 34 | # create the build directories if necessary 35 | @[ -d $(BUILD_PREFIX) ] || mkdir -p $(BUILD_PREFIX) || exit 1 36 | @[ -d pod-build ] || mkdir pod-build || exit 1 37 | @echo "$(BUILD_PREFIX)" > pod-build/build_prefix 38 | 39 | # run CMake to generate and configure the build scripts 40 | @cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \ 41 | -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. 42 | 43 | clean: 44 | -if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi 45 | -if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi 46 | -------------------------------------------------------------------------------- /rrtstar-standalone/Makefile: -------------------------------------------------------------------------------- 1 | # Default makefile distributed with pods version: 10.11.18 2 | 3 | default_target: all 4 | 5 | # Default to a less-verbose build. If you want all the gory compiler output, 6 | # run "make VERBOSE=1" 7 | $(VERBOSE).SILENT: 8 | 9 | # Figure out where to build the software. 10 | # Use BUILD_PREFIX if it was passed in. 11 | # If not, search up to four parent directories for a 'build' directory. 12 | # Otherwise, use ./build. 13 | ifeq "$(BUILD_PREFIX)" "" 14 | BUILD_PREFIX=$(shell for pfx in .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build; \ 15 | if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build) 16 | endif 17 | 18 | # Default to a release build. If you want to enable debugging flags, run 19 | # "make BUILD_TYPE=Debug" 20 | ifeq "$(BUILD_TYPE)" "" 21 | BUILD_TYPE="Release" 22 | endif 23 | 24 | all: pod-build/Makefile 25 | $(MAKE) -C pod-build all install 26 | 27 | pod-build/Makefile: 28 | $(MAKE) configure 29 | 30 | .PHONY: configure 31 | configure: 32 | @echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n" 33 | 34 | # create the build directories if necessary 35 | @[ -d $(BUILD_PREFIX) ] || mkdir -p $(BUILD_PREFIX) || exit 1 36 | @[ -d pod-build ] || mkdir pod-build || exit 1 37 | @echo "$(BUILD_PREFIX)" > pod-build/build_prefix 38 | 39 | # run CMake to generate and configure the build scripts 40 | @cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \ 41 | -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. 42 | 43 | clean: 44 | -if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi 45 | -if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi 46 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/ahmed/r/rrtstar-standalone/src 2 | 3 | # Set the install prefix 4 | IF(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | SET(CMAKE_INSTALL_PREFIX "/home/ahmed/r/build") 6 | ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) 7 | STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | IF(BUILD_TYPE) 12 | STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | ELSE(BUILD_TYPE) 15 | SET(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | ENDIF(BUILD_TYPE) 17 | MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 19 | 20 | # Set the component getting installed. 21 | IF(NOT CMAKE_INSTALL_COMPONENT) 22 | IF(COMPONENT) 23 | MESSAGE(STATUS "Install component: \"${COMPONENT}\"") 24 | SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | ELSE(COMPONENT) 26 | SET(CMAKE_INSTALL_COMPONENT) 27 | ENDIF(COMPONENT) 28 | ENDIF(NOT CMAKE_INSTALL_COMPONENT) 29 | 30 | # Install shared libraries without execute permission? 31 | IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | SET(CMAKE_INSTALL_SO_NO_EXE "1") 33 | ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 34 | 35 | IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") 36 | FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" TYPE FILE FILES "/home/ahmed/r/rrtstar-standalone/pod-build/lib/pkgconfig/rrtstar-standalone.pc") 37 | ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") 38 | 39 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "4.8.4") 5 | set(CMAKE_C_PLATFORM_ID "Linux") 6 | 7 | set(CMAKE_AR "/usr/bin/ar") 8 | set(CMAKE_RANLIB "/usr/bin/ranlib") 9 | set(CMAKE_LINKER "/usr/bin/ld") 10 | set(CMAKE_COMPILER_IS_GNUCC 1) 11 | set(CMAKE_C_COMPILER_LOADED 1) 12 | set(CMAKE_C_COMPILER_WORKS TRUE) 13 | set(CMAKE_C_ABI_COMPILED TRUE) 14 | set(CMAKE_COMPILER_IS_MINGW ) 15 | set(CMAKE_COMPILER_IS_CYGWIN ) 16 | if(CMAKE_COMPILER_IS_CYGWIN) 17 | set(CYGWIN 1) 18 | set(UNIX 1) 19 | endif() 20 | 21 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 22 | 23 | if(CMAKE_COMPILER_IS_MINGW) 24 | set(MINGW 1) 25 | endif() 26 | set(CMAKE_C_COMPILER_ID_RUN 1) 27 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) 28 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 29 | set(CMAKE_C_LINKER_PREFERENCE 10) 30 | 31 | # Save compiler ABI information. 32 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 33 | set(CMAKE_C_COMPILER_ABI "ELF") 34 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 35 | 36 | if(CMAKE_C_SIZEOF_DATA_PTR) 37 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 38 | endif() 39 | 40 | if(CMAKE_C_COMPILER_ABI) 41 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 42 | endif() 43 | 44 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 45 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 46 | endif() 47 | 48 | 49 | 50 | 51 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") 52 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/4.8;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 53 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /viewer/Makefile: -------------------------------------------------------------------------------- 1 | # Default makefile distributed with pods version: 11.03.11 2 | 3 | default_target: all 4 | 5 | # Default to a less-verbose build. If you want all the gory compiler output, 6 | # run "make VERBOSE=1" 7 | $(VERBOSE).SILENT: 8 | 9 | # Figure out where to build the software. 10 | # Use BUILD_PREFIX if it was passed in. 11 | # If not, search up to four parent directories for a 'build' directory. 12 | # Otherwise, use ./build. 13 | ifeq "$(BUILD_PREFIX)" "" 14 | BUILD_PREFIX:=$(shell for pfx in ./ .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build;\ 15 | if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build) 16 | endif 17 | # create the build directory if needed, and normalize its path name 18 | BUILD_PREFIX:=$(shell mkdir -p $(BUILD_PREFIX) && cd $(BUILD_PREFIX) && echo `pwd`) 19 | 20 | # Default to a release build. If you want to enable debugging flags, run 21 | # "make BUILD_TYPE=Debug" 22 | ifeq "$(BUILD_TYPE)" "" 23 | BUILD_TYPE="Release" 24 | endif 25 | 26 | all: pod-build/Makefile 27 | $(MAKE) -C pod-build all install 28 | 29 | pod-build/Makefile: 30 | $(MAKE) configure 31 | 32 | .PHONY: configure 33 | configure: 34 | @echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n" 35 | 36 | # create the temporary build directory if needed 37 | @mkdir -p pod-build 38 | 39 | # run CMake to generate and configure the build scripts 40 | @cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \ 41 | -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. 42 | 43 | clean: 44 | -if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi 45 | -if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi 46 | 47 | # other (custom) targets are passed through to the cmake-generated Makefile 48 | %:: 49 | $(MAKE) -C pod-build $@ -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "4.8.4") 5 | set(CMAKE_CXX_PLATFORM_ID "Linux") 6 | 7 | set(CMAKE_AR "/usr/bin/ar") 8 | set(CMAKE_RANLIB "/usr/bin/ranlib") 9 | set(CMAKE_LINKER "/usr/bin/ld") 10 | set(CMAKE_COMPILER_IS_GNUCXX 1) 11 | set(CMAKE_CXX_COMPILER_LOADED 1) 12 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 13 | set(CMAKE_CXX_ABI_COMPILED TRUE) 14 | set(CMAKE_COMPILER_IS_MINGW ) 15 | set(CMAKE_COMPILER_IS_CYGWIN ) 16 | if(CMAKE_COMPILER_IS_CYGWIN) 17 | set(CYGWIN 1) 18 | set(UNIX 1) 19 | endif() 20 | 21 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 22 | 23 | if(CMAKE_COMPILER_IS_MINGW) 24 | set(MINGW 1) 25 | endif() 26 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 27 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 28 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 29 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 30 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 31 | 32 | # Save compiler ABI information. 33 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 34 | set(CMAKE_CXX_COMPILER_ABI "ELF") 35 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 36 | 37 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 38 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 39 | endif() 40 | 41 | if(CMAKE_CXX_COMPILER_ABI) 42 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 43 | endif() 44 | 45 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 46 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 47 | endif() 48 | 49 | 50 | 51 | 52 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c") 53 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/4.8;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 54 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/ahmed/r/rrtstar-standalone 2 | 3 | # Set the install prefix 4 | IF(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | SET(CMAKE_INSTALL_PREFIX "/home/ahmed/r/build") 6 | ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) 7 | STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | IF(BUILD_TYPE) 12 | STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | ELSE(BUILD_TYPE) 15 | SET(CMAKE_INSTALL_CONFIG_NAME "Release") 16 | ENDIF(BUILD_TYPE) 17 | MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 19 | 20 | # Set the component getting installed. 21 | IF(NOT CMAKE_INSTALL_COMPONENT) 22 | IF(COMPONENT) 23 | MESSAGE(STATUS "Install component: \"${COMPONENT}\"") 24 | SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | ELSE(COMPONENT) 26 | SET(CMAKE_INSTALL_COMPONENT) 27 | ENDIF(COMPONENT) 28 | ENDIF(NOT CMAKE_INSTALL_COMPONENT) 29 | 30 | # Install shared libraries without execute permission? 31 | IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | SET(CMAKE_INSTALL_SO_NO_EXE "1") 33 | ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 34 | 35 | IF(NOT CMAKE_INSTALL_LOCAL_ONLY) 36 | # Include the install script for each subdirectory. 37 | INCLUDE("/home/ahmed/r/rrtstar-standalone/pod-build/src/cmake_install.cmake") 38 | 39 | ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY) 40 | 41 | IF(CMAKE_INSTALL_COMPONENT) 42 | SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 43 | ELSE(CMAKE_INSTALL_COMPONENT) 44 | SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 45 | ENDIF(CMAKE_INSTALL_COMPONENT) 46 | 47 | FILE(WRITE "/home/ahmed/r/rrtstar-standalone/pod-build/${CMAKE_INSTALL_MANIFEST}" "") 48 | FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES}) 49 | FILE(APPEND "/home/ahmed/r/rrtstar-standalone/pod-build/${CMAKE_INSTALL_MANIFEST}" "${file}\n") 50 | ENDFOREACH(file) 51 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/tmp.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | #============================================================================= 5 | # Special targets provided by cmake. 6 | 7 | # Disable implicit rules so canonical targets will work. 8 | .SUFFIXES: 9 | 10 | # Remove some rules from gmake that .SUFFIXES does not remove. 11 | SUFFIXES = 12 | 13 | .SUFFIXES: .hpux_make_needs_suffix_list 14 | 15 | # Suppress display of executed commands. 16 | $(VERBOSE).SILENT: 17 | 18 | # A target that is always out of date. 19 | cmake_force: 20 | .PHONY : cmake_force 21 | 22 | #============================================================================= 23 | # Set environment variables for the build. 24 | 25 | # The shell in which to execute make rules. 26 | SHELL = /bin/sh 27 | 28 | # The CMake executable. 29 | CMAKE_COMMAND = /usr/bin/cmake 30 | 31 | # The command to remove a file. 32 | RM = /usr/bin/cmake -E remove -f 33 | 34 | # Escaping for special characters. 35 | EQUALS = = 36 | 37 | # The program to use to edit the cache. 38 | CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui 39 | 40 | # The top-level source directory on which CMake was run. 41 | CMAKE_SOURCE_DIR = /home/ahmed/r/rrtstar-standalone 42 | 43 | # The top-level build directory on which CMake was run. 44 | CMAKE_BINARY_DIR = /home/ahmed/r/rrtstar-standalone/pod-build 45 | 46 | # Utility rule file for tmp. 47 | 48 | # Include the progress variables for this target. 49 | include CMakeFiles/tmp.dir/progress.make 50 | 51 | CMakeFiles/tmp: 52 | 53 | tmp: CMakeFiles/tmp 54 | tmp: CMakeFiles/tmp.dir/build.make 55 | .PHONY : tmp 56 | 57 | # Rule to build all files generated by this target. 58 | CMakeFiles/tmp.dir/build: tmp 59 | .PHONY : CMakeFiles/tmp.dir/build 60 | 61 | CMakeFiles/tmp.dir/clean: 62 | $(CMAKE_COMMAND) -P CMakeFiles/tmp.dir/cmake_clean.cmake 63 | .PHONY : CMakeFiles/tmp.dir/clean 64 | 65 | CMakeFiles/tmp.dir/depend: 66 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/ahmed/r/rrtstar-standalone /home/ahmed/r/rrtstar-standalone /home/ahmed/r/rrtstar-standalone/pod-build /home/ahmed/r/rrtstar-standalone/pod-build /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles/tmp.dir/DependInfo.cmake --color=$(COLOR) 67 | .PHONY : CMakeFiles/tmp.dir/depend 68 | 69 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/rrts_main.cpp: -------------------------------------------------------------------------------- 1 | #define LIBBOT_PRESENT 0 2 | 3 | #include 4 | #include 5 | 6 | 7 | #include "rrts.hpp" 8 | #include "system_single_integrator.h" 9 | 10 | 11 | using namespace RRTstar; 12 | using namespace SingleIntegrator; 13 | 14 | using namespace std; 15 | 16 | 17 | 18 | typedef Planner planner_t; 19 | typedef Vertex vertex_t; 20 | 21 | 22 | 23 | int main () { 24 | 25 | 26 | planner_t rrts; 27 | 28 | cout << "RRTstar is alive" << endl; 29 | 30 | 31 | 32 | 33 | // Create the dynamical system 34 | System system; 35 | 36 | // Three dimensional configuration space 37 | system.setNumDimensions (3); 38 | 39 | // Define the operating region 40 | system.regionOperating.setNumDimensions(3); 41 | system.regionOperating.center[0] = 0.0; 42 | system.regionOperating.center[1] = 0.0; 43 | system.regionOperating.center[2] = 0.0; 44 | system.regionOperating.size[0] = 20.0; 45 | system.regionOperating.size[1] = 20.0; 46 | system.regionOperating.size[2] = 20.0; 47 | 48 | // Define the goal region 49 | system.regionGoal.setNumDimensions(3); 50 | system.regionGoal.center[0] = 2.0; 51 | system.regionGoal.center[1] = 2.0; 52 | system.regionGoal.center[2] = 2.0; 53 | system.regionGoal.size[0] = 2.0; 54 | system.regionGoal.size[1] = 2.0; 55 | system.regionGoal.size[2] = 2.0; 56 | 57 | 58 | // Define the obstacle region 59 | region *obstacle; 60 | 61 | obstacle = new region; 62 | obstacle->setNumDimensions(3); 63 | obstacle->center[0] = 0; 64 | obstacle->center[1] = 0; 65 | obstacle->center[2] = 6; 66 | obstacle->size[0] = 10; 67 | obstacle->size[1] = 10; 68 | obstacle->size[2] = 8; 69 | 70 | system.obstacles.push_front (obstacle); // Add the obstacle to the list 71 | 72 | 73 | 74 | 75 | // Add the system to the planner 76 | rrts.setSystem (system); 77 | 78 | // Set up the root vertex 79 | vertex_t &root = rrts.getRootVertex(); 80 | State &rootState = root.getState(); 81 | rootState[0] = 0.0; 82 | rootState[1] = 0.0; 83 | rootState[2] = 0.0; 84 | 85 | 86 | // Initialize the planner 87 | rrts.initialize (); 88 | 89 | // This parameter should be larger than 1.5 for asymptotic 90 | // optimality. Larger values will weigh on optimization 91 | // rather than exploration in the RRT* algorithm. Lower 92 | // values, such as 0.1, should recover the RRT. 93 | rrts.setGamma (1.5); 94 | 95 | 96 | 97 | clock_t start = clock(); 98 | 99 | // Run the algorithm for 10000 iteartions 100 | for (int i = 0; i < 2000; i++) 101 | rrts.iteration (); 102 | 103 | clock_t finish = clock(); 104 | cout << "Time : " << ((double)(finish-start))/CLOCKS_PER_SEC << endl; 105 | 106 | 107 | 108 | 109 | return 1; 110 | } 111 | 112 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # The generator used is: 5 | SET(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | SET(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "../CMakeLists.txt" 11 | "../cmake/pods.cmake" 12 | "CMakeFiles/2.8.12.2/CMakeCCompiler.cmake" 13 | "CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake" 14 | "CMakeFiles/2.8.12.2/CMakeSystem.cmake" 15 | "../src/CMakeLists.txt" 16 | "/usr/share/cmake-2.8/Modules/CMakeCCompiler.cmake.in" 17 | "/usr/share/cmake-2.8/Modules/CMakeCCompilerABI.c" 18 | "/usr/share/cmake-2.8/Modules/CMakeCInformation.cmake" 19 | "/usr/share/cmake-2.8/Modules/CMakeCXXCompiler.cmake.in" 20 | "/usr/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp" 21 | "/usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake" 22 | "/usr/share/cmake-2.8/Modules/CMakeClDeps.cmake" 23 | "/usr/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake" 24 | "/usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake" 25 | "/usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake" 26 | "/usr/share/cmake-2.8/Modules/CMakeDetermineCompiler.cmake" 27 | "/usr/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake" 28 | "/usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake" 29 | "/usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake" 30 | "/usr/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake" 31 | "/usr/share/cmake-2.8/Modules/CMakeGenericSystem.cmake" 32 | "/usr/share/cmake-2.8/Modules/CMakeParseArguments.cmake" 33 | "/usr/share/cmake-2.8/Modules/CMakeParseImplicitLinkInfo.cmake" 34 | "/usr/share/cmake-2.8/Modules/CMakeSystem.cmake.in" 35 | "/usr/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake" 36 | "/usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake" 37 | "/usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake" 38 | "/usr/share/cmake-2.8/Modules/CMakeTestCompilerCommon.cmake" 39 | "/usr/share/cmake-2.8/Modules/CMakeUnixFindMake.cmake" 40 | "/usr/share/cmake-2.8/Modules/Compiler/GNU-C.cmake" 41 | "/usr/share/cmake-2.8/Modules/Compiler/GNU-CXX.cmake" 42 | "/usr/share/cmake-2.8/Modules/Compiler/GNU.cmake" 43 | "/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake" 44 | "/usr/share/cmake-2.8/Modules/FindPackageMessage.cmake" 45 | "/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake" 46 | "/usr/share/cmake-2.8/Modules/MultiArchCross.cmake" 47 | "/usr/share/cmake-2.8/Modules/Platform/Linux-CXX.cmake" 48 | "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU-C.cmake" 49 | "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU-CXX.cmake" 50 | "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU.cmake" 51 | "/usr/share/cmake-2.8/Modules/Platform/Linux.cmake" 52 | "/usr/share/cmake-2.8/Modules/Platform/UnixPaths.cmake" 53 | ) 54 | 55 | # The corresponding makefile is: 56 | SET(CMAKE_MAKEFILE_OUTPUTS 57 | "Makefile" 58 | "CMakeFiles/cmake.check_cache" 59 | ) 60 | 61 | # Byproducts of CMake generate step: 62 | SET(CMAKE_MAKEFILE_PRODUCTS 63 | "CMakeFiles/2.8.12.2/CMakeSystem.cmake" 64 | "CMakeFiles/2.8.12.2/CMakeCCompiler.cmake" 65 | "CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake" 66 | "CMakeFiles/2.8.12.2/CMakeCCompiler.cmake" 67 | "CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake" 68 | "CMakeFiles/CMakeDirectoryInformation.cmake" 69 | "src/CMakeFiles/CMakeDirectoryInformation.cmake" 70 | ) 71 | 72 | # Dependency information for all targets: 73 | SET(CMAKE_DEPEND_INFO_FILES 74 | "CMakeFiles/tmp.dir/DependInfo.cmake" 75 | "src/CMakeFiles/rrtstar.dir/DependInfo.cmake" 76 | ) 77 | -------------------------------------------------------------------------------- /rrtstar/src/kdtree.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of ``kdtree'', a library for working with kd-trees. 3 | Copyright (C) 2007-2009 John Tsiombikas 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 3. The name of the author may not be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | OF SUCH DAMAGE. 26 | */ 27 | #ifndef _KDTREE_H_ 28 | #define _KDTREE_H_ 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | struct kdtree; 35 | struct kdres; 36 | 37 | 38 | /* create a kd-tree for "k"-dimensional data */ 39 | struct kdtree *kd_create(int k); 40 | 41 | /* free the struct kdtree */ 42 | void kd_free(struct kdtree *tree); 43 | 44 | /* remove all the elements from the tree */ 45 | void kd_clear(struct kdtree *tree); 46 | 47 | /* if called with non-null 2nd argument, the function provided 48 | * will be called on data pointers (see kd_insert) when nodes 49 | * are to be removed from the tree. 50 | */ 51 | void kd_data_destructor(struct kdtree *tree, void (*destr)(void*)); 52 | 53 | /* insert a node, specifying its position, and optional data */ 54 | int kd_insert(struct kdtree *tree, const double *pos, void *data); 55 | int kd_insertf(struct kdtree *tree, const float *pos, void *data); 56 | int kd_insert3(struct kdtree *tree, double x, double y, double z, void *data); 57 | int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data); 58 | 59 | /* Find one of the nearest nodes from the specified point. 60 | * 61 | * This function returns a pointer to a result set with at most one element. 62 | */ 63 | struct kdres *kd_nearest(struct kdtree *tree, const double *pos); 64 | struct kdres *kd_nearestf(struct kdtree *tree, const float *pos); 65 | struct kdres *kd_nearest3(struct kdtree *tree, double x, double y, double z); 66 | struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z); 67 | 68 | /* Find any nearest nodes from the specified point within a range. 69 | * 70 | * This function returns a pointer to a result set, which can be manipulated 71 | * by the kd_res_* functions. 72 | * The returned pointer can be null as an indication of an error. Otherwise 73 | * a valid result set is always returned which may contain 0 or more elements. 74 | * The result set must be deallocated with kd_res_free, after use. 75 | */ 76 | struct kdres *kd_nearest_range(struct kdtree *tree, const double *pos, double range); 77 | struct kdres *kd_nearest_rangef(struct kdtree *tree, const float *pos, float range); 78 | struct kdres *kd_nearest_range3(struct kdtree *tree, double x, double y, double z, double range); 79 | struct kdres *kd_nearest_range3f(struct kdtree *tree, float x, float y, float z, float range); 80 | 81 | /* frees a result set returned by kd_nearest_range() */ 82 | void kd_res_free(struct kdres *set); 83 | 84 | /* returns the size of the result set (in elements) */ 85 | int kd_res_size(struct kdres *set); 86 | 87 | /* rewinds the result set iterator */ 88 | void kd_res_rewind(struct kdres *set); 89 | 90 | /* returns non-zero if the set iterator reached the end after the last element */ 91 | int kd_res_end(struct kdres *set); 92 | 93 | /* advances the result set iterator, returns non-zero on success, zero if 94 | * there are no more elements in the result set. 95 | */ 96 | int kd_res_next(struct kdres *set); 97 | 98 | /* returns the data pointer (can be null) of the current result set item 99 | * and optionally sets its position to the pointers(s) if not null. 100 | */ 101 | void *kd_res_item(struct kdres *set, double *pos); 102 | void *kd_res_itemf(struct kdres *set, float *pos); 103 | void *kd_res_item3(struct kdres *set, double *x, double *y, double *z); 104 | void *kd_res_item3f(struct kdres *set, float *x, float *y, float *z); 105 | 106 | /* equivalent to kd_res_item(set, 0) */ 107 | void *kd_res_item_data(struct kdres *set); 108 | 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* _KDTREE_H_ */ 115 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/kdtree.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of ``kdtree'', a library for working with kd-trees. 3 | Copyright (C) 2007-2009 John Tsiombikas 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 3. The name of the author may not be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | OF SUCH DAMAGE. 26 | */ 27 | #ifndef _KDTREE_H_ 28 | #define _KDTREE_H_ 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | struct kdtree; 35 | struct kdres; 36 | 37 | 38 | /* create a kd-tree for "k"-dimensional data */ 39 | struct kdtree *kd_create(int k); 40 | 41 | /* free the struct kdtree */ 42 | void kd_free(struct kdtree *tree); 43 | 44 | /* remove all the elements from the tree */ 45 | void kd_clear(struct kdtree *tree); 46 | 47 | /* if called with non-null 2nd argument, the function provided 48 | * will be called on data pointers (see kd_insert) when nodes 49 | * are to be removed from the tree. 50 | */ 51 | void kd_data_destructor(struct kdtree *tree, void (*destr)(void*)); 52 | 53 | /* insert a node, specifying its position, and optional data */ 54 | int kd_insert(struct kdtree *tree, const double *pos, void *data); 55 | int kd_insertf(struct kdtree *tree, const float *pos, void *data); 56 | int kd_insert3(struct kdtree *tree, double x, double y, double z, void *data); 57 | int kd_insert3f(struct kdtree *tree, float x, float y, float z, void *data); 58 | 59 | /* Find one of the nearest nodes from the specified point. 60 | * 61 | * This function returns a pointer to a result set with at most one element. 62 | */ 63 | struct kdres *kd_nearest(struct kdtree *tree, const double *pos); 64 | struct kdres *kd_nearestf(struct kdtree *tree, const float *pos); 65 | struct kdres *kd_nearest3(struct kdtree *tree, double x, double y, double z); 66 | struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z); 67 | 68 | /* Find any nearest nodes from the specified point within a range. 69 | * 70 | * This function returns a pointer to a result set, which can be manipulated 71 | * by the kd_res_* functions. 72 | * The returned pointer can be null as an indication of an error. Otherwise 73 | * a valid result set is always returned which may contain 0 or more elements. 74 | * The result set must be deallocated with kd_res_free, after use. 75 | */ 76 | struct kdres *kd_nearest_range(struct kdtree *tree, const double *pos, double range); 77 | struct kdres *kd_nearest_rangef(struct kdtree *tree, const float *pos, float range); 78 | struct kdres *kd_nearest_range3(struct kdtree *tree, double x, double y, double z, double range); 79 | struct kdres *kd_nearest_range3f(struct kdtree *tree, float x, float y, float z, float range); 80 | 81 | /* frees a result set returned by kd_nearest_range() */ 82 | void kd_res_free(struct kdres *set); 83 | 84 | /* returns the size of the result set (in elements) */ 85 | int kd_res_size(struct kdres *set); 86 | 87 | /* rewinds the result set iterator */ 88 | void kd_res_rewind(struct kdres *set); 89 | 90 | /* returns non-zero if the set iterator reached the end after the last element */ 91 | int kd_res_end(struct kdres *set); 92 | 93 | /* advances the result set iterator, returns non-zero on success, zero if 94 | * there are no more elements in the result set. 95 | */ 96 | int kd_res_next(struct kdres *set); 97 | 98 | /* returns the data pointer (can be null) of the current result set item 99 | * and optionally sets its position to the pointers(s) if not null. 100 | */ 101 | void *kd_res_item(struct kdres *set, double *pos); 102 | void *kd_res_itemf(struct kdres *set, float *pos); 103 | void *kd_res_item3(struct kdres *set, double *x, double *y, double *z); 104 | void *kd_res_item3f(struct kdres *set, float *x, float *y, float *z); 105 | 106 | /* equivalent to kd_res_item(set, 0) */ 107 | void *kd_res_item_data(struct kdres *set); 108 | 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* _KDTREE_H_ */ 115 | -------------------------------------------------------------------------------- /rrtstar/src/system.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file system.h 3 | * 4 | * This serves as a template to start a new system file. 5 | * It should not be included as is. 6 | */ 7 | 8 | #ifndef __RRTS_SYSTEM_H_ 9 | #define __RRTS_SYSTEM_H_ 10 | 11 | #include 12 | 13 | 14 | 15 | /*! 16 | * \brief State Class. 17 | * 18 | * A more elaborate description of the State class 19 | */ 20 | class State { 21 | 22 | public: 23 | 24 | 25 | /*! 26 | * \brief State assingment operator. 27 | * 28 | * A more elaborate description of the State assignment operator 29 | */ 30 | State& operator= (const State &stateIn); 31 | 32 | /*! 33 | * \brief State bracket operator. 34 | * 35 | * A more elaborate description of the State bracket operator 36 | */ 37 | double& operator[] (const int i); 38 | }; 39 | 40 | 41 | /*! 42 | * \brief Trajectory Class. 43 | * 44 | * A more elaborate description of the Trajectory class 45 | */ 46 | class Trajectory { 47 | 48 | public: 49 | 50 | 51 | /*! 52 | * \brief Trajecotory assignment operator. 53 | * 54 | * A more elaborate description. 55 | */ 56 | Trajectory& operator= (const Trajectory &trajectoryIn); 57 | 58 | /*! 59 | * \brief Returns a reference to the end state of this trajectory. 60 | * 61 | * A more elaborate description. 62 | */ 63 | State& getEndState (); 64 | 65 | /*! 66 | * \brief Returns a reference to the end state of this trajectory (constant). 67 | * 68 | * A more elaborate description. 69 | */ 70 | State& getEndState () const; 71 | 72 | 73 | /*! 74 | * \brief Returns the cost of this trajectory. 75 | * 76 | * A more elaborate description. 77 | */ 78 | double evaluateCost (); 79 | }; 80 | 81 | 82 | /*! 83 | * \brief System Class. 84 | * 85 | * A more elaborate description of the System class 86 | */ 87 | class System { 88 | 89 | public: 90 | 91 | /*! 92 | * \brief Returns the dimensionality of the Euclidean space. 93 | * 94 | * A more elaborate description. 95 | */ 96 | int getNumDimensions (); 97 | 98 | /*! 99 | * \brief Returns a reference to the root state. 100 | * 101 | * A more elaborate description. 102 | */ 103 | State & getRootState (); 104 | 105 | /*! 106 | * \brief Returns the statekey for the given state. 107 | * 108 | * A more elaborate description. 109 | * 110 | * \param stateIn the given state 111 | * \param stateKey the key to the state. An array of dimension getNumDimensions() 112 | * 113 | */ 114 | int getStateKey (State& stateIn, double* stateKey); 115 | 116 | /*! 117 | * \brief Returns true of the given state reaches the target. 118 | * 119 | * A more elaborate description. 120 | */ 121 | bool isReachingTarget (State& stateIn); 122 | 123 | /*! 124 | * \brief Returns a sample state. 125 | * 126 | * A more elaborate description. 127 | * 128 | * \param randomStateOut 129 | * 130 | */ 131 | int sampleState (State& randomStateOut); 132 | 133 | 134 | /*! 135 | * \brief Returns a the cost of the trajectory that connects stateFromIn and 136 | * stateTowardsIn. The trajectory is also returned in trajectoryOut. 137 | * 138 | * A more elaborate description. 139 | * 140 | * \param stateFromIn Initial state 141 | * \param stateTowardsIn Final state 142 | * \param trajectoryOut Trajectory that starts the from the initial state and 143 | * reaches near the final state. 144 | * \param exactConnectionOut Set to true if the initial and the final states 145 | * can be connected exactly. 146 | * 147 | */ 148 | int extendTo (State& stateFromIn, State& stateTowardsIn, 149 | Trajectory& trajectoryOut, bool& exactConnectionOut); 150 | 151 | /*! 152 | * \brief Returns the cost of the trajectory that connects stateFromIn and StateTowardsIn. 153 | * 154 | * A more elaborate description. 155 | * 156 | * \param stateFromIn Initial state 157 | * \param stateTowardsIn Final state 158 | * \param exactConnectionOut Set to true if the initial and the final states 159 | * can be connected exactly. 160 | * 161 | */ 162 | double evaluateExtensionCost (State& stateFromIn, State& stateTowardsIn, bool& exactConnectionOut); 163 | 164 | /*! 165 | * \brief Returns a lower bound on the cost to go starting from stateIn 166 | * 167 | * A more elaborate description. 168 | * 169 | * \param stateIn Starting state 170 | * 171 | */ 172 | double evaluateCostToGo (State& stateIn); 173 | 174 | /*! 175 | * \brief Returns the trajectory as a list of double arrays, each with dimension getNumDimensions. 176 | * 177 | * A more elaborate description. 178 | * 179 | * \param stateFromIn Initial state 180 | * \param stateToIn Final state 181 | * \param trajectoryOut The list of double arrays that represent the trajectory 182 | * 183 | */ 184 | int getTrajectory (State& stateFromIn, State& stateToIn, std::list< double* > & trajectoryOut); 185 | }; 186 | 187 | #endif 188 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/system.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file system.h 3 | * 4 | * This serves as a template to start a new system file. 5 | * It should not be included as is. 6 | */ 7 | 8 | #ifndef __RRTS_SYSTEM_H_ 9 | #define __RRTS_SYSTEM_H_ 10 | 11 | #include 12 | 13 | 14 | 15 | /*! 16 | * \brief State Class. 17 | * 18 | * A more elaborate description of the State class 19 | */ 20 | class State { 21 | 22 | public: 23 | 24 | 25 | /*! 26 | * \brief State assingment operator. 27 | * 28 | * A more elaborate description of the State assignment operator 29 | */ 30 | State& operator= (const State &stateIn); 31 | 32 | /*! 33 | * \brief State bracket operator. 34 | * 35 | * A more elaborate description of the State bracket operator 36 | */ 37 | double& operator[] (const int i); 38 | }; 39 | 40 | 41 | /*! 42 | * \brief Trajectory Class. 43 | * 44 | * A more elaborate description of the Trajectory class 45 | */ 46 | class Trajectory { 47 | 48 | public: 49 | 50 | 51 | /*! 52 | * \brief Trajecotory assignment operator. 53 | * 54 | * A more elaborate description. 55 | */ 56 | Trajectory& operator= (const Trajectory &trajectoryIn); 57 | 58 | /*! 59 | * \brief Returns a reference to the end state of this trajectory. 60 | * 61 | * A more elaborate description. 62 | */ 63 | State& getEndState (); 64 | 65 | /*! 66 | * \brief Returns a reference to the end state of this trajectory (constant). 67 | * 68 | * A more elaborate description. 69 | */ 70 | State& getEndState () const; 71 | 72 | 73 | /*! 74 | * \brief Returns the cost of this trajectory. 75 | * 76 | * A more elaborate description. 77 | */ 78 | double evaluateCost (); 79 | }; 80 | 81 | 82 | /*! 83 | * \brief System Class. 84 | * 85 | * A more elaborate description of the System class 86 | */ 87 | class System { 88 | 89 | public: 90 | 91 | /*! 92 | * \brief Returns the dimensionality of the Euclidean space. 93 | * 94 | * A more elaborate description. 95 | */ 96 | int getNumDimensions (); 97 | 98 | /*! 99 | * \brief Returns a reference to the root state. 100 | * 101 | * A more elaborate description. 102 | */ 103 | State & getRootState (); 104 | 105 | /*! 106 | * \brief Returns the statekey for the given state. 107 | * 108 | * A more elaborate description. 109 | * 110 | * \param stateIn the given state 111 | * \param stateKey the key to the state. An array of dimension getNumDimensions() 112 | * 113 | */ 114 | int getStateKey (State& stateIn, double* stateKey); 115 | 116 | /*! 117 | * \brief Returns true of the given state reaches the target. 118 | * 119 | * A more elaborate description. 120 | */ 121 | bool isReachingTarget (State& stateIn); 122 | 123 | /*! 124 | * \brief Returns a sample state. 125 | * 126 | * A more elaborate description. 127 | * 128 | * \param randomStateOut 129 | * 130 | */ 131 | int sampleState (State& randomStateOut); 132 | 133 | 134 | /*! 135 | * \brief Returns a the cost of the trajectory that connects stateFromIn and 136 | * stateTowardsIn. The trajectory is also returned in trajectoryOut. 137 | * 138 | * A more elaborate description. 139 | * 140 | * \param stateFromIn Initial state 141 | * \param stateTowardsIn Final state 142 | * \param trajectoryOut Trajectory that starts the from the initial state and 143 | * reaches near the final state. 144 | * \param exactConnectionOut Set to true if the initial and the final states 145 | * can be connected exactly. 146 | * 147 | */ 148 | int extendTo (State& stateFromIn, State& stateTowardsIn, 149 | Trajectory& trajectoryOut, bool& exactConnectionOut); 150 | 151 | /*! 152 | * \brief Returns the cost of the trajectory that connects stateFromIn and StateTowardsIn. 153 | * 154 | * A more elaborate description. 155 | * 156 | * \param stateFromIn Initial state 157 | * \param stateTowardsIn Final state 158 | * \param exactConnectionOut Set to true if the initial and the final states 159 | * can be connected exactly. 160 | * 161 | */ 162 | double evaluateExtensionCost (State& stateFromIn, State& stateTowardsIn, bool& exactConnectionOut); 163 | 164 | /*! 165 | * \brief Returns a lower bound on the cost to go starting from stateIn 166 | * 167 | * A more elaborate description. 168 | * 169 | * \param stateIn Starting state 170 | * 171 | */ 172 | double evaluateCostToGo (State& stateIn); 173 | 174 | /*! 175 | * \brief Returns the trajectory as a list of double arrays, each with dimension getNumDimensions. 176 | * 177 | * A more elaborate description. 178 | * 179 | * \param stateFromIn Initial state 180 | * \param stateToIn Final state 181 | * \param trajectoryOut The list of double arrays that represent the trajectory 182 | * 183 | */ 184 | int getTrajectory (State& stateFromIn, State& stateToIn, std::list< double* > & trajectoryOut); 185 | }; 186 | 187 | #endif 188 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | # The main recursive all target 9 | all: 10 | .PHONY : all 11 | 12 | # The main recursive preinstall target 13 | preinstall: 14 | .PHONY : preinstall 15 | 16 | #============================================================================= 17 | # Special targets provided by cmake. 18 | 19 | # Disable implicit rules so canonical targets will work. 20 | .SUFFIXES: 21 | 22 | # Remove some rules from gmake that .SUFFIXES does not remove. 23 | SUFFIXES = 24 | 25 | .SUFFIXES: .hpux_make_needs_suffix_list 26 | 27 | # Suppress display of executed commands. 28 | $(VERBOSE).SILENT: 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | .PHONY : cmake_force 33 | 34 | #============================================================================= 35 | # Set environment variables for the build. 36 | 37 | # The shell in which to execute make rules. 38 | SHELL = /bin/sh 39 | 40 | # The CMake executable. 41 | CMAKE_COMMAND = /usr/bin/cmake 42 | 43 | # The command to remove a file. 44 | RM = /usr/bin/cmake -E remove -f 45 | 46 | # Escaping for special characters. 47 | EQUALS = = 48 | 49 | # The program to use to edit the cache. 50 | CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui 51 | 52 | # The top-level source directory on which CMake was run. 53 | CMAKE_SOURCE_DIR = /home/ahmed/r/rrtstar-standalone 54 | 55 | # The top-level build directory on which CMake was run. 56 | CMAKE_BINARY_DIR = /home/ahmed/r/rrtstar-standalone/pod-build 57 | 58 | #============================================================================= 59 | # Target rules for target CMakeFiles/tmp.dir 60 | 61 | # All Build rule for target. 62 | CMakeFiles/tmp.dir/all: 63 | $(MAKE) -f CMakeFiles/tmp.dir/build.make CMakeFiles/tmp.dir/depend 64 | $(MAKE) -f CMakeFiles/tmp.dir/build.make CMakeFiles/tmp.dir/build 65 | $(CMAKE_COMMAND) -E cmake_progress_report /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 66 | @echo "Built target tmp" 67 | .PHONY : CMakeFiles/tmp.dir/all 68 | 69 | # Build rule for subdir invocation for target. 70 | CMakeFiles/tmp.dir/rule: cmake_check_build_system 71 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 0 72 | $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/tmp.dir/all 73 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 0 74 | .PHONY : CMakeFiles/tmp.dir/rule 75 | 76 | # Convenience name for target. 77 | tmp: CMakeFiles/tmp.dir/rule 78 | .PHONY : tmp 79 | 80 | # clean rule for target. 81 | CMakeFiles/tmp.dir/clean: 82 | $(MAKE) -f CMakeFiles/tmp.dir/build.make CMakeFiles/tmp.dir/clean 83 | .PHONY : CMakeFiles/tmp.dir/clean 84 | 85 | # clean rule for target. 86 | clean: CMakeFiles/tmp.dir/clean 87 | .PHONY : clean 88 | 89 | #============================================================================= 90 | # Directory level rules for directory src 91 | 92 | # Convenience name for "all" pass in the directory. 93 | src/all: src/CMakeFiles/rrtstar.dir/all 94 | .PHONY : src/all 95 | 96 | # Convenience name for "clean" pass in the directory. 97 | src/clean: src/CMakeFiles/rrtstar.dir/clean 98 | .PHONY : src/clean 99 | 100 | # Convenience name for "preinstall" pass in the directory. 101 | src/preinstall: 102 | .PHONY : src/preinstall 103 | 104 | #============================================================================= 105 | # Target rules for target src/CMakeFiles/rrtstar.dir 106 | 107 | # All Build rule for target. 108 | src/CMakeFiles/rrtstar.dir/all: 109 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/depend 110 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/build 111 | $(CMAKE_COMMAND) -E cmake_progress_report /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 1 2 3 112 | @echo "Built target rrtstar" 113 | .PHONY : src/CMakeFiles/rrtstar.dir/all 114 | 115 | # Include target in all. 116 | all: src/CMakeFiles/rrtstar.dir/all 117 | .PHONY : all 118 | 119 | # Build rule for subdir invocation for target. 120 | src/CMakeFiles/rrtstar.dir/rule: cmake_check_build_system 121 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 3 122 | $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/rrtstar.dir/all 123 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 0 124 | .PHONY : src/CMakeFiles/rrtstar.dir/rule 125 | 126 | # Convenience name for target. 127 | rrtstar: src/CMakeFiles/rrtstar.dir/rule 128 | .PHONY : rrtstar 129 | 130 | # clean rule for target. 131 | src/CMakeFiles/rrtstar.dir/clean: 132 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/clean 133 | .PHONY : src/CMakeFiles/rrtstar.dir/clean 134 | 135 | # clean rule for target. 136 | clean: src/CMakeFiles/rrtstar.dir/clean 137 | .PHONY : clean 138 | 139 | #============================================================================= 140 | # Special targets to cleanup operation of make. 141 | 142 | # Special rule to run CMake to check the build system integrity. 143 | # No rule that depends on this can have commands that come from listfiles 144 | # because they might be regenerated. 145 | cmake_check_build_system: 146 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 147 | .PHONY : cmake_check_build_system 148 | 149 | -------------------------------------------------------------------------------- /viewer/src/renderers/graph_renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "graph_renderer.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #define RENDERER_NAME "Graph Visualizer" 9 | 10 | using namespace std; 11 | 12 | 13 | class RendererGraph { 14 | public: 15 | BotRenderer renderer; 16 | BotGtkParamWidget *pw; 17 | BotViewer *viewer; 18 | lcm_t * lcm; 19 | 20 | lcmtypes_graph_t *graph_last; 21 | lcmtypes_environment_t *environment_last; 22 | 23 | double obstacle_opacity; 24 | }; 25 | 26 | 27 | 28 | static void graph_message_handler (const lcm_recv_buf_t *rbuf, const char *channel, const lcmtypes_graph_t *msg, void *user) { 29 | 30 | RendererGraph *self = (RendererGraph *) user; 31 | 32 | if (self->graph_last) 33 | lcmtypes_graph_t_destroy (self->graph_last); 34 | 35 | self->graph_last = lcmtypes_graph_t_copy (msg); 36 | 37 | bot_viewer_request_redraw (self->viewer); 38 | } 39 | 40 | 41 | static void environment_message_handler (const lcm_recv_buf_t *rbuf, const char *channel, const lcmtypes_environment_t *msg, void *user) { 42 | 43 | RendererGraph *self = (RendererGraph *) user; 44 | 45 | if (self->environment_last) 46 | lcmtypes_environment_t_destroy (self->environment_last); 47 | 48 | self->environment_last = lcmtypes_environment_t_copy (msg); 49 | 50 | bot_viewer_request_redraw (self->viewer); 51 | } 52 | 53 | 54 | static void renderer_graph_draw(BotViewer *viewer, BotRenderer *renderer) 55 | { 56 | 57 | RendererGraph *self = (RendererGraph*) renderer; 58 | 59 | 60 | glEnable(GL_DEPTH_TEST); 61 | 62 | glEnable (GL_BLEND); 63 | glEnable (GL_RESCALE_NORMAL); 64 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 65 | glShadeModel (GL_SMOOTH); 66 | glEnable (GL_LIGHTING); 67 | 68 | 69 | // Draw the graph 70 | if (self->graph_last) { 71 | 72 | // Draw the vertices 73 | glPointSize (3.0); 74 | float color_vertex[] = {0.1, 0.1, 0.8, 1.0}; 75 | glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color_vertex); 76 | glBegin (GL_POINTS); 77 | 78 | for (int i = 0; i < self->graph_last->num_vertices; i++) { 79 | 80 | glVertex3f (self->graph_last->vertices[i].state.x, 81 | self->graph_last->vertices[i].state.y, 82 | self->graph_last->vertices[i].state.z); 83 | } 84 | 85 | glEnd(); 86 | 87 | 88 | // Draw the edges 89 | for (int i = 0; i < self->graph_last->num_edges; i++) { 90 | 91 | glLineWidth (2.0); 92 | float color_edge[] = {0.8, 0.3, 0.3, 1.0}; 93 | glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color_edge); 94 | glBegin (GL_LINE_STRIP); 95 | 96 | glVertex3f (self->graph_last->edges[i].vertex_src.state.x, 97 | self->graph_last->edges[i].vertex_src.state.y, 98 | self->graph_last->edges[i].vertex_src.state.z); 99 | glVertex3f (self->graph_last->edges[i].vertex_dst.state.x, 100 | self->graph_last->edges[i].vertex_dst.state.y, 101 | self->graph_last->edges[i].vertex_dst.state.z); 102 | glEnd(); 103 | } 104 | } 105 | 106 | 107 | // Draw the environment 108 | if (self->environment_last) { 109 | 110 | // Draw the goal region 111 | 112 | 113 | // Draw the obstacles 114 | for (int i = 0; i < self->environment_last->num_obstacles; i++) { 115 | 116 | float color_obstacles[] = { 0.3, 0, 0, ((double)(self->obstacle_opacity))/100.0}; 117 | glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color_obstacles); 118 | 119 | 120 | glPushMatrix (); 121 | 122 | glTranslated (self->environment_last->obstacles[i].center[0], self->environment_last->obstacles[i].center[1], self->environment_last->obstacles[i].center[2]); 123 | glRotatef (0.0, 0.0, 0.0, 1.0); 124 | 125 | glScalef (self->environment_last->obstacles[i].size[0], self->environment_last->obstacles[i].size[1], self->environment_last->obstacles[i].size[2]); 126 | 127 | bot_gl_draw_cube (); 128 | 129 | glPopMatrix (); 130 | } 131 | } 132 | 133 | 134 | return; 135 | } 136 | 137 | 138 | static void renderer_graph_free (BotRenderer *renderer) 139 | { 140 | RendererGraph *self = (RendererGraph*) renderer; 141 | 142 | if (self->graph_last) 143 | lcmtypes_graph_t_destroy (self->graph_last); 144 | free(self); 145 | } 146 | 147 | 148 | void add_graph_renderer_to_viewer (BotViewer* viewer, int render_priority, lcm_t* lcm) 149 | { 150 | 151 | RendererGraph *self = new RendererGraph; 152 | BotRenderer *renderer = &self->renderer; 153 | self->lcm = lcm; 154 | self->viewer = viewer; 155 | 156 | renderer->draw = renderer_graph_draw; 157 | renderer->destroy = renderer_graph_free; 158 | renderer->widget = gtk_vbox_new(FALSE, 0); 159 | renderer->name = (char *) RENDERER_NAME; 160 | renderer->user = self; 161 | renderer->enabled = 1; 162 | 163 | 164 | self->graph_last = NULL; 165 | self->environment_last = NULL; 166 | 167 | self->obstacle_opacity = 50; 168 | 169 | // subscribe to messages 170 | lcmtypes_graph_t_subscribe (lcm, "GRAPH", graph_message_handler, self); 171 | lcmtypes_environment_t_subscribe (lcm, "ENVIRONMENT", environment_message_handler, self); 172 | 173 | bot_viewer_add_renderer(viewer, &self->renderer, render_priority); 174 | } -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | # Remove some rules from gmake that .SUFFIXES does not remove. 15 | SUFFIXES = 16 | 17 | .SUFFIXES: .hpux_make_needs_suffix_list 18 | 19 | # Suppress display of executed commands. 20 | $(VERBOSE).SILENT: 21 | 22 | # A target that is always out of date. 23 | cmake_force: 24 | .PHONY : cmake_force 25 | 26 | #============================================================================= 27 | # Set environment variables for the build. 28 | 29 | # The shell in which to execute make rules. 30 | SHELL = /bin/sh 31 | 32 | # The CMake executable. 33 | CMAKE_COMMAND = /usr/bin/cmake 34 | 35 | # The command to remove a file. 36 | RM = /usr/bin/cmake -E remove -f 37 | 38 | # Escaping for special characters. 39 | EQUALS = = 40 | 41 | # The program to use to edit the cache. 42 | CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui 43 | 44 | # The top-level source directory on which CMake was run. 45 | CMAKE_SOURCE_DIR = /home/ahmed/r/rrtstar-standalone 46 | 47 | # The top-level build directory on which CMake was run. 48 | CMAKE_BINARY_DIR = /home/ahmed/r/rrtstar-standalone/pod-build 49 | 50 | #============================================================================= 51 | # Targets provided globally by CMake. 52 | 53 | # Special rule for the target edit_cache 54 | edit_cache: 55 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." 56 | /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 57 | .PHONY : edit_cache 58 | 59 | # Special rule for the target edit_cache 60 | edit_cache/fast: edit_cache 61 | .PHONY : edit_cache/fast 62 | 63 | # Special rule for the target install 64 | install: preinstall 65 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 66 | /usr/bin/cmake -P cmake_install.cmake 67 | .PHONY : install 68 | 69 | # Special rule for the target install 70 | install/fast: preinstall/fast 71 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 72 | /usr/bin/cmake -P cmake_install.cmake 73 | .PHONY : install/fast 74 | 75 | # Special rule for the target install/local 76 | install/local: preinstall 77 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." 78 | /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake 79 | .PHONY : install/local 80 | 81 | # Special rule for the target install/local 82 | install/local/fast: install/local 83 | .PHONY : install/local/fast 84 | 85 | # Special rule for the target install/strip 86 | install/strip: preinstall 87 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." 88 | /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake 89 | .PHONY : install/strip 90 | 91 | # Special rule for the target install/strip 92 | install/strip/fast: install/strip 93 | .PHONY : install/strip/fast 94 | 95 | # Special rule for the target list_install_components 96 | list_install_components: 97 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" 98 | .PHONY : list_install_components 99 | 100 | # Special rule for the target list_install_components 101 | list_install_components/fast: list_install_components 102 | .PHONY : list_install_components/fast 103 | 104 | # Special rule for the target rebuild_cache 105 | rebuild_cache: 106 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 107 | /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 108 | .PHONY : rebuild_cache 109 | 110 | # Special rule for the target rebuild_cache 111 | rebuild_cache/fast: rebuild_cache 112 | .PHONY : rebuild_cache/fast 113 | 114 | # The main all target 115 | all: cmake_check_build_system 116 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles/progress.marks 117 | $(MAKE) -f CMakeFiles/Makefile2 all 118 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 0 119 | .PHONY : all 120 | 121 | # The main clean target 122 | clean: 123 | $(MAKE) -f CMakeFiles/Makefile2 clean 124 | .PHONY : clean 125 | 126 | # The main clean target 127 | clean/fast: clean 128 | .PHONY : clean/fast 129 | 130 | # Prepare targets for installation. 131 | preinstall: all 132 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 133 | .PHONY : preinstall 134 | 135 | # Prepare targets for installation. 136 | preinstall/fast: 137 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 138 | .PHONY : preinstall/fast 139 | 140 | # clear depends 141 | depend: 142 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 143 | .PHONY : depend 144 | 145 | #============================================================================= 146 | # Target rules for targets named tmp 147 | 148 | # Build rule for target. 149 | tmp: cmake_check_build_system 150 | $(MAKE) -f CMakeFiles/Makefile2 tmp 151 | .PHONY : tmp 152 | 153 | # fast build rule for target. 154 | tmp/fast: 155 | $(MAKE) -f CMakeFiles/tmp.dir/build.make CMakeFiles/tmp.dir/build 156 | .PHONY : tmp/fast 157 | 158 | #============================================================================= 159 | # Target rules for targets named rrtstar 160 | 161 | # Build rule for target. 162 | rrtstar: cmake_check_build_system 163 | $(MAKE) -f CMakeFiles/Makefile2 rrtstar 164 | .PHONY : rrtstar 165 | 166 | # fast build rule for target. 167 | rrtstar/fast: 168 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/build 169 | .PHONY : rrtstar/fast 170 | 171 | # Help Target 172 | help: 173 | @echo "The following are some of the valid targets for this Makefile:" 174 | @echo "... all (the default if no target is provided)" 175 | @echo "... clean" 176 | @echo "... depend" 177 | @echo "... edit_cache" 178 | @echo "... install" 179 | @echo "... install/local" 180 | @echo "... install/strip" 181 | @echo "... list_install_components" 182 | @echo "... rebuild_cache" 183 | @echo "... tmp" 184 | @echo "... rrtstar" 185 | .PHONY : help 186 | 187 | 188 | 189 | #============================================================================= 190 | # Special targets to cleanup operation of make. 191 | 192 | # Special rule to run CMake to check the build system integrity. 193 | # No rule that depends on this can have commands that come from listfiles 194 | # because they might be regenerated. 195 | cmake_check_build_system: 196 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 197 | .PHONY : cmake_check_build_system 198 | 199 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/rrts.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file rrts.h 3 | */ 4 | 5 | #ifndef __RRTS_H_ 6 | #define __RRTS_H_ 7 | 8 | 9 | #include "kdtree.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | 17 | namespace RRTstar { 18 | 19 | 20 | template 21 | class Planner; 22 | 23 | 24 | /*! 25 | * \brief RRT* Vertex class 26 | * 27 | * More elaborate description 28 | */ 29 | template 30 | class Vertex { 31 | 32 | Vertex *parent; 33 | State *state; 34 | std::set children; 35 | double costFromParent; 36 | double costFromRoot; 37 | Trajectory *trajFromParent; 38 | 39 | 40 | public: 41 | 42 | /*! 43 | * \brief Vertex constructor 44 | * 45 | * More elaborate description 46 | */ 47 | Vertex (); 48 | 49 | /*! 50 | * \brief Vertex destructor 51 | * 52 | * More elaborate description 53 | */ 54 | ~Vertex (); 55 | 56 | /*! 57 | * \brief Vertex copy constructor 58 | * 59 | * More elaborate description 60 | * 61 | * \param vertexIn A reference to the vertex to be copied. 62 | * 63 | */ 64 | Vertex (const Vertex &vertexIn); 65 | 66 | /*! 67 | * \brief Returns a reference to the state 68 | * 69 | * More elaborate description 70 | */ 71 | State& getState () {return *state;} 72 | 73 | /*! 74 | * \brief Returns a reference to the state (constant) 75 | * 76 | * More elaborate description 77 | */ 78 | State& getState () const {return *state;} 79 | 80 | /*! 81 | * \brief Returns a reference to the parent vertex 82 | * 83 | * More elaborate description 84 | */ 85 | Vertex& getParent () {return *parent;} 86 | 87 | /*! 88 | * \brief Returns the accumulated cost at this vertex 89 | * 90 | * More elaborate description 91 | */ 92 | double getCost () {return costFromRoot;} 93 | 94 | friend class Planner; 95 | }; 96 | 97 | 98 | /*! 99 | * \brief RRT* Planner class 100 | * 101 | * More elaborate description 102 | */ 103 | template 104 | class Planner { 105 | 106 | 107 | typedef struct kdtree KdTree; 108 | typedef struct kdres KdRes; 109 | typedef Vertex vertex_t; 110 | 111 | int numDimensions; 112 | 113 | 114 | double gamma; 115 | 116 | 117 | double lowerBoundCost; 118 | vertex_t *lowerBoundVertex; 119 | KdTree *kdtree; 120 | 121 | vertex_t *root; 122 | 123 | int insertIntoKdtree (vertex_t &vertexIn); 124 | 125 | int getNearestVertex (State& stateIn, vertex_t*& vertexPointerOut); 126 | int getNearVertices (State& stateIn, std::vector& vectorNearVerticesOut); 127 | 128 | int checkUpdateBestVertex (vertex_t& vertexIn); 129 | 130 | vertex_t* insertTrajectory (vertex_t& vertexStartIn, Trajectory& trajectoryIn); 131 | int insertTrajectory (vertex_t& vertexStartIn, Trajectory& trajectoryIn, vertex_t& vertexEndIn); 132 | 133 | int findBestParent (State& stateIn, std::vector& vectorNearVerticesIn, 134 | vertex_t*& vertexBestOut, Trajectory& trajectoryOut, bool& exactConnection); 135 | 136 | int updateBranchCost (vertex_t& vertexIn, int depth); 137 | int rewireVertices (vertex_t& vertexNew, std::vector& vectorNearVertices); 138 | 139 | 140 | public: 141 | 142 | /*! 143 | * \brief A list of all the vertices 144 | * 145 | * More elaborate description 146 | */ 147 | std::list listVertices; 148 | 149 | 150 | /*! 151 | * \brief Number of vertices in the list 152 | * 153 | * More elaborate description 154 | */ 155 | int numVertices; 156 | 157 | 158 | /*! 159 | * \brief A pointer to the system class 160 | * 161 | * More elaborate description 162 | */ 163 | System *system; 164 | 165 | 166 | /*! 167 | * \brief Planner constructor 168 | * 169 | * More elaborate description 170 | */ 171 | Planner (); 172 | 173 | 174 | /*! 175 | * \brief Planner destructor 176 | * 177 | * More elaborate description 178 | */ 179 | ~Planner (); 180 | 181 | 182 | /*! 183 | * \brief Sets the gamma constant of the RRT* 184 | * 185 | * More elaborate description 186 | * 187 | * \param gammaIn The new value of the gamma parameter 188 | * 189 | */ 190 | int setGamma (double gammaIn); 191 | 192 | 193 | /*! 194 | * \brief Sets the dynamical system used in the RRT* trajectory generation 195 | * 196 | * More elaborate description 197 | * 198 | * \param system A reference to the new dynamical system 199 | * 200 | */ 201 | int setSystem (System& system); 202 | 203 | 204 | /*! 205 | * \brief Returns a reference to the root vertex 206 | * 207 | * More elaborate description 208 | */ 209 | vertex_t& getRootVertex (); 210 | 211 | 212 | /*! 213 | * \brief Initializes the RRT* algorithm 214 | * 215 | * More elaborate description 216 | */ 217 | int initialize (); 218 | 219 | /*! 220 | * \brief Executes one iteration of the RRT* algorithm 221 | * 222 | * More elaborate description 223 | */ 224 | int iteration (); 225 | 226 | /*! 227 | * \brief Returns the cost of the best vertex in the RRT* 228 | * 229 | * More elaborate description 230 | */ 231 | double getBestVertexCost () {return lowerBoundCost;} 232 | 233 | /*! 234 | * \brief Returns a reference to the best vertex in the RRT* 235 | * 236 | * More elaborate description 237 | */ 238 | vertex_t& getBestVertex () {return *lowerBoundVertex;} 239 | 240 | /*! 241 | * \brief Returns the best trajectory as a list of double arrays 242 | * 243 | * More elaborate description 244 | * 245 | * \param trajectory The trajectory that contains the best trajectory as a 246 | * list of double arrays of dimension system->getNumDimensions() 247 | * 248 | * 249 | */ 250 | int getBestTrajectory (std::list& trajectory); 251 | }; 252 | 253 | } 254 | 255 | #endif 256 | -------------------------------------------------------------------------------- /rrtstar/src/rrts.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file rrts.h 3 | */ 4 | 5 | #ifndef __RRTS_H_ 6 | #define __RRTS_H_ 7 | 8 | 9 | #include "kdtree.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | 17 | namespace RRTstar { 18 | 19 | 20 | template 21 | class Planner; 22 | 23 | 24 | /*! 25 | * \brief RRT* Vertex class 26 | * 27 | * More elaborate description 28 | */ 29 | template 30 | class Vertex { 31 | 32 | Vertex *parent; 33 | State *state; 34 | std::set children; 35 | double costFromParent; 36 | double costFromRoot; 37 | Trajectory *trajFromParent; 38 | 39 | 40 | public: 41 | 42 | /*! 43 | * \brief Vertex constructor 44 | * 45 | * More elaborate description 46 | */ 47 | Vertex (); 48 | 49 | /*! 50 | * \brief Vertex destructor 51 | * 52 | * More elaborate description 53 | */ 54 | ~Vertex (); 55 | 56 | /*! 57 | * \brief Vertex copy constructor 58 | * 59 | * More elaborate description 60 | * 61 | * \param vertexIn A reference to the vertex to be copied. 62 | * 63 | */ 64 | Vertex (const Vertex &vertexIn); // copy constructor 65 | 66 | /*! 67 | * \brief Returns a reference to the state 68 | * 69 | * More elaborate description 70 | */ 71 | State& getState () {return *state;} // Returns a reference to the state of the vertex? 72 | 73 | /*! 74 | * \brief Returns a reference to the state (constant) 75 | * 76 | * More elaborate description 77 | */ 78 | State& getState () const {return *state;} //Returns a reference to the state (constant) 79 | 80 | /*! 81 | * \brief Returns a reference to the parent vertex 82 | * 83 | * More elaborate description 84 | */ 85 | Vertex& getParent () {return *parent;} //Returns a reference to the parent vertex 86 | 87 | /*! 88 | * \brief Returns the accumulated cost at this vertex 89 | * 90 | * More elaborate description 91 | */ 92 | double getCost () {return costFromRoot;} //Returns the accumulated cost at this vertex 93 | 94 | friend class Planner; // Friend Class Planner!!! 95 | }; 96 | 97 | 98 | /*! 99 | * \brief RRT* Planner class 100 | * 101 | * More elaborate description 102 | */ 103 | template 104 | class Planner { 105 | 106 | 107 | typedef struct kdtree KdTree; 108 | typedef struct kdres KdRes; 109 | typedef Vertex vertex_t; 110 | 111 | int numDimensions; 112 | 113 | 114 | double gamma; 115 | 116 | 117 | double lowerBoundCost; 118 | vertex_t *lowerBoundVertex; 119 | KdTree *kdtree; 120 | 121 | vertex_t *root; 122 | 123 | int insertIntoKdtree (vertex_t &vertexIn); 124 | 125 | int getNearestVertex (State& stateIn, vertex_t*& vertexPointerOut); 126 | int getNearVertices (State& stateIn, std::vector& vectorNearVerticesOut); 127 | 128 | int checkUpdateBestVertex (vertex_t& vertexIn); 129 | 130 | vertex_t* insertTrajectory (vertex_t& vertexStartIn, Trajectory& trajectoryIn); 131 | int insertTrajectory (vertex_t& vertexStartIn, Trajectory& trajectoryIn, vertex_t& vertexEndIn); 132 | 133 | int findBestParent (State& stateIn, std::vector& vectorNearVerticesIn, 134 | vertex_t*& vertexBestOut, Trajectory& trajectoryOut, bool& exactConnection); 135 | 136 | int updateBranchCost (vertex_t& vertexIn, int depth); 137 | int rewireVertices (vertex_t& vertexNew, std::vector& vectorNearVertices); 138 | 139 | 140 | public: 141 | 142 | /*! 143 | * \brief A list of all the vertices 144 | * 145 | * More elaborate description 146 | */ 147 | std::list listVertices; 148 | 149 | 150 | /*! 151 | * \brief Number of vertices in the list 152 | * 153 | * More elaborate description 154 | */ 155 | int numVertices; 156 | 157 | 158 | /*! 159 | * \brief A pointer to the system class 160 | * 161 | * More elaborate description 162 | */ 163 | System *system; 164 | 165 | 166 | /*! 167 | * \brief Planner constructor 168 | * 169 | * More elaborate description 170 | */ 171 | Planner (); 172 | 173 | 174 | /*! 175 | * \brief Planner destructor 176 | * 177 | * More elaborate description 178 | */ 179 | ~Planner (); 180 | 181 | 182 | /*! 183 | * \brief Sets the gamma constant of the RRT* 184 | * 185 | * More elaborate description 186 | * 187 | * \param gammaIn The new value of the gamma parameter 188 | * 189 | */ 190 | int setGamma (double gammaIn); 191 | 192 | 193 | /*! 194 | * \brief Sets the dynamical system used in the RRT* trajectory generation 195 | * 196 | * More elaborate description 197 | * 198 | * \param system A reference to the new dynamical system 199 | * 200 | */ 201 | int setSystem (System& system); 202 | 203 | 204 | /*! 205 | * \brief Returns a reference to the root vertex 206 | * 207 | * More elaborate description 208 | */ 209 | vertex_t& getRootVertex (); 210 | 211 | 212 | /*! 213 | * \brief Initializes the RRT* algorithm 214 | * 215 | * More elaborate description 216 | */ 217 | int initialize (); 218 | 219 | /*! 220 | * \brief Executes one iteration of the RRT* algorithm 221 | * 222 | * More elaborate description 223 | */ 224 | int iteration (); 225 | 226 | /*! 227 | * \brief Returns the cost of the best vertex in the RRT* 228 | * 229 | * More elaborate description 230 | */ 231 | double getBestVertexCost () {return lowerBoundCost;} 232 | 233 | /*! 234 | * \brief Returns a reference to the best vertex in the RRT* 235 | * 236 | * More elaborate description 237 | */ 238 | vertex_t& getBestVertex () {return *lowerBoundVertex;} 239 | 240 | /*! 241 | * \brief Returns the best trajectory as a list of double arrays 242 | * 243 | * More elaborate description 244 | * 245 | * \param trajectory The trajectory that contains the best trajectory as a 246 | * list of double arrays of dimension system->getNumDimensions() 247 | * 248 | * 249 | */ 250 | int getBestTrajectory (std::list& trajectory); 251 | }; 252 | 253 | } 254 | 255 | #endif 256 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/system_single_integrator.cpp: -------------------------------------------------------------------------------- 1 | #include "system_single_integrator.h" 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | using namespace std; 8 | using namespace SingleIntegrator; 9 | 10 | #define DISCRETIZATION_STEP 0.01 11 | 12 | 13 | region::region () { 14 | 15 | numDimensions = 0; 16 | 17 | center = NULL; 18 | size = NULL; 19 | } 20 | 21 | 22 | region::~region () { 23 | 24 | if (center) 25 | delete [] center; 26 | if (size) 27 | delete [] size; 28 | 29 | } 30 | 31 | 32 | int region::setNumDimensions (int numDimensionsIn) { 33 | 34 | numDimensions = numDimensionsIn; 35 | 36 | if (center) 37 | delete [] center; 38 | center = new double[numDimensions]; 39 | 40 | if (size) 41 | delete [] size; 42 | size = new double[numDimensions]; 43 | 44 | return 1; 45 | 46 | } 47 | 48 | 49 | State::State () { 50 | 51 | numDimensions = 0; 52 | 53 | x = NULL; 54 | } 55 | 56 | 57 | State::~State () { 58 | 59 | if (x) 60 | delete [] x; 61 | } 62 | 63 | 64 | State::State (const State &stateIn) { 65 | 66 | numDimensions = stateIn.numDimensions; 67 | 68 | if (numDimensions > 0) { 69 | x = new double[numDimensions]; 70 | 71 | for (int i = 0; i < numDimensions; i++) 72 | x[i] = stateIn.x[i]; 73 | } 74 | else { 75 | x = NULL; 76 | } 77 | } 78 | 79 | 80 | State& State::operator=(const State &stateIn){ 81 | 82 | if (this == &stateIn) 83 | return *this; 84 | 85 | if (numDimensions != stateIn.numDimensions) { 86 | if (x) 87 | delete [] x; 88 | numDimensions = stateIn.numDimensions; 89 | if (numDimensions > 0) 90 | x = new double[numDimensions]; 91 | } 92 | 93 | for (int i = 0; i < numDimensions; i++) 94 | x[i] = stateIn.x[i]; 95 | 96 | return *this; 97 | } 98 | 99 | 100 | int State::setNumDimensions (int numDimensionsIn) { 101 | 102 | if (x) 103 | delete [] x; 104 | 105 | if (numDimensions < 0) 106 | return 0; 107 | 108 | numDimensions = numDimensionsIn; 109 | 110 | if (numDimensions > 0) 111 | x = new double[numDimensions]; 112 | 113 | return 1; 114 | } 115 | 116 | 117 | Trajectory::Trajectory () { 118 | 119 | endState = NULL; 120 | } 121 | 122 | 123 | Trajectory::~Trajectory () { 124 | 125 | if (endState) 126 | delete endState; 127 | } 128 | 129 | 130 | Trajectory::Trajectory (const Trajectory &trajectoryIn) { 131 | 132 | endState = new State (trajectoryIn.getEndState()); 133 | 134 | } 135 | 136 | 137 | Trajectory& Trajectory::operator=(const Trajectory &trajectoryIn) { 138 | 139 | if (this == &trajectoryIn) 140 | return *this; 141 | 142 | if (endState) 143 | delete endState; 144 | 145 | 146 | endState = new State (trajectoryIn.getEndState()); 147 | 148 | totalVariation = trajectoryIn.totalVariation; 149 | 150 | return *this; 151 | } 152 | 153 | 154 | double Trajectory::evaluateCost () { 155 | 156 | return totalVariation; 157 | } 158 | 159 | 160 | System::System () { 161 | 162 | numDimensions = 0; 163 | } 164 | 165 | 166 | System::~System () { 167 | 168 | } 169 | 170 | 171 | int System::setNumDimensions (int numDimensionsIn) { 172 | 173 | if (numDimensions < 0) 174 | return 0; 175 | 176 | numDimensions = numDimensionsIn; 177 | 178 | rootState.setNumDimensions (numDimensions); 179 | 180 | return 1; 181 | } 182 | 183 | 184 | int System::getStateKey (State& stateIn, double* stateKey) { 185 | 186 | for (int i = 0; i < numDimensions; i++) 187 | stateKey[i] = stateIn.x[i] / regionOperating.size[i]; 188 | 189 | return 1; 190 | } 191 | 192 | 193 | 194 | bool System::isReachingTarget (State &stateIn) { 195 | 196 | 197 | for (int i = 0; i < numDimensions; i++) { 198 | 199 | if (fabs(stateIn.x[i] - regionGoal.center[i]) > regionGoal.size[i]/2.0 ) 200 | return false; 201 | } 202 | 203 | return true; 204 | } 205 | 206 | 207 | bool System::IsInCollision (double *stateIn) { 208 | 209 | for (list::iterator iter = obstacles.begin(); iter != obstacles.end(); iter++) { 210 | 211 | region *obstacleCurr = *iter; 212 | bool collisionFound = true; 213 | 214 | for (int i = 0; i < numDimensions; i++) 215 | if (fabs(obstacleCurr->center[i] - stateIn[i]) > obstacleCurr->size[i]/2.0 ) { 216 | collisionFound = false; 217 | break; 218 | } 219 | 220 | if (collisionFound) { 221 | return true; 222 | } 223 | } 224 | 225 | return false; 226 | } 227 | 228 | 229 | int System::sampleState (State &randomStateOut) { 230 | 231 | randomStateOut.setNumDimensions (numDimensions); 232 | 233 | for (int i = 0; i < numDimensions; i++) { 234 | 235 | randomStateOut.x[i] = (double)rand()/(RAND_MAX + 1.0)*regionOperating.size[i] 236 | - regionOperating.size[i]/2.0 + regionOperating.center[i]; 237 | } 238 | 239 | if (IsInCollision (randomStateOut.x)) 240 | return 0; 241 | 242 | return 1; 243 | } 244 | 245 | 246 | 247 | int System::extendTo (State &stateFromIn, State &stateTowardsIn, Trajectory &trajectoryOut, bool &exactConnectionOut) { 248 | 249 | double *dists = new double[numDimensions]; 250 | for (int i = 0; i < numDimensions; i++) 251 | dists[i] = stateTowardsIn.x[i] - stateFromIn.x[i]; 252 | 253 | double distTotal = 0.0; 254 | for (int i = 0; i < numDimensions; i++) 255 | distTotal += dists[i]*dists[i]; 256 | distTotal = sqrt (distTotal); 257 | 258 | double incrementTotal = distTotal/DISCRETIZATION_STEP; 259 | 260 | // normalize the distance according to the disretization step 261 | for (int i = 0; i < numDimensions; i++) 262 | dists[i] /= incrementTotal; 263 | 264 | int numSegments = (int)floor(incrementTotal); 265 | 266 | double *stateCurr = new double[numDimensions]; 267 | for (int i = 0; i < numDimensions; i++) 268 | stateCurr[i] = stateFromIn.x[i]; 269 | 270 | for (int i = 0; i < numSegments; i++) { 271 | 272 | if (IsInCollision (stateCurr)) 273 | return 0; 274 | 275 | for (int i = 0; i < numDimensions; i++) 276 | stateCurr[i] += dists[i]; 277 | } 278 | 279 | if (IsInCollision (stateTowardsIn.x)) 280 | return 0; 281 | 282 | trajectoryOut.endState = new State (stateTowardsIn); 283 | trajectoryOut.totalVariation = distTotal; 284 | 285 | delete [] dists; 286 | delete [] stateCurr; 287 | 288 | exactConnectionOut = true; 289 | 290 | return 1; 291 | } 292 | 293 | 294 | double System::evaluateExtensionCost (State& stateFromIn, State& stateTowardsIn, bool &exactConnectionOut) { 295 | 296 | 297 | exactConnectionOut = true; 298 | 299 | double distTotal = 0.0; 300 | for (int i = 0; i < numDimensions; i++) { 301 | double distCurr = stateTowardsIn.x[i] - stateFromIn.x[i]; 302 | distTotal += distCurr*distCurr; 303 | } 304 | 305 | return sqrt(distTotal); 306 | 307 | } 308 | 309 | 310 | int System::getTrajectory (State& stateFromIn, State& stateToIn, list& trajectoryOut) { 311 | 312 | double *stateArr = new double[numDimensions]; 313 | for (int i = 0; i < numDimensions; i++) 314 | stateArr[i] = stateToIn[i]; 315 | trajectoryOut.push_front (stateArr); 316 | 317 | return 1; 318 | 319 | } 320 | 321 | 322 | double System::evaluateCostToGo (State& stateIn) { 323 | 324 | double radius = 0.0; 325 | for (int i = 0; i < numDimensions; i++) 326 | radius += regionGoal.size[i] * regionGoal.size[i]; 327 | radius = sqrt(radius); 328 | 329 | double dist = 0.0; 330 | for (int i = 0; i < numDimensions; i++) 331 | dist += (stateIn[i] - regionGoal.center[i])*(stateIn[0] - regionGoal.center[i]); 332 | dist = sqrt(dist); 333 | 334 | return dist - radius; 335 | } 336 | -------------------------------------------------------------------------------- /rrtstar/src/system_single_integrator.cpp: -------------------------------------------------------------------------------- 1 | #include "system_single_integrator.h" 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | using namespace std; 8 | using namespace SingleIntegrator; 9 | 10 | #define DISCRETIZATION_STEP 0.01 11 | 12 | 13 | region::region () { 14 | 15 | numDimensions = 0; 16 | 17 | center = NULL; 18 | size = NULL; 19 | } 20 | 21 | 22 | region::~region () { 23 | 24 | if (center) 25 | delete [] center; 26 | if (size) 27 | delete [] size; 28 | 29 | } 30 | 31 | 32 | int region::setNumDimensions (int numDimensionsIn) { 33 | 34 | numDimensions = numDimensionsIn; 35 | 36 | if (center) 37 | delete [] center; 38 | center = new double[numDimensions]; 39 | 40 | if (size) 41 | delete [] size; 42 | size = new double[numDimensions]; 43 | 44 | return 1; 45 | 46 | } 47 | 48 | 49 | State::State () { 50 | 51 | numDimensions = 0; 52 | 53 | x = NULL; 54 | } 55 | 56 | 57 | State::~State () { 58 | 59 | if (x) 60 | delete [] x; 61 | } 62 | 63 | 64 | State::State (const State &stateIn) { 65 | 66 | numDimensions = stateIn.numDimensions; 67 | 68 | if (numDimensions > 0) { 69 | x = new double[numDimensions]; 70 | 71 | for (int i = 0; i < numDimensions; i++) 72 | x[i] = stateIn.x[i]; 73 | } 74 | else { 75 | x = NULL; 76 | } 77 | } 78 | 79 | 80 | State& State::operator=(const State &stateIn){ 81 | 82 | if (this == &stateIn) 83 | return *this; 84 | 85 | if (numDimensions != stateIn.numDimensions) { 86 | if (x) 87 | delete [] x; 88 | numDimensions = stateIn.numDimensions; 89 | if (numDimensions > 0) 90 | x = new double[numDimensions]; 91 | } 92 | 93 | for (int i = 0; i < numDimensions; i++) 94 | x[i] = stateIn.x[i]; 95 | 96 | return *this; 97 | } 98 | 99 | 100 | int State::setNumDimensions (int numDimensionsIn) { 101 | 102 | if (x) 103 | delete [] x; 104 | 105 | if (numDimensions < 0) 106 | return 0; 107 | 108 | numDimensions = numDimensionsIn; 109 | 110 | if (numDimensions > 0) 111 | x = new double[numDimensions]; 112 | 113 | return 1; 114 | } 115 | 116 | 117 | Trajectory::Trajectory () { 118 | 119 | endState = NULL; 120 | } 121 | 122 | 123 | Trajectory::~Trajectory () { 124 | 125 | if (endState) 126 | delete endState; 127 | } 128 | 129 | 130 | Trajectory::Trajectory (const Trajectory &trajectoryIn) { 131 | 132 | endState = new State (trajectoryIn.getEndState()); 133 | 134 | } 135 | 136 | 137 | Trajectory& Trajectory::operator=(const Trajectory &trajectoryIn) { 138 | 139 | if (this == &trajectoryIn) 140 | return *this; 141 | 142 | if (endState) 143 | delete endState; 144 | 145 | 146 | endState = new State (trajectoryIn.getEndState()); 147 | 148 | totalVariation = trajectoryIn.totalVariation; 149 | 150 | return *this; 151 | } 152 | 153 | 154 | double Trajectory::evaluateCost () { 155 | 156 | return totalVariation; 157 | } 158 | 159 | 160 | System::System () { 161 | 162 | numDimensions = 0; 163 | } 164 | 165 | 166 | System::~System () { 167 | 168 | } 169 | 170 | 171 | int System::setNumDimensions (int numDimensionsIn) { 172 | 173 | if (numDimensions < 0) 174 | return 0; 175 | 176 | numDimensions = numDimensionsIn; 177 | 178 | rootState.setNumDimensions (numDimensions); 179 | 180 | return 1; 181 | } 182 | 183 | 184 | int System::getStateKey (State& stateIn, double* stateKey) { 185 | 186 | for (int i = 0; i < numDimensions; i++) 187 | stateKey[i] = stateIn.x[i] / regionOperating.size[i]; 188 | 189 | return 1; 190 | } 191 | 192 | 193 | 194 | bool System::isReachingTarget (State &stateIn) { 195 | 196 | 197 | for (int i = 0; i < numDimensions; i++) { 198 | 199 | if (fabs(stateIn.x[i] - regionGoal.center[i]) > regionGoal.size[i]/2.0 ) 200 | return false; 201 | } 202 | 203 | return true; 204 | } 205 | 206 | 207 | bool System::IsInCollision (double *stateIn) { 208 | 209 | for (list::iterator iter = obstacles.begin(); iter != obstacles.end(); iter++) { 210 | 211 | region *obstacleCurr = *iter; 212 | bool collisionFound = true; 213 | 214 | for (int i = 0; i < numDimensions; i++) 215 | if (fabs(obstacleCurr->center[i] - stateIn[i]) > obstacleCurr->size[i]/2.0 ) { 216 | collisionFound = false; 217 | break; 218 | } 219 | 220 | if (collisionFound) { 221 | return true; 222 | } 223 | } 224 | 225 | return false; 226 | } 227 | 228 | 229 | int System::RGD(State &rstout) { 230 | 231 | int k = 100; 232 | double lamda = 0.05; //lamda step size 233 | State& previous_state = rstout; 234 | for(int n = 0; n 0) 247 | { //as Potential is zero in goal region 248 | if(isReachingTarget(rstout) == false) 249 | { 250 | previous_state = rstout; 251 | rstout.x[j] = rstout.x[j] - lamda; 252 | } 253 | }else if(rstout.x[j] - regionGoal.center[j] < 0) 254 | { //as Potential is zero in goal region 255 | if(isReachingTarget(rstout) == false) 256 | { previous_state = rstout; 257 | rstout.x[j] = rstout.x[j] + lamda; 258 | } 259 | 260 | } 261 | 262 | } 263 | 264 | } 265 | 266 | return 1; 267 | 268 | } 269 | 270 | 271 | 272 | 273 | 274 | 275 | int System::sampleState (State &randomStateOut) { 276 | 277 | randomStateOut.setNumDimensions (numDimensions); 278 | 279 | for (int i = 0; i < numDimensions; i++) { 280 | 281 | randomStateOut.x[i] = (double)rand()/(RAND_MAX + 1.0)*regionOperating.size[i] 282 | - regionOperating.size[i]/2.0 + regionOperating.center[i]; 283 | } 284 | 285 | if (IsInCollision (randomStateOut.x)) 286 | return 0; 287 | 288 | //RGD function 289 | RGD(randomStateOut); 290 | 291 | return 1; 292 | } 293 | 294 | 295 | 296 | int System::extendTo (State &stateFromIn, State &stateTowardsIn, Trajectory &trajectoryOut, bool &exactConnectionOut) { 297 | 298 | double *dists = new double[numDimensions]; 299 | for (int i = 0; i < numDimensions; i++) 300 | dists[i] = stateTowardsIn.x[i] - stateFromIn.x[i]; 301 | 302 | double distTotal = 0.0; 303 | for (int i = 0; i < numDimensions; i++) 304 | distTotal += dists[i]*dists[i]; 305 | distTotal = sqrt (distTotal); 306 | 307 | double incrementTotal = distTotal/DISCRETIZATION_STEP; //DISCRETIZATION_STEP = 0.01 308 | 309 | // normalize the distance according to the disretization step 310 | for (int i = 0; i < numDimensions; i++) 311 | dists[i] /= incrementTotal; 312 | 313 | int numSegments = (int)floor(incrementTotal); 314 | 315 | double *stateCurr = new double[numDimensions]; 316 | for (int i = 0; i < numDimensions; i++) 317 | stateCurr[i] = stateFromIn.x[i]; 318 | 319 | for (int i = 0; i < numSegments; i++) { 320 | 321 | if (IsInCollision (stateCurr)) 322 | return 0; 323 | 324 | for (int i = 0; i < numDimensions; i++) 325 | stateCurr[i] += dists[i]; 326 | } 327 | 328 | if (IsInCollision (stateTowardsIn.x)) 329 | return 0; 330 | 331 | trajectoryOut.endState = new State (stateTowardsIn); 332 | trajectoryOut.totalVariation = distTotal; 333 | 334 | delete [] dists; 335 | delete [] stateCurr; 336 | 337 | exactConnectionOut = true; 338 | 339 | return 1; 340 | } 341 | 342 | 343 | double System::evaluateExtensionCost (State& stateFromIn, State& stateTowardsIn, bool &exactConnectionOut) { 344 | 345 | 346 | exactConnectionOut = true; 347 | 348 | double distTotal = 0.0; 349 | for (int i = 0; i < numDimensions; i++) { 350 | double distCurr = stateTowardsIn.x[i] - stateFromIn.x[i]; 351 | distTotal += distCurr*distCurr; 352 | } 353 | 354 | return sqrt(distTotal); 355 | 356 | } 357 | 358 | 359 | int System::getTrajectory (State& stateFromIn, State& stateToIn, list& trajectoryOut) { 360 | 361 | double *stateArr = new double[numDimensions]; 362 | for (int i = 0; i < numDimensions; i++) 363 | stateArr[i] = stateToIn[i]; 364 | trajectoryOut.push_front (stateArr); 365 | 366 | return 1; 367 | 368 | } 369 | 370 | 371 | double System::evaluateCostToGo (State& stateIn) { 372 | 373 | double radius = 0.0; 374 | for (int i = 0; i < numDimensions; i++) 375 | radius += regionGoal.size[i] * regionGoal.size[i]; 376 | radius = sqrt(radius); 377 | 378 | double dist = 0.0; 379 | for (int i = 0; i < numDimensions; i++) 380 | dist += (stateIn[i] - regionGoal.center[i])*(stateIn[i] - regionGoal.center[i]); 381 | dist = sqrt(dist); 382 | 383 | return dist - radius; 384 | } 385 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | #============================================================================= 5 | # Special targets provided by cmake. 6 | 7 | # Disable implicit rules so canonical targets will work. 8 | .SUFFIXES: 9 | 10 | # Remove some rules from gmake that .SUFFIXES does not remove. 11 | SUFFIXES = 12 | 13 | .SUFFIXES: .hpux_make_needs_suffix_list 14 | 15 | # Suppress display of executed commands. 16 | $(VERBOSE).SILENT: 17 | 18 | # A target that is always out of date. 19 | cmake_force: 20 | .PHONY : cmake_force 21 | 22 | #============================================================================= 23 | # Set environment variables for the build. 24 | 25 | # The shell in which to execute make rules. 26 | SHELL = /bin/sh 27 | 28 | # The CMake executable. 29 | CMAKE_COMMAND = /usr/bin/cmake 30 | 31 | # The command to remove a file. 32 | RM = /usr/bin/cmake -E remove -f 33 | 34 | # Escaping for special characters. 35 | EQUALS = = 36 | 37 | # The program to use to edit the cache. 38 | CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui 39 | 40 | # The top-level source directory on which CMake was run. 41 | CMAKE_SOURCE_DIR = /home/ahmed/r/rrtstar-standalone 42 | 43 | # The top-level build directory on which CMake was run. 44 | CMAKE_BINARY_DIR = /home/ahmed/r/rrtstar-standalone/pod-build 45 | 46 | # Include any dependencies generated for this target. 47 | include src/CMakeFiles/rrtstar.dir/depend.make 48 | 49 | # Include the progress variables for this target. 50 | include src/CMakeFiles/rrtstar.dir/progress.make 51 | 52 | # Include the compile flags for this target's objects. 53 | include src/CMakeFiles/rrtstar.dir/flags.make 54 | 55 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: src/CMakeFiles/rrtstar.dir/flags.make 56 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o: ../src/rrts_main.cpp 57 | $(CMAKE_COMMAND) -E cmake_progress_report /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles $(CMAKE_PROGRESS_1) 58 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o" 59 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/rrtstar.dir/rrts_main.cpp.o -c /home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp 60 | 61 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.i: cmake_force 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/rrtstar.dir/rrts_main.cpp.i" 63 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp > CMakeFiles/rrtstar.dir/rrts_main.cpp.i 64 | 65 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.s: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rrtstar.dir/rrts_main.cpp.s" 67 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/ahmed/r/rrtstar-standalone/src/rrts_main.cpp -o CMakeFiles/rrtstar.dir/rrts_main.cpp.s 68 | 69 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.requires: 70 | .PHONY : src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.requires 71 | 72 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.provides: src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.requires 73 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.provides.build 74 | .PHONY : src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.provides 75 | 76 | src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.provides.build: src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o 77 | 78 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o: src/CMakeFiles/rrtstar.dir/flags.make 79 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o: ../src/system_single_integrator.cpp 80 | $(CMAKE_COMMAND) -E cmake_progress_report /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles $(CMAKE_PROGRESS_2) 81 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building CXX object src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o" 82 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -o CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o -c /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp 83 | 84 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.i: cmake_force 85 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/rrtstar.dir/system_single_integrator.cpp.i" 86 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -E /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp > CMakeFiles/rrtstar.dir/system_single_integrator.cpp.i 87 | 88 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.s: cmake_force 89 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rrtstar.dir/system_single_integrator.cpp.s" 90 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_FLAGS) -S /home/ahmed/r/rrtstar-standalone/src/system_single_integrator.cpp -o CMakeFiles/rrtstar.dir/system_single_integrator.cpp.s 91 | 92 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.requires: 93 | .PHONY : src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.requires 94 | 95 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.provides: src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.requires 96 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.provides.build 97 | .PHONY : src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.provides 98 | 99 | src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.provides.build: src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o 100 | 101 | src/CMakeFiles/rrtstar.dir/kdtree.c.o: src/CMakeFiles/rrtstar.dir/flags.make 102 | src/CMakeFiles/rrtstar.dir/kdtree.c.o: ../src/kdtree.c 103 | $(CMAKE_COMMAND) -E cmake_progress_report /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles $(CMAKE_PROGRESS_3) 104 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Building C object src/CMakeFiles/rrtstar.dir/kdtree.c.o" 105 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/cc $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/rrtstar.dir/kdtree.c.o -c /home/ahmed/r/rrtstar-standalone/src/kdtree.c 106 | 107 | src/CMakeFiles/rrtstar.dir/kdtree.c.i: cmake_force 108 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/rrtstar.dir/kdtree.c.i" 109 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/cc $(C_DEFINES) $(C_FLAGS) -E /home/ahmed/r/rrtstar-standalone/src/kdtree.c > CMakeFiles/rrtstar.dir/kdtree.c.i 110 | 111 | src/CMakeFiles/rrtstar.dir/kdtree.c.s: cmake_force 112 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/rrtstar.dir/kdtree.c.s" 113 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && /usr/bin/cc $(C_DEFINES) $(C_FLAGS) -S /home/ahmed/r/rrtstar-standalone/src/kdtree.c -o CMakeFiles/rrtstar.dir/kdtree.c.s 114 | 115 | src/CMakeFiles/rrtstar.dir/kdtree.c.o.requires: 116 | .PHONY : src/CMakeFiles/rrtstar.dir/kdtree.c.o.requires 117 | 118 | src/CMakeFiles/rrtstar.dir/kdtree.c.o.provides: src/CMakeFiles/rrtstar.dir/kdtree.c.o.requires 119 | $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/kdtree.c.o.provides.build 120 | .PHONY : src/CMakeFiles/rrtstar.dir/kdtree.c.o.provides 121 | 122 | src/CMakeFiles/rrtstar.dir/kdtree.c.o.provides.build: src/CMakeFiles/rrtstar.dir/kdtree.c.o 123 | 124 | # Object files for target rrtstar 125 | rrtstar_OBJECTS = \ 126 | "CMakeFiles/rrtstar.dir/rrts_main.cpp.o" \ 127 | "CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o" \ 128 | "CMakeFiles/rrtstar.dir/kdtree.c.o" 129 | 130 | # External object files for target rrtstar 131 | rrtstar_EXTERNAL_OBJECTS = 132 | 133 | bin/rrtstar: src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o 134 | bin/rrtstar: src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o 135 | bin/rrtstar: src/CMakeFiles/rrtstar.dir/kdtree.c.o 136 | bin/rrtstar: src/CMakeFiles/rrtstar.dir/build.make 137 | bin/rrtstar: src/CMakeFiles/rrtstar.dir/link.txt 138 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking CXX executable ../bin/rrtstar" 139 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/rrtstar.dir/link.txt --verbose=$(VERBOSE) 140 | 141 | # Rule to build all files generated by this target. 142 | src/CMakeFiles/rrtstar.dir/build: bin/rrtstar 143 | .PHONY : src/CMakeFiles/rrtstar.dir/build 144 | 145 | src/CMakeFiles/rrtstar.dir/requires: src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o.requires 146 | src/CMakeFiles/rrtstar.dir/requires: src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o.requires 147 | src/CMakeFiles/rrtstar.dir/requires: src/CMakeFiles/rrtstar.dir/kdtree.c.o.requires 148 | .PHONY : src/CMakeFiles/rrtstar.dir/requires 149 | 150 | src/CMakeFiles/rrtstar.dir/clean: 151 | cd /home/ahmed/r/rrtstar-standalone/pod-build/src && $(CMAKE_COMMAND) -P CMakeFiles/rrtstar.dir/cmake_clean.cmake 152 | .PHONY : src/CMakeFiles/rrtstar.dir/clean 153 | 154 | src/CMakeFiles/rrtstar.dir/depend: 155 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/ahmed/r/rrtstar-standalone /home/ahmed/r/rrtstar-standalone/src /home/ahmed/r/rrtstar-standalone/pod-build /home/ahmed/r/rrtstar-standalone/pod-build/src /home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/rrtstar.dir/DependInfo.cmake --color=$(COLOR) 156 | .PHONY : src/CMakeFiles/rrtstar.dir/depend 157 | 158 | -------------------------------------------------------------------------------- /rrtstar-standalone/src/system_single_integrator.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file system_single_integrator.h 3 | */ 4 | 5 | #ifndef __RRTS_SYSTEM_SINGLE_INTEGRATOR_H_ 6 | #define __RRTS_SYSTEM_SINGLE_INTEGRATOR_H_ 7 | 8 | #include 9 | 10 | 11 | 12 | namespace SingleIntegrator { 13 | 14 | 15 | /*! 16 | * \brief region class 17 | * 18 | * More elaborate description 19 | */ 20 | class region { 21 | 22 | int numDimensions; 23 | 24 | public: 25 | 26 | /*! 27 | * \brief Cartesian coordinates of the center of the region 28 | * 29 | * More elaborate description 30 | */ 31 | double *center; 32 | 33 | /*! 34 | * \brief Size of the region in cartesian coordinates 35 | * 36 | * More elaborate description 37 | */ 38 | double *size; 39 | 40 | /*! 41 | * \brief region constructor 42 | * 43 | * More elaborate description 44 | */ 45 | region (); 46 | 47 | /*! 48 | * \brief region destructor 49 | * 50 | * More elaborate description 51 | */ 52 | ~region (); 53 | 54 | /*! 55 | * \brief Sets the dimensionality of the region 56 | * 57 | * More elaborate description 58 | * 59 | * \param numDimensionsIn New number of dimensions. 60 | * 61 | */ 62 | int setNumDimensions (int numDimensionsIn); 63 | }; 64 | 65 | 66 | 67 | /*! 68 | * \brief State Class. 69 | * 70 | * A more elaborate description of the State class 71 | */ 72 | class State { 73 | 74 | int numDimensions; 75 | double *x; 76 | 77 | int setNumDimensions (int numDimensions); 78 | 79 | public: 80 | 81 | /*! 82 | * \brief State constructor 83 | * 84 | * More elaborate description 85 | */ 86 | State (); 87 | 88 | /*! 89 | * \brief State desctructor 90 | * 91 | * More elaborate description 92 | */ 93 | ~State (); 94 | 95 | /*! 96 | * \brief State copy constructor 97 | * 98 | * More elaborate description 99 | */ 100 | State (const State& stateIn); 101 | 102 | /*! 103 | * \brief State assignment operator 104 | * 105 | * More elaborate description 106 | */ 107 | State& operator= (const State& stateIn); 108 | 109 | /*! 110 | * \brief State bracket operator 111 | * 112 | * More elaborate description 113 | */ 114 | double& operator[] (const int i) {return x[i];} 115 | 116 | friend class System; 117 | friend class Trajectory; 118 | }; 119 | 120 | 121 | 122 | /*! 123 | * \brief Trajectory Class. 124 | * 125 | * A more elaborate description of the State class 126 | */ 127 | class Trajectory { 128 | 129 | State *endState; 130 | double totalVariation; 131 | 132 | public: 133 | 134 | /*! 135 | * \brief Trajectory constructor 136 | * 137 | * More elaborate description 138 | */ 139 | Trajectory (); 140 | 141 | /*! 142 | * \brief Trajectory destructor 143 | * 144 | * More elaborate description 145 | */ 146 | ~Trajectory (); 147 | 148 | /*! 149 | * \brief Trajectory copy constructor 150 | * 151 | * More elaborate description 152 | * 153 | * \param trajectoryIn The trajectory to be copied. 154 | * 155 | */ 156 | Trajectory (const Trajectory& trajectoryIn); 157 | 158 | /*! 159 | * \brief Trajectory assignment constructor 160 | * 161 | * More elaborate description 162 | * 163 | * \param trajectoryIn the trajectory to be copied. 164 | * 165 | */ 166 | Trajectory& operator= (const Trajectory& trajectoryIn); 167 | 168 | /*! 169 | * \brief Returns a reference to the end state of this trajectory. 170 | * 171 | * More elaborate description 172 | */ 173 | State& getEndState () {return *endState;} 174 | 175 | /*! 176 | * \brief Returns a reference to the end state of this trajectory (constant). 177 | * 178 | * More elaborate description 179 | */ 180 | State& getEndState () const {return *endState;} 181 | 182 | /*! 183 | * \brief Returns the cost of this trajectory. 184 | * 185 | * More elaborate description 186 | */ 187 | double evaluateCost (); 188 | 189 | friend class System; 190 | }; 191 | 192 | 193 | 194 | /*! 195 | * \brief System Class. 196 | * 197 | * A more elaborate description of the State class 198 | */ 199 | class System { 200 | 201 | int numDimensions; 202 | bool IsInCollision (double *stateIn); 203 | 204 | State rootState; 205 | 206 | public: 207 | 208 | /*! 209 | * \brief The operating region 210 | * 211 | * More elaborate description 212 | */ 213 | region regionOperating; 214 | 215 | /*! 216 | * \brief The goal region 217 | * 218 | * More elaborate description 219 | */ 220 | region regionGoal; 221 | 222 | /*! 223 | * \brief The list of all obstacles 224 | * 225 | * More elaborate description 226 | */ 227 | std::list obstacles; 228 | 229 | /*! 230 | * \brief System constructor 231 | * 232 | * More elaborate description 233 | */ 234 | System (); 235 | 236 | /*! 237 | * \brief System destructor 238 | * 239 | * More elaborate description 240 | */ 241 | ~System (); 242 | 243 | int setNumDimensions (int numDimensionsIn); 244 | 245 | /*! 246 | * \brief Returns the dimensionality of the Euclidean space. 247 | * 248 | * A more elaborate description. 249 | */ 250 | int getNumDimensions () {return numDimensions;} 251 | 252 | /*! 253 | * \brief Returns a reference to the root state. 254 | * 255 | * A more elaborate description. 256 | */ 257 | State& getRootState () {return rootState;} 258 | 259 | /*! 260 | * \brief Returns the statekey for the given state. 261 | * 262 | * A more elaborate description. 263 | * 264 | * \param stateIn the given state 265 | * \param stateKey the key to the state. An array of dimension getNumDimensions() 266 | * 267 | */ 268 | int getStateKey (State &stateIn, double *stateKey); 269 | 270 | /*! 271 | * \brief Returns true of the given state reaches the target. 272 | * 273 | * A more elaborate description. 274 | */ 275 | bool isReachingTarget (State &stateIn); 276 | 277 | /*! 278 | * \brief Returns a sample state. 279 | * 280 | * A more elaborate description. 281 | * 282 | * \param randomStateOut 283 | * 284 | */ 285 | int sampleState (State &randomStateOut); 286 | 287 | 288 | /*! 289 | * \brief Returns a the cost of the trajectory that connects stateFromIn and 290 | * stateTowardsIn. The trajectory is also returned in trajectoryOut. 291 | * 292 | * A more elaborate description. 293 | * 294 | * \param stateFromIn Initial state 295 | * \param stateTowardsIn Final state 296 | * \param trajectoryOut Trajectory that starts the from the initial state and 297 | * reaches near the final state. 298 | * \param exactConnectionOut Set to true if the initial and the final states 299 | * can be connected exactly. 300 | * 301 | */ 302 | int extendTo (State &stateFromIn, State &stateTowardsIn, 303 | Trajectory &trajectoryOut, bool &exactConnectionOut); 304 | 305 | /*! 306 | * \brief Returns the cost of the trajectory that connects stateFromIn and StateTowardsIn. 307 | * 308 | * A more elaborate description. 309 | * 310 | * \param stateFromIn Initial state 311 | * \param stateTowardsIn Final state 312 | * \param exactConnectionOut Set to true if the initial and the final states 313 | * can be connected exactly. 314 | * 315 | */ 316 | double evaluateExtensionCost (State &stateFromIn, State &stateTowardsIn, bool &exactConnectionOut); 317 | 318 | /*! 319 | * \brief Returns a lower bound on the cost to go starting from stateIn 320 | * 321 | * A more elaborate description. 322 | * 323 | * \param stateIn Starting state 324 | * 325 | */ 326 | double evaluateCostToGo (State& stateIn); 327 | 328 | /*! 329 | * \brief Returns the trajectory as a list of double arrays, each with dimension getNumDimensions. 330 | * 331 | * A more elaborate description. 332 | * 333 | * \param stateFromIn Initial state 334 | * \param stateToIn Final state 335 | * \param trajectoryOut The list of double arrays that represent the trajectory 336 | * 337 | */ 338 | int getTrajectory (State& stateFromIn, State& stateToIn, std::list& trajectoryOut); 339 | 340 | }; 341 | } 342 | 343 | 344 | #endif 345 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/src/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | # Remove some rules from gmake that .SUFFIXES does not remove. 15 | SUFFIXES = 16 | 17 | .SUFFIXES: .hpux_make_needs_suffix_list 18 | 19 | # Suppress display of executed commands. 20 | $(VERBOSE).SILENT: 21 | 22 | # A target that is always out of date. 23 | cmake_force: 24 | .PHONY : cmake_force 25 | 26 | #============================================================================= 27 | # Set environment variables for the build. 28 | 29 | # The shell in which to execute make rules. 30 | SHELL = /bin/sh 31 | 32 | # The CMake executable. 33 | CMAKE_COMMAND = /usr/bin/cmake 34 | 35 | # The command to remove a file. 36 | RM = /usr/bin/cmake -E remove -f 37 | 38 | # Escaping for special characters. 39 | EQUALS = = 40 | 41 | # The program to use to edit the cache. 42 | CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui 43 | 44 | # The top-level source directory on which CMake was run. 45 | CMAKE_SOURCE_DIR = /home/ahmed/r/rrtstar-standalone 46 | 47 | # The top-level build directory on which CMake was run. 48 | CMAKE_BINARY_DIR = /home/ahmed/r/rrtstar-standalone/pod-build 49 | 50 | #============================================================================= 51 | # Targets provided globally by CMake. 52 | 53 | # Special rule for the target edit_cache 54 | edit_cache: 55 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." 56 | /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 57 | .PHONY : edit_cache 58 | 59 | # Special rule for the target edit_cache 60 | edit_cache/fast: edit_cache 61 | .PHONY : edit_cache/fast 62 | 63 | # Special rule for the target install 64 | install: preinstall 65 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 66 | /usr/bin/cmake -P cmake_install.cmake 67 | .PHONY : install 68 | 69 | # Special rule for the target install 70 | install/fast: preinstall/fast 71 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." 72 | /usr/bin/cmake -P cmake_install.cmake 73 | .PHONY : install/fast 74 | 75 | # Special rule for the target install/local 76 | install/local: preinstall 77 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." 78 | /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake 79 | .PHONY : install/local 80 | 81 | # Special rule for the target install/local 82 | install/local/fast: install/local 83 | .PHONY : install/local/fast 84 | 85 | # Special rule for the target install/strip 86 | install/strip: preinstall 87 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." 88 | /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake 89 | .PHONY : install/strip 90 | 91 | # Special rule for the target install/strip 92 | install/strip/fast: install/strip 93 | .PHONY : install/strip/fast 94 | 95 | # Special rule for the target list_install_components 96 | list_install_components: 97 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" 98 | .PHONY : list_install_components 99 | 100 | # Special rule for the target list_install_components 101 | list_install_components/fast: list_install_components 102 | .PHONY : list_install_components/fast 103 | 104 | # Special rule for the target rebuild_cache 105 | rebuild_cache: 106 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 107 | /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 108 | .PHONY : rebuild_cache 109 | 110 | # Special rule for the target rebuild_cache 111 | rebuild_cache/fast: rebuild_cache 112 | .PHONY : rebuild_cache/fast 113 | 114 | # The main all target 115 | all: cmake_check_build_system 116 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles /home/ahmed/r/rrtstar-standalone/pod-build/src/CMakeFiles/progress.marks 117 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f CMakeFiles/Makefile2 src/all 118 | $(CMAKE_COMMAND) -E cmake_progress_start /home/ahmed/r/rrtstar-standalone/pod-build/CMakeFiles 0 119 | .PHONY : all 120 | 121 | # The main clean target 122 | clean: 123 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f CMakeFiles/Makefile2 src/clean 124 | .PHONY : clean 125 | 126 | # The main clean target 127 | clean/fast: clean 128 | .PHONY : clean/fast 129 | 130 | # Prepare targets for installation. 131 | preinstall: all 132 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall 133 | .PHONY : preinstall 134 | 135 | # Prepare targets for installation. 136 | preinstall/fast: 137 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall 138 | .PHONY : preinstall/fast 139 | 140 | # clear depends 141 | depend: 142 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 143 | .PHONY : depend 144 | 145 | # Convenience name for target. 146 | src/CMakeFiles/rrtstar.dir/rule: 147 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/rrtstar.dir/rule 148 | .PHONY : src/CMakeFiles/rrtstar.dir/rule 149 | 150 | # Convenience name for target. 151 | rrtstar: src/CMakeFiles/rrtstar.dir/rule 152 | .PHONY : rrtstar 153 | 154 | # fast build rule for target. 155 | rrtstar/fast: 156 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/build 157 | .PHONY : rrtstar/fast 158 | 159 | kdtree.o: kdtree.c.o 160 | .PHONY : kdtree.o 161 | 162 | # target to build an object file 163 | kdtree.c.o: 164 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/kdtree.c.o 165 | .PHONY : kdtree.c.o 166 | 167 | kdtree.i: kdtree.c.i 168 | .PHONY : kdtree.i 169 | 170 | # target to preprocess a source file 171 | kdtree.c.i: 172 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/kdtree.c.i 173 | .PHONY : kdtree.c.i 174 | 175 | kdtree.s: kdtree.c.s 176 | .PHONY : kdtree.s 177 | 178 | # target to generate assembly for a file 179 | kdtree.c.s: 180 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/kdtree.c.s 181 | .PHONY : kdtree.c.s 182 | 183 | rrts_main.o: rrts_main.cpp.o 184 | .PHONY : rrts_main.o 185 | 186 | # target to build an object file 187 | rrts_main.cpp.o: 188 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/rrts_main.cpp.o 189 | .PHONY : rrts_main.cpp.o 190 | 191 | rrts_main.i: rrts_main.cpp.i 192 | .PHONY : rrts_main.i 193 | 194 | # target to preprocess a source file 195 | rrts_main.cpp.i: 196 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/rrts_main.cpp.i 197 | .PHONY : rrts_main.cpp.i 198 | 199 | rrts_main.s: rrts_main.cpp.s 200 | .PHONY : rrts_main.s 201 | 202 | # target to generate assembly for a file 203 | rrts_main.cpp.s: 204 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/rrts_main.cpp.s 205 | .PHONY : rrts_main.cpp.s 206 | 207 | system_single_integrator.o: system_single_integrator.cpp.o 208 | .PHONY : system_single_integrator.o 209 | 210 | # target to build an object file 211 | system_single_integrator.cpp.o: 212 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.o 213 | .PHONY : system_single_integrator.cpp.o 214 | 215 | system_single_integrator.i: system_single_integrator.cpp.i 216 | .PHONY : system_single_integrator.i 217 | 218 | # target to preprocess a source file 219 | system_single_integrator.cpp.i: 220 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.i 221 | .PHONY : system_single_integrator.cpp.i 222 | 223 | system_single_integrator.s: system_single_integrator.cpp.s 224 | .PHONY : system_single_integrator.s 225 | 226 | # target to generate assembly for a file 227 | system_single_integrator.cpp.s: 228 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(MAKE) -f src/CMakeFiles/rrtstar.dir/build.make src/CMakeFiles/rrtstar.dir/system_single_integrator.cpp.s 229 | .PHONY : system_single_integrator.cpp.s 230 | 231 | # Help Target 232 | help: 233 | @echo "The following are some of the valid targets for this Makefile:" 234 | @echo "... all (the default if no target is provided)" 235 | @echo "... clean" 236 | @echo "... depend" 237 | @echo "... edit_cache" 238 | @echo "... install" 239 | @echo "... install/local" 240 | @echo "... install/strip" 241 | @echo "... list_install_components" 242 | @echo "... rebuild_cache" 243 | @echo "... rrtstar" 244 | @echo "... kdtree.o" 245 | @echo "... kdtree.i" 246 | @echo "... kdtree.s" 247 | @echo "... rrts_main.o" 248 | @echo "... rrts_main.i" 249 | @echo "... rrts_main.s" 250 | @echo "... system_single_integrator.o" 251 | @echo "... system_single_integrator.i" 252 | @echo "... system_single_integrator.s" 253 | .PHONY : help 254 | 255 | 256 | 257 | #============================================================================= 258 | # Special targets to cleanup operation of make. 259 | 260 | # Special rule to run CMake to check the build system integrity. 261 | # No rule that depends on this can have commands that come from listfiles 262 | # because they might be regenerated. 263 | cmake_check_build_system: 264 | cd /home/ahmed/r/rrtstar-standalone/pod-build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 265 | .PHONY : cmake_check_build_system 266 | 267 | -------------------------------------------------------------------------------- /rrtstar/src/system_single_integrator.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file system_single_integrator.h 3 | */ 4 | 5 | #ifndef __RRTS_SYSTEM_SINGLE_INTEGRATOR_H_ 6 | #define __RRTS_SYSTEM_SINGLE_INTEGRATOR_H_ 7 | 8 | #include 9 | 10 | 11 | 12 | namespace SingleIntegrator { 13 | 14 | 15 | /*! 16 | * \brief region class 17 | * 18 | * More elaborate description 19 | */ 20 | class region { 21 | 22 | int numDimensions; 23 | 24 | public: 25 | 26 | /*! 27 | * \brief Cartesian coordinates of the center of the region 28 | * 29 | * More elaborate description 30 | */ 31 | double *center; 32 | 33 | /*! 34 | * \brief Size of the region in cartesian coordinates 35 | * 36 | * More elaborate description 37 | */ 38 | double *size; 39 | 40 | /*! 41 | * \brief region constructor 42 | * 43 | * More elaborate description 44 | */ 45 | region (); 46 | 47 | /*! 48 | * \brief region destructor 49 | * 50 | * More elaborate description 51 | */ 52 | ~region (); 53 | 54 | /*! 55 | * \brief Sets the dimensionality of the region 56 | * 57 | * More elaborate description 58 | * 59 | * \param numDimensionsIn New number of dimensions. 60 | * 61 | */ 62 | int setNumDimensions (int numDimensionsIn); 63 | }; 64 | 65 | 66 | 67 | /*! 68 | * \brief State Class. 69 | * 70 | * A more elaborate description of the State class 71 | */ 72 | class State { 73 | 74 | int numDimensions; 75 | double *x; 76 | 77 | int setNumDimensions (int numDimensions); 78 | 79 | public: 80 | 81 | /*! 82 | * \brief State constructor 83 | * 84 | * More elaborate description 85 | */ 86 | State (); 87 | 88 | /*! 89 | * \brief State desctructor 90 | * 91 | * More elaborate description 92 | */ 93 | ~State (); 94 | 95 | /*! 96 | * \brief State copy constructor 97 | * 98 | * More elaborate description 99 | */ 100 | State (const State& stateIn); 101 | 102 | /*! 103 | * \brief State assignment operator 104 | * 105 | * More elaborate description 106 | */ 107 | State& operator= (const State& stateIn); 108 | 109 | /*! 110 | * \brief State bracket operator 111 | * 112 | * More elaborate description 113 | */ 114 | double& operator[] (const int i) {return x[i];} 115 | 116 | friend class System; 117 | friend class Trajectory; 118 | }; 119 | 120 | 121 | 122 | /*! 123 | * \brief Trajectory Class. 124 | * 125 | * A more elaborate description of the State class 126 | */ 127 | class Trajectory { 128 | 129 | State *endState; 130 | double totalVariation; //Wat is this??? 131 | 132 | public: 133 | 134 | /*! 135 | * \brief Trajectory constructor 136 | * 137 | * More elaborate description 138 | */ 139 | Trajectory (); 140 | 141 | /*! 142 | * \brief Trajectory destructor 143 | * 144 | * More elaborate description 145 | */ 146 | ~Trajectory (); 147 | 148 | /*! 149 | * \brief Trajectory copy constructor 150 | * 151 | * More elaborate description 152 | * 153 | * \param trajectoryIn The trajectory to be copied. 154 | * 155 | */ 156 | Trajectory (const Trajectory& trajectoryIn); 157 | 158 | /*! 159 | * \brief Trajectory assignment constructor 160 | * 161 | * More elaborate description 162 | * 163 | * \param trajectoryIn the trajectory to be copied. 164 | * 165 | */ 166 | Trajectory& operator= (const Trajectory& trajectoryIn); 167 | 168 | /*! 169 | * \brief Returns a reference to the end state of this trajectory. 170 | * 171 | * More elaborate description 172 | */ 173 | State& getEndState () {return *endState;} //definiton idr he 174 | 175 | /*! 176 | * \brief Returns a reference to the end state of this trajectory (constant). 177 | * 178 | * More elaborate description 179 | */ 180 | State& getEndState () const {return *endState;} //definiton idr he 181 | 182 | /*! 183 | * \brief Returns the cost of this trajectory. 184 | * 185 | * More elaborate description 186 | */ 187 | double evaluateCost (); 188 | 189 | friend class System; 190 | }; 191 | 192 | 193 | 194 | /*! 195 | * \brief System Class. 196 | * 197 | * A more elaborate description of the State class 198 | */ 199 | class System { 200 | 201 | int numDimensions; 202 | bool IsInCollision (double *stateIn); 203 | 204 | State rootState; 205 | 206 | public: 207 | 208 | /*! 209 | * \brief The operating region 210 | * 211 | * More elaborate description 212 | */ 213 | region regionOperating; 214 | 215 | /*! 216 | * \brief The goal region 217 | * 218 | * More elaborate description 219 | */ 220 | region regionGoal; 221 | 222 | /*! 223 | * \brief The list of all obstacles 224 | * 225 | * More elaborate description 226 | */ 227 | std::list obstacles; 228 | 229 | /*! 230 | * \brief System constructor 231 | * 232 | * More elaborate description 233 | */ 234 | System (); 235 | 236 | /*! 237 | * \brief System destructor 238 | * 239 | * More elaborate description 240 | */ 241 | ~System (); 242 | 243 | int setNumDimensions (int numDimensionsIn); 244 | 245 | /*! 246 | * \brief Returns the dimensionality of the Euclidean space. 247 | * 248 | * A more elaborate description. 249 | */ 250 | int getNumDimensions () {return numDimensions;} 251 | 252 | /*! 253 | * \brief Returns a reference to the root state. 254 | * 255 | * A more elaborate description. 256 | */ 257 | State& getRootState () {return rootState;} 258 | 259 | /*! 260 | * \brief Returns the statekey for the given state. 261 | * 262 | * A more elaborate description. 263 | * 264 | * \param stateIn the given state 265 | * \param stateKey the key to the state. An array of dimension getNumDimensions() 266 | * 267 | */ 268 | int getStateKey (State &stateIn, double *stateKey); 269 | 270 | /*! 271 | * \brief Returns true of the given state reaches the target. 272 | * 273 | * A more elaborate description. 274 | */ 275 | bool isReachingTarget (State &stateIn); 276 | 277 | /*! 278 | * RGD function returns a Randomized Gradient Decent 279 | * sample state after taking input as a Random State 280 | */ 281 | int RGD(State &rstout); 282 | 283 | /*! 284 | * \brief Returns a sample state. 285 | * 286 | * A more elaborate description. 287 | * 288 | * \param randomStateOut 289 | * 290 | */ 291 | int sampleState (State &randomStateOut); 292 | 293 | 294 | /*! 295 | * \brief Returns a the cost of the trajectory that connects stateFromIn and 296 | * stateTowardsIn. The trajectory is also returned in trajectoryOut. 297 | * 298 | * A more elaborate description. 299 | * 300 | * \param stateFromIn Initial state 301 | * \param stateTowardsIn Final state 302 | * \param trajectoryOut Trajectory that starts the from the initial state and 303 | * reaches near the final state. 304 | * \param exactConnectionOut Set to true if the initial and the final states 305 | * can be connected exactly. 306 | * 307 | */ 308 | int extendTo (State &stateFromIn, State &stateTowardsIn, 309 | Trajectory &trajectoryOut, bool &exactConnectionOut); 310 | 311 | /*! 312 | * \brief Returns the cost of the trajectory that connects stateFromIn and StateTowardsIn. 313 | * 314 | * A more elaborate description. 315 | * 316 | * \param stateFromIn Initial state 317 | * \param stateTowardsIn Final state 318 | * \param exactConnectionOut Set to true if the initial and the final states 319 | * can be connected exactly. 320 | * 321 | */ 322 | double evaluateExtensionCost (State &stateFromIn, State &stateTowardsIn, bool &exactConnectionOut); 323 | 324 | /*! 325 | * \brief Returns a lower bound on the cost to go starting from stateIn 326 | * 327 | * A more elaborate description. 328 | * 329 | * \param stateIn Starting state 330 | * 331 | */ 332 | double evaluateCostToGo (State& stateIn); 333 | 334 | /*! 335 | * \brief Returns the trajectory as a list of double arrays, each with dimension getNumDimensions. 336 | * 337 | * A more elaborate description. 338 | * 339 | * \param stateFromIn Initial state 340 | * \param stateToIn Final state 341 | * \param trajectoryOut The list of double arrays that represent the trajectory 342 | * 343 | */ 344 | int getTrajectory (State& stateFromIn, State& stateToIn, std::list& trajectoryOut); 345 | 346 | }; 347 | } 348 | 349 | 350 | #endif 351 | -------------------------------------------------------------------------------- /rrtstar/src/rrts_main.cpp: -------------------------------------------------------------------------------- 1 | #define LIBBOT_PRESENT 0 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "rrts.hpp" 13 | #include "system_single_integrator.h" 14 | 15 | 16 | using namespace RRTstar; 17 | using namespace SingleIntegrator; 18 | 19 | using namespace std; 20 | 21 | 22 | 23 | typedef Planner planner_t; 24 | typedef Vertex vertex_t; 25 | 26 | 27 | int publishTree (lcm_t *lcm, planner_t& planner, System& system); 28 | int publishTraj (lcm_t *lcm, planner_t& planner, System& system); 29 | int publishEnvironment (lcm_t *lcm, region& regionOperating, region& regionGoal, list& obstacles); 30 | 31 | 32 | int main () { 33 | 34 | 35 | planner_t rrts; 36 | 37 | cout << "RRTstar is alive" << endl; 38 | 39 | 40 | // Get lcm 41 | lcm_t *lcm = bot_lcm_get_global (NULL); 42 | 43 | 44 | // Create the dynamical system 45 | System system; 46 | 47 | // Configuration space 48 | system.setNumDimensions (2); 49 | 50 | // Define the operating region 51 | system.regionOperating.setNumDimensions(2); 52 | system.regionOperating.center[0] = 0.0; 53 | system.regionOperating.center[1] = 0.0; 54 | 55 | system.regionOperating.size[0] = 400.0; 56 | system.regionOperating.size[1] = 400.0; 57 | 58 | 59 | // Define the goal region 60 | system.regionGoal.setNumDimensions(2); 61 | system.regionGoal.center[0] = -25.0; 62 | system.regionGoal.center[1] = -120.0; 63 | 64 | system.regionGoal.size[0] = 2.0; 65 | system.regionGoal.size[1] = 2.0; 66 | 67 | 68 | // Define the obstacle region 69 | region *obstaclel1, *obstaclel2, *obstaclel3, *obstacler1, *obstacler2, *obstacler3; 70 | 71 | obstaclel1 = new region; 72 | obstaclel1->setNumDimensions(2); 73 | obstaclel1->center[0] = 25; 74 | obstaclel1->center[1] = 100; 75 | obstaclel1->size[0] = 20; 76 | obstaclel1->size[1] = 5; 77 | 78 | obstaclel2 = new region; 79 | obstaclel2->setNumDimensions(2); 80 | obstaclel2->center[0] = 35; 81 | obstaclel2->center[1] = 120; 82 | obstaclel2->size[0] = 5; 83 | obstaclel2->size[1] = 40; 84 | 85 | obstaclel3 = new region; 86 | obstaclel3->setNumDimensions(2); 87 | obstaclel3->center[0] = 15; 88 | obstaclel3->center[1] = 120; 89 | obstaclel3->size[0] = 5; 90 | obstaclel3->size[1] = 40; 91 | 92 | obstacler1 = new region; 93 | obstacler1->setNumDimensions(2); 94 | obstacler1->center[0] = -25; 95 | obstacler1->center[1] = -100; 96 | obstacler1->size[0] = 20; 97 | obstacler1->size[1] = 5; 98 | 99 | obstacler2 = new region; 100 | obstacler2->setNumDimensions(2); 101 | obstacler2->center[0] = -35; 102 | obstacler2->center[1] = -120; 103 | obstacler2->size[0] = 5; 104 | obstacler2->size[1] = 40; 105 | 106 | obstacler3 = new region; 107 | obstacler3->setNumDimensions(2); 108 | obstacler3->center[0] = -15; 109 | obstacler3->center[1] = -120; 110 | obstacler3->size[0] = 5; 111 | obstacler3->size[1] = 40; 112 | 113 | 114 | 115 | system.obstacles.push_front (obstaclel1); 116 | system.obstacles.push_front (obstaclel2); 117 | system.obstacles.push_front (obstaclel3); 118 | system.obstacles.push_front (obstacler1); 119 | system.obstacles.push_front (obstacler2); 120 | system.obstacles.push_front (obstacler3); 121 | 122 | publishEnvironment (lcm, system.regionOperating, system.regionGoal, system.obstacles); 123 | 124 | 125 | 126 | // Add the system to the planner 127 | rrts.setSystem (system); 128 | 129 | //ROOT VERTEX 130 | vertex_t &root = rrts.getRootVertex(); 131 | State &rootState = root.getState(); 132 | rootState[0] = 25.0; 133 | rootState[1] = 120.0; 134 | 135 | 136 | 137 | // Initialize the planner 138 | rrts.initialize (); 139 | 140 | // This parameter should be larger than 1.5 for asymptotic 141 | // optimality. Larger values will weigh on optimization 142 | // rather than exploration in the RRT* algorithm. Lower 143 | // values, such as 0.1, should recover the RRT. 144 | rrts.setGamma (1.5); 145 | 146 | 147 | 148 | clock_t start = clock(); 149 | 150 | // Run the algorithm for 10000 iteartions 151 | for (int i = 0; i < 10000; i++) { 152 | rrts.iteration (); 153 | if (&rrts.getBestVertex() != NULL) { 154 | cout << "Found best vertex in " << i << " iterations" << endl; 155 | break; 156 | } 157 | 158 | } 159 | 160 | clock_t finish = clock(); 161 | cout << "Time : " << ((double)(finish-start))/CLOCKS_PER_SEC << endl; 162 | 163 | publishTree (lcm, rrts, system); 164 | 165 | publishTraj (lcm, rrts, system); 166 | 167 | 168 | return 1; 169 | } 170 | 171 | 172 | 173 | int publishEnvironment (lcm_t *lcm, region& regionOperating, region& regionGoal, list& obstacles) { 174 | 175 | // Publish the environment 176 | lcmtypes_environment_t *environment = (lcmtypes_environment_t*) malloc (sizeof(lcmtypes_environment_t)); 177 | 178 | environment->operating.center[0] = regionOperating.center[0]; 179 | environment->operating.center[1] = regionOperating.center[1]; 180 | 181 | environment->operating.size[0] = regionOperating.size[0]; 182 | environment->operating.size[1] = regionOperating.size[1]; 183 | 184 | 185 | environment->goal.center[0] = regionGoal.center[0]; 186 | environment->goal.center[1] = regionGoal.center[1]; 187 | 188 | environment->goal.size[0] = regionGoal.size[0]; 189 | environment->goal.size[1] = regionGoal.size[1]; 190 | 191 | 192 | environment->num_obstacles = obstacles.size(); 193 | 194 | if (environment->num_obstacles > 0) 195 | environment->obstacles = (lcmtypes_region_3d_t *) malloc (sizeof(lcmtypes_region_3d_t)); 196 | 197 | int idx_obstacles = 0; 198 | for (list::iterator iter = obstacles.begin(); iter != obstacles.end(); iter++){ 199 | 200 | region* obstacleCurr = *iter; 201 | 202 | environment->obstacles[idx_obstacles].center[0] = obstacleCurr->center[0]; 203 | environment->obstacles[idx_obstacles].center[1] = obstacleCurr->center[1]; 204 | 205 | environment->obstacles[idx_obstacles].size[0] = obstacleCurr->size[0]; 206 | environment->obstacles[idx_obstacles].size[1] = obstacleCurr->size[1]; 207 | 208 | 209 | idx_obstacles++; 210 | } 211 | 212 | lcmtypes_environment_t_publish (lcm, "ENVIRONMENT", environment); 213 | 214 | return 1; 215 | } 216 | 217 | 218 | int publishTraj (lcm_t *lcm, planner_t& planner, System& system) { 219 | 220 | 221 | cout << "Publishing trajectory -- start" << endl; 222 | 223 | vertex_t& vertexBest = planner.getBestVertex (); 224 | 225 | if (&vertexBest == NULL) { 226 | cout << "No best vertex" << endl; 227 | return 0; 228 | } 229 | 230 | list stateList; 231 | 232 | planner.getBestTrajectory (stateList); 233 | 234 | lcmtypes_trajectory_t *opttraj = (lcmtypes_trajectory_t *) malloc (sizeof (lcmtypes_trajectory_t)); 235 | 236 | opttraj->num_states = stateList.size(); 237 | opttraj->states = (lcmtypes_state_t *) malloc (opttraj->num_states * sizeof (lcmtypes_state_t)); 238 | 239 | int stateIndex = 0; 240 | for (list::iterator iter = stateList.begin(); iter != stateList.end(); iter++) { 241 | 242 | double* stateRef = *iter; 243 | opttraj->states[stateIndex].x = stateRef[0]; 244 | opttraj->states[stateIndex].y = stateRef[1]; 245 | if (system.getNumDimensions() > 2) 246 | opttraj->states[stateIndex].z = stateRef[2]; 247 | else 248 | opttraj->states[stateIndex].z = 0.0; 249 | 250 | delete [] stateRef; 251 | 252 | stateIndex++; 253 | } 254 | 255 | 256 | lcmtypes_trajectory_t_publish (lcm, "TRAJECTORY", opttraj); 257 | 258 | lcmtypes_trajectory_t_destroy (opttraj); 259 | 260 | cout << "Publishing trajectory -- end" << endl; 261 | 262 | 263 | 264 | return 1; 265 | } 266 | 267 | 268 | 269 | 270 | int publishTree (lcm_t *lcm, planner_t& planner, System& system) { 271 | 272 | 273 | cout << "Publishing the tree -- start" << endl; 274 | 275 | bool plot3d = (system.getNumDimensions() > 2); 276 | 277 | lcmtypes_graph_t *graph = (lcmtypes_graph_t *) malloc (sizeof (lcmtypes_graph_t)); 278 | graph->num_vertices = planner.numVertices; 279 | 280 | 281 | if (graph->num_vertices > 0) { 282 | 283 | graph->vertices = (lcmtypes_vertex_t *) malloc (graph->num_vertices * sizeof(lcmtypes_vertex_t)); 284 | 285 | int vertexIndex = 0; 286 | for (list::iterator iter = planner.listVertices.begin(); iter != planner.listVertices.end(); iter++) { 287 | 288 | 289 | vertex_t &vertexCurr = **iter; 290 | State &stateCurr = vertexCurr.getState (); 291 | 292 | graph->vertices[vertexIndex].state.x = stateCurr[0]; 293 | graph->vertices[vertexIndex].state.y = stateCurr[1]; 294 | if (plot3d) 295 | graph->vertices[vertexIndex].state.z = stateCurr[2]; 296 | else 297 | graph->vertices[vertexIndex].state.z = 0.0; 298 | 299 | vertexIndex++; 300 | 301 | } 302 | 303 | } 304 | else { 305 | graph->vertices = NULL; 306 | } 307 | 308 | if (graph->num_vertices > 1) { 309 | 310 | graph->num_edges = graph->num_vertices - 1; 311 | graph->edges = (lcmtypes_edge_t *) malloc (graph->num_edges * sizeof(lcmtypes_edge_t)); 312 | 313 | 314 | int edgeIndex = 0; 315 | for (list::iterator iter = planner.listVertices.begin(); iter != planner.listVertices.end(); iter++) { 316 | 317 | vertex_t &vertexCurr = **iter; 318 | 319 | vertex_t &vertexParent = vertexCurr.getParent(); 320 | 321 | if ( &vertexParent == NULL ) 322 | continue; 323 | 324 | State &stateCurr = vertexCurr.getState (); 325 | State &stateParent = vertexParent.getState(); 326 | 327 | 328 | graph->edges[edgeIndex].vertex_src.state.x = stateParent[0]; 329 | graph->edges[edgeIndex].vertex_src.state.y = stateParent[1]; 330 | if (plot3d) 331 | graph->edges[edgeIndex].vertex_src.state.z = stateParent[2]; 332 | else 333 | graph->edges[edgeIndex].vertex_src.state.z = 0.0; 334 | 335 | 336 | graph->edges[edgeIndex].vertex_dst.state.x = stateCurr[0]; 337 | graph->edges[edgeIndex].vertex_dst.state.y = stateCurr[1]; 338 | if (plot3d) 339 | graph->edges[edgeIndex].vertex_dst.state.z = stateCurr[2]; 340 | else 341 | graph->edges[edgeIndex].vertex_dst.state.z = 0.0; 342 | 343 | graph->edges[edgeIndex].trajectory.num_states = 0; 344 | graph->edges[edgeIndex].trajectory.states = NULL; 345 | 346 | edgeIndex++; 347 | } 348 | 349 | } 350 | else { 351 | graph->num_edges = 0; 352 | graph->edges = NULL; 353 | } 354 | 355 | lcmtypes_graph_t_publish (lcm, "GRAPH", graph); 356 | 357 | lcmtypes_graph_t_destroy (graph); 358 | 359 | cout << "Publishing the tree -- end" << endl; 360 | 361 | return 1; 362 | } 363 | 364 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | /* Version number components: V=Version, R=Revision, P=Patch 9 | Version date components: YYYY=Year, MM=Month, DD=Day */ 10 | 11 | #if defined(__COMO__) 12 | # define COMPILER_ID "Comeau" 13 | /* __COMO_VERSION__ = VRR */ 14 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 15 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 16 | 17 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 18 | # define COMPILER_ID "Intel" 19 | /* __INTEL_COMPILER = VRP */ 20 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 21 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 22 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 23 | # if defined(__INTEL_COMPILER_BUILD_DATE) 24 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 25 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 26 | # endif 27 | 28 | #elif defined(__PATHCC__) 29 | # define COMPILER_ID "PathScale" 30 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 31 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 32 | # if defined(__PATHCC_PATCHLEVEL__) 33 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 34 | # endif 35 | 36 | #elif defined(__clang__) 37 | # define COMPILER_ID "Clang" 38 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 39 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 40 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 41 | 42 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 43 | # define COMPILER_ID "Embarcadero" 44 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 45 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 46 | # define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) 47 | 48 | #elif defined(__BORLANDC__) 49 | # define COMPILER_ID "Borland" 50 | /* __BORLANDC__ = 0xVRR */ 51 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 52 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 53 | 54 | #elif defined(__WATCOMC__) 55 | # define COMPILER_ID "Watcom" 56 | /* __WATCOMC__ = VVRR */ 57 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 58 | # define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) 59 | 60 | #elif defined(__SUNPRO_CC) 61 | # define COMPILER_ID "SunPro" 62 | # if __SUNPRO_CC >= 0x5100 63 | /* __SUNPRO_CC = 0xVRRP */ 64 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 65 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 66 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 67 | # else 68 | /* __SUNPRO_CC = 0xVRP */ 69 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 70 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 71 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 72 | # endif 73 | 74 | #elif defined(__HP_aCC) 75 | # define COMPILER_ID "HP" 76 | /* __HP_aCC = VVRRPP */ 77 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 78 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 79 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 80 | 81 | #elif defined(__DECCXX) 82 | # define COMPILER_ID "Compaq" 83 | /* __DECCXX_VER = VVRRTPPPP */ 84 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 85 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 86 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 87 | 88 | #elif defined(__IBMCPP__) 89 | # if defined(__COMPILER_VER__) 90 | # define COMPILER_ID "zOS" 91 | # else 92 | # if __IBMCPP__ >= 800 93 | # define COMPILER_ID "XL" 94 | # else 95 | # define COMPILER_ID "VisualAge" 96 | # endif 97 | /* __IBMCPP__ = VRP */ 98 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 99 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 100 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 101 | # endif 102 | 103 | #elif defined(__PGI) 104 | # define COMPILER_ID "PGI" 105 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 106 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 107 | # if defined(__PGIC_PATCHLEVEL__) 108 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 109 | # endif 110 | 111 | #elif defined(_CRAYC) 112 | # define COMPILER_ID "Cray" 113 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE) 114 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 115 | 116 | #elif defined(__TI_COMPILER_VERSION__) 117 | # define COMPILER_ID "TI" 118 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 119 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 120 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 121 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 122 | 123 | #elif defined(__SCO_VERSION__) 124 | # define COMPILER_ID "SCO" 125 | 126 | #elif defined(__GNUC__) 127 | # define COMPILER_ID "GNU" 128 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 129 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 130 | # if defined(__GNUC_PATCHLEVEL__) 131 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 132 | # endif 133 | 134 | #elif defined(_MSC_VER) 135 | # define COMPILER_ID "MSVC" 136 | /* _MSC_VER = VVRR */ 137 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 138 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 139 | # if defined(_MSC_FULL_VER) 140 | # if _MSC_VER >= 1400 141 | /* _MSC_FULL_VER = VVRRPPPPP */ 142 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 143 | # else 144 | /* _MSC_FULL_VER = VVRRPPPP */ 145 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 146 | # endif 147 | # endif 148 | # if defined(_MSC_BUILD) 149 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 150 | # endif 151 | 152 | /* Analog VisualDSP++ >= 4.5.6 */ 153 | #elif defined(__VISUALDSPVERSION__) 154 | # define COMPILER_ID "ADSP" 155 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 156 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 157 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 158 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 159 | 160 | /* Analog VisualDSP++ < 4.5.6 */ 161 | #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 162 | # define COMPILER_ID "ADSP" 163 | 164 | /* IAR Systems compiler for embedded systems. 165 | http://www.iar.com */ 166 | #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) 167 | # define COMPILER_ID "IAR" 168 | 169 | #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) 170 | # define COMPILER_ID "MIPSpro" 171 | # if defined(_SGI_COMPILER_VERSION) 172 | /* _SGI_COMPILER_VERSION = VRP */ 173 | # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) 174 | # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) 175 | # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) 176 | # else 177 | /* _COMPILER_VERSION = VRP */ 178 | # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) 179 | # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) 180 | # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) 181 | # endif 182 | 183 | /* This compiler is either not known or is too old to define an 184 | identification macro. Try to identify the platform and guess that 185 | it is the native compiler. */ 186 | #elif defined(__sgi) 187 | # define COMPILER_ID "MIPSpro" 188 | 189 | #elif defined(__hpux) || defined(__hpua) 190 | # define COMPILER_ID "HP" 191 | 192 | #else /* unknown compiler */ 193 | # define COMPILER_ID "" 194 | 195 | #endif 196 | 197 | /* Construct the string literal in pieces to prevent the source from 198 | getting matched. Store it in a pointer rather than an array 199 | because some compilers will just produce instructions to fill the 200 | array rather than assigning a pointer to a static array. */ 201 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 202 | 203 | /* Identify known platforms by name. */ 204 | #if defined(__linux) || defined(__linux__) || defined(linux) 205 | # define PLATFORM_ID "Linux" 206 | 207 | #elif defined(__CYGWIN__) 208 | # define PLATFORM_ID "Cygwin" 209 | 210 | #elif defined(__MINGW32__) 211 | # define PLATFORM_ID "MinGW" 212 | 213 | #elif defined(__APPLE__) 214 | # define PLATFORM_ID "Darwin" 215 | 216 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 217 | # define PLATFORM_ID "Windows" 218 | 219 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 220 | # define PLATFORM_ID "FreeBSD" 221 | 222 | #elif defined(__NetBSD__) || defined(__NetBSD) 223 | # define PLATFORM_ID "NetBSD" 224 | 225 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 226 | # define PLATFORM_ID "OpenBSD" 227 | 228 | #elif defined(__sun) || defined(sun) 229 | # define PLATFORM_ID "SunOS" 230 | 231 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 232 | # define PLATFORM_ID "AIX" 233 | 234 | #elif defined(__sgi) || defined(__sgi__) || defined(_SGI) 235 | # define PLATFORM_ID "IRIX" 236 | 237 | #elif defined(__hpux) || defined(__hpux__) 238 | # define PLATFORM_ID "HP-UX" 239 | 240 | #elif defined(__HAIKU__) 241 | # define PLATFORM_ID "Haiku" 242 | 243 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 244 | # define PLATFORM_ID "BeOS" 245 | 246 | #elif defined(__QNX__) || defined(__QNXNTO__) 247 | # define PLATFORM_ID "QNX" 248 | 249 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 250 | # define PLATFORM_ID "Tru64" 251 | 252 | #elif defined(__riscos) || defined(__riscos__) 253 | # define PLATFORM_ID "RISCos" 254 | 255 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 256 | # define PLATFORM_ID "SINIX" 257 | 258 | #elif defined(__UNIX_SV__) 259 | # define PLATFORM_ID "UNIX_SV" 260 | 261 | #elif defined(__bsdos__) 262 | # define PLATFORM_ID "BSDOS" 263 | 264 | #elif defined(_MPRAS) || defined(MPRAS) 265 | # define PLATFORM_ID "MP-RAS" 266 | 267 | #elif defined(__osf) || defined(__osf__) 268 | # define PLATFORM_ID "OSF1" 269 | 270 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 271 | # define PLATFORM_ID "SCO_SV" 272 | 273 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 274 | # define PLATFORM_ID "ULTRIX" 275 | 276 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 277 | # define PLATFORM_ID "Xenix" 278 | 279 | #else /* unknown platform */ 280 | # define PLATFORM_ID "" 281 | 282 | #endif 283 | 284 | /* For windows compilers MSVC and Intel we can determine 285 | the architecture of the compiler being used. This is because 286 | the compilers do not have flags that can change the architecture, 287 | but rather depend on which compiler is being used 288 | */ 289 | #if defined(_WIN32) && defined(_MSC_VER) 290 | # if defined(_M_IA64) 291 | # define ARCHITECTURE_ID "IA64" 292 | 293 | # elif defined(_M_X64) || defined(_M_AMD64) 294 | # define ARCHITECTURE_ID "x64" 295 | 296 | # elif defined(_M_IX86) 297 | # define ARCHITECTURE_ID "X86" 298 | 299 | # elif defined(_M_ARM) 300 | # define ARCHITECTURE_ID "ARM" 301 | 302 | # elif defined(_M_MIPS) 303 | # define ARCHITECTURE_ID "MIPS" 304 | 305 | # elif defined(_M_SH) 306 | # define ARCHITECTURE_ID "SHx" 307 | 308 | # else /* unknown architecture */ 309 | # define ARCHITECTURE_ID "" 310 | # endif 311 | 312 | #else 313 | # define ARCHITECTURE_ID "" 314 | #endif 315 | 316 | /* Convert integer to decimal digit literals. */ 317 | #define DEC(n) \ 318 | ('0' + (((n) / 10000000)%10)), \ 319 | ('0' + (((n) / 1000000)%10)), \ 320 | ('0' + (((n) / 100000)%10)), \ 321 | ('0' + (((n) / 10000)%10)), \ 322 | ('0' + (((n) / 1000)%10)), \ 323 | ('0' + (((n) / 100)%10)), \ 324 | ('0' + (((n) / 10)%10)), \ 325 | ('0' + ((n) % 10)) 326 | 327 | /* Convert integer to hex digit literals. */ 328 | #define HEX(n) \ 329 | ('0' + ((n)>>28 & 0xF)), \ 330 | ('0' + ((n)>>24 & 0xF)), \ 331 | ('0' + ((n)>>20 & 0xF)), \ 332 | ('0' + ((n)>>16 & 0xF)), \ 333 | ('0' + ((n)>>12 & 0xF)), \ 334 | ('0' + ((n)>>8 & 0xF)), \ 335 | ('0' + ((n)>>4 & 0xF)), \ 336 | ('0' + ((n) & 0xF)) 337 | 338 | /* Construct a string literal encoding the version number components. */ 339 | #ifdef COMPILER_VERSION_MAJOR 340 | char const info_version[] = { 341 | 'I', 'N', 'F', 'O', ':', 342 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 343 | COMPILER_VERSION_MAJOR, 344 | # ifdef COMPILER_VERSION_MINOR 345 | '.', COMPILER_VERSION_MINOR, 346 | # ifdef COMPILER_VERSION_PATCH 347 | '.', COMPILER_VERSION_PATCH, 348 | # ifdef COMPILER_VERSION_TWEAK 349 | '.', COMPILER_VERSION_TWEAK, 350 | # endif 351 | # endif 352 | # endif 353 | ']','\0'}; 354 | #endif 355 | 356 | /* Construct the string literal in pieces to prevent the source from 357 | getting matched. Store it in a pointer rather than an array 358 | because some compilers will just produce instructions to fill the 359 | array rather than assigning a pointer to a static array. */ 360 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 361 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 362 | 363 | 364 | 365 | /*--------------------------------------------------------------------------*/ 366 | 367 | int main(int argc, char* argv[]) 368 | { 369 | int require = 0; 370 | require += info_compiler[argc]; 371 | require += info_platform[argc]; 372 | #ifdef COMPILER_VERSION_MAJOR 373 | require += info_version[argc]; 374 | #endif 375 | (void)argv; 376 | return require; 377 | } 378 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # error "A C++ compiler has been selected for C." 3 | #endif 4 | 5 | /* Version number components: V=Version, R=Revision, P=Patch 6 | Version date components: YYYY=Year, MM=Month, DD=Day */ 7 | 8 | #if defined(__18CXX) 9 | # define ID_VOID_MAIN 10 | #endif 11 | 12 | #if defined(__INTEL_COMPILER) || defined(__ICC) 13 | # define COMPILER_ID "Intel" 14 | /* __INTEL_COMPILER = VRP */ 15 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 16 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 17 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 18 | # if defined(__INTEL_COMPILER_BUILD_DATE) 19 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 20 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 21 | # endif 22 | 23 | #elif defined(__PATHCC__) 24 | # define COMPILER_ID "PathScale" 25 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 26 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 27 | # if defined(__PATHCC_PATCHLEVEL__) 28 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 29 | # endif 30 | 31 | #elif defined(__clang__) 32 | # define COMPILER_ID "Clang" 33 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 34 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 35 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 36 | 37 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 38 | # define COMPILER_ID "Embarcadero" 39 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 40 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 41 | # define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) 42 | 43 | #elif defined(__BORLANDC__) 44 | # define COMPILER_ID "Borland" 45 | /* __BORLANDC__ = 0xVRR */ 46 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 47 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 48 | 49 | #elif defined(__WATCOMC__) 50 | # define COMPILER_ID "Watcom" 51 | /* __WATCOMC__ = VVRR */ 52 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 53 | # define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) 54 | 55 | #elif defined(__SUNPRO_C) 56 | # define COMPILER_ID "SunPro" 57 | # if __SUNPRO_C >= 0x5100 58 | /* __SUNPRO_C = 0xVRRP */ 59 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) 60 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) 61 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 62 | # else 63 | /* __SUNPRO_C = 0xVRP */ 64 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) 65 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) 66 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 67 | # endif 68 | 69 | #elif defined(__HP_cc) 70 | # define COMPILER_ID "HP" 71 | /* __HP_cc = VVRRPP */ 72 | # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) 73 | # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) 74 | # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) 75 | 76 | #elif defined(__DECC) 77 | # define COMPILER_ID "Compaq" 78 | /* __DECC_VER = VVRRTPPPP */ 79 | # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) 80 | # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) 81 | # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) 82 | 83 | #elif defined(__IBMC__) 84 | # if defined(__COMPILER_VER__) 85 | # define COMPILER_ID "zOS" 86 | # else 87 | # if __IBMC__ >= 800 88 | # define COMPILER_ID "XL" 89 | # else 90 | # define COMPILER_ID "VisualAge" 91 | # endif 92 | /* __IBMC__ = VRP */ 93 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 94 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 95 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 96 | # endif 97 | 98 | #elif defined(__PGI) 99 | # define COMPILER_ID "PGI" 100 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 101 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 102 | # if defined(__PGIC_PATCHLEVEL__) 103 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 104 | # endif 105 | 106 | #elif defined(_CRAYC) 107 | # define COMPILER_ID "Cray" 108 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE) 109 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 110 | 111 | #elif defined(__TI_COMPILER_VERSION__) 112 | # define COMPILER_ID "TI" 113 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 114 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 115 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 116 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 117 | 118 | #elif defined(__TINYC__) 119 | # define COMPILER_ID "TinyCC" 120 | 121 | #elif defined(__SCO_VERSION__) 122 | # define COMPILER_ID "SCO" 123 | 124 | #elif defined(__GNUC__) 125 | # define COMPILER_ID "GNU" 126 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 127 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 128 | # if defined(__GNUC_PATCHLEVEL__) 129 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 130 | # endif 131 | 132 | #elif defined(_MSC_VER) 133 | # define COMPILER_ID "MSVC" 134 | /* _MSC_VER = VVRR */ 135 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 136 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 137 | # if defined(_MSC_FULL_VER) 138 | # if _MSC_VER >= 1400 139 | /* _MSC_FULL_VER = VVRRPPPPP */ 140 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 141 | # else 142 | /* _MSC_FULL_VER = VVRRPPPP */ 143 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 144 | # endif 145 | # endif 146 | # if defined(_MSC_BUILD) 147 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 148 | # endif 149 | 150 | /* Analog VisualDSP++ >= 4.5.6 */ 151 | #elif defined(__VISUALDSPVERSION__) 152 | # define COMPILER_ID "ADSP" 153 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 154 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 155 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 156 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 157 | 158 | /* Analog VisualDSP++ < 4.5.6 */ 159 | #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 160 | # define COMPILER_ID "ADSP" 161 | 162 | /* IAR Systems compiler for embedded systems. 163 | http://www.iar.com */ 164 | #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) 165 | # define COMPILER_ID "IAR" 166 | 167 | /* sdcc, the small devices C compiler for embedded systems, 168 | http://sdcc.sourceforge.net */ 169 | #elif defined(SDCC) 170 | # define COMPILER_ID "SDCC" 171 | /* SDCC = VRP */ 172 | # define COMPILER_VERSION_MAJOR DEC(SDCC/100) 173 | # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) 174 | # define COMPILER_VERSION_PATCH DEC(SDCC % 10) 175 | 176 | #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) 177 | # define COMPILER_ID "MIPSpro" 178 | # if defined(_SGI_COMPILER_VERSION) 179 | /* _SGI_COMPILER_VERSION = VRP */ 180 | # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) 181 | # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) 182 | # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) 183 | # else 184 | /* _COMPILER_VERSION = VRP */ 185 | # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) 186 | # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) 187 | # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) 188 | # endif 189 | 190 | /* This compiler is either not known or is too old to define an 191 | identification macro. Try to identify the platform and guess that 192 | it is the native compiler. */ 193 | #elif defined(__sgi) 194 | # define COMPILER_ID "MIPSpro" 195 | 196 | #elif defined(__hpux) || defined(__hpua) 197 | # define COMPILER_ID "HP" 198 | 199 | #else /* unknown compiler */ 200 | # define COMPILER_ID "" 201 | 202 | #endif 203 | 204 | /* Construct the string literal in pieces to prevent the source from 205 | getting matched. Store it in a pointer rather than an array 206 | because some compilers will just produce instructions to fill the 207 | array rather than assigning a pointer to a static array. */ 208 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 209 | 210 | /* Identify known platforms by name. */ 211 | #if defined(__linux) || defined(__linux__) || defined(linux) 212 | # define PLATFORM_ID "Linux" 213 | 214 | #elif defined(__CYGWIN__) 215 | # define PLATFORM_ID "Cygwin" 216 | 217 | #elif defined(__MINGW32__) 218 | # define PLATFORM_ID "MinGW" 219 | 220 | #elif defined(__APPLE__) 221 | # define PLATFORM_ID "Darwin" 222 | 223 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 224 | # define PLATFORM_ID "Windows" 225 | 226 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 227 | # define PLATFORM_ID "FreeBSD" 228 | 229 | #elif defined(__NetBSD__) || defined(__NetBSD) 230 | # define PLATFORM_ID "NetBSD" 231 | 232 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 233 | # define PLATFORM_ID "OpenBSD" 234 | 235 | #elif defined(__sun) || defined(sun) 236 | # define PLATFORM_ID "SunOS" 237 | 238 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 239 | # define PLATFORM_ID "AIX" 240 | 241 | #elif defined(__sgi) || defined(__sgi__) || defined(_SGI) 242 | # define PLATFORM_ID "IRIX" 243 | 244 | #elif defined(__hpux) || defined(__hpux__) 245 | # define PLATFORM_ID "HP-UX" 246 | 247 | #elif defined(__HAIKU__) 248 | # define PLATFORM_ID "Haiku" 249 | 250 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 251 | # define PLATFORM_ID "BeOS" 252 | 253 | #elif defined(__QNX__) || defined(__QNXNTO__) 254 | # define PLATFORM_ID "QNX" 255 | 256 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 257 | # define PLATFORM_ID "Tru64" 258 | 259 | #elif defined(__riscos) || defined(__riscos__) 260 | # define PLATFORM_ID "RISCos" 261 | 262 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 263 | # define PLATFORM_ID "SINIX" 264 | 265 | #elif defined(__UNIX_SV__) 266 | # define PLATFORM_ID "UNIX_SV" 267 | 268 | #elif defined(__bsdos__) 269 | # define PLATFORM_ID "BSDOS" 270 | 271 | #elif defined(_MPRAS) || defined(MPRAS) 272 | # define PLATFORM_ID "MP-RAS" 273 | 274 | #elif defined(__osf) || defined(__osf__) 275 | # define PLATFORM_ID "OSF1" 276 | 277 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 278 | # define PLATFORM_ID "SCO_SV" 279 | 280 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 281 | # define PLATFORM_ID "ULTRIX" 282 | 283 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 284 | # define PLATFORM_ID "Xenix" 285 | 286 | #else /* unknown platform */ 287 | # define PLATFORM_ID "" 288 | 289 | #endif 290 | 291 | /* For windows compilers MSVC and Intel we can determine 292 | the architecture of the compiler being used. This is because 293 | the compilers do not have flags that can change the architecture, 294 | but rather depend on which compiler is being used 295 | */ 296 | #if defined(_WIN32) && defined(_MSC_VER) 297 | # if defined(_M_IA64) 298 | # define ARCHITECTURE_ID "IA64" 299 | 300 | # elif defined(_M_X64) || defined(_M_AMD64) 301 | # define ARCHITECTURE_ID "x64" 302 | 303 | # elif defined(_M_IX86) 304 | # define ARCHITECTURE_ID "X86" 305 | 306 | # elif defined(_M_ARM) 307 | # define ARCHITECTURE_ID "ARM" 308 | 309 | # elif defined(_M_MIPS) 310 | # define ARCHITECTURE_ID "MIPS" 311 | 312 | # elif defined(_M_SH) 313 | # define ARCHITECTURE_ID "SHx" 314 | 315 | # else /* unknown architecture */ 316 | # define ARCHITECTURE_ID "" 317 | # endif 318 | 319 | #else 320 | # define ARCHITECTURE_ID "" 321 | #endif 322 | 323 | /* Convert integer to decimal digit literals. */ 324 | #define DEC(n) \ 325 | ('0' + (((n) / 10000000)%10)), \ 326 | ('0' + (((n) / 1000000)%10)), \ 327 | ('0' + (((n) / 100000)%10)), \ 328 | ('0' + (((n) / 10000)%10)), \ 329 | ('0' + (((n) / 1000)%10)), \ 330 | ('0' + (((n) / 100)%10)), \ 331 | ('0' + (((n) / 10)%10)), \ 332 | ('0' + ((n) % 10)) 333 | 334 | /* Convert integer to hex digit literals. */ 335 | #define HEX(n) \ 336 | ('0' + ((n)>>28 & 0xF)), \ 337 | ('0' + ((n)>>24 & 0xF)), \ 338 | ('0' + ((n)>>20 & 0xF)), \ 339 | ('0' + ((n)>>16 & 0xF)), \ 340 | ('0' + ((n)>>12 & 0xF)), \ 341 | ('0' + ((n)>>8 & 0xF)), \ 342 | ('0' + ((n)>>4 & 0xF)), \ 343 | ('0' + ((n) & 0xF)) 344 | 345 | /* Construct a string literal encoding the version number components. */ 346 | #ifdef COMPILER_VERSION_MAJOR 347 | char const info_version[] = { 348 | 'I', 'N', 'F', 'O', ':', 349 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 350 | COMPILER_VERSION_MAJOR, 351 | # ifdef COMPILER_VERSION_MINOR 352 | '.', COMPILER_VERSION_MINOR, 353 | # ifdef COMPILER_VERSION_PATCH 354 | '.', COMPILER_VERSION_PATCH, 355 | # ifdef COMPILER_VERSION_TWEAK 356 | '.', COMPILER_VERSION_TWEAK, 357 | # endif 358 | # endif 359 | # endif 360 | ']','\0'}; 361 | #endif 362 | 363 | /* Construct the string literal in pieces to prevent the source from 364 | getting matched. Store it in a pointer rather than an array 365 | because some compilers will just produce instructions to fill the 366 | array rather than assigning a pointer to a static array. */ 367 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 368 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 369 | 370 | 371 | 372 | /*--------------------------------------------------------------------------*/ 373 | 374 | #ifdef ID_VOID_MAIN 375 | void main() {} 376 | #else 377 | int main(int argc, char* argv[]) 378 | { 379 | int require = 0; 380 | require += info_compiler[argc]; 381 | require += info_platform[argc]; 382 | require += info_arch[argc]; 383 | #ifdef COMPILER_VERSION_MAJOR 384 | require += info_version[argc]; 385 | #endif 386 | (void)argv; 387 | return require; 388 | } 389 | #endif 390 | -------------------------------------------------------------------------------- /rrtstar-standalone/pod-build/CMakeCache.txt: -------------------------------------------------------------------------------- 1 | # This is the CMakeCache file. 2 | # For build in directory: /home/ahmed/r/rrtstar-standalone/pod-build 3 | # It was generated by CMake: /usr/bin/cmake 4 | # You can edit this file to change values found and used by cmake. 5 | # If you do not want to change any of the values, simply exit the editor. 6 | # If you do want to change a value, simply edit, save, and exit the editor. 7 | # The syntax for the file is as follows: 8 | # KEY:TYPE=VALUE 9 | # KEY is the name of a variable in the cache. 10 | # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. 11 | # VALUE is the current value for the KEY. 12 | 13 | ######################## 14 | # EXTERNAL cache entries 15 | ######################## 16 | 17 | //Path to a program. 18 | CMAKE_AR:FILEPATH=/usr/bin/ar 19 | 20 | //Choose the type of build, options are: None(CMAKE_CXX_FLAGS or 21 | // CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. 22 | CMAKE_BUILD_TYPE:STRING=Release 23 | 24 | //Enable/Disable color output during build. 25 | CMAKE_COLOR_MAKEFILE:BOOL=ON 26 | 27 | //CXX compiler. 28 | CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ 29 | 30 | //Flags used by the compiler during all build types. 31 | CMAKE_CXX_FLAGS:STRING= 32 | 33 | //Flags used by the compiler during debug builds. 34 | CMAKE_CXX_FLAGS_DEBUG:STRING=-g 35 | 36 | //Flags used by the compiler during release minsize builds. 37 | CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 38 | 39 | //Flags used by the compiler during release builds (/MD /Ob1 /Oi 40 | // /Ot /Oy /Gs will produce slightly less optimized but smaller 41 | // files). 42 | CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 43 | 44 | //Flags used by the compiler during Release with Debug Info builds. 45 | CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 46 | 47 | //C compiler. 48 | CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc 49 | 50 | //Flags used by the compiler during all build types. 51 | CMAKE_C_FLAGS:STRING= 52 | 53 | //Flags used by the compiler during debug builds. 54 | CMAKE_C_FLAGS_DEBUG:STRING=-g 55 | 56 | //Flags used by the compiler during release minsize builds. 57 | CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 58 | 59 | //Flags used by the compiler during release builds (/MD /Ob1 /Oi 60 | // /Ot /Oy /Gs will produce slightly less optimized but smaller 61 | // files). 62 | CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 63 | 64 | //Flags used by the compiler during Release with Debug Info builds. 65 | CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 66 | 67 | //Flags used by the linker. 68 | CMAKE_EXE_LINKER_FLAGS:STRING=' ' 69 | 70 | //Flags used by the linker during debug builds. 71 | CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= 72 | 73 | //Flags used by the linker during release minsize builds. 74 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= 75 | 76 | //Flags used by the linker during release builds. 77 | CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= 78 | 79 | //Flags used by the linker during Release with Debug Info builds. 80 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 81 | 82 | //Enable/Disable output of compile commands during generation. 83 | CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF 84 | 85 | //Install path prefix, prepended onto install directories. 86 | CMAKE_INSTALL_PREFIX:PATH=/home/ahmed/r/build 87 | 88 | //Path to a program. 89 | CMAKE_LINKER:FILEPATH=/usr/bin/ld 90 | 91 | //Path to a program. 92 | CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make 93 | 94 | //Flags used by the linker during the creation of modules. 95 | CMAKE_MODULE_LINKER_FLAGS:STRING=' ' 96 | 97 | //Flags used by the linker during debug builds. 98 | CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= 99 | 100 | //Flags used by the linker during release minsize builds. 101 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= 102 | 103 | //Flags used by the linker during release builds. 104 | CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= 105 | 106 | //Flags used by the linker during Release with Debug Info builds. 107 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 108 | 109 | //Path to a program. 110 | CMAKE_NM:FILEPATH=/usr/bin/nm 111 | 112 | //Path to a program. 113 | CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy 114 | 115 | //Path to a program. 116 | CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump 117 | 118 | //Value Computed by CMake 119 | CMAKE_PROJECT_NAME:STATIC=rrtstar-standalone 120 | 121 | //Path to a program. 122 | CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib 123 | 124 | //Flags used by the linker during the creation of dll's. 125 | CMAKE_SHARED_LINKER_FLAGS:STRING=' ' 126 | 127 | //Flags used by the linker during debug builds. 128 | CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= 129 | 130 | //Flags used by the linker during release minsize builds. 131 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= 132 | 133 | //Flags used by the linker during release builds. 134 | CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= 135 | 136 | //Flags used by the linker during Release with Debug Info builds. 137 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= 138 | 139 | //If set, runtime paths are not added when installing shared libraries, 140 | // but are added when building. 141 | CMAKE_SKIP_INSTALL_RPATH:BOOL=NO 142 | 143 | //If set, runtime paths are not added when using shared libraries. 144 | CMAKE_SKIP_RPATH:BOOL=NO 145 | 146 | //Flags used by the linker during the creation of static libraries. 147 | CMAKE_STATIC_LINKER_FLAGS:STRING= 148 | 149 | //Flags used by the linker during debug builds. 150 | CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= 151 | 152 | //Flags used by the linker during release minsize builds. 153 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= 154 | 155 | //Flags used by the linker during release builds. 156 | CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= 157 | 158 | //Flags used by the linker during Release with Debug Info builds. 159 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= 160 | 161 | //Path to a program. 162 | CMAKE_STRIP:FILEPATH=/usr/bin/strip 163 | 164 | //If true, cmake will use relative paths in makefiles and projects. 165 | CMAKE_USE_RELATIVE_PATHS:BOOL=OFF 166 | 167 | //If this value is on, makefiles will be generated without the 168 | // .SILENT directive, and all commands will be echoed to the console 169 | // during the make. This is useful for debugging only. With Visual 170 | // Studio IDE projects all commands are done without /nologo. 171 | CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE 172 | 173 | //pkg-config executable 174 | PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config 175 | 176 | //Value Computed by CMake 177 | Project_BINARY_DIR:STATIC=/home/ahmed/r/rrtstar-standalone/pod-build 178 | 179 | //Value Computed by CMake 180 | Project_SOURCE_DIR:STATIC=/home/ahmed/r/rrtstar-standalone 181 | 182 | //Value Computed by CMake 183 | rrtstar-standalone_BINARY_DIR:STATIC=/home/ahmed/r/rrtstar-standalone/pod-build 184 | 185 | //Value Computed by CMake 186 | rrtstar-standalone_SOURCE_DIR:STATIC=/home/ahmed/r/rrtstar-standalone 187 | 188 | 189 | ######################## 190 | # INTERNAL cache entries 191 | ######################## 192 | 193 | //ADVANCED property for variable: CMAKE_AR 194 | CMAKE_AR-ADVANCED:INTERNAL=1 195 | //ADVANCED property for variable: CMAKE_BUILD_TOOL 196 | CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 197 | //What is the target build tool cmake is generating for. 198 | CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make 199 | //This is the directory where this CMakeCache.txt was created 200 | CMAKE_CACHEFILE_DIR:INTERNAL=/home/ahmed/r/rrtstar-standalone/pod-build 201 | //Major version of cmake used to create the current loaded cache 202 | CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 203 | //Minor version of cmake used to create the current loaded cache 204 | CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 205 | //Patch version of cmake used to create the current loaded cache 206 | CMAKE_CACHE_PATCH_VERSION:INTERNAL=12 207 | //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE 208 | CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 209 | //Path to CMake executable. 210 | CMAKE_COMMAND:INTERNAL=/usr/bin/cmake 211 | //Path to cpack program executable. 212 | CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack 213 | //Path to ctest program executable. 214 | CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest 215 | //ADVANCED property for variable: CMAKE_CXX_COMPILER 216 | CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 217 | //ADVANCED property for variable: CMAKE_CXX_FLAGS 218 | CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 219 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG 220 | CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 221 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL 222 | CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 223 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE 224 | CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 225 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO 226 | CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 227 | //ADVANCED property for variable: CMAKE_C_COMPILER 228 | CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 229 | //ADVANCED property for variable: CMAKE_C_FLAGS 230 | CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 231 | //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG 232 | CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 233 | //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL 234 | CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 235 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE 236 | CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 237 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO 238 | CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 239 | //Path to cache edit program executable. 240 | CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/cmake-gui 241 | //Executable file format 242 | CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF 243 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS 244 | CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 245 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG 246 | CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 247 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL 248 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 249 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE 250 | CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 251 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO 252 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 253 | //ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS 254 | CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 255 | //Name of generator. 256 | CMAKE_GENERATOR:INTERNAL=Unix Makefiles 257 | //Name of generator toolset. 258 | CMAKE_GENERATOR_TOOLSET:INTERNAL= 259 | //Start directory with the top level CMakeLists.txt file for this 260 | // project 261 | CMAKE_HOME_DIRECTORY:INTERNAL=/home/ahmed/r/rrtstar-standalone 262 | //Install .so files without execute permission. 263 | CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 264 | //ADVANCED property for variable: CMAKE_LINKER 265 | CMAKE_LINKER-ADVANCED:INTERNAL=1 266 | //ADVANCED property for variable: CMAKE_MAKE_PROGRAM 267 | CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 268 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS 269 | CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 270 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG 271 | CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 272 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL 273 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 274 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE 275 | CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 276 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO 277 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 278 | //ADVANCED property for variable: CMAKE_NM 279 | CMAKE_NM-ADVANCED:INTERNAL=1 280 | //number of local generators 281 | CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2 282 | //ADVANCED property for variable: CMAKE_OBJCOPY 283 | CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 284 | //ADVANCED property for variable: CMAKE_OBJDUMP 285 | CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 286 | //ADVANCED property for variable: CMAKE_RANLIB 287 | CMAKE_RANLIB-ADVANCED:INTERNAL=1 288 | //Path to CMake installation. 289 | CMAKE_ROOT:INTERNAL=/usr/share/cmake-2.8 290 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS 291 | CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 292 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG 293 | CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 294 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL 295 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 296 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE 297 | CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 298 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO 299 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 300 | //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH 301 | CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 302 | //ADVANCED property for variable: CMAKE_SKIP_RPATH 303 | CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 304 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS 305 | CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 306 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG 307 | CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 308 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL 309 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 310 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE 311 | CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 312 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO 313 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 314 | //ADVANCED property for variable: CMAKE_STRIP 315 | CMAKE_STRIP-ADVANCED:INTERNAL=1 316 | //uname command 317 | CMAKE_UNAME:INTERNAL=/bin/uname 318 | //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS 319 | CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 320 | //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE 321 | CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 322 | //Details about finding PkgConfig 323 | FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig:INTERNAL=[/usr/bin/pkg-config][v0.26()] 324 | //ADVANCED property for variable: PKG_CONFIG_EXECUTABLE 325 | PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1 326 | 327 | --------------------------------------------------------------------------------