Skip to content

Commit

Permalink
Merge branch 'devel' for 1.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahornung committed Apr 28, 2017
2 parents 12fe991 + 4f01275 commit bf3b394
Show file tree
Hide file tree
Showing 48 changed files with 839 additions and 299 deletions.
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
language: cpp
sudo: required
dist: trusty
compiler:
- gcc
- clang
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libqt4-dev libqt4-opengl-dev libqglviewer-qt4-dev
- sudo apt-get install -qq libqt4-dev libqt4-opengl-dev libqglviewer-dev
before_script:
- mkdir build
- cd build
- cmake ..
script: make && make test
script: ./scripts/travis_build_jobs.sh $VARIANT
env:
- VARIANT=dist
- VARIANT=components
matrix:
exclude:
- compiler: clang
env: VARIANT=components

8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT( octomap-distribution )

ENABLE_TESTING() # enable CTest environment of subprojects

option(BUILD_OCTOVIS_SUBPROJECT "Build targets from subproject octovis" ON)
option(BUILD_DYNAMICETD3D_SUBPROJECT "Build targets from subproject dynamicEDT3D" ON)
option(OCTOVIS_QT5 "Link Octovis against Qt5?" NO)

if(OCTOVIS_QT5)
# Compiling against QT5 requires C++11.
set(CMAKE_CXX_STANDARD 11)
endif(OCTOVIS_QT5)

ADD_SUBDIRECTORY( octomap )

Expand Down
47 changes: 35 additions & 12 deletions dynamicEDT3D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT(dynamicEDT3D)

ENABLE_TESTING()
include(CTest)

# version (e.g. for packaging)
set(DYNAMICEDT3D_MAJOR_VERSION 1)
set(DYNAMICEDT3D_MINOR_VERSION 8)
set(DYNAMICEDT3D_MINOR_VERSION 9)
set(DYNAMICEDT3D_PATCH_VERSION 0)
set(DYNAMICEDT3D_VERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION}.${DYNAMICEDT3D_PATCH_VERSION})
set(DYNAMICEDT3D_SOVERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION})

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0042)
# Enable MACOSX_RPATH by default.
cmake_policy(SET CMP0042 NEW)
endif(POLICY CMP0042)
endif(COMMAND cmake_policy)

SET (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules")
Expand Down Expand Up @@ -53,7 +57,7 @@ find_package(octomap REQUIRED
MESSAGE(STATUS "Found octomap version: " ${octomap_VERSION})
MESSAGE(STATUS "octomap libraries: ${OCTOMAP_LIBRARIES}")

INCLUDE_DIRECTORIES(${OCTOMAP_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OCTOMAP_INCLUDE_DIRS})

ADD_SUBDIRECTORY(src)

Expand Down Expand Up @@ -96,10 +100,18 @@ ELSE()
ENDIF()
# not used right now (export depends?)
#set(DYNEDT3D_CMAKE_DIR "${PROJECT_BINARY_DIR}")
configure_file(dynamicEDT3DConfig.cmake.in
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig.cmake" @ONLY)
configure_file(dynamicEDT3DConfig-version.cmake.in
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig-version.cmake" @ONLY)
include(CMakePackageConfigHelpers)

CONFIGURE_PACKAGE_CONFIG_FILE(
dynamicEDT3DConfig.cmake.in
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig.cmake"
PATH_VARS DYNAMICEDT3D_INCLUDE_DIRS DYNAMICEDT3D_LIB_DIR
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dynamicEDT3D)

WRITE_BASIC_PACKAGE_VERSION_FILE(
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig-version.cmake"
VERSION ${DYNAMICEDT3D_VERSION}
COMPATIBILITY AnyNewerVersion)

# Install the export set for use with the install-tree
#install(EXPORT FooBarLibraryDepends DESTINATION
Expand All @@ -111,10 +123,21 @@ configure_file(dynamicEDT3DConfig-version.cmake.in
set(DYNAMICEDT3D_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
set(DYNAMICEDT3D_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
#set(DYNAMICEDT3D_CMAKE_DIR "${INSTALL_DATA_DIR}/FooBar/CMake")
configure_file(dynamicEDT3DConfig.cmake.in
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake" @ONLY)
configure_file(dynamicEDT3DConfig-version.cmake.in
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake" @ONLY)

set(DYNAMICEDT3D_INCLUDE_TARGETS
"include(\${CMAKE_CURRENT_LIST_DIR}/dynamicEDT3DTargets.cmake)")

CONFIGURE_PACKAGE_CONFIG_FILE(
dynamicEDT3DConfig.cmake.in
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake"
PATH_VARS DYNAMICEDT3D_INCLUDE_DIRS DYNAMICEDT3D_LIB_DIR
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dynamicEDT3D)

WRITE_BASIC_PACKAGE_VERSION_FILE(
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake"
VERSION ${DYNAMICEDT3D_VERSION}
COMPATIBILITY AnyNewerVersion)

install(FILES
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake"
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake"
Expand Down
11 changes: 0 additions & 11 deletions dynamicEDT3D/dynamicEDT3DConfig-version.cmake.in

This file was deleted.

33 changes: 21 additions & 12 deletions dynamicEDT3D/dynamicEDT3DConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# - Config file for the dynamicEDT3D package
# (example from http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file)
#
# Usage from an external project:
# In your CMakeLists.txt, add these lines:
Expand All @@ -9,15 +8,25 @@
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${DYNAMICEDT3D_LIBRARIES})
#
# It defines the following variables
# DYNAMICEDT3D_INCLUDE_DIRS - include directories for dynamicEDT3D
# DYNAMICEDT3D_LIBRARY_DIRS - library directories for dynamicEDT3D (normally not used!)
# DYNAMICEDT3D_LIBRARIES - libraries to link against

# DYNAMICEDT3D_INCLUDE_DIRS - include directories for dynamicEDT3D
# DYNAMICEDT3D_LIBRARY_DIRS - library directories for dynamicEDT3D (normally not used!)
# DYNAMICEDT3D_LIBRARIES - libraries to link against
# DYNAMICEDT3D_MAJOR_VERSION - major version
# DYNAMICEDT3D_MINOR_VERSION - minor version
# DYNAMICEDT3D_PATCH_VERSION - patch version
# DYNAMICEDT3D_VERSION - major.minor.patch version

@PACKAGE_INIT@

set(DYNAMICEDT3D_MAJOR_VERSION "@DYNAMICEDT3D_MAJOR_VERSION@")
set(DYNAMICEDT3D_MINOR_VERSION "@DYNAMICEDT3D_MINOR_VERSION@")
set(DYNAMICEDT3D_PATCH_VERSION "@DYNAMICEDT3D_PATCH_VERSION@")
set(DYNAMICEDT3D_VERSION "@DYNAMICEDT3D_VERSION@")

# Tell the user project where to find our headers and libraries
set(DYNAMICEDT3D_INCLUDE_DIRS "@DYNAMICEDT3D_INCLUDE_DIRS@")
set(DYNAMICEDT3D_LIBRARY_DIRS "@DYNAMICEDT3D_LIB_DIR@")

# Our library dependencies (contains definitions for IMPORTED targets)
# include("@FOOBAR_CMAKE_DIR@/FooBarLibraryDepends.cmake")

set(DYNAMICEDT3D_LIBRARIES "@DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@")
set_and_check(DYNAMICEDT3D_INCLUDE_DIRS "@PACKAGE_DYNAMICEDT3D_INCLUDE_DIRS@")
set_and_check(DYNAMICEDT3D_LIBRARY_DIRS "@PACKAGE_DYNAMICEDT3D_LIB_DIR@")

set(DYNAMICEDT3D_LIBRARIES "@PACKAGE_DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@")

@DYNAMICEDT3D_INCLUDE_TARGETS@
27 changes: 17 additions & 10 deletions dynamicEDT3D/include/dynamicEDT3D/dynamicEDTOctomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,36 +40,38 @@

#include "dynamicEDT3D.h"
#include <octomap/OcTree.h>
#include <octomap/OcTreeStamped.h>

/// A DynamicEDTOctomap object connects a DynamicEDT3D object to an octomap.
class DynamicEDTOctomap: private DynamicEDT3D {
/// A DynamicEDTOctomapBase object connects a DynamicEDT3D object to an octomap.
template <class TREE>
class DynamicEDTOctomapBase: private DynamicEDT3D {
public:
/** Create a DynamicEDTOctomap object that maintains a distance transform in the bounding box given by bbxMin, bbxMax and clamps distances at maxdist.
/** Create a DynamicEDTOctomapBase object that maintains a distance transform in the bounding box given by bbxMin, bbxMax and clamps distances at maxdist.
* treatUnknownAsOccupied configures the treatment of unknown cells in the distance computation.
*
* The constructor copies occupancy data but does not yet compute the distance map. You need to call udpate to do this.
*
* The distance map is maintained in a full three-dimensional array, i.e., there exists a float field in memory for every voxel inside the bounding box given by bbxMin and bbxMax. Consider this when computing distance maps for large octomaps, they will use much more memory than the octomap itself!
*/
DynamicEDTOctomap(float maxdist, octomap::OcTree* _octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied);
DynamicEDTOctomapBase(float maxdist, TREE* _octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied);

virtual ~DynamicEDTOctomap();
virtual ~DynamicEDTOctomapBase();

///trigger updating of the distance map. This will query the octomap for the set of changes since the last update.
///If you set updateRealDist to false, computations will be faster (square root will be omitted), but you can only retrieve squared distances
virtual void update(bool updateRealDist=true);

///retrieves distance and closestObstacle (closestObstacle is to be discarded if distance is maximum distance, the method does not write closestObstacle in this case).
///Returns DynamicEDTOctomap::distanceValue_Error if point is outside the map.
///Returns DynamicEDTOctomapBase::distanceValue_Error if point is outside the map.
void getDistanceAndClosestObstacle(const octomap::point3d& p, float &distance, octomap::point3d& closestObstacle) const;

///retrieves distance at point. Returns DynamicEDTOctomap::distanceValue_Error if point is outside the map.
///retrieves distance at point. Returns DynamicEDTOctomapBase::distanceValue_Error if point is outside the map.
float getDistance(const octomap::point3d& p) const;

///retrieves distance at key. Returns DynamicEDTOctomap::distanceValue_Error if key is outside the map.
///retrieves distance at key. Returns DynamicEDTOctomapBase::distanceValue_Error if key is outside the map.
float getDistance(const octomap::OcTreeKey& k) const;

///retrieves squared distance in cells at point. Returns DynamicEDTOctomap::distanceInCellsValue_Error if point is outside the map.
///retrieves squared distance in cells at point. Returns DynamicEDTOctomapBase::distanceInCellsValue_Error if point is outside the map.
int getSquaredDistanceInCells(const octomap::point3d& p) const;

//variant of getDistanceAndClosestObstacle that ommits the check whether p is inside the area of the distance map. Use only if you are certain that p is covered by the distance map and if you need to save the time of the check.
Expand Down Expand Up @@ -111,7 +113,7 @@ class DynamicEDTOctomap: private DynamicEDT3D {
void mapToWorld(int x, int y, int z, octomap::point3d &p) const;
void mapToWorld(int x, int y, int z, octomap::OcTreeKey &key) const;

octomap::OcTree* octree;
TREE* octree;
bool unknownOccupied;
int treeDepth;
double treeResolution;
Expand All @@ -120,4 +122,9 @@ class DynamicEDTOctomap: private DynamicEDT3D {
int offsetX, offsetY, offsetZ;
};

typedef DynamicEDTOctomapBase<octomap::OcTree> DynamicEDTOctomap;
typedef DynamicEDTOctomapBase<octomap::OcTreeStamped> DynamicEDTOctomapStamped;

#include "dynamicEDTOctomap.hxx"

#endif /* DYNAMICEDTOCTOMAP_H_ */
Loading

0 comments on commit bf3b394

Please sign in to comment.