Skip to content

Commit bf3b394

Browse files
committed
Merge branch 'devel' for 1.9.0 release
2 parents 12fe991 + 4f01275 commit bf3b394

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+839
-299
lines changed

.travis.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
language: cpp
2+
sudo: required
3+
dist: trusty
24
compiler:
35
- gcc
46
- clang
57
before_install:
68
- sudo apt-get update -qq
7-
- sudo apt-get install -qq libqt4-dev libqt4-opengl-dev libqglviewer-qt4-dev
9+
- sudo apt-get install -qq libqt4-dev libqt4-opengl-dev libqglviewer-dev
810
before_script:
9-
- mkdir build
10-
- cd build
11-
- cmake ..
12-
script: make && make test
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+

CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
22
PROJECT( octomap-distribution )
33

44
ENABLE_TESTING() # enable CTest environment of subprojects
55

66
option(BUILD_OCTOVIS_SUBPROJECT "Build targets from subproject octovis" ON)
77
option(BUILD_DYNAMICETD3D_SUBPROJECT "Build targets from subproject dynamicEDT3D" ON)
8+
option(OCTOVIS_QT5 "Link Octovis against Qt5?" NO)
9+
10+
if(OCTOVIS_QT5)
11+
# Compiling against QT5 requires C++11.
12+
set(CMAKE_CXX_STANDARD 11)
13+
endif(OCTOVIS_QT5)
814

915
ADD_SUBDIRECTORY( octomap )
1016

dynamicEDT3D/CMakeLists.txt

+35-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
22
PROJECT(dynamicEDT3D)
33

4-
ENABLE_TESTING()
4+
include(CTest)
55

66
# version (e.g. for packaging)
77
set(DYNAMICEDT3D_MAJOR_VERSION 1)
8-
set(DYNAMICEDT3D_MINOR_VERSION 8)
8+
set(DYNAMICEDT3D_MINOR_VERSION 9)
99
set(DYNAMICEDT3D_PATCH_VERSION 0)
1010
set(DYNAMICEDT3D_VERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION}.${DYNAMICEDT3D_PATCH_VERSION})
1111
set(DYNAMICEDT3D_SOVERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION})
1212

1313
if(COMMAND cmake_policy)
1414
cmake_policy(SET CMP0003 NEW)
15+
if(POLICY CMP0042)
16+
# Enable MACOSX_RPATH by default.
17+
cmake_policy(SET CMP0042 NEW)
18+
endif(POLICY CMP0042)
1519
endif(COMMAND cmake_policy)
1620

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

56-
INCLUDE_DIRECTORIES(${OCTOMAP_INCLUDE_DIRS})
60+
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OCTOMAP_INCLUDE_DIRS})
5761

5862
ADD_SUBDIRECTORY(src)
5963

@@ -96,10 +100,18 @@ ELSE()
96100
ENDIF()
97101
# not used right now (export depends?)
98102
#set(DYNEDT3D_CMAKE_DIR "${PROJECT_BINARY_DIR}")
99-
configure_file(dynamicEDT3DConfig.cmake.in
100-
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig.cmake" @ONLY)
101-
configure_file(dynamicEDT3DConfig-version.cmake.in
102-
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig-version.cmake" @ONLY)
103+
include(CMakePackageConfigHelpers)
104+
105+
CONFIGURE_PACKAGE_CONFIG_FILE(
106+
dynamicEDT3DConfig.cmake.in
107+
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig.cmake"
108+
PATH_VARS DYNAMICEDT3D_INCLUDE_DIRS DYNAMICEDT3D_LIB_DIR
109+
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dynamicEDT3D)
110+
111+
WRITE_BASIC_PACKAGE_VERSION_FILE(
112+
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/dynamicEDT3D/dynamicEDT3DConfig-version.cmake"
113+
VERSION ${DYNAMICEDT3D_VERSION}
114+
COMPATIBILITY AnyNewerVersion)
103115

104116
# Install the export set for use with the install-tree
105117
#install(EXPORT FooBarLibraryDepends DESTINATION
@@ -111,10 +123,21 @@ configure_file(dynamicEDT3DConfig-version.cmake.in
111123
set(DYNAMICEDT3D_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
112124
set(DYNAMICEDT3D_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
113125
#set(DYNAMICEDT3D_CMAKE_DIR "${INSTALL_DATA_DIR}/FooBar/CMake")
114-
configure_file(dynamicEDT3DConfig.cmake.in
115-
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake" @ONLY)
116-
configure_file(dynamicEDT3DConfig-version.cmake.in
117-
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake" @ONLY)
126+
127+
set(DYNAMICEDT3D_INCLUDE_TARGETS
128+
"include(\${CMAKE_CURRENT_LIST_DIR}/dynamicEDT3DTargets.cmake)")
129+
130+
CONFIGURE_PACKAGE_CONFIG_FILE(
131+
dynamicEDT3DConfig.cmake.in
132+
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake"
133+
PATH_VARS DYNAMICEDT3D_INCLUDE_DIRS DYNAMICEDT3D_LIB_DIR
134+
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dynamicEDT3D)
135+
136+
WRITE_BASIC_PACKAGE_VERSION_FILE(
137+
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake"
138+
VERSION ${DYNAMICEDT3D_VERSION}
139+
COMPATIBILITY AnyNewerVersion)
140+
118141
install(FILES
119142
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig.cmake"
120143
"${PROJECT_BINARY_DIR}/InstallFiles/dynamicEDT3DConfig-version.cmake"

dynamicEDT3D/dynamicEDT3DConfig-version.cmake.in

-11
This file was deleted.
+21-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# - Config file for the dynamicEDT3D package
2-
# (example from http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file)
32
#
43
# Usage from an external project:
54
# In your CMakeLists.txt, add these lines:
@@ -9,15 +8,25 @@
98
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${DYNAMICEDT3D_LIBRARIES})
109
#
1110
# It defines the following variables
12-
# DYNAMICEDT3D_INCLUDE_DIRS - include directories for dynamicEDT3D
13-
# DYNAMICEDT3D_LIBRARY_DIRS - library directories for dynamicEDT3D (normally not used!)
14-
# DYNAMICEDT3D_LIBRARIES - libraries to link against
15-
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+
1626
# Tell the user project where to find our headers and libraries
17-
set(DYNAMICEDT3D_INCLUDE_DIRS "@DYNAMICEDT3D_INCLUDE_DIRS@")
18-
set(DYNAMICEDT3D_LIBRARY_DIRS "@DYNAMICEDT3D_LIB_DIR@")
19-
20-
# Our library dependencies (contains definitions for IMPORTED targets)
21-
# include("@FOOBAR_CMAKE_DIR@/FooBarLibraryDepends.cmake")
22-
23-
set(DYNAMICEDT3D_LIBRARIES "@DYNAMICEDT3D_LIB_DIR@/@DYNAMICEDT3D_LIBRARY@")
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@

dynamicEDT3D/include/dynamicEDT3D/dynamicEDTOctomap.h

+17-10
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,38 @@
4040

4141
#include "dynamicEDT3D.h"
4242
#include <octomap/OcTree.h>
43+
#include <octomap/OcTreeStamped.h>
4344

44-
/// A DynamicEDTOctomap object connects a DynamicEDT3D object to an octomap.
45-
class DynamicEDTOctomap: private DynamicEDT3D {
45+
/// A DynamicEDTOctomapBase object connects a DynamicEDT3D object to an octomap.
46+
template <class TREE>
47+
class DynamicEDTOctomapBase: private DynamicEDT3D {
4648
public:
47-
/** Create a DynamicEDTOctomap object that maintains a distance transform in the bounding box given by bbxMin, bbxMax and clamps distances at maxdist.
49+
/** Create a DynamicEDTOctomapBase object that maintains a distance transform in the bounding box given by bbxMin, bbxMax and clamps distances at maxdist.
4850
* treatUnknownAsOccupied configures the treatment of unknown cells in the distance computation.
4951
*
5052
* The constructor copies occupancy data but does not yet compute the distance map. You need to call udpate to do this.
5153
*
5254
* 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!
5355
*/
54-
DynamicEDTOctomap(float maxdist, octomap::OcTree* _octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied);
56+
DynamicEDTOctomapBase(float maxdist, TREE* _octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied);
5557

56-
virtual ~DynamicEDTOctomap();
58+
virtual ~DynamicEDTOctomapBase();
5759

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

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

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

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

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

7577
//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.
@@ -111,7 +113,7 @@ class DynamicEDTOctomap: private DynamicEDT3D {
111113
void mapToWorld(int x, int y, int z, octomap::point3d &p) const;
112114
void mapToWorld(int x, int y, int z, octomap::OcTreeKey &key) const;
113115

114-
octomap::OcTree* octree;
116+
TREE* octree;
115117
bool unknownOccupied;
116118
int treeDepth;
117119
double treeResolution;
@@ -120,4 +122,9 @@ class DynamicEDTOctomap: private DynamicEDT3D {
120122
int offsetX, offsetY, offsetZ;
121123
};
122124

125+
typedef DynamicEDTOctomapBase<octomap::OcTree> DynamicEDTOctomap;
126+
typedef DynamicEDTOctomapBase<octomap::OcTreeStamped> DynamicEDTOctomapStamped;
127+
128+
#include "dynamicEDTOctomap.hxx"
129+
123130
#endif /* DYNAMICEDTOCTOMAP_H_ */

0 commit comments

Comments
 (0)