├── .github └── workflows │ └── industrial_ci_action.yml ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── README.md ├── dynamicEDT3D ├── CHANGELOG.txt ├── CMakeLists.txt ├── CMakeModules │ ├── CMakeUninstall.cmake.in │ ├── CPackSettings.cmake │ ├── CompilerSettings.cmake │ └── InstallPkgConfigFile.cmake ├── LICENSE.txt ├── README.txt ├── doxygen.h ├── dynamicEDT3D.dox ├── dynamicEDT3DConfig.cmake.in ├── include │ └── dynamicEDT3D │ │ ├── bucketedqueue.h │ │ ├── bucketedqueue.hxx │ │ ├── dynamicEDT3D.h │ │ ├── dynamicEDTOctomap.h │ │ ├── dynamicEDTOctomap.hxx │ │ └── point.h ├── package.xml └── src │ ├── CMakeLists.txt │ ├── dynamicEDT3D.cpp │ └── examples │ ├── CMakeLists.txt │ ├── exampleEDT3D.cpp │ ├── exampleEDTOctomap.cpp │ └── exampleEDTOctomapStamped.cpp ├── octomap ├── AUTHORS.txt ├── CHANGELOG.txt ├── CMakeLists.txt ├── CMakeModules │ ├── CMakeUninstall.cmake.in │ ├── CPackSettings.cmake │ ├── CompilerSettings.cmake │ └── InstallPkgConfigFile.cmake ├── LICENSE.txt ├── README.md ├── doxygen.h ├── extern │ └── README_BINVOX ├── include │ └── octomap │ │ ├── AbstractOcTree.h │ │ ├── AbstractOccupancyOcTree.h │ │ ├── ColorOcTree.h │ │ ├── CountingOcTree.h │ │ ├── MCTables.h │ │ ├── MapCollection.h │ │ ├── MapCollection.hxx │ │ ├── MapNode.h │ │ ├── MapNode.hxx │ │ ├── OcTree.h │ │ ├── OcTreeBase.h │ │ ├── OcTreeBaseImpl.h │ │ ├── OcTreeBaseImpl.hxx │ │ ├── OcTreeDataNode.h │ │ ├── OcTreeDataNode.hxx │ │ ├── OcTreeIterator.hxx │ │ ├── OcTreeKey.h │ │ ├── OcTreeNode.h │ │ ├── OcTreeStamped.h │ │ ├── OccupancyOcTreeBase.h │ │ ├── OccupancyOcTreeBase.hxx │ │ ├── Pointcloud.h │ │ ├── ScanGraph.h │ │ ├── math │ │ ├── Pose6D.h │ │ ├── Quaternion.h │ │ ├── Utils.h │ │ └── Vector3.h │ │ ├── octomap.h │ │ ├── octomap_deprecated.h │ │ ├── octomap_timing.h │ │ ├── octomap_types.h │ │ └── octomap_utils.h ├── octomap-config.cmake.in ├── octomap.dox.in ├── package.xml ├── share │ ├── data │ │ ├── geb079.bt │ │ ├── mapcoll.txt │ │ ├── scan.dat.bz2 │ │ └── spherical_scan.graph │ ├── example-project.tgz │ └── images │ │ └── uml_overview.png ├── src │ ├── AbstractOcTree.cpp │ ├── AbstractOccupancyOcTree.cpp │ ├── CMakeLists.txt │ ├── ColorOcTree.cpp │ ├── CountingOcTree.cpp │ ├── OcTree.cpp │ ├── OcTreeNode.cpp │ ├── OcTreeStamped.cpp │ ├── Pointcloud.cpp │ ├── ScanGraph.cpp │ ├── binvox2bt.cpp │ ├── bt2vrml.cpp │ ├── compare_octrees.cpp │ ├── convert_octree.cpp │ ├── edit_octree.cpp │ ├── eval_octree_accuracy.cpp │ ├── graph2tree.cpp │ ├── intersection_example.cpp │ ├── log2graph.cpp │ ├── math │ │ ├── CMakeLists.txt │ │ ├── Pose6D.cpp │ │ ├── Quaternion.cpp │ │ └── Vector3.cpp │ ├── normals_example.cpp │ ├── octree2pointcloud.cpp │ ├── offset_graph.cpp │ ├── pcd_to_bt_example.cpp │ ├── simple_example.cpp │ └── testing │ │ ├── CMakeLists.txt │ │ ├── color_tree_histogram.cpp │ │ ├── test_bbx.cpp │ │ ├── test_changedkeys.cpp │ │ ├── test_color_tree.cpp │ │ ├── test_io.cpp │ │ ├── test_iterators.cpp │ │ ├── test_mapcollection.cpp │ │ ├── test_pruning.cpp │ │ ├── test_raycasting.cpp │ │ ├── test_scans.cpp │ │ ├── testing.h │ │ └── unit_tests.cpp └── valgrind_memcheck.supp ├── octovis ├── CMakeLists.txt ├── CMakeLists_src.txt ├── CMakeModules │ ├── CMakeUninstall.cmake.in │ ├── CompilerSettings.cmake │ └── FindQGLViewer.cmake ├── LICENSE.txt ├── README.md ├── include │ └── octovis │ │ ├── CameraFollowMode.h │ │ ├── ColorOcTreeDrawer.h │ │ ├── OcTreeDrawer.h │ │ ├── OcTreeRecord.h │ │ ├── PointcloudDrawer.h │ │ ├── SceneObject.h │ │ ├── SelectionBox.h │ │ ├── TrajectoryDrawer.h │ │ ├── ViewerGui.h │ │ ├── ViewerGui.ui │ │ ├── ViewerSettings.h │ │ ├── ViewerSettings.ui │ │ ├── ViewerSettingsPanel.h │ │ ├── ViewerSettingsPanel.ui │ │ ├── ViewerSettingsPanelCamera.h │ │ ├── ViewerSettingsPanelCamera.ui │ │ └── ViewerWidget.h ├── octovis-config.cmake.in ├── package.xml └── src │ ├── CameraFollowMode.cpp │ ├── ColorOcTreeDrawer.cpp │ ├── OcTreeDrawer.cpp │ ├── PointcloudDrawer.cpp │ ├── SceneObject.cpp │ ├── SelectionBox.cpp │ ├── TrajectoryDrawer.cpp │ ├── ViewerGui.cpp │ ├── ViewerSettings.cpp │ ├── ViewerSettingsPanel.cpp │ ├── ViewerSettingsPanelCamera.cpp │ ├── ViewerWidget.cpp │ ├── extern │ └── QGLViewer │ │ ├── .gitignore │ │ ├── CHANGELOG │ │ ├── GPL_EXCEPTION │ │ ├── INSTALL │ │ ├── ImageInterface.ui │ │ ├── LICENCE │ │ ├── QGLViewer.pro │ │ ├── README │ │ ├── VRender │ │ ├── AxisAlignedBox.h │ │ ├── BSPSortMethod.cpp │ │ ├── BackFaceCullingOptimizer.cpp │ │ ├── EPSExporter.cpp │ │ ├── Exporter.cpp │ │ ├── Exporter.h │ │ ├── FIGExporter.cpp │ │ ├── NVector3.cpp │ │ ├── NVector3.h │ │ ├── Optimizer.h │ │ ├── ParserGL.cpp │ │ ├── ParserGL.h │ │ ├── Primitive.cpp │ │ ├── Primitive.h │ │ ├── PrimitivePositioning.cpp │ │ ├── PrimitivePositioning.h │ │ ├── SortMethod.h │ │ ├── TopologicalSortMethod.cpp │ │ ├── Types.h │ │ ├── VRender.cpp │ │ ├── VRender.h │ │ ├── Vector2.cpp │ │ ├── Vector2.h │ │ ├── Vector3.cpp │ │ ├── Vector3.h │ │ ├── VisibilityOptimizer.cpp │ │ ├── gpc.cpp │ │ └── gpc.h │ │ ├── VRenderInterface.ui │ │ ├── camera.cpp │ │ ├── camera.h │ │ ├── config.h │ │ ├── constraint.cpp │ │ ├── constraint.h │ │ ├── domUtils.h │ │ ├── frame.cpp │ │ ├── frame.h │ │ ├── keyFrameInterpolator.cpp │ │ ├── keyFrameInterpolator.h │ │ ├── manipulatedCameraFrame.cpp │ │ ├── manipulatedCameraFrame.h │ │ ├── manipulatedFrame.cpp │ │ ├── manipulatedFrame.h │ │ ├── mouseGrabber.cpp │ │ ├── mouseGrabber.h │ │ ├── qglviewer-icon.xpm │ │ ├── qglviewer.cpp │ │ ├── qglviewer.h │ │ ├── qglviewer.icns │ │ ├── qglviewer_fr.qm │ │ ├── qglviewer_fr.ts │ │ ├── quaternion.cpp │ │ ├── quaternion.h │ │ ├── saveSnapshot.cpp │ │ ├── vec.cpp │ │ └── vec.h │ ├── icons.qrc │ ├── icons │ ├── LICENSE.txt │ ├── application-exit.png │ ├── configure.png │ ├── document-open-folder.png │ ├── document-open.png │ ├── document-save-as.png │ ├── document-save.png │ ├── edit-clear-list.png │ ├── edit-undo.png │ ├── go-bottom.png │ ├── go-top.png │ ├── help-contents.png │ ├── lgpl-3.0.txt │ ├── list-add.png │ ├── list-remove.png │ ├── media-playback-start.png │ ├── media-seek-backward.png │ ├── media-seek-forward.png │ ├── media-skip-backward.png │ ├── media-skip-forward.png │ ├── system-restart.png │ ├── view-preview.png │ └── view-refresh.png │ └── main.cpp └── scripts ├── increase_version.py └── travis_build_jobs.sh /.github/workflows/industrial_ci_action.yml: -------------------------------------------------------------------------------- 1 | # This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). 2 | # For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) 3 | 4 | name: ROS-CI 5 | 6 | # This determines when this workflow is run 7 | on: [push, pull_request] # on all pushes and PRs 8 | 9 | jobs: 10 | CI: 11 | strategy: 12 | matrix: 13 | env: 14 | - {ROS_DISTRO: noetic, PRERELEASE: true} 15 | #- {ROS_DISTRO: rolling} # 2024-03-12 temporarily deactivate until transitin to Ubuntu Noble is complete 16 | env: 17 | BUILDER: colcon 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: 'ros-industrial/industrial_ci@master' 22 | env: ${{ matrix.env }} 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # temp. editor backups: 2 | *~ 3 | 4 | # generated content / project files: 5 | .project 6 | .cproject 7 | doc 8 | html 9 | .qglviewer.xml 10 | 11 | # build output: 12 | lib 13 | bin 14 | build 15 | callgrind.out* 16 | 17 | # in case someone runs an in-source build: 18 | CMakeCache.txt 19 | cmake_install.cmake 20 | CPackConfig.cmake 21 | CMakeFiles 22 | CPackSourceConfig.cmake 23 | install_manifest.txt 24 | Makefile 25 | 26 | # our binary files, in case someone forgets them in the source dir: 27 | *.bt 28 | *.ot 29 | *.graph 30 | *.pcd 31 | 32 | # ccache 33 | .cache -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | sudo: required 3 | dist: bionic 4 | compiler: 5 | - gcc 6 | - clang 7 | before_install: 8 | - sudo apt-get update -qq 9 | - sudo apt-get install -qq libqglviewer-dev-qt5 10 | before_script: 11 | script: ./scripts/travis_build_jobs.sh $VARIANT 12 | env: 13 | - VARIANT=dist 14 | - VARIANT=components 15 | matrix: 16 | exclude: 17 | - compiler: clang 18 | env: VARIANT=components 19 | 20 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 3.10) 2 | PROJECT( octomap-distribution ) 3 | 4 | ENABLE_TESTING() # enable CTest environment of subprojects 5 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) # enables -fPIC in applicable compilers (required to avoid link errors in some cases) 6 | 7 | option(BUILD_OCTOVIS_SUBPROJECT "Build targets from subproject octovis" ON) 8 | option(BUILD_DYNAMICETD3D_SUBPROJECT "Build targets from subproject dynamicEDT3D" ON) 9 | option(OCTOVIS_QT5 "Link Octovis against Qt5?" ON) 10 | 11 | set(CMAKE_CXX_STANDARD 11) 12 | 13 | ADD_SUBDIRECTORY( octomap ) 14 | 15 | if(BUILD_OCTOVIS_SUBPROJECT) 16 | ADD_SUBDIRECTORY( octovis ) 17 | endif() 18 | 19 | if(BUILD_DYNAMICETD3D_SUBPROJECT) 20 | ADD_SUBDIRECTORY( dynamicEDT3D ) 21 | endif() 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees. 2 | =========================================================================== 3 | 4 | http://octomap.github.io 5 | 6 | Originally developed by Kai M. Wurm and Armin Hornung, University of Freiburg, Copyright (C) 2009-2014. 7 | Currently maintained by [Armin Hornung](https://github.com/ahornung). 8 | See the [list of contributors](octomap/AUTHORS.txt) for further authors. 9 | 10 | License: 11 | * octomap: [New BSD License](octomap/LICENSE.txt) 12 | * octovis and related libraries: [GPL](octovis/LICENSE.txt) 13 | 14 | 15 | Download the latest releases: 16 | https://github.com/octomap/octomap/releases 17 | 18 | API documentation: 19 | https://octomap.github.io/octomap/doc/ 20 | 21 | Build status: 22 | [![Build Status](https://travis-ci.org/OctoMap/octomap.png?branch=devel)](https://travis-ci.org/OctoMap/octomap) 23 | 24 | Report bugs and request features in our tracker: 25 | https://github.com/OctoMap/octomap/issues 26 | 27 | A list of changes is available in the [octomap changelog](octomap/CHANGELOG.txt) 28 | 29 | 30 | OVERVIEW 31 | -------- 32 | 33 | OctoMap consists of two separate libraries each in its own subfolder: 34 | **octomap**, the actual library, and **octovis**, our visualization libraries and tools. 35 | This README provides an overview of both, for details on compiling each please 36 | see [octomap/README.md](octomap/README.md) and [octovis/README.md](octovis/README.md) respectively. 37 | See http://www.ros.org/wiki/octomap and http://www.ros.org/wiki/octovis if you 38 | want to use OctoMap in ROS; there are pre-compiled packages available. 39 | 40 | You can build each library separately with CMake by running it from the subdirectories, 41 | or build octomap and octovis together from this top-level directory. E.g., to 42 | only compile the library, run: 43 | 44 | cd octomap 45 | mkdir build 46 | cd build 47 | cmake .. 48 | make 49 | 50 | To compile the complete package, run: 51 | 52 | cd build 53 | cmake .. 54 | make 55 | 56 | Binaries and libs will end up in the directories `bin` and `lib` of the 57 | top-level directory where you started the build. 58 | 59 | Alternatively, you can build and install octomap using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: 60 | 61 | git clone https://github.com/Microsoft/vcpkg.git 62 | cd vcpkg 63 | ./bootstrap-vcpkg.sh 64 | ./vcpkg integrate install 65 | ./vcpkg install octomap 66 | 67 | The octomap port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. 68 | 69 | See [octomap README](octomap/README.md) and [octovis README](octovis/README.md) for further 70 | details and hints on compiling, especially under Windows. 71 | -------------------------------------------------------------------------------- /dynamicEDT3D/CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | v1.6.8: 2014-09-06 2 | ================== 3 | - fixing package.xml installation location, now in /share/dynamic_edt_3d 4 | 5 | v1.6.7: 2014-08-31 6 | ================== 7 | - Support for SOVERSION in the library for better packaging 8 | - fixing ${DYNAMICEDT3D_LIBRARIES} to have full path 9 | - fixing location of dynamicEDT3DConfig.cmake 10 | - fixing package.xml installation 11 | -------------------------------------------------------------------------------- /dynamicEDT3D/CMakeModules/CMakeUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | list(REVERSE files) 8 | foreach (file ${files}) 9 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 10 | if (EXISTS "$ENV{DESTDIR}${file}") 11 | execute_process( 12 | COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" 13 | OUTPUT_VARIABLE rm_out 14 | RESULT_VARIABLE rm_retval 15 | ) 16 | if(NOT ${rm_retval} EQUAL 0) 17 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 18 | endif (NOT ${rm_retval} EQUAL 0) 19 | else (EXISTS "$ENV{DESTDIR}${file}") 20 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 21 | endif (EXISTS "$ENV{DESTDIR}${file}") 22 | endforeach(file) 23 | -------------------------------------------------------------------------------- /dynamicEDT3D/CMakeModules/CPackSettings.cmake: -------------------------------------------------------------------------------- 1 | # Package building stuff - Experimental! 2 | SET(CPACK_PACKAGE_VERSION "${OCTOMAP_VERSION}") 3 | SET(CPACK_PACKAGE_VERSION_MAJOR "${OCTOMAP_MAJOR_VERSION}") 4 | SET(CPACK_PACKAGE_VERSION_MINOR "${OCTOMAP_MINOR_VERSION}") 5 | SET(CPACK_PACKAGE_VERSION_PATCH "${OCTOMAP_PATCH_VERSION}") 6 | SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${V_MAJOR}.${V_MINOR}") 7 | SET(CPACK_PACKAGE_CONTACT "K.M. Wurm and A. Hornung") 8 | SET(CPACK_PACKAGE_VENDOR "University of Freiburg") 9 | SET(CPACK_GENERATOR "DEB") 10 | SET(CPACK_SOURCE_GENERATOR "TGZ") 11 | SET(CPACK_SOURCE_PACKAGE_FILE_NAME 12 | "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") 13 | 14 | # This must always be last statement! 15 | INCLUDE(CPack) 16 | 17 | -------------------------------------------------------------------------------- /dynamicEDT3D/CMakeModules/CompilerSettings.cmake: -------------------------------------------------------------------------------- 1 | # COMPILER SETTINGS (default: Release) 2 | # use "-DCMAKE_BUILD_TYPE=Debug" in cmake for a Debug-build 3 | IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 4 | SET(CMAKE_BUILD_TYPE Release) 5 | ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 6 | 7 | MESSAGE (STATUS "\n") 8 | MESSAGE (STATUS "${PROJECT_NAME} building as ${CMAKE_BUILD_TYPE}") 9 | 10 | # OCTOMAP_OMP = enable OpenMP 11 | # SET(OCTOMAP_OMP 1 CACHE BOOL "Enable/disable OpenMP") 12 | # IF($ENV{OCTOMAP_OMP}) 13 | # SET(OCTOMAP_OMP $ENV{OCTOMAP_OMP}) 14 | # MESSAGE(STATUS "Found OCTOMAP_OMP=${OCTOMAP_OMP}") 15 | # ENDIF($ENV{OCTOMAP_OMP}) 16 | 17 | # COMPILER FLAGS 18 | IF (CMAKE_COMPILER_IS_GNUCC) 19 | SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-error ") 20 | SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-error ") 21 | SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops -DNDEBUG") 22 | SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") 23 | # Shared object compilation under 64bit (vtable) 24 | ADD_DEFINITIONS(-fPIC) 25 | # IF(OCTOMAP_OMP) 26 | # SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") 27 | # SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -fopenmp") 28 | # ENDIF(OCTOMAP_OMP) 29 | ENDIF() 30 | 31 | 32 | # Set full rpath http://www.paraview.org/Wiki/CMake_RPATH_handling 33 | # (good to have and required with ROS) 34 | set(CMAKE_SKIP_BUILD_RPATH FALSE) 35 | set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 36 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") 37 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 38 | 39 | # no prefix needed for python modules 40 | set(CMAKE_SHARED_MODULE_PREFIX "") 41 | -------------------------------------------------------------------------------- /dynamicEDT3D/CMakeModules/InstallPkgConfigFile.cmake: -------------------------------------------------------------------------------- 1 | # A Macro to simplify creating a pkg-config file 2 | 3 | # install_pkg_config_file( 4 | # [VERSION ] 5 | # [DESCRIPTION ] 6 | # [CFLAGS ...] 7 | # [LIBS ...] 8 | # [REQUIRES ...]) 9 | # 10 | # Create and install a pkg-config .pc file to CMAKE_INSTALL_LIBDIR/pkgconfig 11 | # assuming the following install layout: 12 | # libraries: CMAKE_INSTALL_LIBDIR 13 | # headers : CMAKE_INSTALL_INCLUDEDIR 14 | # 15 | # example: 16 | # add_library(mylib mylib.c) 17 | # install_pkg_config_file(mylib 18 | # DESCRIPTION My Library 19 | # CFLAGS 20 | # LIBS -lmylib 21 | # REQUIRES glib-2.0 lcm 22 | # VERSION 0.0.1) 23 | # 24 | # 25 | function(install_pkg_config_file) 26 | list(GET ARGV 0 pc_name) 27 | # TODO error check 28 | 29 | set(pc_version 0.0.1) 30 | set(pc_description ${pc_name}) 31 | set(pc_requires "") 32 | set(pc_libs "") 33 | set(pc_cflags "") 34 | set(pc_fname "${CMAKE_BINARY_DIR}/lib/pkgconfig/${pc_name}.pc") 35 | 36 | set(modewords LIBS CFLAGS REQUIRES VERSION DESCRIPTION) 37 | set(curmode "") 38 | 39 | # parse function arguments and populate pkg-config parameters 40 | list(REMOVE_AT ARGV 0) 41 | foreach(word ${ARGV}) 42 | list(FIND modewords ${word} mode_index) 43 | if(${mode_index} GREATER -1) 44 | set(curmode ${word}) 45 | elseif(curmode STREQUAL LIBS) 46 | set(pc_libs "${pc_libs} ${word}") 47 | elseif(curmode STREQUAL CFLAGS) 48 | set(pc_cflags "${pc_cflags} ${word}") 49 | elseif(curmode STREQUAL REQUIRES) 50 | set(pc_requires "${pc_requires} ${word}") 51 | elseif(curmode STREQUAL VERSION) 52 | set(pc_version ${word}) 53 | set(curmode "") 54 | elseif(curmode STREQUAL DESCRIPTION) 55 | set(pc_description "${word}") 56 | set(curmode "") 57 | else(${mode_index} GREATER -1) 58 | message("WARNING incorrect use of install_pkg_config_file (${word})") 59 | break() 60 | endif(${mode_index} GREATER -1) 61 | endforeach(word) 62 | 63 | # write the .pc file out 64 | file(WRITE ${pc_fname} 65 | "prefix=${CMAKE_INSTALL_PREFIX}\n" 66 | "libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n" 67 | "includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n" 68 | "\n" 69 | "Name: ${pc_name}\n" 70 | "Description: ${pc_description}\n" 71 | "Requires: ${pc_requires}\n" 72 | "Version: ${pc_version}\n" 73 | "Libs: -L\${libdir} ${pc_libs}\n" 74 | "Cflags: -I\${includedir} ${pc_cflags}\n") 75 | 76 | # mark the .pc file for installation to the lib/pkgconfig directory 77 | install(FILES ${pc_fname} DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 78 | endfunction(install_pkg_config_file) 79 | -------------------------------------------------------------------------------- /dynamicEDT3D/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | dynamicEDT3D: 3 | A library for incrementally updatable Euclidean distance transforms in 3D. 4 | 5 | License for the "dynamicEDT3D" library: New BSD License. 6 | 7 | Copyright (c) 2011-2012, C. Sprunk, B. Lau, W. Burgard, University of Freiburg 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | * Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions and the following disclaimer in the 17 | documentation and/or other materials provided with the distribution. 18 | * Neither the name of the University of Freiburg nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 26 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /dynamicEDT3D/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/dynamicEDT3D/README.txt -------------------------------------------------------------------------------- /dynamicEDT3D/doxygen.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * \namespace dynamicEDT3D Namespace of the dynamicEDT3D library 4 | * 5 | */ 6 | 7 | 8 | /** \mainpage dynamicEDT3D 9 | 10 | \section intro_sec Introduction 11 | 12 | The dynamicEDT3D library implements an inrementally updatable Euclidean distance transform (EDT) in 3D. It comes with a wrapper to use the OctoMap 3D representation and hooks into the change detection of the OctoMap library to propagate changes to the EDT. 13 | 14 | \section install_sec Installation 15 |

See the file README.txt in the main folder. 16 |

17 | 18 | \section gettingstarted_sec Getting Started 19 |

There are two example programs in the src/examples directory that show the basic functionality of the library.

20 | 21 | 22 | \section changelog_sec Changelog 23 |

See the file CHANGELOG.txt in the main folder or the latest version online 24 |

25 | 26 | \section using_sec Using dynamicEDT3D? 27 |

Please let us know if you are using dynamicEDT3D, as we are curious to find out how it enables other people's work or research. Additionally, please cite our paper if you use dynamicEDT3D in your research:

28 |

B. Lau, C. Sprunk, and W. Burgard, 29 | "Efficient Grid-based Spatial Representations for Robot Navigation in Dynamic Environments" in 30 | Robotics and Autonomous Systems, 2012. Accepted for publication. 31 | Software available at http://octomap.sf.net/. 32 |

33 |

BibTeX:

34 |
@@article{lau12ras,
35 |   author = {Boris Lau and Christoph Sprunk and Wolfram Burgard},
36 |   title = {Efficient Grid-based Spatial Representations for Robot Navigation in Dynamic Environments},
37 |   journal = {Robotics and Autonomous Systems (RAS)},
38 |   year = {2012},
39 |   url = {http://octomap.sf.net/},
40 |   note = {Accepted for publication. Software available at \url{http://octomap.sf.net/}}
41 | }
42 | 43 | **/ 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /dynamicEDT3D/dynamicEDT3DConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the dynamicEDT3D package 2 | # 3 | # Usage from an external project: 4 | # In your CMakeLists.txt, add these lines: 5 | # 6 | # FIND_PACKAGE(dynamicedt3d REQUIRED ) 7 | # INCLUDE_DIRECTORIES(${DYNAMICEDT3D_INCLUDE_DIRS}) 8 | # TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${DYNAMICEDT3D_LIBRARIES}) 9 | # 10 | # It defines the following variables 11 | # DYNAMICEDT3D_INCLUDE_DIRS - include directories for dynamicEDT3D 12 | # DYNAMICEDT3D_LIBRARY_DIRS - library directories for dynamicEDT3D (normally not used!) 13 | # DYNAMICEDT3D_LIBRARIES - libraries to link against 14 | # DYNAMICEDT3D_MAJOR_VERSION - major version 15 | # DYNAMICEDT3D_MINOR_VERSION - minor version 16 | # DYNAMICEDT3D_PATCH_VERSION - patch version 17 | # DYNAMICEDT3D_VERSION - major.minor.patch version 18 | 19 | @PACKAGE_INIT@ 20 | 21 | set(DYNAMICEDT3D_MAJOR_VERSION "@DYNAMICEDT3D_MAJOR_VERSION@") 22 | set(DYNAMICEDT3D_MINOR_VERSION "@DYNAMICEDT3D_MINOR_VERSION@") 23 | set(DYNAMICEDT3D_PATCH_VERSION "@DYNAMICEDT3D_PATCH_VERSION@") 24 | set(DYNAMICEDT3D_VERSION "@DYNAMICEDT3D_VERSION@") 25 | 26 | # Tell the user project where to find our headers and libraries 27 | set_and_check(DYNAMICEDT3D_INCLUDE_DIRS "@PACKAGE_DYNAMICEDT3D_INCLUDE_DIRS@") 28 | set_and_check(DYNAMICEDT3D_LIBRARY_DIRS "@PACKAGE_DYNAMICEDT3D_LIB_DIR@") 29 | 30 | set(DYNAMICEDT3D_LIBRARIES "@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@") 31 | 32 | @DYNAMICEDT3D_INCLUDE_TARGETS@ 33 | -------------------------------------------------------------------------------- /dynamicEDT3D/include/dynamicEDT3D/bucketedqueue.h: -------------------------------------------------------------------------------- 1 | /** 2 | * dynamicEDT3D: 3 | * A library for incrementally updatable Euclidean distance transforms in 3D. 4 | * @author C. Sprunk, B. Lau, W. Burgard, University of Freiburg, Copyright (C) 2011. 5 | * @see http://octomap.sourceforge.net/ 6 | * License: New BSD License 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2011-2012, C. Sprunk, B. Lau, W. Burgard, University of Freiburg 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the University of Freiburg nor the names of its 22 | * contributors may be used to endorse or promote products derived from 23 | * this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #ifndef _PRIORITYQUEUE2_H_ 39 | #define _PRIORITYQUEUE2_H_ 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include "point.h" 46 | #include 47 | 48 | //! Priority queue for integer coordinates with squared distances as priority. 49 | /** A priority queue that uses buckets to group elements with the same priority. 50 | * The individual buckets are unsorted, which increases efficiency if these groups are large. 51 | * The elements are assumed to be integer coordinates, and the priorities are assumed 52 | * to be squared euclidean distances (integers). 53 | */ 54 | 55 | 56 | template 57 | class BucketPrioQueue { 58 | 59 | public: 60 | //! Standard constructor 61 | /** Standard constructor. When called for the first time it creates a look up table 62 | * that maps square distanes to bucket numbers, which might take some time... 63 | */ 64 | BucketPrioQueue(); 65 | 66 | void clear() { buckets.clear(); } 67 | 68 | //! Checks whether the Queue is empty 69 | bool empty(); 70 | //! push an element 71 | void push(int prio, T t); 72 | //! return and pop the element with the lowest squared distance */ 73 | T pop(); 74 | 75 | int size() { return count; } 76 | int getNumBuckets() { return buckets.size(); } 77 | 78 | private: 79 | 80 | int count; 81 | 82 | typedef std::map< int, std::queue > BucketType; 83 | BucketType buckets; 84 | typename BucketType::iterator nextPop; 85 | }; 86 | 87 | #include "bucketedqueue.hxx" 88 | 89 | #endif 90 | 91 | -------------------------------------------------------------------------------- /dynamicEDT3D/include/dynamicEDT3D/bucketedqueue.hxx: -------------------------------------------------------------------------------- 1 | /** 2 | * dynamicEDT3D: 3 | * A library for incrementally updatable Euclidean distance transforms in 3D. 4 | * @author C. Sprunk, B. Lau, W. Burgard, University of Freiburg, Copyright (C) 2011. 5 | * @see http://octomap.sourceforge.net/ 6 | * License: New BSD License 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2011-2012, C. Sprunk, B. Lau, W. Burgard, University of Freiburg 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the University of Freiburg nor the names of its 22 | * contributors may be used to endorse or promote products derived from 23 | * this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #include "bucketedqueue.h" 39 | 40 | #include "limits.h" 41 | 42 | template 43 | BucketPrioQueue::BucketPrioQueue() { 44 | nextPop = buckets.end(); 45 | count = 0; 46 | } 47 | 48 | template 49 | bool BucketPrioQueue::empty() { 50 | return (count==0); 51 | } 52 | 53 | 54 | template 55 | void BucketPrioQueue::push(int prio, T t) { 56 | buckets[prio].push(t); 57 | if (nextPop == buckets.end() || prio < nextPop->first) nextPop = buckets.find(prio); 58 | count++; 59 | } 60 | 61 | template 62 | T BucketPrioQueue::pop() { 63 | while (nextPop!=buckets.end() && nextPop->second.empty()) ++nextPop; 64 | 65 | T p = nextPop->second.front(); 66 | nextPop->second.pop(); 67 | if (nextPop->second.empty()) { 68 | typename BucketType::iterator it = nextPop; 69 | nextPop++; 70 | buckets.erase(it); 71 | } 72 | count--; 73 | return p; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /dynamicEDT3D/include/dynamicEDT3D/point.h: -------------------------------------------------------------------------------- 1 | /** 2 | * dynamicEDT3D: 3 | * A library for incrementally updatable Euclidean distance transforms in 3D. 4 | * @author C. Sprunk, B. Lau, W. Burgard, University of Freiburg, Copyright (C) 2011. 5 | * @see http://octomap.sourceforge.net/ 6 | * License: New BSD License 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2011-2012, C. Sprunk, B. Lau, W. Burgard, University of Freiburg 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the University of Freiburg nor the names of its 22 | * contributors may be used to endorse or promote products derived from 23 | * this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #ifndef _VOROPOINT_H_ 39 | #define _VOROPOINT_H_ 40 | 41 | #define INTPOINT IntPoint 42 | #define INTPOINT3D IntPoint3D 43 | 44 | /*! A light-weight integer point with fields x,y */ 45 | class IntPoint { 46 | public: 47 | IntPoint() : x(0), y(0) {} 48 | IntPoint(int _x, int _y) : x(_x), y(_y) {} 49 | int x,y; 50 | }; 51 | 52 | /*! A light-weight integer point with fields x,y,z */ 53 | class IntPoint3D { 54 | public: 55 | IntPoint3D() : x(0), y(0), z(0) {} 56 | IntPoint3D(int _x, int _y, int _z) : x(_x), y(_y), z(_z) {} 57 | int x,y,z; 58 | }; 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /dynamicEDT3D/package.xml: -------------------------------------------------------------------------------- 1 | 2 | dynamic_edt_3d 3 | 1.10.0 4 | The dynamicEDT3D library implements an inrementally updatable Euclidean distance transform (EDT) in 3D. It comes with a wrapper to use the OctoMap 3D representation and hooks into the change detection of the OctoMap library to propagate changes to the EDT. 5 | 6 | Christoph Sprunk 7 | Christoph Sprunk 8 | Wolfgang Merkt 9 | BSD 10 | 11 | http://octomap.github.io 12 | https://github.com/OctoMap/octomap/issues 13 | 14 | octomap 15 | 16 | 17 | catkin 18 | 19 | cmake 20 | 21 | cmake 22 | 23 | 24 | -------------------------------------------------------------------------------- /dynamicEDT3D/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET( dynamicEDT3D_SRCS 2 | dynamicEDT3D.cpp 3 | ) 4 | 5 | add_library(dynamicedt3d SHARED ${dynamicEDT3D_SRCS}) 6 | set_target_properties(dynamicedt3d PROPERTIES 7 | VERSION ${DYNAMICEDT3D_VERSION} 8 | SOVERSION ${DYNAMICEDT3D_SOVERSION} 9 | ) 10 | target_link_libraries(dynamicedt3d ${OCTOMAP_LIBRARIES}) 11 | 12 | add_library(dynamicedt3d-static STATIC ${dynamicEDT3D_SRCS}) 13 | target_link_libraries(dynamicedt3d-static ${OCTOMAP_LIBRARIES}) 14 | 15 | SET_TARGET_PROPERTIES(dynamicedt3d-static PROPERTIES OUTPUT_NAME "dynamicedt3d") 16 | 17 | if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D") 18 | file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D") 19 | endif() 20 | 21 | export(TARGETS dynamicedt3d dynamicedt3d-static 22 | FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DTargets.cmake") 23 | 24 | # directly depend on the octomap library target when building the 25 | # complete distribution, so it it recompiled as needed 26 | if (CMAKE_PROJECT_NAME STREQUAL "octomap-distribution") 27 | ADD_DEPENDENCIES(dynamicedt3d-static octomap-static) 28 | ADD_DEPENDENCIES(dynamicedt3d octomap) 29 | endif() 30 | 31 | ADD_SUBDIRECTORY(examples) 32 | 33 | install(TARGETS dynamicedt3d dynamicedt3d-static 34 | EXPORT dynamicEDT3DTargets 35 | INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" 36 | ${INSTALL_TARGETS_DEFAULT_ARGS} 37 | ) 38 | install(EXPORT dynamicEDT3DTargets DESTINATION "${CMAKE_INSTALL_DATADIR}/dynamicEDT3D") 39 | -------------------------------------------------------------------------------- /dynamicEDT3D/src/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(exampleEDT3D exampleEDT3D.cpp) 2 | target_link_libraries(exampleEDT3D dynamicedt3d) 3 | 4 | add_executable(exampleEDTOctomap exampleEDTOctomap.cpp) 5 | target_link_libraries(exampleEDTOctomap dynamicedt3d) 6 | 7 | add_executable(exampleEDTOctomapStamped exampleEDTOctomapStamped.cpp) 8 | target_link_libraries(exampleEDTOctomapStamped dynamicedt3d) -------------------------------------------------------------------------------- /octomap/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | OctoMap was originally developed by Kai M. Wurm and Armin Hornung, 2 | University of Freiburg 3 | 4 | Further contributors: 5 | * C. Sprunk, University of Freiburg 6 | * J. Mueller, University of Freiburg 7 | * S. Osswald, University of Freiburg 8 | * R. Schmitt, University of Freiburg 9 | * R. Bogdan Rusu, Willow Garage Inc. 10 | * C. Dornhege, University of Freiburg 11 | * F-M. de Rainville, Universite Laval Quebec 12 | * B. Jensen, TU Munich 13 | * A. Ecins, University of Maryland 14 | * C. Brew 15 | * F. Boniardi, University of Freiburg -------------------------------------------------------------------------------- /octomap/CMakeModules/CMakeUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # Ignore empty list items. 2 | cmake_policy(SET CMP0007 OLD) 3 | 4 | if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 5 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") 6 | endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 7 | 8 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 9 | string(REGEX REPLACE "\n" ";" files "${files}") 10 | list(REVERSE files) 11 | foreach (file ${files}) 12 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 13 | if (EXISTS "$ENV{DESTDIR}${file}") 14 | execute_process( 15 | COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" 16 | OUTPUT_VARIABLE rm_out 17 | RESULT_VARIABLE rm_retval 18 | ) 19 | if(NOT ${rm_retval} EQUAL 0) 20 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 21 | endif (NOT ${rm_retval} EQUAL 0) 22 | else (EXISTS "$ENV{DESTDIR}${file}") 23 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 24 | endif (EXISTS "$ENV{DESTDIR}${file}") 25 | endforeach(file) 26 | -------------------------------------------------------------------------------- /octomap/CMakeModules/CPackSettings.cmake: -------------------------------------------------------------------------------- 1 | # Package building stuff - Experimental! 2 | SET(CPACK_PACKAGE_VERSION "${OCTOMAP_VERSION}") 3 | SET(CPACK_PACKAGE_VERSION_MAJOR "${OCTOMAP_MAJOR_VERSION}") 4 | SET(CPACK_PACKAGE_VERSION_MINOR "${OCTOMAP_MINOR_VERSION}") 5 | SET(CPACK_PACKAGE_VERSION_PATCH "${OCTOMAP_PATCH_VERSION}") 6 | SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${V_MAJOR}.${V_MINOR}") 7 | SET(CPACK_PACKAGE_CONTACT "K.M. Wurm and A. Hornung") 8 | SET(CPACK_PACKAGE_VENDOR "University of Freiburg") 9 | SET(CPACK_GENERATOR "DEB") 10 | SET(CPACK_SOURCE_GENERATOR "TGZ") 11 | SET(CPACK_SOURCE_PACKAGE_FILE_NAME 12 | "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") 13 | 14 | # This must always be last statement! 15 | INCLUDE(CPack) 16 | 17 | -------------------------------------------------------------------------------- /octomap/CMakeModules/CompilerSettings.cmake: -------------------------------------------------------------------------------- 1 | # COMPILER SETTINGS (default: Release) 2 | # use "-DCMAKE_BUILD_TYPE=Debug" in cmake for a Debug-build 3 | IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 4 | SET(CMAKE_BUILD_TYPE Release) 5 | ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 6 | 7 | MESSAGE (STATUS "\n") 8 | MESSAGE (STATUS "${PROJECT_NAME} building as ${CMAKE_BUILD_TYPE}") 9 | 10 | # COMPILER FLAGS 11 | IF (CMAKE_COMPILER_IS_GNUCC) 12 | SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-error ") 13 | SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wpedantic") 14 | SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops -DNDEBUG") 15 | SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") 16 | # Shared object compilation under 64bit (vtable) 17 | ADD_DEFINITIONS(-fPIC) 18 | ENDIF() 19 | 20 | 21 | # Set full rpath http://www.paraview.org/Wiki/CMake_RPATH_handling 22 | # (good to have and required with ROS) 23 | set(CMAKE_SKIP_BUILD_RPATH FALSE) 24 | set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 25 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") 26 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 27 | 28 | # no prefix needed for python modules 29 | set(CMAKE_SHARED_MODULE_PREFIX "") 30 | -------------------------------------------------------------------------------- /octomap/CMakeModules/InstallPkgConfigFile.cmake: -------------------------------------------------------------------------------- 1 | # A Macro to simplify creating a pkg-config file 2 | 3 | # install_pkg_config_file( 4 | # [VERSION ] 5 | # [DESCRIPTION ] 6 | # [CFLAGS ...] 7 | # [LIBS ...] 8 | # [REQUIRES ...]) 9 | # 10 | # Create and install a pkg-config .pc file to CMAKE_INSTALL_LIBDIR/pkgconfig 11 | # assuming the following install layout: 12 | # libraries: CMAKE_INSTALL_LIBDIR 13 | # headers : CMAKE_INSTALL_INCLUDEDIR 14 | # 15 | # example: 16 | # add_library(mylib mylib.c) 17 | # install_pkg_config_file(mylib 18 | # DESCRIPTION My Library 19 | # CFLAGS 20 | # LIBS -lmylib 21 | # REQUIRES glib-2.0 lcm 22 | # VERSION 0.0.1) 23 | # 24 | # 25 | function(install_pkg_config_file) 26 | list(GET ARGV 0 pc_name) 27 | # TODO error check 28 | 29 | set(pc_version 0.0.1) 30 | set(pc_description ${pc_name}) 31 | set(pc_requires "") 32 | set(pc_libs "") 33 | set(pc_cflags "") 34 | set(pc_fname "${CMAKE_BINARY_DIR}/lib/pkgconfig/${pc_name}.pc") 35 | 36 | set(modewords LIBS CFLAGS REQUIRES VERSION DESCRIPTION) 37 | set(curmode "") 38 | 39 | # parse function arguments and populate pkg-config parameters 40 | list(REMOVE_AT ARGV 0) 41 | foreach(word ${ARGV}) 42 | list(FIND modewords ${word} mode_index) 43 | if(${mode_index} GREATER -1) 44 | set(curmode ${word}) 45 | elseif(curmode STREQUAL LIBS) 46 | set(pc_libs "${pc_libs} ${word}") 47 | elseif(curmode STREQUAL CFLAGS) 48 | set(pc_cflags "${pc_cflags} ${word}") 49 | elseif(curmode STREQUAL REQUIRES) 50 | set(pc_requires "${pc_requires} ${word}") 51 | elseif(curmode STREQUAL VERSION) 52 | set(pc_version ${word}) 53 | set(curmode "") 54 | elseif(curmode STREQUAL DESCRIPTION) 55 | set(pc_description "${word}") 56 | set(curmode "") 57 | else(${mode_index} GREATER -1) 58 | message("WARNING incorrect use of install_pkg_config_file (${word})") 59 | break() 60 | endif(${mode_index} GREATER -1) 61 | endforeach(word) 62 | 63 | # write the .pc file out 64 | file(WRITE ${pc_fname} 65 | "prefix=${CMAKE_INSTALL_PREFIX}\n" 66 | "libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n" 67 | "includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n" 68 | "\n" 69 | "Name: ${pc_name}\n" 70 | "Description: ${pc_description}\n" 71 | "Requires: ${pc_requires}\n" 72 | "Version: ${pc_version}\n" 73 | "Libs: -L\${libdir} ${pc_libs}\n" 74 | "Cflags: -I\${includedir} ${pc_cflags}\n") 75 | 76 | # mark the .pc file for installation to the lib/pkgconfig directory 77 | install(FILES ${pc_fname} DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 78 | endfunction(install_pkg_config_file) 79 | -------------------------------------------------------------------------------- /octomap/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | 4 | License for the "octomap" library: New BSD License. 5 | 6 | Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted provided that the following conditions are met: 11 | 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the University of Freiburg nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /octomap/extern/README_BINVOX: -------------------------------------------------------------------------------- 1 | binvox (and viewvox) binaries are no longer provided in the 2 | OctoMap source. Please obtain the latest versions from: 3 | 4 | http://www.cs.princeton.edu/~min/binvox 5 | 6 | -------------------------------------------------------------------------------- /octomap/include/octomap/MapNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_MAP_NODE_H 35 | #define OCTOMAP_MAP_NODE_H 36 | 37 | 38 | #include 39 | #include 40 | 41 | namespace octomap { 42 | 43 | template 44 | class MapNode { 45 | 46 | public: 47 | MapNode(); 48 | MapNode(TREETYPE* node_map, pose6d origin); 49 | MapNode(std::string filename, pose6d origin); 50 | MapNode(const Pointcloud& cloud, pose6d origin); 51 | ~MapNode(); 52 | 53 | typedef TREETYPE TreeType; 54 | 55 | TREETYPE* getMap() { return node_map; } 56 | 57 | void updateMap(const Pointcloud& cloud, point3d sensor_origin); 58 | 59 | inline std::string getId() { return id; } 60 | inline void setId(std::string newid) { id = newid; } 61 | 62 | inline pose6d getOrigin() { return origin; } 63 | 64 | // returns cloud of voxel centers in global reference frame 65 | Pointcloud generatePointcloud(); 66 | bool writeMap(std::string filename); 67 | 68 | protected: 69 | TREETYPE* node_map; // occupancy grid map 70 | pose6d origin; // origin and orientation relative to parent 71 | std::string id; 72 | 73 | void clear(); 74 | bool readMap(std::string filename); 75 | 76 | }; 77 | 78 | } // end namespace 79 | 80 | #include "octomap/MapNode.hxx" 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /octomap/include/octomap/MapNode.hxx: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | namespace octomap { 35 | 36 | template 37 | MapNode::MapNode(): node_map(0) { 38 | } 39 | 40 | template 41 | MapNode::MapNode(TREETYPE* in_node_map, pose6d in_origin) { 42 | this->node_map = in_node_map; 43 | this->origin = in_origin; 44 | } 45 | 46 | template 47 | MapNode::MapNode(const Pointcloud& in_cloud, pose6d in_origin): node_map(0) { 48 | } 49 | 50 | template 51 | MapNode::MapNode(std::string filename, pose6d in_origin): node_map(0){ 52 | readMap(filename); 53 | this->origin = in_origin; 54 | id = filename; 55 | } 56 | 57 | template 58 | MapNode::~MapNode() { 59 | clear(); 60 | } 61 | 62 | template 63 | void MapNode::updateMap(const Pointcloud& cloud, point3d sensor_origin) { 64 | } 65 | 66 | template 67 | Pointcloud MapNode::generatePointcloud() { 68 | Pointcloud pc; 69 | point3d_list occs; 70 | node_map->getOccupied(occs); 71 | for(point3d_list::iterator it = occs.begin(); it != occs.end(); ++it){ 72 | pc.push_back(*it); 73 | } 74 | return pc; 75 | } 76 | 77 | template 78 | void MapNode::clear(){ 79 | if(node_map != 0){ 80 | delete node_map; 81 | node_map = 0; 82 | id = ""; 83 | origin = pose6d(0.0,0.0,0.0,0.0,0.0,0.0); 84 | } 85 | } 86 | 87 | template 88 | bool MapNode::readMap(std::string filename){ 89 | if(node_map != 0) 90 | delete node_map; 91 | 92 | node_map = new TREETYPE(0.05); 93 | return node_map->readBinary(filename); 94 | } 95 | 96 | template 97 | bool MapNode::writeMap(std::string filename){ 98 | return node_map->writeBinary(filename); 99 | } 100 | 101 | } // namespace 102 | -------------------------------------------------------------------------------- /octomap/include/octomap/OcTree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_OCTREE_H 35 | #define OCTOMAP_OCTREE_H 36 | 37 | 38 | #include "OccupancyOcTreeBase.h" 39 | #include "OcTreeNode.h" 40 | #include "ScanGraph.h" 41 | 42 | namespace octomap { 43 | 44 | /** 45 | * octomap main map data structure, stores 3D occupancy grid map in an OcTree. 46 | * Basic functionality is implemented in OcTreeBase. 47 | * 48 | */ 49 | class OcTree : public OccupancyOcTreeBase { 50 | 51 | public: 52 | /// Default constructor, sets resolution of leafs 53 | OcTree(double resolution); 54 | 55 | /** 56 | * Reads an OcTree from a binary file 57 | * @param _filename 58 | * 59 | */ 60 | OcTree(std::string _filename); 61 | 62 | virtual ~OcTree(){} 63 | 64 | /// virtual constructor: creates a new object of same type 65 | /// (Covariant return type requires an up-to-date compiler) 66 | OcTree* create() const {return new OcTree(resolution); } 67 | 68 | std::string getTreeType() const {return "OcTree";} 69 | 70 | 71 | protected: 72 | /** 73 | * Static member object which ensures that this OcTree's prototype 74 | * ends up in the classIDMapping only once. You need this as a 75 | * static member in any derived octree class in order to read .ot 76 | * files through the AbstractOcTree factory. You should also call 77 | * ensureLinking() once from the constructor. 78 | */ 79 | class StaticMemberInitializer{ 80 | public: 81 | StaticMemberInitializer() { 82 | OcTree* tree = new OcTree(0.1); 83 | tree->clearKeyRays(); 84 | AbstractOcTree::registerTreeType(tree); 85 | } 86 | 87 | /** 88 | * Dummy function to ensure that MSVC does not drop the 89 | * StaticMemberInitializer, causing this tree failing to register. 90 | * Needs to be called from the constructor of this octree. 91 | */ 92 | void ensureLinking() {} 93 | }; 94 | 95 | /// to ensure static initialization (only once) 96 | static StaticMemberInitializer ocTreeMemberInit; 97 | }; 98 | 99 | } // end namespace 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /octomap/include/octomap/OcTreeBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_OCTREE_BASE_H 35 | #define OCTOMAP_OCTREE_BASE_H 36 | 37 | 38 | #include "OcTreeBaseImpl.h" 39 | #include "AbstractOcTree.h" 40 | 41 | 42 | namespace octomap { 43 | template 44 | class OcTreeBase : public OcTreeBaseImpl { 45 | public: 46 | OcTreeBase(double res) : OcTreeBaseImpl(res) {} 47 | 48 | /// virtual constructor: creates a new object of same type 49 | /// (Covariant return type requires an up-to-date compiler) 50 | OcTreeBase* create() const {return new OcTreeBase(this->resolution); } 51 | std::string getTreeType() const {return "OcTreeBase";} 52 | }; 53 | 54 | } 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /octomap/include/octomap/OcTreeNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_OCTREE_NODE_H 35 | #define OCTOMAP_OCTREE_NODE_H 36 | 37 | #include "octomap_types.h" 38 | #include "octomap_utils.h" 39 | #include "OcTreeDataNode.h" 40 | #include 41 | 42 | namespace octomap { 43 | 44 | /** 45 | * Nodes to be used in OcTree. They represent 3d occupancy grid cells. 46 | * "value" stores their log-odds occupancy. 47 | * 48 | * Note: If you derive a class (directly or indirectly) from OcTreeNode or 49 | * OcTreeDataNode, you have to implement (at least) the following functions: 50 | * createChild(), getChild(), getChild() const, expandNode() to avoid slicing 51 | * errors and memory-related bugs. 52 | * See ColorOcTreeNode in ColorOcTree.h for an example. 53 | * 54 | */ 55 | class OcTreeNode : public OcTreeDataNode { 56 | 57 | public: 58 | OcTreeNode(); 59 | ~OcTreeNode(); 60 | 61 | 62 | // -- node occupancy ---------------------------- 63 | 64 | /// \return occupancy probability of node 65 | inline double getOccupancy() const { return probability(value); } 66 | 67 | /// \return log odds representation of occupancy probability of node 68 | inline float getLogOdds() const{ return value; } 69 | /// sets log odds occupancy of node 70 | inline void setLogOdds(float l) { value = l; } 71 | 72 | /** 73 | * @return mean of all children's occupancy probabilities, in log odds 74 | */ 75 | double getMeanChildLogOdds() const; 76 | 77 | /** 78 | * @return maximum of children's occupancy probabilities, in log odds 79 | */ 80 | float getMaxChildLogOdds() const; 81 | 82 | /// update this node's occupancy according to its children's maximum occupancy 83 | inline void updateOccupancyChildren() { 84 | this->setLogOdds(this->getMaxChildLogOdds()); // conservative 85 | } 86 | 87 | /// adds p to the node's logOdds value (with no boundary / threshold checking!) 88 | void addValue(const float& p); 89 | 90 | 91 | protected: 92 | // "value" stores log odds occupancy probability 93 | }; 94 | 95 | } // end namespace 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /octomap/include/octomap/math/Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMATH_UTILS_H 35 | #define OCTOMATH_UTILS_H 36 | 37 | #ifndef M_PI 38 | #define M_PI 3.14159265358979323846 39 | #endif 40 | 41 | #ifndef M_PI_2 42 | #define M_PI_2 1.570796326794896619 43 | #endif 44 | 45 | 46 | #ifndef DEG2RAD 47 | #define DEG2RAD(x) ((x) * 0.01745329251994329575) 48 | #endif 49 | 50 | #ifndef RAD2DEG 51 | #define RAD2DEG(x) ((x) * 57.29577951308232087721) 52 | #endif 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /octomap/include/octomap/octomap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include "octomap_types.h" 35 | #include "Pointcloud.h" 36 | #include "ScanGraph.h" 37 | #include "OcTree.h" 38 | 39 | -------------------------------------------------------------------------------- /octomap/include/octomap/octomap_deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_DEPRECATED_H 35 | #define OCTOMAP_DEPRECATED_H 36 | 37 | // define multi-platform deprecation mechanism 38 | #ifndef OCTOMAP_DEPRECATED 39 | #ifdef __GNUC__ 40 | #define OCTOMAP_DEPRECATED(func) func __attribute__ ((deprecated)) 41 | #elif defined(_MSC_VER) 42 | #define OCTOMAP_DEPRECATED(func) __declspec(deprecated) func 43 | #else 44 | #pragma message("WARNING: You need to implement OCTOMAP_DEPRECATED for this compiler") 45 | #define OCTOMAP_DEPRECATED(func) func 46 | #endif 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /octomap/include/octomap/octomap_timing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_TIMING_H_ 35 | #define OCTOMAP_TIMING_H_ 36 | 37 | #ifdef _MSC_VER 38 | // MS compilers 39 | #include 40 | #include 41 | #include 42 | void gettimeofday(struct timeval* t, void* timezone) { 43 | struct _timeb timebuffer; 44 | _ftime64_s( &timebuffer ); 45 | t->tv_sec= (long) timebuffer.time; 46 | t->tv_usec=1000*timebuffer.millitm; 47 | } 48 | #else 49 | // GCC and minGW 50 | #include 51 | #endif 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /octomap/include/octomap/octomap_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_TYPES_H 35 | #define OCTOMAP_TYPES_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | namespace octomap { 47 | 48 | ///Use Vector3 (float precision) as a point3d in octomap 49 | typedef octomath::Vector3 point3d; 50 | /// Use our Pose6D (float precision) as pose6d in octomap 51 | typedef octomath::Pose6D pose6d; 52 | 53 | typedef std::vector point3d_collection; 54 | typedef std::list point3d_list; 55 | 56 | /// A voxel defined by its center point3d and its side length 57 | typedef std::pair OcTreeVolume; 58 | 59 | } 60 | 61 | // no debug output if not in debug mode: 62 | #ifdef NDEBUG 63 | #ifndef OCTOMAP_NODEBUGOUT 64 | #define OCTOMAP_NODEBUGOUT 65 | #endif 66 | #endif 67 | 68 | #ifdef OCTOMAP_NODEBUGOUT 69 | #define OCTOMAP_DEBUG(...) (void)0 70 | #define OCTOMAP_DEBUG_STR(...) (void)0 71 | #else 72 | #define OCTOMAP_DEBUG(...) fprintf(stderr, __VA_ARGS__), fflush(stderr) 73 | #define OCTOMAP_DEBUG_STR(args) std::cerr << args << std::endl 74 | #endif 75 | 76 | #define OCTOMAP_WARNING(...) fprintf(stderr, "WARNING: "), fprintf(stderr, __VA_ARGS__), fflush(stderr) 77 | #define OCTOMAP_WARNING_STR(args) std::cerr << "WARNING: " << args << std::endl 78 | #define OCTOMAP_ERROR(...) fprintf(stderr, "ERROR: "), fprintf(stderr, __VA_ARGS__), fflush(stderr) 79 | #define OCTOMAP_ERROR_STR(args) std::cerr << "ERROR: " << args << std::endl 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /octomap/include/octomap/octomap_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #ifndef OCTOMAP_UTILS_H_ 35 | #define OCTOMAP_UTILS_H_ 36 | 37 | #include 38 | 39 | namespace octomap{ 40 | 41 | /// compute log-odds from probability: 42 | inline float logodds(double probability){ 43 | return (float) log(probability/(1-probability)); 44 | } 45 | 46 | /// compute probability from logodds: 47 | inline double probability(double logodds){ 48 | return 1. - ( 1. / (1. + exp(logodds))); 49 | 50 | } 51 | } 52 | 53 | 54 | 55 | #endif /* OCTOMAP_UTILS_H_ */ 56 | -------------------------------------------------------------------------------- /octomap/octomap-config.cmake.in: -------------------------------------------------------------------------------- 1 | # =================================================================================== 2 | # The OctoMap CMake configuration file 3 | # 4 | # ** File generated automatically, do not modify ** 5 | # 6 | # Usage from an external project: 7 | # In your CMakeLists.txt, add these lines: 8 | # 9 | # FIND_PACKAGE(OCTOMAP REQUIRED ) 10 | # INCLUDE_DIRECTORIES(${OCTOMAP_INCLUDE_DIRS}) 11 | # TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OCTOMAP_LIBRARIES}) 12 | # 13 | # 14 | # This file will define the following variables: 15 | # - OCTOMAP_LIBRARIES : The list of libraries to links against. 16 | # - OCTOMAP_LIBRARY_DIRS : The directory where lib files are. Calling 17 | # LINK_DIRECTORIES with this path is NOT needed. 18 | # - OCTOMAP_INCLUDE_DIRS : The OctoMap include directories. 19 | # - OCTOMAP_MAJOR_VERSION : Major version. 20 | # - OCTOMAP_MINOR_VERSION : Minor version. 21 | # - OCTOMAP_PATCH_VERSION : Patch version. 22 | # - OCTOMAP_VERSION : Major.Minor.Patch version. 23 | # 24 | # =================================================================================== 25 | 26 | @PACKAGE_INIT@ 27 | 28 | set(OCTOMAP_MAJOR_VERSION "@OCTOMAP_MAJOR_VERSION@") 29 | set(OCTOMAP_MINOR_VERSION "@OCTOMAP_MINOR_VERSION@") 30 | set(OCTOMAP_PATCH_VERSION "@OCTOMAP_PATCH_VERSION@") 31 | set(OCTOMAP_VERSION "@OCTOMAP_VERSION@") 32 | 33 | set_and_check(OCTOMAP_INCLUDE_DIRS "@PACKAGE_OCTOMAP_INCLUDE_DIRS@") 34 | set_and_check(OCTOMAP_LIBRARY_DIRS "@PACKAGE_OCTOMAP_LIB_DIR@") 35 | 36 | # Set library names 37 | set(OCTOMAP_LIBRARIES 38 | "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@" 39 | "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@" 40 | ) 41 | 42 | # Additionally set the variables using a lower-case project name. 43 | # This fixes discovery for downstream packages that search for lower-case octomap, which has been common in downstream code: 44 | set(octomap_MAJOR_VERSION "${OCTOMAP_MAJOR_VERSION}") 45 | set(octomap_MINOR_VERSION "${OCTOMAP_MINOR_VERSION}") 46 | set(octomap_PATCH_VERSION "${OCTOMAP_PATCH_VERSION}") 47 | set(octomap_VERSION "${OCTOMAP_VERSION}") 48 | set(octomap_INCLUDE_DIRS "${OCTOMAP_INCLUDE_DIRS}") 49 | set(octomap_LIBRARY_DIRS "${OCTOMAP_LIBRARY_DIRS}") 50 | set(octomap_LIBRARIES "${OCTOMAP_LIBRARIES}") 51 | 52 | 53 | @OCTOMAP_INCLUDE_TARGETS@ 54 | -------------------------------------------------------------------------------- /octomap/package.xml: -------------------------------------------------------------------------------- 1 | 2 | octomap 3 | 1.10.0 4 | The OctoMap library implements a 3D occupancy grid mapping approach, providing data structures and mapping algorithms in C++. The map implementation is based on an octree. See 5 | http://octomap.github.io for details. 6 | 7 | Kai M. Wurm 8 | Armin Hornung 9 | Armin Hornung 10 | Wolfgang Merkt 11 | BSD 12 | 13 | http://octomap.github.io 14 | https://github.com/OctoMap/octomap/issues 15 | 16 | 17 | catkin 18 | 19 | cmake 20 | 21 | cmake 22 | 23 | 24 | -------------------------------------------------------------------------------- /octomap/share/data/geb079.bt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octomap/share/data/geb079.bt -------------------------------------------------------------------------------- /octomap/share/data/mapcoll.txt: -------------------------------------------------------------------------------- 1 | #a comment 2 | #a comment 3 | MAPNODEID cup0815 4 | #a further comment 5 | #a further comment 6 | MAPNODEFILENAME geb079.bt 7 | #a further comment 8 | MAPNODEPOSE 1 2 3 4.56 67.3 1.24 9 | #a further comment 10 | MAPNODEID glass 11 | MAPNODEFILENAME geb079.bt 12 | MAPNODEPOSE 1 2 3 4.56 67.3 1.24 13 | MAPNODEID cup08w5 14 | MAPNODEFILENAME geb079.bt 15 | MAPNODEPOSE 1 2 3 4.56 67.3 1.24 -------------------------------------------------------------------------------- /octomap/share/data/scan.dat.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octomap/share/data/scan.dat.bz2 -------------------------------------------------------------------------------- /octomap/share/data/spherical_scan.graph: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octomap/share/data/spherical_scan.graph -------------------------------------------------------------------------------- /octomap/share/example-project.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octomap/share/example-project.tgz -------------------------------------------------------------------------------- /octomap/share/images/uml_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octomap/share/images/uml_overview.png -------------------------------------------------------------------------------- /octomap/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET (octomap_SRCS 2 | AbstractOcTree.cpp 3 | AbstractOccupancyOcTree.cpp 4 | Pointcloud.cpp 5 | ScanGraph.cpp 6 | CountingOcTree.cpp 7 | OcTree.cpp 8 | OcTreeNode.cpp 9 | OcTreeStamped.cpp 10 | ColorOcTree.cpp 11 | ) 12 | 13 | # dynamic and static libs, see CMake FAQ: 14 | ADD_LIBRARY( octomap SHARED ${octomap_SRCS}) 15 | set_target_properties( octomap PROPERTIES 16 | VERSION ${OCTOMAP_VERSION} 17 | SOVERSION ${OCTOMAP_SOVERSION} 18 | ) 19 | ADD_LIBRARY( octomap-static STATIC ${octomap_SRCS}) 20 | SET_TARGET_PROPERTIES(octomap-static PROPERTIES OUTPUT_NAME "octomap") 21 | add_dependencies(octomap-static octomath-static) 22 | 23 | TARGET_LINK_LIBRARIES(octomap octomath) 24 | 25 | if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") 26 | file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") 27 | endif() 28 | 29 | export(TARGETS octomap octomap-static 30 | APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") 31 | 32 | ADD_SUBDIRECTORY( testing ) 33 | 34 | ADD_EXECUTABLE(graph2tree graph2tree.cpp) 35 | TARGET_LINK_LIBRARIES(graph2tree octomap) 36 | 37 | ADD_EXECUTABLE(log2graph log2graph.cpp) 38 | TARGET_LINK_LIBRARIES(log2graph octomap) 39 | 40 | ADD_EXECUTABLE(binvox2bt binvox2bt.cpp) 41 | TARGET_LINK_LIBRARIES(binvox2bt octomap) 42 | 43 | ADD_EXECUTABLE(bt2vrml bt2vrml.cpp) 44 | TARGET_LINK_LIBRARIES(bt2vrml octomap) 45 | 46 | ADD_EXECUTABLE(edit_octree edit_octree.cpp) 47 | TARGET_LINK_LIBRARIES(edit_octree octomap) 48 | 49 | ADD_EXECUTABLE(convert_octree convert_octree.cpp) 50 | TARGET_LINK_LIBRARIES(convert_octree octomap) 51 | 52 | ADD_EXECUTABLE(eval_octree_accuracy eval_octree_accuracy.cpp) 53 | TARGET_LINK_LIBRARIES(eval_octree_accuracy octomap) 54 | 55 | ADD_EXECUTABLE(compare_octrees compare_octrees.cpp) 56 | TARGET_LINK_LIBRARIES(compare_octrees octomap) 57 | 58 | ADD_EXECUTABLE(simple_example simple_example.cpp) 59 | TARGET_LINK_LIBRARIES(simple_example octomap) 60 | 61 | ADD_EXECUTABLE(pcd_to_bt_example pcd_to_bt_example.cpp) 62 | TARGET_LINK_LIBRARIES(pcd_to_bt_example octomap) 63 | 64 | ADD_EXECUTABLE(normals_example normals_example.cpp) 65 | TARGET_LINK_LIBRARIES(normals_example octomap) 66 | 67 | ADD_EXECUTABLE(intersection_example intersection_example.cpp) 68 | TARGET_LINK_LIBRARIES(intersection_example octomap) 69 | 70 | ADD_EXECUTABLE(octree2pointcloud octree2pointcloud.cpp) 71 | TARGET_LINK_LIBRARIES(octree2pointcloud octomap) 72 | 73 | install(TARGETS octomap octomap-static 74 | EXPORT octomap-targets 75 | INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" 76 | ${INSTALL_TARGETS_DEFAULT_ARGS} 77 | ) 78 | install(EXPORT octomap-targets DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap") 79 | 80 | install(TARGETS 81 | graph2tree 82 | log2graph 83 | binvox2bt 84 | bt2vrml 85 | edit_octree 86 | convert_octree 87 | eval_octree_accuracy 88 | compare_octrees 89 | ${INSTALL_TARGETS_DEFAULT_ARGS} 90 | ) 91 | 92 | -------------------------------------------------------------------------------- /octomap/src/OcTree.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | 36 | 37 | namespace octomap { 38 | 39 | OcTree::OcTree(double in_resolution) 40 | : OccupancyOcTreeBase(in_resolution) { 41 | ocTreeMemberInit.ensureLinking(); 42 | } 43 | 44 | OcTree::OcTree(std::string _filename) 45 | : OccupancyOcTreeBase (0.1) { // resolution will be set according to tree file 46 | readBinary(_filename); 47 | } 48 | 49 | OcTree::StaticMemberInitializer OcTree::ocTreeMemberInit; 50 | 51 | 52 | 53 | 54 | } // namespace 55 | -------------------------------------------------------------------------------- /octomap/src/OcTreeNode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | namespace octomap { 44 | 45 | OcTreeNode::OcTreeNode() 46 | : OcTreeDataNode(0.0) 47 | { 48 | } 49 | 50 | OcTreeNode::~OcTreeNode(){ 51 | } 52 | 53 | 54 | // ============================================================ 55 | // = occupancy probability ================================== 56 | // ============================================================ 57 | 58 | double OcTreeNode::getMeanChildLogOdds() const{ 59 | double mean = 0; 60 | uint8_t c = 0; 61 | if (children !=NULL){ 62 | for (unsigned int i=0; i<8; i++) { 63 | if (children[i] != NULL) { 64 | mean += static_cast(children[i])->getOccupancy(); // TODO check if works generally 65 | ++c; 66 | } 67 | } 68 | } 69 | 70 | if (c > 0) 71 | mean /= (double) c; 72 | 73 | return log(mean/(1-mean)); 74 | } 75 | 76 | float OcTreeNode::getMaxChildLogOdds() const{ 77 | float max = -std::numeric_limits::max(); 78 | 79 | if (children !=NULL){ 80 | for (unsigned int i=0; i<8; i++) { 81 | if (children[i] != NULL) { 82 | float l = static_cast(children[i])->getLogOdds(); // TODO check if works generally 83 | if (l > max) 84 | max = l; 85 | } 86 | } 87 | } 88 | return max; 89 | } 90 | 91 | void OcTreeNode::addValue(const float& logOdds) { 92 | value += logOdds; 93 | } 94 | 95 | } // end namespace 96 | 97 | 98 | -------------------------------------------------------------------------------- /octomap/src/OcTreeStamped.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include "octomap/OcTreeStamped.h" 35 | 36 | namespace octomap { 37 | 38 | OcTreeStamped::OcTreeStamped(double in_resolution) 39 | : OccupancyOcTreeBase(in_resolution) { 40 | ocTreeStampedMemberInit.ensureLinking(); 41 | } 42 | 43 | unsigned int OcTreeStamped::getLastUpdateTime() { 44 | // this value is updated whenever inner nodes are 45 | // updated using updateOccupancyChildren() 46 | return root->getTimestamp(); 47 | } 48 | 49 | void OcTreeStamped::degradeOutdatedNodes(unsigned int time_thres) { 50 | unsigned int query_time = (unsigned int) time(NULL); 51 | 52 | for(leaf_iterator it = this->begin_leafs(), end=this->end_leafs(); 53 | it!= end; ++it) { 54 | if ( this->isNodeOccupied(*it) 55 | && ((query_time - it->getTimestamp()) > time_thres) ) { 56 | integrateMissNoTime(&*it); 57 | } 58 | } 59 | } 60 | 61 | void OcTreeStamped::updateNodeLogOdds(OcTreeNodeStamped* node, const float& update) const { 62 | OccupancyOcTreeBase::updateNodeLogOdds(node, update); 63 | node->updateTimestamp(); 64 | } 65 | 66 | void OcTreeStamped::integrateMissNoTime(OcTreeNodeStamped* node) const{ 67 | OccupancyOcTreeBase::updateNodeLogOdds(node, prob_miss_log); 68 | } 69 | 70 | OcTreeStamped::StaticMemberInitializer OcTreeStamped::ocTreeStampedMemberInit; 71 | 72 | } // end namespace 73 | -------------------------------------------------------------------------------- /octomap/src/bt2vrml.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | using namespace std; 42 | using namespace octomap; 43 | 44 | void printUsage(char* self){ 45 | std::cerr << "\nUSAGE: " << self << " input.bt\n\n"; 46 | 47 | std::cerr << "This tool will convert the occupied voxels of a binary OctoMap \n" 48 | "file input.bt to a VRML2.0 file input.bt.wrl.\n\n"; 49 | 50 | std::cerr << "WARNING: The output files will be quite large!\n\n"; 51 | 52 | exit(0); 53 | } 54 | 55 | int main(int argc, char** argv) { 56 | // default values: 57 | string vrmlFilename = ""; 58 | string btFilename = ""; 59 | 60 | if (argc != 2 || (argc > 1 && strcmp(argv[1], "-h") == 0)){ 61 | printUsage(argv[0]); 62 | } 63 | 64 | btFilename = std::string(argv[1]); 65 | vrmlFilename = btFilename + ".wrl"; 66 | 67 | 68 | cout << "\nReading OcTree file\n===========================\n"; 69 | // TODO: check if file exists and if OcTree read correctly? 70 | OcTree* tree = new OcTree(btFilename); 71 | 72 | 73 | cout << "\nWriting occupied volumes to VRML\n===========================\n"; 74 | 75 | std::ofstream outfile (vrmlFilename.c_str()); 76 | 77 | outfile << "#VRML V2.0 utf8\n#\n"; 78 | outfile << "# created from OctoMap file "<begin(), end=tree->end(); it!= end; ++it) { 83 | if(tree->isNodeOccupied(*it)){ 84 | count++; 85 | double size = it.getSize(); 86 | outfile << "Transform { translation " 87 | << it.getX() << " " << it.getY() << " " << it.getZ() 88 | << " \n children [" 89 | << " Shape { geometry Box { size " 90 | << size << " " << size << " " << size << "} } ]\n" 91 | << "}\n"; 92 | } 93 | } 94 | 95 | delete tree; 96 | 97 | outfile.close(); 98 | 99 | std::cout << "Finished writing "<< count << " voxels to " << vrmlFilename << std::endl; 100 | 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /octomap/src/intersection_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | #include 39 | 40 | using namespace std; 41 | using namespace octomap; 42 | 43 | int main(int /*argc*/, char** /*argv*/) { 44 | 45 | cout << "generating example map" << endl; 46 | 47 | OcTree tree (0.1); // create empty tree with resolution 0.1 48 | 49 | // insert some measurements of free cells 50 | 51 | for (float x = -2; x <= 0; x += 0.02f) { 52 | for (float y = -2; y <= 0; y += 0.02f) { 53 | for (float z = -2; z <= 0; z += 0.02f) { 54 | point3d endpoint(x, y, z); 55 | tree.updateNode(endpoint, false); // integrate 'free' measurement 56 | } 57 | } 58 | } 59 | 60 | // insert some measurements of occupied cells (twice as much) 61 | for (float x = -1; x <= 0; x += 0.01f) { 62 | for (float y = -1; y <= 0; y += 0.01f) { 63 | for (float z = -1; z <= 0; z += 0.01f) { 64 | point3d endpoint(x, y, z); 65 | tree.updateNode(endpoint, true); // integrate 'occupied' measurement 66 | } 67 | } 68 | } 69 | 70 | point3d origin(-1.5, -1.5, -0.5); 71 | point3d direction; 72 | point3d ray_end; 73 | 74 | 75 | for(float z = 0; z <= 0.25; z += 0.125){ 76 | direction = point3d(1, 1, z); 77 | cout << endl; 78 | cout << "casting ray from " << origin << " in the " << direction << " direction"<< endl; 79 | bool success = tree.castRay(origin, direction, ray_end); 80 | 81 | if(success){ 82 | cout << "ray hit cell with center " << ray_end << endl; 83 | 84 | point3d intersection; 85 | success = tree.getRayIntersection(origin, direction, ray_end, intersection); 86 | if(success) 87 | cout << "entrance point is " << intersection << endl; 88 | } 89 | } 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /octomap/src/log2graph.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | using namespace std; 39 | using namespace octomap; 40 | 41 | void printUsage(char* self){ 42 | std::cerr << "\nUSAGE: " << self << " InputFile.log OutputFile.graph\n\n"; 43 | 44 | std::cerr << "This tool converts a plain text log file into a binary scangraph file" << std::endl; 45 | std::cerr << "which can be used in Octomap.\n\n"; 46 | std::cerr << "The log file needs to be in the format of:\n" 47 | << "NODE x y z roll pitch yaw\n" 48 | << "x y z\nx y z\n...\n" 49 | << "NODE x y z roll pitch yaw\n" 50 | << "x y z\n...\n\n" 51 | << "Lines starting with '#' or empty lines are ignored.\n\n"; 52 | 53 | exit(0); 54 | } 55 | 56 | int main(int argc, char** argv) { 57 | // default values: 58 | string logFilename = ""; 59 | string graphFilename = ""; 60 | 61 | 62 | if (argc != 3){ 63 | printUsage(argv[0]); 64 | } else{ 65 | logFilename = std::string(argv[1]); 66 | graphFilename = std::string(argv[2]); 67 | } 68 | 69 | cout << "\nReading Log file\n===========================\n"; 70 | ScanGraph* graph = new ScanGraph(); 71 | graph->readPlainASCII(logFilename); 72 | 73 | cout << "\nWriting binary graph file\n===========================\n"; 74 | 75 | graph->writeBinary(graphFilename); 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /octomap/src/math/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET (octomath_SRCS 2 | Vector3.cpp 3 | Quaternion.cpp 4 | Pose6D.cpp 5 | ) 6 | 7 | 8 | ADD_LIBRARY( octomath SHARED ${octomath_SRCS}) 9 | 10 | SET_TARGET_PROPERTIES( octomath PROPERTIES 11 | VERSION ${OCTOMAP_VERSION} 12 | SOVERSION ${OCTOMAP_SOVERSION} 13 | ) 14 | 15 | ADD_LIBRARY( octomath-static STATIC ${octomath_SRCS}) 16 | SET_TARGET_PROPERTIES(octomath-static PROPERTIES OUTPUT_NAME "octomath") 17 | 18 | if(NOT EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") 19 | file(MAKE_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap") 20 | endif() 21 | 22 | export(TARGETS octomath octomath-static 23 | APPEND FILE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-targets.cmake") 24 | 25 | install(TARGETS octomath octomath-static 26 | EXPORT octomap-targets 27 | INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" 28 | ${INSTALL_TARGETS_DEFAULT_ARGS} 29 | ) 30 | -------------------------------------------------------------------------------- /octomap/src/offset_graph.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include "octomap.h" 35 | #include 36 | #include 37 | #include 38 | 39 | using namespace std; 40 | using namespace octomap; 41 | using namespace octomath; 42 | 43 | int main(int argc, char** argv) { 44 | 45 | if (argc != 4) { 46 | printf("usage: in.graph offset out.graph\n"); 47 | exit(0); 48 | } 49 | 50 | ScanGraph* graph = new ScanGraph(); 51 | graph->readBinary(argv[1]); 52 | 53 | double offset = atof(argv[2]); 54 | Pose6D trans(0,0,-offset,0,0,0); 55 | 56 | for (ScanGraph::iterator scan_it = graph->begin(); scan_it != graph->end(); scan_it++) { 57 | (*scan_it)->scan->transform(trans); 58 | (*scan_it)->pose *= trans.inv(); 59 | } 60 | 61 | graph->writeBinary(argv[3]); 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /octomap/src/pcd_to_bt_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include "octomap/Pointcloud.h" 35 | #include 36 | #include 37 | 38 | using namespace std; 39 | using namespace octomap; 40 | 41 | int main(int /*argc*/, char ** /*argv*/) { 42 | 43 | OcTree tree(0.1); 44 | 45 | ifstream input_file("room.pcd"); 46 | if (!input_file.is_open()) { 47 | cout << "Failed to open room.pcd" << endl; 48 | return 1; 49 | } 50 | 51 | Pointcloud cloud; 52 | cloud.readPCD(input_file); 53 | 54 | std::cout << "cloud size: " << cloud.size() << std::endl; 55 | 56 | point3d sensor_origin(0.0, 0.0, 0.0); 57 | tree.insertPointCloud(cloud, sensor_origin); 58 | tree.writeBinary("room.bt"); 59 | } 60 | -------------------------------------------------------------------------------- /octomap/src/simple_example.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees 3 | * https://octomap.github.io/ 4 | * 5 | * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg 6 | * All rights reserved. 7 | * License: New BSD 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * Neither the name of the University of Freiburg nor the names of its 18 | * contributors may be used to endorse or promote products derived from 19 | * this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | using namespace std; 38 | using namespace octomap; 39 | 40 | 41 | void print_query_info(point3d query, OcTreeNode* node) { 42 | if (node != NULL) { 43 | cout << "occupancy probability at " << query << ":\t " << node->getOccupancy() << endl; 44 | } 45 | else 46 | cout << "occupancy probability at " << query << ":\t is unknown" << endl; 47 | } 48 | 49 | int main(int /*argc*/, char** /*argv*/) { 50 | 51 | cout << endl; 52 | cout << "generating example map" << endl; 53 | 54 | OcTree tree (0.1); // create empty tree with resolution 0.1 55 | 56 | 57 | // insert some measurements of occupied cells 58 | 59 | for (int x=-20; x<20; x++) { 60 | for (int y=-20; y<20; y++) { 61 | for (int z=-20; z<20; z++) { 62 | point3d endpoint ((float) x*0.05f, (float) y*0.05f, (float) z*0.05f); 63 | tree.updateNode(endpoint, true); // integrate 'occupied' measurement 64 | } 65 | } 66 | } 67 | 68 | // insert some measurements of free cells 69 | 70 | for (int x=-30; x<30; x++) { 71 | for (int y=-30; y<30; y++) { 72 | for (int z=-30; z<30; z++) { 73 | point3d endpoint ((float) x*0.02f-1.0f, (float) y*0.02f-1.0f, (float) z*0.02f-1.0f); 74 | tree.updateNode(endpoint, false); // integrate 'free' measurement 75 | } 76 | } 77 | } 78 | 79 | cout << endl; 80 | cout << "performing some queries:" << endl; 81 | 82 | point3d query (0., 0., 0.); 83 | OcTreeNode* result = tree.search (query); 84 | print_query_info(query, result); 85 | 86 | query = point3d(-1.,-1.,-1.); 87 | result = tree.search (query); 88 | print_query_info(query, result); 89 | 90 | query = point3d(1.,1.,1.); 91 | result = tree.search (query); 92 | print_query_info(query, result); 93 | 94 | 95 | cout << endl; 96 | tree.writeBinary("simple_tree.bt"); 97 | cout << "wrote example file simple_tree.bt" << endl << endl; 98 | cout << "now you can use octovis to visualize: octovis simple_tree.bt" << endl; 99 | cout << "Hint: hit 'F'-key in viewer to see the freespace" << endl << endl; 100 | 101 | } 102 | -------------------------------------------------------------------------------- /octomap/src/testing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(BUILD_TESTING) 2 | ADD_EXECUTABLE(test_raycasting test_raycasting.cpp) 3 | TARGET_LINK_LIBRARIES(test_raycasting octomap) 4 | 5 | ADD_EXECUTABLE(test_iterators test_iterators.cpp) 6 | TARGET_LINK_LIBRARIES(test_iterators octomap) 7 | 8 | ADD_EXECUTABLE(test_io test_io.cpp) 9 | TARGET_LINK_LIBRARIES(test_io octomap) 10 | 11 | ADD_EXECUTABLE(test_changedkeys test_changedkeys.cpp) 12 | TARGET_LINK_LIBRARIES(test_changedkeys octomap) 13 | 14 | ADD_EXECUTABLE(test_scans test_scans.cpp) 15 | TARGET_LINK_LIBRARIES(test_scans octomap) 16 | 17 | ADD_EXECUTABLE(test_color_tree test_color_tree.cpp) 18 | TARGET_LINK_LIBRARIES(test_color_tree octomap) 19 | 20 | ADD_EXECUTABLE(color_tree_histogram color_tree_histogram.cpp) 21 | TARGET_LINK_LIBRARIES(color_tree_histogram octomap) 22 | 23 | ADD_EXECUTABLE(test_mapcollection test_mapcollection.cpp) 24 | TARGET_LINK_LIBRARIES(test_mapcollection octomap octomath) 25 | 26 | ADD_EXECUTABLE(test_pruning test_pruning.cpp) 27 | TARGET_LINK_LIBRARIES(test_pruning octomap octomath) 28 | 29 | ADD_EXECUTABLE(test_bbx test_bbx.cpp) 30 | TARGET_LINK_LIBRARIES(test_bbx octomap) 31 | 32 | 33 | # CTest tests below 34 | 35 | ADD_EXECUTABLE(unit_tests unit_tests.cpp) 36 | TARGET_LINK_LIBRARIES(unit_tests octomap) 37 | 38 | ADD_TEST (NAME MathVector COMMAND unit_tests MathVector ) 39 | ADD_TEST (NAME MathPose COMMAND unit_tests MathPose ) 40 | ADD_TEST (NAME InsertRay COMMAND unit_tests InsertRay ) 41 | ADD_TEST (NAME InsertScan COMMAND unit_tests InsertScan ) 42 | ADD_TEST (NAME ReadGraph COMMAND unit_tests ReadGraph ) 43 | ADD_TEST (NAME StampedTree COMMAND unit_tests StampedTree ) 44 | ADD_TEST (NAME OcTreeKey COMMAND unit_tests OcTreeKey ) 45 | ADD_TEST (NAME test_scans COMMAND test_scans ${PROJECT_SOURCE_DIR}/share/data/spherical_scan.graph) 46 | ADD_TEST (NAME test_raycasting COMMAND test_raycasting) 47 | ADD_TEST (NAME test_io COMMAND test_io ${PROJECT_SOURCE_DIR}/share/data/geb079.bt) 48 | ADD_TEST (NAME test_pruning COMMAND test_pruning ) 49 | ADD_TEST (NAME test_iterators COMMAND test_iterators ${PROJECT_SOURCE_DIR}/share/data/geb079.bt) 50 | ADD_TEST (NAME test_mapcollection COMMAND test_mapcollection ${PROJECT_SOURCE_DIR}/share/data/mapcoll.txt) 51 | ADD_TEST (NAME test_color_tree COMMAND test_color_tree) 52 | ADD_TEST (NAME test_bbx COMMAND test_bbx) 53 | 54 | SET_TESTS_PROPERTIES (ReadGraph PROPERTIES DEPENDS InsertScan) 55 | endif() 56 | -------------------------------------------------------------------------------- /octomap/src/testing/color_tree_histogram.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | using namespace octomap; 6 | 7 | 8 | int main(int /*argc*/, char** argv) { 9 | 10 | std::string filename(argv[1]); 11 | 12 | std::ifstream infile(filename.c_str(), std::ios_base::in |std::ios_base::binary); 13 | if (!infile.is_open()) { 14 | cout << "file "<< filename << " could not be opened for reading.\n"; 15 | return -1; 16 | } 17 | 18 | ColorOcTree tree (0.1); 19 | tree.readData(infile); 20 | infile.close(); 21 | cout << "color tree read from "<< filename <<"\n"; 22 | 23 | tree.writeColorHistogram("histogram.eps"); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /octomap/src/testing/test_bbx.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "testing.h" 4 | 5 | using namespace octomap; 6 | 7 | int main(int /*argc*/, char** /*argv*/) { 8 | const float resolution = 0.2f; 9 | OcTree tree(resolution); 10 | 11 | // Set up the bounding box. 12 | const float bbx_limit = 10.1f; 13 | point3d bbx_min(-bbx_limit, -bbx_limit, -bbx_limit); 14 | point3d bbx_max(bbx_limit, bbx_limit, bbx_limit); 15 | tree.setBBXMin(bbx_min); 16 | tree.setBBXMax(bbx_max); 17 | tree.useBBXLimit(true); 18 | 19 | // Set up the point cloud. Offset the origin by half resolution to use the 20 | // center of a voxel. 21 | Pointcloud cloud; 22 | const point3d origin(resolution / 2.f, 5.f + resolution / 2.f, resolution / 2.f); 23 | const float maxrange = 8.f; 24 | // The first point is inside the bounding box and max range. 25 | const point3d point0 = origin + point3d(5.f, 0.f, 0.f); 26 | cloud.push_back(point0); 27 | // The second point is outside the bounding box but within max range. 28 | const point3d point1 = origin + point3d(0.f, 7.f, 0.f); 29 | cloud.push_back(point1); 30 | // The third point is inside the bounding box but outside max range. 31 | const point3d point2 = origin + point3d(0.f, 0.f, 9.f); 32 | cloud.push_back(point2); 33 | tree.insertPointCloud(cloud, origin, maxrange); 34 | 35 | // Check the point cloud insertion using ray casting. 36 | tree.setOccupancyThres(0.5f); 37 | point3d end_point; 38 | 39 | // Searching in the x-direction from the origin finds the first point. 40 | bool ray_cast_ret = tree.castRay(origin, point3d(1.f, 0.f, 0.f), end_point); 41 | EXPECT_TRUE(ray_cast_ret); 42 | const float eps = 1e-3; 43 | EXPECT_NEAR(end_point.x(), point0.x(), eps); 44 | EXPECT_NEAR(end_point.y(), point0.y(), eps); 45 | EXPECT_NEAR(end_point.z(), point0.z(), eps); 46 | 47 | // Searching in the y-direction from the origin terminates just outside the 48 | // bounding box. 49 | ray_cast_ret = tree.castRay(origin, point3d(0.f, 1.f, 0.f), end_point); 50 | EXPECT_FALSE(ray_cast_ret); 51 | EXPECT_NEAR(end_point.x(), point1.x(), eps); 52 | EXPECT_NEAR(end_point.y(), bbx_limit + resolution, eps); 53 | EXPECT_NEAR(end_point.z(), point1.z(), eps); 54 | 55 | // Searching in the z-direction from the origin terminates at the max range. 56 | ray_cast_ret = tree.castRay(origin, point3d(0.f, 0.f, 1.f), end_point); 57 | EXPECT_FALSE(ray_cast_ret); 58 | EXPECT_NEAR(end_point.x(), point2.x(), eps); 59 | EXPECT_NEAR(end_point.y(), point2.y(), eps); 60 | EXPECT_NEAR(end_point.z(), origin.z() + maxrange, eps); 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /octomap/src/testing/test_changedkeys.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | using namespace octomap; 8 | 9 | void printChanges(OcTree& tree){ 10 | unsigned int changedOccupied = 0; 11 | unsigned int changedFree = 0; 12 | unsigned int actualOccupied = 0; 13 | unsigned int actualFree = 0; 14 | unsigned int missingChanged = 0; 15 | 16 | tree.expand(); 17 | 18 | // iterate through the changed nodes 19 | KeyBoolMap::const_iterator it; 20 | for (it=tree.changedKeysBegin(); it!=tree.changedKeysEnd(); it++) { 21 | OcTreeNode* node = tree.search(it->first); 22 | if (node != NULL) { 23 | if (tree.isNodeOccupied(node)) { 24 | changedOccupied += 1; 25 | } 26 | else { 27 | changedFree += 1; 28 | } 29 | } else { 30 | missingChanged +=1; 31 | } 32 | } 33 | 34 | 35 | // iterate through the entire tree 36 | for(OcTree::tree_iterator it=tree.begin_tree(), 37 | end=tree.end_tree(); it!= end; ++it) { 38 | if (it.isLeaf()) { 39 | if (tree.isNodeOccupied(*it)) { 40 | actualOccupied += 1; 41 | } 42 | else { 43 | actualFree += 1; 44 | } 45 | } 46 | } 47 | 48 | cout << "change detection: " << changedOccupied << " occ; " << changedFree << " free; "<< missingChanged << " missing" << endl; 49 | cout << "actual: " << actualOccupied << " occ; " << actualFree << " free; " << endl; 50 | 51 | tree.prune(); 52 | } 53 | 54 | 55 | 56 | int main(int /*argc*/, char** /*argv*/) { 57 | 58 | 59 | //############################################################## 60 | 61 | OcTree tree (0.05); 62 | tree.enableChangeDetection(true); 63 | 64 | point3d origin (0.01f, 0.01f, 0.02f); 65 | point3d point_on_surface (4.01f,0.01f,0.01f); 66 | tree.insertRay(origin, point_on_surface); 67 | printChanges(tree); 68 | tree.updateNode(point3d(2.01f, 0.01f, 0.01f), 2.0f); 69 | printChanges(tree); 70 | tree.updateNode(point3d(2.01f, 0.01f, 0.01f), -2.0f); 71 | printChanges(tree); 72 | 73 | cout << "generating spherical scan at " << origin << " ..." << endl; 74 | 75 | for (int i=-100; i<101; i++) { 76 | Pointcloud cloud; 77 | for (int j=-100; j<101; j++) { 78 | point3d rotated = point_on_surface; 79 | rotated.rotate_IP(0, DEG2RAD(i*0.5), DEG2RAD(j*0.5)); 80 | cloud.push_back(rotated); 81 | } 82 | 83 | // insert in global coordinates: 84 | tree.insertPointCloud(cloud, origin, -1); 85 | } 86 | 87 | printChanges(tree); 88 | 89 | 90 | cout << "done." << endl; 91 | 92 | return 0; 93 | } 94 | 95 | -------------------------------------------------------------------------------- /octomap/src/testing/test_scans.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include "testing.h" 6 | 7 | using namespace std; 8 | using namespace octomap; 9 | 10 | void printUsage(char* self){ 11 | std::cerr << "\nUSAGE: " << self << " spherical_scan.graph (reference file to compare, required)\n\n"; 12 | 13 | exit(1); 14 | } 15 | 16 | void comparePose(const pose6d& first, const pose6d& sec){ 17 | EXPECT_FLOAT_EQ(first.x(), sec.x()); 18 | EXPECT_FLOAT_EQ(first.y(), sec.y()); 19 | EXPECT_FLOAT_EQ(first.z(), sec.z()); 20 | 21 | EXPECT_FLOAT_EQ(first.roll(), sec.roll()); 22 | EXPECT_FLOAT_EQ(first.pitch(), sec.pitch()); 23 | EXPECT_FLOAT_EQ(first.yaw(), sec.yaw()); 24 | } 25 | 26 | void comparePoint(const point3d& first, const point3d& sec){ 27 | EXPECT_FLOAT_EQ(first.x(), sec.x()); 28 | EXPECT_FLOAT_EQ(first.y(), sec.y()); 29 | EXPECT_FLOAT_EQ(first.z(), sec.z()); 30 | } 31 | 32 | int main(int argc, char** argv) { 33 | if (argc != 2){ 34 | printUsage(argv[0]); 35 | } 36 | 37 | std::string filename = std::string(argv[1]); 38 | 39 | ScanGraph referenceGraph; 40 | EXPECT_TRUE(referenceGraph.readBinary(filename)); 41 | 42 | // TODO: read in reference graph file 43 | 44 | 45 | //############################################################## 46 | 47 | point3d point_on_surface (4.01f, 0.01f, 0.01f); 48 | 49 | 50 | Pointcloud* cloud = new Pointcloud(); 51 | 52 | for (int i=-50; i<51; i++) { 53 | for (int j=-50; j<51; j++) { 54 | point3d rotated = point_on_surface; 55 | rotated.rotate_IP(0, DEG2RAD(i*0.5), DEG2RAD(j*0.5)); 56 | cloud->push_back(rotated); 57 | } 58 | } 59 | 60 | pose6d origin(1.0, 0, -0.5, 0, 0, 0); 61 | 62 | ScanGraph graph; 63 | graph.addNode(cloud, origin); // graph assumes ownership of cloud! 64 | 65 | { 66 | std::cout << "Comparing ScanGraph with reference file at " << filename << std::endl; 67 | EXPECT_TRUE(graph.size() == referenceGraph.size()); 68 | ScanNode* scanNode = *graph.begin(); 69 | ScanNode* refScanNode = *referenceGraph.begin(); 70 | 71 | EXPECT_EQ(scanNode->id, refScanNode->id); 72 | comparePose(scanNode->pose, refScanNode->pose); 73 | EXPECT_EQ(scanNode->scan->size(), refScanNode->scan->size()); 74 | 75 | for (size_t i = 0; i < scanNode->scan->size(); ++i){ 76 | comparePoint((*scanNode->scan)[i], (*refScanNode->scan)[i]); 77 | } 78 | 79 | } 80 | // test reading and writing to file - to verify, are the values really exactly equal or just close? 81 | { 82 | std::cout << "Testing ScanGraph I/O" << std::endl; 83 | 84 | EXPECT_TRUE(graph.writeBinary("spherical_scan_out.graph")); 85 | 86 | ScanGraph reReadGraph; 87 | EXPECT_TRUE(reReadGraph.readBinary("spherical_scan_out.graph")); 88 | 89 | EXPECT_TRUE(graph.size() == reReadGraph.size()); 90 | EXPECT_EQ(reReadGraph.size(), 1); 91 | 92 | ScanNode* scanNode = *graph.begin(); 93 | ScanNode* readScanNode = *reReadGraph.begin(); 94 | 95 | EXPECT_EQ(scanNode->id, readScanNode->id); 96 | EXPECT_EQ(scanNode->pose, readScanNode->pose); 97 | EXPECT_EQ(scanNode->scan->size(), readScanNode->scan->size()); 98 | 99 | for (size_t i = 0; i < scanNode->scan->size(); ++i){ 100 | EXPECT_EQ((*scanNode->scan)[i], (*readScanNode->scan)[i]); 101 | } 102 | } 103 | 104 | 105 | // insert into OcTree 106 | { 107 | OcTree tree (0.05); 108 | 109 | // insert in global coordinates: 110 | tree.insertPointCloud(*cloud, origin.trans()); 111 | 112 | tree.writeBinary("spherical_scan.bt"); 113 | } 114 | 115 | cout << "Test done." << endl; 116 | exit(0); 117 | 118 | } 119 | -------------------------------------------------------------------------------- /octomap/src/testing/testing.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // this is mimicing gtest expressions 5 | 6 | #define EXPECT_TRUE(args) { \ 7 | if (!(args)) { fprintf(stderr, "test failed (EXPECT_TRUE) in %s, line %d\n", __FILE__, __LINE__); \ 8 | exit(1); \ 9 | } } 10 | 11 | #define EXPECT_FALSE(args) { \ 12 | if (args) { fprintf(stderr, "test failed (EXPECT_FALSE) in %s, line %d\n", __FILE__, __LINE__); \ 13 | exit(1); \ 14 | } } 15 | 16 | #define EXPECT_EQ(a,b) { \ 17 | if (!((a) == (b))) { std::cerr << "test failed: " < %f in %s, line %d\n", a, b, prec, __FILE__, __LINE__); \ 29 | exit(1); \ 30 | } } 31 | 32 | -------------------------------------------------------------------------------- /octovis/CMakeModules/CMakeUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | list(REVERSE files) 8 | foreach (file ${files}) 9 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 10 | if (EXISTS "$ENV{DESTDIR}${file}") 11 | execute_process( 12 | COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" 13 | OUTPUT_VARIABLE rm_out 14 | RESULT_VARIABLE rm_retval 15 | ) 16 | if(NOT ${rm_retval} EQUAL 0) 17 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 18 | endif (NOT ${rm_retval} EQUAL 0) 19 | else (EXISTS "$ENV{DESTDIR}${file}") 20 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 21 | endif (EXISTS "$ENV{DESTDIR}${file}") 22 | endforeach(file) 23 | -------------------------------------------------------------------------------- /octovis/CMakeModules/CompilerSettings.cmake: -------------------------------------------------------------------------------- 1 | # COMPILER SETTINGS (default: Release) 2 | # use "-DCMAKE_BUILD_TYPE=Debug" in cmake for a Debug-build 3 | IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 4 | SET(CMAKE_BUILD_TYPE Release) 5 | ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) 6 | 7 | MESSAGE (STATUS "\n") 8 | MESSAGE (STATUS "${PROJECT_NAME} building as ${CMAKE_BUILD_TYPE}") 9 | 10 | # OCTOMAP_OMP = enable OpenMP 11 | # SET(OCTOMAP_OMP 1 CACHE BOOL "Enable/disable OpenMP") 12 | # IF($ENV{OCTOMAP_OMP}) 13 | # SET(OCTOMAP_OMP $ENV{OCTOMAP_OMP}) 14 | # MESSAGE(STATUS "Found OCTOMAP_OMP=${OCTOMAP_OMP}") 15 | # ENDIF($ENV{OCTOMAP_OMP}) 16 | 17 | # COMPILER FLAGS 18 | IF (CMAKE_COMPILER_IS_GNUCC) 19 | SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-error ") 20 | SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-error ") 21 | SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops -DNDEBUG") #sse3 disabled for compatibility 22 | # SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops -DNDEBUG -msse3 -mssse3") 23 | SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") 24 | # IF(OCTOMAP_OMP) 25 | # SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") 26 | # SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -fopenmp") 27 | # ENDIF(OCTOMAP_OMP) 28 | ENDIF() 29 | 30 | # Set full rpath http://www.paraview.org/Wiki/CMake_RPATH_handling 31 | # (good to have and required with ROS) 32 | set(CMAKE_SKIP_BUILD_RPATH FALSE) 33 | set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 34 | set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") 35 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 36 | 37 | # enables -fPIC in applicable compilers 38 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 39 | 40 | # no prefix needed for python modules 41 | set(CMAKE_SHARED_MODULE_PREFIX "") 42 | -------------------------------------------------------------------------------- /octovis/include/octovis/CameraFollowMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef CAMERAFOLLOWMODE_H_ 26 | #define CAMERAFOLLOWMODE_H_ 27 | 28 | #include "SceneObject.h" 29 | #include 30 | 31 | class CameraFollowMode : public QObject { 32 | Q_OBJECT 33 | 34 | public: 35 | CameraFollowMode(octomap::ScanGraph *graph = NULL); 36 | virtual ~CameraFollowMode(); 37 | void setScanGraph(octomap::ScanGraph *graph); 38 | 39 | public slots: 40 | void jumpToFrame(unsigned int frame); 41 | void cameraPathStopped(int id); 42 | void cameraPathFrameChanged(int id, int current_camera_frame); 43 | void play(); 44 | void pause(); 45 | void clearCameraPath(); 46 | void saveToCameraPath(); 47 | void addToCameraPath(); 48 | void removeFromCameraPath(); 49 | void followCameraPath(); 50 | void followRobotPath(); 51 | 52 | signals: 53 | void changeCamPose(const octomath::Pose6D& pose); 54 | void interpolateCamPose(const octomath::Pose6D& old_pose, const octomath::Pose6D& new_pose, double u); 55 | void stopped(); 56 | void frameChanged(unsigned int frame); 57 | void deleteCameraPath(int id); 58 | void removeFromCameraPath(int id, int frame); 59 | void updateCameraPath(int id, int frame); 60 | void appendToCameraPath(int id, const octomath::Pose6D& pose); 61 | void appendCurrentToCameraPath(int id); 62 | void addCurrentToCameraPath(int id, int frame); 63 | void playCameraPath(int id, int start_frame); 64 | void stopCameraPath(int id); 65 | void jumpToCamFrame(int id, int frame); 66 | void changeNumberOfFrames(unsigned count); 67 | void scanGraphAvailable(bool available); 68 | 69 | 70 | protected: 71 | octomap::ScanGraph *m_scan_graph; 72 | unsigned int m_current_scan; 73 | unsigned int m_current_cam_frame; 74 | unsigned int m_number_cam_frames; 75 | unsigned int m_start_frame; 76 | bool m_followRobotTrajectory; 77 | }; 78 | 79 | #endif /* CAMERAFOLLOWMODE_H_ */ 80 | -------------------------------------------------------------------------------- /octovis/include/octovis/ColorOcTreeDrawer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef OCTOVIS_COLOR_OCTREEDRAWER_H_ 26 | #define OCTOVIS_COLOR_OCTREEDRAWER_H_ 27 | 28 | #include 29 | #include 30 | 31 | namespace octomap { 32 | 33 | class ColorOcTreeDrawer : public OcTreeDrawer { 34 | public: 35 | ColorOcTreeDrawer(); 36 | virtual ~ColorOcTreeDrawer(); 37 | 38 | virtual void setOcTree(const AbstractOcTree& tree_pnt, const pose6d& origin, int map_id_); 39 | 40 | protected: 41 | 42 | 43 | }; 44 | 45 | 46 | } // end namespace 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /octovis/include/octovis/OcTreeRecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef OCTOVIS_OC_TREE_RECORD 26 | #define OCTOVIS_OC_TREE_RECORD 27 | 28 | #include 29 | 30 | namespace octomap { 31 | 32 | class OcTreeRecord { 33 | public: 34 | AbstractOcTree* octree; 35 | OcTreeDrawer* octree_drawer; 36 | unsigned int id; 37 | pose6d origin; 38 | }; 39 | 40 | } // namespace 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /octovis/include/octovis/PointcloudDrawer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef POINTCLOUDDRAWER_H_ 26 | #define POINTCLOUDDRAWER_H_ 27 | 28 | #include "SceneObject.h" 29 | 30 | namespace octomap { 31 | 32 | /** 33 | * Drawer which visualizes Pointclouds 34 | */ 35 | class PointcloudDrawer: public ScanGraphDrawer { 36 | public: 37 | PointcloudDrawer(); 38 | PointcloudDrawer(const ScanGraph& graph); 39 | virtual ~PointcloudDrawer(); 40 | 41 | virtual void draw() const; 42 | virtual void clear(); 43 | virtual void setScanGraph(const ScanGraph& graph); 44 | 45 | protected: 46 | GLfloat* m_pointsArray; 47 | unsigned m_numberPoints; 48 | 49 | }; 50 | 51 | } 52 | 53 | #endif /* POINTCLOUDDRAWER_H_ */ 54 | -------------------------------------------------------------------------------- /octovis/include/octovis/SceneObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef SCENEOBJECT_H_ 26 | #define SCENEOBJECT_H_ 27 | 28 | // fix Windows includes 29 | #include 30 | #if defined(Q_WS_WIN) || defined(Q_OS_WIN) 31 | #include 32 | #endif 33 | 34 | #if defined(Q_WS_MAC) || defined(Q_OS_MAC) 35 | #include 36 | #else 37 | #include 38 | #endif 39 | 40 | #include 41 | 42 | namespace octomap { 43 | 44 | /** 45 | * Abstract base class for objects to be drawn in the ViewerWidget. 46 | * 47 | */ 48 | class SceneObject { 49 | public: 50 | enum ColorMode { 51 | CM_FLAT, 52 | CM_PRINTOUT, 53 | CM_COLOR_HEIGHT, 54 | CM_GRAY_HEIGHT, 55 | CM_SEMANTIC 56 | }; 57 | 58 | public: 59 | SceneObject(); 60 | virtual ~SceneObject(){} 61 | 62 | /** 63 | * Actual draw function which will be called to visualize the object 64 | */ 65 | virtual void draw() const = 0; 66 | 67 | /** 68 | * Clears the object's representation (will be called when it gets invalid) 69 | */ 70 | virtual void clear(){} 71 | 72 | public: 73 | //! the color mode has to be set before calling OcTreDrawer::setMap() 74 | //! because the cubes are generated in OcTreDrawer::setMap() using the color information 75 | inline void setColorMode(ColorMode mode) { m_colorMode = mode; } 76 | inline void enablePrintoutMode(bool enabled = true) { if (enabled) m_colorMode = CM_PRINTOUT; else m_colorMode = CM_FLAT; } 77 | inline void enableHeightColorMode(bool enabled = true) { if (enabled) m_colorMode = CM_COLOR_HEIGHT; else m_colorMode = CM_FLAT; } 78 | inline void enableSemanticColoring(bool enabled = true) { if (enabled) m_colorMode = CM_SEMANTIC; else m_colorMode = CM_FLAT; } 79 | 80 | protected: 81 | /// writes rgb values which correspond to a rel. height in the map. 82 | /// (glArrayPos needs to have at least size 3!) 83 | void heightMapColor(double h, GLfloat* glArrayPos) const; 84 | void heightMapGray(double h, GLfloat* glArrayPos) const; 85 | double m_zMin; 86 | double m_zMax; 87 | ColorMode m_colorMode; 88 | }; 89 | 90 | 91 | 92 | 93 | /** 94 | * Abstract base class for all objects visualizing ScanGraphs. 95 | */ 96 | class ScanGraphDrawer : public SceneObject { 97 | public: 98 | ScanGraphDrawer(): SceneObject(){} 99 | virtual ~ScanGraphDrawer(){} 100 | 101 | /** 102 | * Notifies drawer of a new or changed ScanGraph, so that the internal 103 | * representation can be rebuilt. Needs to be overloaded by each specific 104 | * drawer. 105 | * 106 | * @param graph ScanGraph to be visualized 107 | */ 108 | virtual void setScanGraph(const octomap::ScanGraph& graph) = 0; 109 | }; 110 | 111 | } 112 | 113 | #endif /* SCENEOBJECT_H_ */ 114 | -------------------------------------------------------------------------------- /octovis/include/octovis/SelectionBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef SELECTIONBOX_H_ 26 | #define SELECTIONBOX_H_ 27 | 28 | #include 29 | 30 | namespace octomap { 31 | class SelectionBox{ 32 | 33 | public: 34 | SelectionBox(); 35 | virtual ~SelectionBox(); 36 | void draw(bool withNames = false); 37 | const qglviewer::ManipulatedFrame* frame (unsigned short i) const { return m_frames.at(i); } 38 | qglviewer::ManipulatedFrame* frame (unsigned short i) { return m_frames.at(i); } 39 | void getBBXMin(float& x, float& y, float& z) const; 40 | void getBBXMax(float& x, float& y, float& z) const; 41 | int getGrabbedFrame() const; 42 | 43 | protected: 44 | void drawAxis(float length = 0.2f) const; 45 | 46 | bool m_visible; 47 | std::vector m_frames; 48 | unsigned short m_selectedFrame; 49 | qglviewer::Vec m_minPt; 50 | qglviewer::Vec m_maxPt; 51 | float m_arrowLength; 52 | 53 | }; 54 | 55 | 56 | 57 | } 58 | 59 | 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /octovis/include/octovis/TrajectoryDrawer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef TRAJECTORYDRAWER_H_ 26 | #define TRAJECTORYDRAWER_H_ 27 | 28 | #include "SceneObject.h" 29 | #include 30 | 31 | namespace octomap { 32 | 33 | class TrajectoryDrawer : public ScanGraphDrawer{ 34 | public: 35 | TrajectoryDrawer(); 36 | TrajectoryDrawer(const ScanGraph& graph); 37 | virtual ~TrajectoryDrawer(); 38 | virtual void draw() const; 39 | virtual void clear(); 40 | virtual void setScanGraph(const octomap::ScanGraph& graph); 41 | 42 | protected: 43 | GLfloat* m_trajectoryVertexArray; 44 | GLfloat* m_trajectoryColorArray; 45 | unsigned int m_trajectorySize; //!< number of nodes in the ScanGraph 46 | }; 47 | 48 | } 49 | 50 | #endif /* TRAJECTORYDRAWER_H_ */ 51 | -------------------------------------------------------------------------------- /octovis/include/octovis/ViewerSettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef VIEWERSETTINGS_H 26 | #define VIEWERSETTINGS_H 27 | 28 | #include 29 | #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 30 | #include 31 | #else // QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 32 | #include 33 | #endif // QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 34 | #include "ui_ViewerSettings.h" 35 | 36 | class ViewerSettings : public QDialog 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | ViewerSettings(QWidget *parent = 0); 42 | ~ViewerSettings(); 43 | double getResolution(){return ui.resolution->value(); } 44 | void setResolution(double resolution){ui.resolution->setValue(resolution);} 45 | unsigned int getLaserType(){return ui.laserType->currentIndex(); } 46 | void setLaserType(int type){ui.laserType->setCurrentIndex(type); } 47 | double getMaxRange(){return ui.maxRange->value(); } 48 | void setMaxRange(double range){ui.maxRange->setValue(range); } 49 | 50 | private: 51 | Ui::ViewerSettingsClass ui; 52 | }; 53 | 54 | #endif // VIEWERSETTINGS_H 55 | -------------------------------------------------------------------------------- /octovis/include/octovis/ViewerSettingsPanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef VIEWERSETTINGSPANEL_H 26 | #define VIEWERSETTINGSPANEL_H 27 | 28 | #include 29 | #include 30 | #include "ui_ViewerSettingsPanel.h" 31 | 32 | #define _TREE_MAX_DEPTH 16 33 | 34 | class ViewerSettingsPanel : public QWidget 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | ViewerSettingsPanel(QWidget *parent = 0); 40 | ~ViewerSettingsPanel(); 41 | 42 | public slots: 43 | void setNumberOfScans(unsigned scans); 44 | void setCurrentScan(unsigned scan); 45 | void setResolution(double resolution); 46 | void setTreeDepth(int depth); 47 | 48 | private slots: 49 | void on_firstScanButton_clicked(); 50 | void on_lastScanButton_clicked(); 51 | void on_nextScanButton_clicked(); 52 | void on_fastFwdScanButton_clicked(); 53 | 54 | signals: 55 | void treeDepthChanged(int depth); 56 | void addNextScans(unsigned scans); 57 | void gotoFirstScan(); 58 | 59 | 60 | private: 61 | void scanProgressChanged(); 62 | void leafSizeChanged(); 63 | Ui::ViewerSettingsPanelClass ui; 64 | unsigned m_currentScan; 65 | unsigned m_numberScans; 66 | unsigned m_treeDepth; 67 | double m_resolution; 68 | }; 69 | 70 | #endif // VIEWERSETTINGSPANEL_H 71 | -------------------------------------------------------------------------------- /octovis/include/octovis/ViewerSettingsPanelCamera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #ifndef VIEWERSETTINGSPANELFLYMODE_H 26 | #define VIEWERSETTINGSPANELFLYMODE_H 27 | 28 | #include 29 | #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 30 | #include 31 | #else 32 | #include 33 | #endif 34 | #include "ui_ViewerSettingsPanelCamera.h" 35 | 36 | class ViewerSettingsPanelCamera : public QWidget 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | ViewerSettingsPanelCamera(QWidget *parent = 0); 42 | ~ViewerSettingsPanelCamera(); 43 | QSize sizeHint() const; 44 | 45 | public slots: 46 | void setNumberOfFrames(unsigned frames); 47 | void setCurrentFrame(unsigned frame); 48 | void setRobotTrajectoryAvailable(bool available); 49 | void setStopped(); 50 | 51 | private slots: 52 | void on_firstScanButton_clicked(); 53 | void on_lastScanButton_clicked(); 54 | void on_nextScanButton_clicked(); 55 | void on_previousScanButton_clicked(); 56 | void on_playScanButton_clicked(); 57 | void on_scanProgressSlider_sliderMoved(int value); 58 | void on_followCameraPathButton_clicked(); 59 | void on_followTrajectoryButton_clicked(); 60 | void on_cameraPathAdd_clicked(); 61 | void on_cameraPathRemove_clicked(); 62 | void on_cameraPathSave_clicked(); 63 | void on_cameraPathClear_clicked(); 64 | void positionEditDone(double); 65 | 66 | 67 | signals: 68 | void changeCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ); 69 | void jumpToFrame(unsigned int frame); 70 | void play(); 71 | void pause(); 72 | void clearCameraPath(); 73 | void saveToCameraPath(); 74 | void removeFromCameraPath(); 75 | void addToCameraPath(); 76 | void followCameraPath(); 77 | void followRobotPath(); 78 | 79 | private: 80 | void dataChanged(); 81 | void gotoFrame(unsigned int frame); 82 | bool followRobotTrajectory(); 83 | Ui::ViewerSettingsPanelCameraClass ui; 84 | unsigned int m_currentFrame; 85 | unsigned int m_numberFrames; 86 | bool m_robotTrajectoryAvailable; 87 | }; 88 | 89 | #endif // VIEWERSETTINGSPANELFLYMODE_H 90 | -------------------------------------------------------------------------------- /octovis/octovis-config.cmake.in: -------------------------------------------------------------------------------- 1 | # It defines the following variables 2 | # OCTOVIS_INCLUDE_DIRS - include directories for OctoMap viewer 3 | # OCTOVIS_LIBRARY_DIRS - library directories for OctoMap viewer 4 | # OCTOVIS_LIBRARIES - libraries to link against 5 | # OCTOVIS_MAJOR_VERSION - major version 6 | # OCTOVIS_MINOR_VERSION - minor version 7 | # OCTOVIS_PATCH_VERSION - patch version 8 | # OCTOVIS_VERSION - major.minor.patch version 9 | 10 | @PACKAGE_INIT@ 11 | 12 | set(OCTOVIS_MAJOR_VERSION "@OCTOVIS_MAJOR_VERSION@") 13 | set(OCTOVIS_MINOR_VERSION "@OCTOVIS_MINOR_VERSION@") 14 | set(OCTOVIS_PATCH_VERSION "@OCTOVIS_PATCH_VERSION@") 15 | set(OCTOVIS_VERSION "@OCTOVIS_VERSION@") 16 | 17 | set_and_check(OCTOVIS_INCLUDE_DIRS "@PACKAGE_OCTOVIS_INCLUDE_DIRS@" "@QGLViewer_INCLUDE_DIR@") 18 | set_and_check(OCTOVIS_LIBRARY_DIRS "@PACKAGE_OCTOVIS_LIB_DIR@" "@QGLViewer_LIBRARY_DIR@") 19 | 20 | # Set library names as absolute paths: 21 | set(OCTOVIS_LIBRARIES 22 | "@QGLViewer_LIBRARIES@" 23 | "@QT_LIBRARIES@" 24 | "@PACKAGE_OCTOVIS_LIB_DIR@/@OCTOVIS_LIBRARY@" 25 | ) 26 | 27 | @OCTOVIS_INCLUDE_TARGETS@ 28 | -------------------------------------------------------------------------------- /octovis/package.xml: -------------------------------------------------------------------------------- 1 | 2 | octovis 3 | 1.10.0 4 | octovis is visualization tool for the OctoMap library based on Qt and libQGLViewer. See 5 | http://octomap.github.io for details. 6 | 7 | Kai M. Wurm 8 | Armin Hornung 9 | Armin Hornung 10 | Wolfgang Merkt 11 | GPLv2 12 | 13 | http://octomap.github.io 14 | https://github.com/OctoMap/octomap/issues 15 | 16 | 17 | catkin 18 | 19 | cmake 20 | 21 | cmake 22 | 23 | 24 | octomap 25 | opengl 26 | 27 | 28 | libqglviewer-dev-qt5 29 | libqt5-core 30 | libqt5-opengl-dev 31 | 32 | 33 | 36 | 37 | octomap 38 | opengl 39 | 40 | 41 | libqglviewer2-qt5 42 | libqt5-core 43 | libqt5-gui 44 | libqt5-opengl 45 | 46 | 47 | 50 | 51 | -------------------------------------------------------------------------------- /octovis/src/PointcloudDrawer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #include 26 | 27 | namespace octomap { 28 | 29 | PointcloudDrawer::PointcloudDrawer() 30 | : ScanGraphDrawer(), m_pointsArray(NULL), m_numberPoints(0) 31 | { 32 | } 33 | 34 | PointcloudDrawer::PointcloudDrawer(const ScanGraph& graph) 35 | : ScanGraphDrawer(), m_pointsArray(NULL), m_numberPoints(0) 36 | { 37 | this->setScanGraph(graph); 38 | 39 | } 40 | 41 | PointcloudDrawer::~PointcloudDrawer() { 42 | clear(); 43 | 44 | } 45 | 46 | void PointcloudDrawer::setScanGraph(const ScanGraph& graph){ 47 | clear(); 48 | 49 | // count points first: 50 | for (octomap::ScanGraph::const_iterator it = graph.begin(); it != graph.end(); it++) { 51 | m_numberPoints += (*it)->scan->size(); 52 | } 53 | 54 | m_pointsArray = new GLfloat[3*m_numberPoints]; 55 | 56 | unsigned i = 0; 57 | for (octomap::ScanGraph::const_iterator graph_it = graph.begin(); graph_it != graph.end(); graph_it++) { 58 | octomap::Pointcloud* scan = new Pointcloud((*graph_it)->scan); 59 | scan->transformAbsolute((*graph_it)->pose); 60 | 61 | for (Pointcloud::iterator pc_it = scan->begin(); pc_it != scan->end(); ++pc_it){ 62 | m_pointsArray[3*i] = pc_it->x(); 63 | m_pointsArray[3*i +1] = pc_it->y(); 64 | m_pointsArray[3*i +2] = pc_it->z(); 65 | 66 | i++; 67 | } 68 | delete scan; 69 | } 70 | } 71 | 72 | void PointcloudDrawer::clear(){ 73 | 74 | if (m_numberPoints != 0) { 75 | delete[] m_pointsArray; 76 | m_numberPoints = 0; 77 | } 78 | } 79 | 80 | void PointcloudDrawer::draw() const{ 81 | if (m_numberPoints == 0) 82 | return; 83 | 84 | glEnable(GL_POINT_SMOOTH); 85 | glEnableClientState(GL_VERTEX_ARRAY); 86 | 87 | // TODO: find a solution for printout-mode (=> separate drawer?) 88 | // if (m_printoutMode){ 89 | // if (!m_drawFree) { 90 | // glClearColor(1.0f, 1.0f, 1.0f, 1.0f); 91 | // } 92 | // glColor4f(0.0, 0.0, 0.0, 1.); 93 | // } else{ 94 | // glColor4f(1.0, 0.0, 0.0, 1.); 95 | // } 96 | 97 | glPointSize(1.0); 98 | glColor4f(1.0, 0.0, 0.0, 1.); 99 | 100 | glVertexPointer(3, GL_FLOAT, 0, m_pointsArray); 101 | glDrawArrays(GL_POINTS, 0, m_numberPoints); 102 | glDisableClientState(GL_VERTEX_ARRAY); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /octovis/src/SceneObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #define NOMINMAX 26 | #include 27 | 28 | #ifndef RAD2DEG 29 | #define RAD2DEG(x) ((x) * 57.29577951308232087721) 30 | #endif 31 | 32 | namespace octomap { 33 | 34 | SceneObject::SceneObject() : 35 | m_zMin(0.0), m_zMax(1.0), m_colorMode(CM_FLAT) { 36 | } 37 | 38 | void SceneObject::heightMapColor(double h, GLfloat* glArrayPos) const { 39 | if (m_zMin >= m_zMax) 40 | h = 0.5; 41 | else{ 42 | h = (1.0 - std::min(std::max((h-m_zMin)/ (m_zMax - m_zMin), 0.0), 1.0)) *0.8; 43 | } 44 | 45 | // blend over HSV-values (more colors) 46 | double r, g, b; 47 | double s = 1.0; 48 | double v = 1.0; 49 | 50 | h -= floor(h); 51 | h *= 6; 52 | int i; 53 | double m, n, f; 54 | 55 | i = floor(h); 56 | f = h - i; 57 | if (!(i & 1)) 58 | f = 1 - f; // if i is even 59 | m = v * (1 - s); 60 | n = v * (1 - s * f); 61 | 62 | switch (i) { 63 | case 6: 64 | case 0: 65 | r = v; g = n; b = m; 66 | break; 67 | case 1: 68 | r = n; g = v; b = m; 69 | break; 70 | case 2: 71 | r = m; g = v; b = n; 72 | break; 73 | case 3: 74 | r = m; g = n; b = v; 75 | break; 76 | case 4: 77 | r = n; g = m; b = v; 78 | break; 79 | case 5: 80 | r = v; g = m; b = n; 81 | break; 82 | default: 83 | r = 1; g = 0.5; b = 0.5; 84 | break; 85 | } 86 | 87 | glArrayPos[0] = r; 88 | glArrayPos[1] = g; 89 | glArrayPos[2] = b; 90 | } 91 | 92 | void SceneObject::heightMapGray(double h, GLfloat* glArrayPos) const { 93 | if (m_zMin >= m_zMax) 94 | h = 0.5; 95 | else{ 96 | h = std::min(std::max((h-m_zMin)/ (m_zMax - m_zMin), 0.0), 1.0) * 0.4 + 0.3; // h \in [0.3, 0.7] 97 | } 98 | 99 | glArrayPos[0] = h; 100 | glArrayPos[1] = h; 101 | glArrayPos[2] = h; 102 | } 103 | 104 | 105 | } 106 | -------------------------------------------------------------------------------- /octovis/src/TrajectoryDrawer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #include 26 | 27 | namespace octomap { 28 | 29 | TrajectoryDrawer::TrajectoryDrawer() 30 | : ScanGraphDrawer(), m_trajectoryVertexArray(NULL), m_trajectoryColorArray(NULL), m_trajectorySize(0) 31 | { 32 | 33 | } 34 | 35 | TrajectoryDrawer::TrajectoryDrawer(const octomap::ScanGraph& graph) 36 | : ScanGraphDrawer(), m_trajectoryVertexArray(NULL), m_trajectoryColorArray(NULL), m_trajectorySize(0) 37 | { 38 | this->setScanGraph(graph); 39 | } 40 | 41 | TrajectoryDrawer::~TrajectoryDrawer() { 42 | clear(); 43 | 44 | } 45 | 46 | void TrajectoryDrawer::draw() const{ 47 | if (m_trajectorySize == 0) 48 | return; 49 | 50 | // draw lines: 51 | glEnableClientState(GL_VERTEX_ARRAY); 52 | glEnableClientState(GL_COLOR_ARRAY); 53 | glLineWidth(3.0f); 54 | glVertexPointer(3, GL_FLOAT, 0, m_trajectoryVertexArray); 55 | glColorPointer(4, GL_FLOAT, 0, m_trajectoryColorArray); 56 | glDrawArrays(GL_LINE_STRIP, 0, m_trajectorySize); 57 | glDisableClientState(GL_COLOR_ARRAY); 58 | glDisableClientState(GL_VERTEX_ARRAY); 59 | 60 | // draw nodes: 61 | GLUquadricObj* quadric=gluNewQuadric(); 62 | gluQuadricNormals(quadric, GLU_SMOOTH); 63 | for (uint i = 0; i < m_trajectorySize; ++i){ 64 | glPushMatrix(); 65 | glTranslatef(m_trajectoryVertexArray[3*i], m_trajectoryVertexArray[3*i +1], m_trajectoryVertexArray[3*i +2]); 66 | glColor4f(m_trajectoryColorArray[4*i],m_trajectoryColorArray[4*i+1],m_trajectoryColorArray[4*i+2],m_trajectoryColorArray[4*i+3]); 67 | gluSphere(quadric, 0.05, 32, 32); 68 | glPopMatrix(); 69 | } 70 | 71 | gluDeleteQuadric(quadric); 72 | } 73 | 74 | void TrajectoryDrawer::clear(){ 75 | 76 | if (m_trajectorySize != 0) { 77 | delete[] m_trajectoryVertexArray; 78 | delete[] m_trajectoryColorArray; 79 | m_trajectorySize = 0; 80 | } 81 | } 82 | 83 | void TrajectoryDrawer::setScanGraph(const octomap::ScanGraph& graph){ 84 | 85 | clear(); 86 | 87 | m_trajectorySize = graph.size(); 88 | m_trajectoryVertexArray = new GLfloat[m_trajectorySize * 3]; 89 | m_trajectoryColorArray = new GLfloat[m_trajectorySize * 4]; 90 | 91 | uint i = 0; 92 | for (octomap::ScanGraph::const_iterator it = graph.begin(); it != graph.end(); it++) { 93 | m_trajectoryVertexArray[i] = (*it)->pose.trans().x(); 94 | m_trajectoryVertexArray[i+1] = (*it)->pose.trans().y(); 95 | m_trajectoryVertexArray[i+2] = (*it)->pose.trans().z(); 96 | i+=3; 97 | } 98 | 99 | for (unsigned int j=0; j < m_trajectorySize*4; j+=4) { 100 | m_trajectoryColorArray[j] = 0.; // r 101 | m_trajectoryColorArray[j+1] = 0.; // g 102 | m_trajectoryColorArray[j+2] = 1.; // b 103 | m_trajectoryColorArray[j+3] = 1.; // alpha 104 | } 105 | } 106 | 107 | } 108 | 109 | -------------------------------------------------------------------------------- /octovis/src/ViewerSettings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #include 26 | 27 | ViewerSettings::ViewerSettings(QWidget *parent) 28 | : QDialog(parent) 29 | { 30 | ui.setupUi(this); 31 | } 32 | 33 | ViewerSettings::~ViewerSettings() 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /octovis/src/ViewerSettingsPanel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #include 26 | 27 | ViewerSettingsPanel::ViewerSettingsPanel(QWidget *parent) 28 | : QWidget(parent), m_currentScan(0), m_numberScans(0), m_treeDepth(_TREE_MAX_DEPTH), m_resolution(0.1) 29 | { 30 | ui.setupUi(this); 31 | connect(ui.treeDepth, SIGNAL(valueChanged(int)), this, SLOT(setTreeDepth(int))); 32 | 33 | scanProgressChanged(); 34 | leafSizeChanged(); 35 | } 36 | 37 | ViewerSettingsPanel::~ViewerSettingsPanel() 38 | { 39 | 40 | } 41 | 42 | void ViewerSettingsPanel::on_nextScanButton_clicked(){ 43 | if (m_currentScan < m_numberScans){ 44 | m_currentScan++; 45 | scanProgressChanged(); 46 | emit addNextScans(1); 47 | } 48 | } 49 | 50 | void ViewerSettingsPanel::on_fastFwdScanButton_clicked(){ 51 | unsigned increase = int(m_numberScans)-int(m_currentScan); 52 | if (increase > 5) increase = 5; 53 | m_currentScan += increase; 54 | scanProgressChanged(); 55 | emit addNextScans(increase); 56 | } 57 | 58 | void ViewerSettingsPanel::on_lastScanButton_clicked(){ 59 | unsigned increase = int(m_numberScans)-int(m_currentScan); 60 | m_currentScan += increase; 61 | scanProgressChanged(); 62 | emit addNextScans(increase); 63 | } 64 | 65 | void ViewerSettingsPanel::on_firstScanButton_clicked(){ 66 | m_currentScan = 1; 67 | scanProgressChanged(); 68 | emit gotoFirstScan(); 69 | } 70 | 71 | void ViewerSettingsPanel::scanProgressChanged(){ 72 | if (int(m_numberScans) > 1) 73 | ui.scanProgressBar->setMaximum(int(m_numberScans)); 74 | else 75 | ui.scanProgressBar->setMaximum(1); 76 | 77 | if (m_currentScan == m_numberScans){ 78 | ui.nextScanButton->setEnabled(false); 79 | ui.fastFwdScanButton->setEnabled(false); 80 | ui.lastScanButton->setEnabled(false); 81 | 82 | } else{ 83 | ui.nextScanButton->setEnabled(true); 84 | ui.fastFwdScanButton->setEnabled(true); 85 | ui.lastScanButton->setEnabled(true); 86 | } 87 | 88 | if (m_currentScan < 2){ 89 | ui.firstScanButton->setEnabled(false); 90 | } else{ 91 | ui.firstScanButton->setEnabled(true); 92 | } 93 | 94 | ui.scanProgressBar->setValue(m_currentScan); 95 | // queue a redraw: 96 | ui.scanProgressBar->update(); 97 | } 98 | 99 | void ViewerSettingsPanel::setNumberOfScans(unsigned scans){ 100 | m_numberScans = scans; 101 | scanProgressChanged(); 102 | } 103 | 104 | void ViewerSettingsPanel::setCurrentScan(unsigned scan){ 105 | m_currentScan = scan; 106 | scanProgressChanged(); 107 | } 108 | 109 | void ViewerSettingsPanel::setResolution(double resolution){ 110 | m_resolution = resolution; 111 | leafSizeChanged(); 112 | } 113 | 114 | void ViewerSettingsPanel::setTreeDepth(int depth){ 115 | emit treeDepthChanged(depth); 116 | m_treeDepth = depth; 117 | ui.treeDepth->setValue(depth); 118 | ui.treeDepthSlider->setValue(depth); 119 | leafSizeChanged(); 120 | } 121 | 122 | void ViewerSettingsPanel::leafSizeChanged(){ 123 | double leafSize = m_resolution * pow(2.0, (int) (_TREE_MAX_DEPTH-m_treeDepth)); 124 | ui.leafSize->setText(QString::number(leafSize)+" m"); 125 | } 126 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/.gitignore: -------------------------------------------------------------------------------- 1 | .moc 2 | .obj 3 | *.so 4 | *.so.* 5 | ui_*.h 6 | libQGLViewer.prl 7 | 8 | 9 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/CHANGELOG: -------------------------------------------------------------------------------- 1 | This is libQGLViewer version 2.6.3. Packaged on July 10, 2015. 2 | 3 | The complete change log is available in doc/changeLog.html 4 | 5 | The latest releases and changeLog are available at: 6 | http://www.libqglviewer.com/changeLog.html 7 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/GPL_EXCEPTION: -------------------------------------------------------------------------------- 1 | 2 | libQGLViewer GPL Exception 3 | ========================== 4 | 5 | Additional rights granted beyond the GPL (the "Exception"). 6 | 7 | As a special exception to the terms and conditions of GPL version 2.0 or 8 | GPL version 3.0, Gilles Debunne hereby grants you the rights described below, 9 | provided you agree to the terms and conditions in this Exception, including 10 | its obligations and restrictions on use. 11 | 12 | Nothing in this Exception gives you or anyone else the right to change the 13 | licensing terms of the libQGLViewer Open Source Edition. 14 | 15 | Below, "Licensed Software" shall refer to the software licensed under the GPL 16 | version 2.0 or GPL version 3.0 and this exception. 17 | 18 | 1) The right to use Open Source Licenses not compatible with the GNU 19 | General Public License version 2.0 or GNU General Public License version 20 | 3.0: You may link software (hereafter referred to as "Your Software") 21 | against the Licensed Software and/or distribute binaries of Your Software 22 | linked against the Licensed Software, provided that: 23 | 24 | A) Your Software is licensed under one of the following licenses: 25 | 26 | 27 | License name Version(s)/Copyright Date 28 | Academic Free License 2.0, 2.1, 3.0 29 | Apache Software License 1.0 or 1.1 30 | Apache License 2.0 31 | Apple Public Source License 2.0 32 | BSD license "July 22 1999" 33 | Common Development and Distribution 34 | License (CDDL) 1.0 35 | Common Public License 1.0 36 | Eclipse Public License 1.0 37 | GNU Library or "Lesser" 38 | General Public License (LGPL) 2.0, 2.1, 3.0 39 | Jabber Open Source License 1.0 40 | Mozilla Public License (MPL) 1.0 or 1.1 41 | Open Software License 2.0, 3.0 42 | PHP License 3.0 43 | Python Software Foundation License 2.1.1 44 | Q Public License 1.0 45 | Sleepycat License "1999" 46 | W3C License "2001" 47 | X11 License X11R6.6 48 | Zope Public License 2.0, 2.1 49 | 50 | 51 | and 52 | 53 | B) You must, on request, make a complete package including the complete 54 | source code of Your Software (as defined in the GNU General Public 55 | License version 2, section 3, but excluding anything excluded by the 56 | special exception in the same section) available to Gilles Debunne 57 | under the same license as that granted to other recipients of the 58 | source code of Your Software. 59 | 60 | and 61 | 62 | C) Your or any other contributor's rights to: 63 | 64 | i) distribute the source code of Your Software to anyone for 65 | any purpose; 66 | 67 | and 68 | 69 | ii) publicly discuss the development project for Your 70 | Software and its goals in any form and in any forum 71 | 72 | are not prohibited by any legal instrument, including but not limited to 73 | contracts, non-disclosure agreements, and employee contracts. 74 | 75 | 76 | 2) The right to link non-Open Source applications with versions of the 77 | Licensed Software: You may link applications with versions of the Licensed 78 | Software, provided that such applications have been developed and are deployed 79 | in accordance with the terms and conditions of the libQGLViewer Commercial 80 | License Agreement. 81 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/INSTALL: -------------------------------------------------------------------------------- 1 | 2 | l i b Q G L V i e w e r I n s t a l l a t i o n 3 | 4 | 5 | 6 | libQGLViewer requires the Qt library, available from Digia. 7 | 8 | In order to compile the library from its sources: 9 | 10 | - On UNIX platforms, simply type (see doc/installUnix.html for details): 11 | 12 | > qmake 13 | > make 14 | > make install [optional] 15 | 16 | - For Windows installation, see doc/installWindows.html. 17 | 18 | 19 | 20 | See doc/compilation.html for details on compiling programs that use libQGLViewer. 21 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/README: -------------------------------------------------------------------------------- 1 | 2 | l i b Q G L V i e w e r 3 | 4 | Version 2.6.3. Packaged on July 10, 2015 5 | 6 | 7 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 8 | http://www.libqglviewer.com 9 | Send e-mail to contact@libqglviewer.com 10 | 11 | 12 | libQGLViewer is a C++ library based on Qt that eases the creation of OpenGL 3D viewers. 13 | 14 | It provides some of the typical 3D viewer functionalities, such as the possibility to 15 | move the camera using the mouse, which lacks in most of the other APIs. Other features 16 | include mouse manipulated frames, interpolated keyFrames, object selection, stereo 17 | display, screenshot saving and much more. It can be used by OpenGL beginners as well as 18 | to create complex applications, being fully customizable and easy to extend. 19 | 20 | Based on the Qt toolkit, it compiles on any architecture (Unix-Linux, Mac, Windows). 21 | Full reference documentation and many examples are provided. libQGLViewer does not 22 | display 3D scenes in various formats, but it can be the base for the coding of such a 23 | viewer. 24 | 25 | libQGLViewer uses dual licensing: it is freely available under the terms of the GNU-GPL 26 | license for open source software development, while commercial applications can apply 27 | for a commercial license. 28 | 29 | 30 | The library's main functionalities are: 31 | 32 | - A camera trackball to intuitively move the camera in the scene. 33 | - Screenshot saving in different file formats (JPG, PNG, EPS...). 34 | - Easy scene object selection and manipulation using the mouse. 35 | - Definition and replay of keyFrame paths. 36 | - Stereo display (provided that your hardware supports it). 37 | - Clean, well-designed and easily extendable API. 38 | - Many examples and a complete reference documentation. 39 | 40 | See the doc/index.html page for details. 41 | 42 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/AxisAlignedBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #ifndef _VRENDER_AXISALIGNEDBOX_H 46 | #define _VRENDER_AXISALIGNEDBOX_H 47 | 48 | namespace vrender 49 | { 50 | class Vector2; 51 | class Vector3; 52 | 53 | template class AxisAlignedBox 54 | { 55 | public: 56 | AxisAlignedBox() ; 57 | AxisAlignedBox(const T& v) ; 58 | AxisAlignedBox(const T& v,const T& w) ; 59 | 60 | const T& mini() const { return _min ; } 61 | const T& maxi() const { return _max ; } 62 | 63 | void include(const T& v) ; 64 | void include(const AxisAlignedBox& b) ; 65 | private: 66 | T _min ; 67 | T _max ; 68 | }; 69 | 70 | typedef AxisAlignedBox< Vector2 > AxisAlignedBox_xy ; 71 | typedef AxisAlignedBox< Vector3 > AxisAlignedBox_xyz ; 72 | 73 | template AxisAlignedBox::AxisAlignedBox() 74 | : _min(T::inf), _max(-T::inf) 75 | { 76 | } 77 | 78 | template AxisAlignedBox::AxisAlignedBox(const T& v) 79 | : _min(v), _max(v) 80 | { 81 | } 82 | 83 | template AxisAlignedBox::AxisAlignedBox(const T& v,const T& w) 84 | : _min(v), _max(v) 85 | { 86 | include(w) ; 87 | } 88 | 89 | template void AxisAlignedBox::include(const T& v) 90 | { 91 | _min = T::mini(_min,v) ; 92 | _max = T::maxi(_max,v) ; 93 | } 94 | 95 | template void AxisAlignedBox::include(const AxisAlignedBox& b) 96 | { 97 | include(b._min) ; 98 | include(b._max) ; 99 | } 100 | } 101 | #endif 102 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/BackFaceCullingOptimizer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #include 46 | #include "VRender.h" 47 | #include "Optimizer.h" 48 | #include "Primitive.h" 49 | 50 | using namespace std ; 51 | using namespace vrender ; 52 | 53 | // Over-simplified algorithm to check wether a polygon is front-facing or not. 54 | // Only works for convex polygons. 55 | 56 | void BackFaceCullingOptimizer::optimize(std::vector& primitives_tab,VRenderParams&) 57 | { 58 | Polygone *P ; 59 | int nb_culled = 0 ; 60 | 61 | for(size_t i=0;i(primitives_tab[i])) != NULL) 63 | { 64 | for(unsigned int j=0;jnbVertices();++j) 65 | if(( (P->vertex(j+2) - P->vertex(j+1))^(P->vertex(j+1) - P->vertex(j))).z() > 0.0 ) 66 | { 67 | delete primitives_tab[i] ; 68 | primitives_tab[i] = NULL ; 69 | ++nb_culled ; 70 | break ; 71 | } 72 | } 73 | 74 | // Rule out gaps. This avoids testing for null primitives later. 75 | 76 | int j=0 ; 77 | for(size_t k=0;k 50 | #include 51 | 52 | using namespace vrender ; 53 | using namespace std ; 54 | 55 | Exporter::Exporter() 56 | { 57 | _xmin=_xmax=_ymin=_ymax=_zmin=_zmax = 0.0 ; 58 | _pointSize=1 ; 59 | } 60 | 61 | void Exporter::exportToFile(const QString& filename, 62 | const vector& primitive_tab, 63 | VRenderParams& vparams) 64 | { 65 | QFile file(filename); 66 | 67 | if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { 68 | QMessageBox::warning(NULL, QGLViewer::tr("Exporter error", "Message box window title"), QGLViewer::tr("Unable to open file %1.").arg(filename)); 69 | return; 70 | } 71 | 72 | QTextStream out(&file); 73 | 74 | writeHeader(out) ; 75 | 76 | unsigned int N = primitive_tab.size()/200 + 1 ; 77 | 78 | for(unsigned int i=0;i(primitive_tab[i]) ; 81 | Segment *s = dynamic_cast(primitive_tab[i]) ; 82 | Polygone *P = dynamic_cast(primitive_tab[i]) ; 83 | 84 | if(p != NULL) spewPoint(p,out) ; 85 | if(s != NULL) spewSegment(s,out) ; 86 | if(P != NULL) spewPolygone(P,out) ; 87 | 88 | if(i%N == 0) 89 | vparams.progress(i/(float)primitive_tab.size(),QGLViewer::tr("Exporting to file %1").arg(filename)) ; 90 | } 91 | 92 | writeFooter(out) ; 93 | 94 | file.close(); 95 | } 96 | 97 | void Exporter::setBoundingBox(float xmin,float ymin,float xmax,float ymax) 98 | { 99 | _xmin = xmin ; 100 | _ymin = ymin ; 101 | _xmax = xmax ; 102 | _ymax = ymax ; 103 | } 104 | 105 | void Exporter::setClearColor(float r, float g, float b) { _clearR=r; _clearG=g; _clearB=b; } 106 | void Exporter::setClearBackground(bool b) { _clearBG=b; } 107 | void Exporter::setBlackAndWhite(bool b) { _blackAndWhite = b; } 108 | 109 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/Optimizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #ifndef _OPTIMIZER_H 46 | #define _OPTIMIZER_H 47 | 48 | #include "Types.h" 49 | 50 | namespace vrender 51 | { 52 | // Implements some global optimizations on the polygon sorting. 53 | 54 | class VRenderParams ; 55 | class Optimizer 56 | { 57 | public: 58 | virtual void optimize(std::vector&,VRenderParams&) = 0 ; 59 | virtual ~Optimizer() {} ; 60 | }; 61 | 62 | // Optimizes visibility by culling primitives which do not appear in the 63 | // rendered image. Computations are done analytically rather than using an item 64 | // buffer. 65 | 66 | class VisibilityOptimizer: public Optimizer 67 | { 68 | public: 69 | virtual void optimize(std::vector&,VRenderParams&) ; 70 | virtual ~VisibilityOptimizer() {} ; 71 | }; 72 | 73 | // Optimizes by collapsing together primitives which can be, without 74 | // perturbating the back to front painting algorithm. 75 | 76 | class PrimitiveSplitOptimizer: public Optimizer 77 | { 78 | public: 79 | virtual void optimize(std::vector&,VRenderParams&) {} 80 | virtual ~PrimitiveSplitOptimizer() {} ; 81 | }; 82 | 83 | class BackFaceCullingOptimizer: public Optimizer 84 | { 85 | public: 86 | virtual void optimize(std::vector&,VRenderParams&) ; 87 | virtual ~BackFaceCullingOptimizer() {} ; 88 | }; 89 | } 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/ParserGL.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #ifndef _VRENDER_PARSERGL_H 46 | #define _VRENDER_PARSERGL_H 47 | 48 | // This class implements the conversion from OpenGL feedback buffer into more 49 | // usable data structures such as points, segments, and polygons (See Primitive.h) 50 | 51 | #include 52 | #include "Primitive.h" 53 | 54 | namespace vrender 55 | { 56 | class ParserGL 57 | { 58 | public: 59 | void parseFeedbackBuffer( GLfloat *, 60 | int size, 61 | std::vector& primitive_tab, 62 | VRenderParams& vparams) ; 63 | void printStats() const ; 64 | 65 | inline GLfloat xmin() const { return _xmin ; } 66 | inline GLfloat ymin() const { return _ymin ; } 67 | inline GLfloat zmin() const { return _zmin ; } 68 | inline GLfloat xmax() const { return _xmax ; } 69 | inline GLfloat ymax() const { return _ymax ; } 70 | inline GLfloat zmax() const { return _zmax ; } 71 | private: 72 | int nb_lines ; 73 | int nb_polys ; 74 | int nb_points ; 75 | int nb_degenerated_lines ; 76 | int nb_degenerated_polys ; 77 | int nb_degenerated_points ; 78 | 79 | GLfloat _xmin ; 80 | GLfloat _ymin ; 81 | GLfloat _zmin ; 82 | GLfloat _xmax ; 83 | GLfloat _ymax ; 84 | GLfloat _zmax ; 85 | }; 86 | } 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/SortMethod.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #ifndef _SORTMETHOD_H 46 | #define _SORTMETHOD_H 47 | 48 | #include 49 | #include "Types.h" 50 | 51 | namespace vrender 52 | { 53 | // Class which implements the sorting of the primitives. An object of 54 | class VRenderParams ; 55 | class SortMethod 56 | { 57 | public: 58 | SortMethod() {} 59 | virtual ~SortMethod() {} 60 | 61 | virtual void sortPrimitives(std::vector&,VRenderParams&) = 0 ; 62 | 63 | void SetZDepth(FLOAT s) { zSize = s ; } 64 | FLOAT ZDepth() const { return zSize ; } 65 | 66 | protected: 67 | FLOAT zSize ; 68 | }; 69 | 70 | class DontSortMethod: public SortMethod 71 | { 72 | public: 73 | DontSortMethod() {} 74 | virtual ~DontSortMethod() {} 75 | 76 | virtual void sortPrimitives(std::vector&,VRenderParams&) {} 77 | }; 78 | 79 | class BSPSortMethod: public SortMethod 80 | { 81 | public: 82 | BSPSortMethod() {} ; 83 | virtual ~BSPSortMethod() {} 84 | 85 | virtual void sortPrimitives(std::vector&,VRenderParams&) ; 86 | }; 87 | 88 | class TopologicalSortMethod: public SortMethod 89 | { 90 | public: 91 | TopologicalSortMethod() ; 92 | virtual ~TopologicalSortMethod() {} 93 | 94 | virtual void sortPrimitives(std::vector&,VRenderParams&) ; 95 | 96 | void setBreakCycles(bool b) { _break_cycles = b ; } 97 | private: 98 | bool _break_cycles ; 99 | }; 100 | } 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/VRender/Types.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the VRender library. 3 | Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) 4 | Version 1.0.0, released on June 27, 2005. 5 | 6 | http://artis.imag.fr/Members/Cyril.Soler/VRender 7 | 8 | VRender is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | VRender is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with VRender; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | /**************************************************************************** 24 | 25 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 26 | 27 | This file is part of the QGLViewer library version 2.6.3. 28 | 29 | http://www.libqglviewer.com - contact@libqglviewer.com 30 | 31 | This file may be used under the terms of the GNU General Public License 32 | versions 2.0 or 3.0 as published by the Free Software Foundation and 33 | appearing in the LICENSE file included in the packaging of this file. 34 | In addition, as a special exception, Gilles Debunne gives you certain 35 | additional rights, described in the file GPL_EXCEPTION in this package. 36 | 37 | libQGLViewer uses dual licensing. Commercial/proprietary software must 38 | purchase a libQGLViewer Commercial License. 39 | 40 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 41 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 42 | 43 | *****************************************************************************/ 44 | 45 | #ifndef _VRENDER_TYPES_H 46 | #define _VRENDER_TYPES_H 47 | 48 | #ifdef WIN32 49 | # include 50 | #endif 51 | 52 | #ifdef __APPLE__ 53 | # include 54 | #else 55 | # include 56 | #endif 57 | 58 | namespace vrender 59 | { 60 | typedef double FLOAT ; 61 | typedef GLdouble GLFLOAT ; 62 | 63 | #ifdef A_VOIR 64 | typedef T_Vect3 DVector3 ; 65 | typedef T_Vect2 Vector2 ; 66 | #endif 67 | 68 | class Primitive ; 69 | typedef Primitive *PtrPrimitive ; 70 | 71 | const float FLAT_POLYGON_EPS = 1e-5f ; 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/config.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 4 | 5 | This file is part of the QGLViewer library version 2.6.3. 6 | 7 | http://www.libqglviewer.com - contact@libqglviewer.com 8 | 9 | This file may be used under the terms of the GNU General Public License 10 | versions 2.0 or 3.0 as published by the Free Software Foundation and 11 | appearing in the LICENSE file included in the packaging of this file. 12 | In addition, as a special exception, Gilles Debunne gives you certain 13 | additional rights, described in the file GPL_EXCEPTION in this package. 14 | 15 | libQGLViewer uses dual licensing. Commercial/proprietary software must 16 | purchase a libQGLViewer Commercial License. 17 | 18 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 19 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 | 21 | *****************************************************************************/ 22 | 23 | /////////////////////////////////////////////////////////////////// 24 | // libQGLViewer configuration file // 25 | // Modify these settings according to your local configuration // 26 | /////////////////////////////////////////////////////////////////// 27 | 28 | #ifndef QGLVIEWER_CONFIG_H 29 | #define QGLVIEWER_CONFIG_H 30 | 31 | #define QGLVIEWER_VERSION 0x020603 32 | 33 | // Needed for Qt < 4 (?) 34 | #ifndef QT_CLEAN_NAMESPACE 35 | # define QT_CLEAN_NAMESPACE 36 | #endif 37 | 38 | // Get QT_VERSION and other Qt flags 39 | #include 40 | 41 | #if QT_VERSION < 0x040000 42 | Error : libQGLViewer requires a minimum Qt version of 4.0 43 | #endif 44 | 45 | // Win 32 DLL export macros 46 | #ifdef Q_OS_WIN32 47 | # ifndef M_PI 48 | # define M_PI 3.14159265358979323846 49 | # endif 50 | # ifndef QGLVIEWER_STATIC 51 | # ifdef CREATE_QGLVIEWER_DLL 52 | # if QT_VERSION >= 0x040500 53 | # define QGLVIEWER_EXPORT Q_DECL_EXPORT 54 | # else 55 | # define QGLVIEWER_EXPORT __declspec(dllexport) 56 | # endif 57 | # else 58 | # if QT_VERSION >= 0x040500 59 | # define QGLVIEWER_EXPORT Q_DECL_IMPORT 60 | # else 61 | # define QGLVIEWER_EXPORT __declspec(dllimport) 62 | # endif 63 | # endif 64 | # endif 65 | # ifndef __MINGW32__ 66 | # pragma warning( disable : 4251 ) // DLL interface, needed with Visual 6 67 | # pragma warning( disable : 4786 ) // identifier truncated to 255 in browser information (Visual 6). 68 | # endif 69 | #endif // Q_OS_WIN32 70 | 71 | // For other architectures, this macro is empty 72 | #ifndef QGLVIEWER_EXPORT 73 | # define QGLVIEWER_EXPORT 74 | #endif 75 | 76 | // OpenGL includes - Included here and hence shared by all the files that need OpenGL headers. 77 | # include 78 | 79 | // GLU was removed from Qt in version 4.8 80 | #ifdef Q_OS_MAC 81 | # include 82 | #else 83 | # include 84 | #endif 85 | 86 | // Container classes interfaces changed a lot in Qt. 87 | // Compatibility patches are all grouped here. 88 | #include 89 | #include 90 | 91 | // For deprecated methods 92 | // #define __WHERE__ "In file "<<__FILE__<<", line "<<__LINE__<<": " 93 | // #define orientationAxisAngle(x,y,z,a) { std::cout << __WHERE__ << "getOrientationAxisAngle()." << std::endl; exit(0); } 94 | 95 | // Patch for gcc version <= 2.95. Seems to no longer be needed with recent Qt versions. 96 | // Uncomment these lines if you have error message dealing with operator << on QStrings 97 | // #if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ < 3) && (__GNUC_MINOR__ < 96) 98 | // # include 99 | // # include 100 | // std::ostream& operator<<(std::ostream& out, const QString& str) 101 | // { out << str.latin1(); return out; } 102 | // #endif 103 | 104 | #endif // QGLVIEWER_CONFIG_H 105 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/mouseGrabber.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. 4 | 5 | This file is part of the QGLViewer library version 2.6.3. 6 | 7 | http://www.libqglviewer.com - contact@libqglviewer.com 8 | 9 | This file may be used under the terms of the GNU General Public License 10 | versions 2.0 or 3.0 as published by the Free Software Foundation and 11 | appearing in the LICENSE file included in the packaging of this file. 12 | In addition, as a special exception, Gilles Debunne gives you certain 13 | additional rights, described in the file GPL_EXCEPTION in this package. 14 | 15 | libQGLViewer uses dual licensing. Commercial/proprietary software must 16 | purchase a libQGLViewer Commercial License. 17 | 18 | This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 19 | WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 | 21 | *****************************************************************************/ 22 | 23 | #include "mouseGrabber.h" 24 | 25 | using namespace qglviewer; 26 | 27 | // Static private variable 28 | QList MouseGrabber::MouseGrabberPool_; 29 | 30 | /*! Default constructor. 31 | 32 | Adds the created MouseGrabber in the MouseGrabberPool(). grabsMouse() is set to \c false. */ 33 | MouseGrabber::MouseGrabber() 34 | : grabsMouse_(false) 35 | { 36 | addInMouseGrabberPool(); 37 | } 38 | 39 | /*! Adds the MouseGrabber in the MouseGrabberPool(). 40 | 41 | All created MouseGrabber are automatically added in the MouseGrabberPool() by the constructor. 42 | Trying to add a MouseGrabber that already isInMouseGrabberPool() has no effect. 43 | 44 | Use removeFromMouseGrabberPool() to remove the MouseGrabber from the list, so that it is no longer 45 | tested with checkIfGrabsMouse() by the QGLViewer, and hence can no longer grab mouse focus. Use 46 | isInMouseGrabberPool() to know the current state of the MouseGrabber. */ 47 | void MouseGrabber::addInMouseGrabberPool() 48 | { 49 | if (!isInMouseGrabberPool()) 50 | MouseGrabber::MouseGrabberPool_.append(this); 51 | } 52 | 53 | /*! Removes the MouseGrabber from the MouseGrabberPool(). 54 | 55 | See addInMouseGrabberPool() for details. Removing a MouseGrabber that is not in MouseGrabberPool() 56 | has no effect. */ 57 | void MouseGrabber::removeFromMouseGrabberPool() 58 | { 59 | if (isInMouseGrabberPool()) 60 | MouseGrabber::MouseGrabberPool_.removeAll(const_cast(this)); 61 | } 62 | 63 | /*! Clears the MouseGrabberPool(). 64 | 65 | Use this method only if it is faster to clear the MouseGrabberPool() and then to add back a few 66 | MouseGrabbers than to remove each one independently. Use QGLViewer::setMouseTracking(false) instead 67 | if you want to disable mouse grabbing. 68 | 69 | When \p autoDelete is \c true, the MouseGrabbers of the MouseGrabberPool() are actually deleted 70 | (use this only if you're sure of what you do). */ 71 | void MouseGrabber::clearMouseGrabberPool(bool autoDelete) 72 | { 73 | if (autoDelete) 74 | qDeleteAll(MouseGrabber::MouseGrabberPool_); 75 | MouseGrabber::MouseGrabberPool_.clear(); 76 | } 77 | -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/qglviewer.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/extern/QGLViewer/qglviewer.icns -------------------------------------------------------------------------------- /octovis/src/extern/QGLViewer/qglviewer_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/extern/QGLViewer/qglviewer_fr.qm -------------------------------------------------------------------------------- /octovis/src/icons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/media-playback-start.png 4 | icons/media-seek-backward.png 5 | icons/media-seek-forward.png 6 | icons/media-skip-backward.png 7 | icons/media-skip-forward.png 8 | icons/application-exit.png 9 | icons/configure.png 10 | icons/document-open-folder.png 11 | icons/document-open.png 12 | icons/document-save.png 13 | icons/edit-undo.png 14 | icons/help-contents.png 15 | icons/system-restart.png 16 | icons/view-preview.png 17 | icons/document-save-as.png 18 | icons/go-bottom.png 19 | icons/go-top.png 20 | icons/view-refresh.png 21 | icons/edit-clear-list.png 22 | icons/list-add.png 23 | icons/list-remove.png 24 | 25 | 26 | -------------------------------------------------------------------------------- /octovis/src/icons/LICENSE.txt: -------------------------------------------------------------------------------- 1 | These are the KDE4 icons from http://www.oxygen-icons.org/. 2 | All icons are released under GNU Library General Public License, 3 | for details please see http://www.gnu.org/licenses/lgpl-3.0.txt 4 | or "lgpl-3.0.txt" in this directory. -------------------------------------------------------------------------------- /octovis/src/icons/application-exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/application-exit.png -------------------------------------------------------------------------------- /octovis/src/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/configure.png -------------------------------------------------------------------------------- /octovis/src/icons/document-open-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/document-open-folder.png -------------------------------------------------------------------------------- /octovis/src/icons/document-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/document-open.png -------------------------------------------------------------------------------- /octovis/src/icons/document-save-as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/document-save-as.png -------------------------------------------------------------------------------- /octovis/src/icons/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/document-save.png -------------------------------------------------------------------------------- /octovis/src/icons/edit-clear-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/edit-clear-list.png -------------------------------------------------------------------------------- /octovis/src/icons/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/edit-undo.png -------------------------------------------------------------------------------- /octovis/src/icons/go-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/go-bottom.png -------------------------------------------------------------------------------- /octovis/src/icons/go-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/go-top.png -------------------------------------------------------------------------------- /octovis/src/icons/help-contents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/help-contents.png -------------------------------------------------------------------------------- /octovis/src/icons/list-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/list-add.png -------------------------------------------------------------------------------- /octovis/src/icons/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/list-remove.png -------------------------------------------------------------------------------- /octovis/src/icons/media-playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/media-playback-start.png -------------------------------------------------------------------------------- /octovis/src/icons/media-seek-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/media-seek-backward.png -------------------------------------------------------------------------------- /octovis/src/icons/media-seek-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/media-seek-forward.png -------------------------------------------------------------------------------- /octovis/src/icons/media-skip-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/media-skip-backward.png -------------------------------------------------------------------------------- /octovis/src/icons/media-skip-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/media-skip-forward.png -------------------------------------------------------------------------------- /octovis/src/icons/system-restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/system-restart.png -------------------------------------------------------------------------------- /octovis/src/icons/view-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/view-preview.png -------------------------------------------------------------------------------- /octovis/src/icons/view-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OctoMap/octomap/c5c714139a82969915b84cd5548dedcd257ebf1e/octovis/src/icons/view-refresh.png -------------------------------------------------------------------------------- /octovis/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping 3 | * Framework Based on Octrees 4 | * http://octomap.github.io 5 | * 6 | * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg 7 | * All rights reserved. License for the viewer octovis: GNU GPL v2 8 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt 9 | * 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, but 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19 | * for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see http://www.gnu.org/licenses/. 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | #include //strtol 29 | 30 | int main(int argc, char *argv[]) { 31 | 32 | std::string filename = ""; 33 | int depth = 0; 34 | if (argc == 1) { 35 | std::cout << "Usage: " << argv[0] << " [mapfile] [tree depth cutoff]\n"; 36 | std::cout << "Where the optional [tree depth cutoff] is an integer from 1 to 16\n"; 37 | } 38 | if (argc >= 2) { filename = std::string(argv[1]); } 39 | if (argc >= 3) { depth = std::strtol(argv[2], NULL, 10); }//zero on parse error 40 | 41 | QApplication app(argc, argv); 42 | 43 | octomap::ViewerGui gui(filename, NULL, depth); 44 | gui.show(); 45 | return app.exec(); 46 | } 47 | -------------------------------------------------------------------------------- /scripts/increase_version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Increases the version number of package.xml and CMakeLists.txt files in 4 | # subfolders. The first argument specifies the version increase: 5 | # major, minor, or patch (default, e.g. 1.6.2 --> 1.6.3) 6 | # 7 | # Borrows heaviliy from ROS / catkin release tools 8 | 9 | 10 | import re 11 | import sys 12 | import copy 13 | 14 | manifest_match = "(\d+)\.(\d+)\.(\d+)" 15 | 16 | 17 | if __name__ == '__main__': 18 | bump = "patch" 19 | if len(sys.argv) > 1: 20 | bump = sys.argv[1] 21 | if bump not in {"major","minor","patch"}: 22 | print sys.argv[0]+" [major|minor|patch] (default: patch)" 23 | exit(-1) 24 | 25 | 26 | 27 | manifests=["octomap/package.xml","octovis/package.xml","dynamicEDT3D/package.xml"] 28 | cmakelists=["octomap/CMakeLists.txt","octovis/CMakeLists.txt","dynamicEDT3D/CMakeLists.txt"] 29 | versions = [] 30 | 31 | # find versions in package.xml 32 | for manifest in manifests: 33 | with open(manifest, 'r') as f: 34 | package_str = f.read() 35 | match = re.search(manifest_match, package_str) 36 | if match is None: 37 | print "Error: no version tag found in %s" % manifest 38 | exit(-1) 39 | else: 40 | v= match.groups() 41 | v = [int(x) for x in v] 42 | versions.append(v) 43 | 44 | # find version in CMakeLists: 45 | for cmake in cmakelists: 46 | with open(cmake, 'r') as f: 47 | cmake_str = f.read() 48 | v = [] 49 | for m in ["MAJOR","MINOR","PATCH"]: 50 | searchstr = "_%s_VERSION (\d+)\)" % m 51 | match = re.search(searchstr, cmake_str) 52 | if match is None: 53 | print "Error: no version tag %s found in %s" % (searchstr,cmake) 54 | exit(-1) 55 | 56 | v.append(int(match.group(1))) 57 | 58 | versions.append(v) 59 | 60 | new_version = copy.deepcopy(versions[0]) 61 | for v in versions: 62 | if v != versions[0]: 63 | print "Error: check current versions, mismatch: %d.%d.%d vs. %d.%d.%d" %(tuple(v)+tuple(versions[0])) 64 | exit(-1) 65 | 66 | print "OctoMap component versions found: %d.%d.%d" % tuple(versions[0]) 67 | # "bump version" from catkin: 68 | # find the desired index 69 | idx = dict(major=0, minor=1, patch=2)[bump] 70 | # increment the desired part 71 | new_version[idx] += 1 72 | # reset all parts behind the bumped part 73 | new_version = new_version[:idx + 1] + [0 for x in new_version[idx + 1:]] 74 | new_version_str = "%d.%d.%d" % tuple(new_version) 75 | print 'Updating to new version: %s\n' % new_version_str 76 | 77 | # adjust CMakeLists 78 | for cmake in cmakelists: 79 | with open(cmake, 'r') as f: 80 | cmake_str = f.read() 81 | idx = dict(MAJOR=0, MINOR=1, PATCH=2) 82 | for m in ["MAJOR","MINOR","PATCH"]: 83 | old_str = "_%s_VERSION %d)" % (m,versions[0][idx[m]]) 84 | new_str = "_%s_VERSION %d)" % (m,new_version[idx[m]]) 85 | cmake_str = cmake_str.replace(old_str, new_str) 86 | 87 | with open(cmake, 'w') as f: 88 | f.write(cmake_str) 89 | 90 | 91 | 92 | # adjust package.xml 93 | for manifest in manifests: 94 | with open(manifest, 'r') as f: 95 | package_str = f.read() 96 | old_str = "%d.%d.%d" % tuple(versions[0]) 97 | new_str = "%s" % new_version_str 98 | new_package_str = package_str.replace(old_str, new_str) 99 | 100 | with open(manifest, 'w') as f: 101 | f.write(new_package_str) 102 | 103 | print "Finished writing package.xml and CMakeLists.txt files.\n" 104 | print "Now check the output, adjust CHANGELOG, and \"git commit\".\nFinally, run:" 105 | print " git checkout master && git merge --no-ff devel && git tag v%s" % new_version_str 106 | print " git push origin master devel && git push --tags" 107 | print "\n(adjust when not on the \"devel\" branch)\n" 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /scripts/travis_build_jobs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # travis build script for test compilations 4 | 5 | set -e 6 | 7 | function build { 8 | cd $1 9 | mkdir build 10 | cd build 11 | cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/octomap/$1 12 | make -j4 13 | cd .. 14 | } 15 | 16 | case "$1" in 17 | "dist") 18 | build . 19 | cd build && make test 20 | make install 21 | ;; 22 | "components") 23 | build octomap 24 | cd build && make test 25 | make install 26 | cd ../.. 27 | build dynamicEDT3D 28 | cd .. 29 | build octovis 30 | cd .. 31 | ;; 32 | *) 33 | echo "Invalid build variant" 34 | exit 1 35 | esac 36 | 37 | 38 | 39 | 40 | --------------------------------------------------------------------------------