Skip to content

Commit

Permalink
Merge branch 'devel' for 1.7.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahornung committed Jan 31, 2016
2 parents 57eaec9 + a4ecae2 commit 03da11e
Show file tree
Hide file tree
Showing 42 changed files with 444 additions and 158 deletions.
20 changes: 19 additions & 1 deletion dynamicEDT3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENABLE_TESTING()
# version (e.g. for packaging)
set(DYNAMICEDT3D_MAJOR_VERSION 1)
set(DYNAMICEDT3D_MINOR_VERSION 7)
set(DYNAMICEDT3D_PATCH_VERSION 0)
set(DYNAMICEDT3D_PATCH_VERSION 1)
set(DYNAMICEDT3D_VERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION}.${DYNAMICEDT3D_PATCH_VERSION})
set(DYNAMICEDT3D_SOVERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION})

Expand All @@ -25,6 +25,13 @@ SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin )
# output dirs for multi-config builds (MSVC)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
STRING( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/bin )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )

set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include")
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
Expand Down Expand Up @@ -73,6 +80,17 @@ export(PACKAGE dynamicEDT3D)
# Create a dynamicEDT3DConfig.cmake file for the use from the build tree
set(DYNAMICEDT3D_INCLUDE_DIRS "${INCLUDE_DIRS}")
set(DYNAMICEDT3D_LIB_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
# Set library names as absolute paths
# Windows, spec. MSVC requires the .lib suffix for imported libs
IF(WIN32)
set(DYNAMICEDT3D_LIBRARY
"${DYNAMICEDT3D_LIB_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}dynamicedt3d${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
ELSE()
set(DYNAMICEDT3D_LIBRARY
"${DYNAMICEDT3D_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}dynamicedt3d${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
ENDIF()
# not used right now (export depends?)
#set(DYNEDT3D_CMAKE_DIR "${PROJECT_BINARY_DIR}")
configure_file(dynamicEDT3DConfig.cmake.in
Expand Down
4 changes: 1 addition & 3 deletions dynamicEDT3D/dynamicEDT3DConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ 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@/libdynamicedt3d@CMAKE_SHARED_LIBRARY_SUFFIX@"
)
set(DYNAMICEDT3D_LIBRARIES "@DYNAMICEDT3D_LIBRARY@")
2 changes: 1 addition & 1 deletion dynamicEDT3D/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<package>
<name>dynamic_edt_3d</name>
<version>1.7.0</version>
<version>1.7.1</version>
<description> 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.</description>

<author email="[email protected]">Christoph Sprunk</author>
Expand Down
16 changes: 16 additions & 0 deletions octomap/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
v1.7.1: 2016-01-31
==================
- Fixed #82: Enable uninstall target for complete project
- Fixed #47: Exported CMake library paths for Windows no longer
have the Release/Debug prefix and correctly contain the .lib file
- Fixed #51: IO factory class registry with MSVC. Calling a dummy
function from an OcTree class c'tor enables reading general .ot files
when compiling with MSVC
- Fixed #100: Explicit casts to avoid warnings with MSVC

v1.7.0: 2015-11-27
==================
- BBX iterators fixed for empty trees (thx to F. Boniardi)
Expand All @@ -8,6 +18,12 @@ v1.7.0: 2015-11-27
A. Ecins)
- Fixed hashing overflow with clang (thx to L. Riano)


v1.6.9: 2016-01-13
==================
- Maintenance release for ROS:
Added function to determine state of change detection

v1.6.7: 2014-08-31
==================
- FSF address in octovis license header for OctoMap package in Fedora
Expand Down
34 changes: 27 additions & 7 deletions octomap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENABLE_TESTING()
# version (e.g. for packaging)
set(OCTOMAP_MAJOR_VERSION 1)
set(OCTOMAP_MINOR_VERSION 7)
set(OCTOMAP_PATCH_VERSION 0)
set(OCTOMAP_PATCH_VERSION 1)
set(OCTOMAP_VERSION ${OCTOMAP_MAJOR_VERSION}.${OCTOMAP_MINOR_VERSION}.${OCTOMAP_PATCH_VERSION})
set(OCTOMAP_SOVERSION ${OCTOMAP_MAJOR_VERSION}.${OCTOMAP_MINOR_VERSION})
if(COMMAND cmake_policy)
Expand Down Expand Up @@ -35,6 +35,13 @@ SET( BASE_DIR ${CMAKE_SOURCE_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BASE_DIR}/bin )
# output dirs for multi-config builds (MSVC)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
STRING( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/lib )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${BASE_DIR}/bin )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )

set(INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include")
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
Expand Down Expand Up @@ -69,26 +76,39 @@ configure_file(
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)


# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE octomap)

# Create a octomap-config.cmake file for the use from the build tree
set(OCTOMAP_INCLUDE_DIRS "${INCLUDE_DIRS}")
set(OCTOMAP_LIB_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
# Set library names as absolute paths
# Windows, spec. MSVC requires the .lib suffix for imported libs
IF(WIN32)
set(OCTOMAP_LIBRARY
"${OCTOMAP_LIB_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}octomap${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
set(OCTOMATH_LIBRARY
"${OCTOMAP_LIB_DIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}octomath${CMAKE_IMPORT_LIBRARY_SUFFIX}"
)
ELSE()
set(OCTOMAP_LIBRARY
"${OCTOMAP_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}octomap${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
set(OCTOMATH_LIBRARY
"${OCTOMAP_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}octomath${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
ENDIF()

# not used right now (export depends?)
#set(OCTOMAP_CMAKE_DIR "${PROJECT_BINARY_DIR}")
configure_file(octomap-config.cmake.in
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config.cmake" @ONLY)
configure_file(octomap-config-version.cmake.in
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config-version.cmake" @ONLY)

# Install the export set for use with the install-tree
#install(EXPORT FooBarLibraryDepends DESTINATION
# "${INSTALL_DATA_DIR}/FooBar/CMake"
# COMPONENT dev)


# Create a octomap-config.cmake file for the use from the install tree
# and install it
set(OCTOMAP_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
Expand Down
11 changes: 7 additions & 4 deletions octomap/CMakeModules/CMakeUninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
# Ignore empty list items.
cmake_policy(SET CMP0007 OLD)

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")

file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
list(REVERSE files)
foreach (file ${files})
Expand Down
34 changes: 22 additions & 12 deletions octomap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,38 +121,48 @@ The octomap library and tools can be compiled and used
under Windows although this has not been tested in-depth.
Feedback is welcome.

To compile the library you need cmake (http://www.cmake.org).
To compile the library you need cmake (http://www.cmake.org)
and either MinGW or Visual Studio.

### MinGW ###

1. Download the MinGW distribution (http://www.mingw.org)
2. Install C++ compiler and add MingGW/bin to your system PATH
3. Start the cmake-gui and set the code directory to the
library root (e.g. `/octomap`)
4. Set the build directory to, e.g., `/octomap/build`.
5. Press "Generate", select the appropriate generator, "MinGW Makefiles".
4. Create and set the build directory to, e.g., `/octomap/build`.
5. Press "Configure" then "Generate", select the appropriate generator, "MinGW Makefiles".
6. Start a command shell and "make" the project:

octomap> cd build
octomap/build> mingw32-make.exe


You can run the unit tests using ctest on the command prompt:
As verification, you can run the unit tests using ctest on the
command prompt:

octomap/build> ctest.exe


### Microsoft Visual Studio 2010 ###
### Microsoft Visual Studio (2013 or later recommended) ###

1. Start the cmake-gui and set the code directory to the
library root (e.g. `/octomap`)
2. Set the build directory to, e.g., /octomap/build.
3. Press "Generate", select the appropriate generator, e.g. "Visual Studio 10".
This generates a solution file octomap.sln
4. Load this file and build the project
Last tested with MSVC 2013 and 2015 (Community Edition).

1. Start the cmake-gui and set the source code directory to the
library root (e.g. `\octomap`)
2. Create a build directory and set it in CMake ("Where to build the
binaries"), e.g. `\octomap\build`.
3. Press "Configure" then "Generate", select the appropriate generator, e.g. "Visual Studio 2015".
This generates a solution file `octomap.sln` in the build directory.
4. Load this file and build the project `ALL_BUILD` in Visual Studio.

Instead of building the complete distribution (octomap, octovis, and dynamicEDT3D)
you can only build octomap by proceeding as described above but in the `octomap`
subdirectory. This can help you getting started when there are problems with
octovis and Qt4.

You can run the unit tests using ctest on the command prompt:
As verification, you can run the unit tests in Visual Studio by building the
`RUN_TESTS` project or by using ctest on the command prompt:

octomap/build> ctest.exe -C Release

14 changes: 12 additions & 2 deletions octomap/include/octomap/ColorOcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace octomap {

public:
/// Default constructor, sets resolution of leafs
ColorOcTree(double resolution) : OccupancyOcTreeBase<ColorOcTreeNode>(resolution) {};
ColorOcTree(double resolution);

/// virtual constructor: creates a new object of same type
/// (Covariant return type requires an up-to-date compiler)
Expand Down Expand Up @@ -172,14 +172,24 @@ namespace octomap {

/**
* Static member object which ensures that this OcTree's prototype
* ends up in the classIDMapping only once
* ends up in the classIDMapping only once. You need this as a
* static member in any derived octree class in order to read .ot
* files through the AbstractOcTree factory. You should also call
* ensureLinking() once from the constructor.
*/
class StaticMemberInitializer{
public:
StaticMemberInitializer() {
ColorOcTree* tree = new ColorOcTree(0.1);
AbstractOcTree::registerTreeType(tree);
}

/**
* Dummy function to ensure that MSVC does not drop the
* StaticMemberInitializer, causing this tree failing to register.
* Needs to be called from the constructor of this octree.
*/
void ensureLinking() {};
};
/// static member to ensure static initialization (only once)
static StaticMemberInitializer colorOcTreeMemberInit;
Expand Down
14 changes: 12 additions & 2 deletions octomap/include/octomap/CountingOcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace octomap {

public:
/// Default constructor, sets resolution of leafs
CountingOcTree(double resolution) : OcTreeBase<CountingOcTreeNode>(resolution) {};
CountingOcTree(double resolution);
virtual CountingOcTreeNode* updateNode(const point3d& value);
CountingOcTreeNode* updateNode(const OcTreeKey& k);
void getCentersMinHits(point3d_list& node_centers, unsigned int min_hits) const;
Expand All @@ -104,14 +104,24 @@ namespace octomap {

/**
* Static member object which ensures that this OcTree's prototype
* ends up in the classIDMapping only once
* ends up in the classIDMapping only once. You need this as a
* static member in any derived octree class in order to read .ot
* files through the AbstractOcTree factory. You should also call
* ensureLinking() once from the constructor.
*/
class StaticMemberInitializer{
public:
StaticMemberInitializer() {
CountingOcTree* tree = new CountingOcTree(0.1);
AbstractOcTree::registerTreeType(tree);
}

/**
* Dummy function to ensure that MSVC does not drop the
* StaticMemberInitializer, causing this tree failing to register.
* Needs to be called from the constructor of this octree.
*/
void ensureLinking() {};
};
/// static member to ensure static initialization (only once)
static StaticMemberInitializer countingOcTreeMemberInit;
Expand Down
2 changes: 1 addition & 1 deletion octomap/include/octomap/MapCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace octomap {
bool isOccupied(const point3d& p) const;
bool isOccupied(float x, float y, float z) const;

float getOccupancy(const point3d& p);
double getOccupancy(const point3d& p);

bool castRay(const point3d& origin, const point3d& direction, point3d& end,
bool ignoreUnknownCells=false, double maxRange=-1.0) const;
Expand Down
6 changes: 3 additions & 3 deletions octomap/include/octomap/MapCollection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ namespace octomap {


template <class MAPNODE>
float MapCollection<MAPNODE>::getOccupancy(const point3d& p) {
float max_occ_val = 0;
double MapCollection<MAPNODE>::getOccupancy(const point3d& p) {
double max_occ_val = 0;
bool is_unknown = true;
for (const_iterator it = this->begin(); it != this->end(); ++it) {
point3d ptrans = (*it)->getOrigin().inv().transform(p);
typename MAPNODE::TreeType::NodeType* n = (*it)->getMap()->search(ptrans);
if (n) {
float occ = n->getOccupancy();
double occ = n->getOccupancy();
if (occ > max_occ_val) max_occ_val = occ;
is_unknown = false;
}
Expand Down
15 changes: 13 additions & 2 deletions octomap/include/octomap/OcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace octomap {

public:
/// Default constructor, sets resolution of leafs
OcTree(double resolution) : OccupancyOcTreeBase<OcTreeNode>(resolution) {};
OcTree(double resolution);

/**
* Reads an OcTree from a binary file
Expand All @@ -71,15 +71,26 @@ namespace octomap {
protected:
/**
* Static member object which ensures that this OcTree's prototype
* ends up in the classIDMapping only once
* ends up in the classIDMapping only once. You need this as a
* static member in any derived octree class in order to read .ot
* files through the AbstractOcTree factory. You should also call
* ensureLinking() once from the constructor.
*/
class StaticMemberInitializer{
public:
StaticMemberInitializer() {
OcTree* tree = new OcTree(0.1);
AbstractOcTree::registerTreeType(tree);
}

/**
* Dummy function to ensure that MSVC does not drop the
* StaticMemberInitializer, causing this tree failing to register.
* Needs to be called from the constructor of this octree.
*/
void ensureLinking() {};
};

/// to ensure static initialization (only once)
static StaticMemberInitializer ocTreeMemberInit;
};
Expand Down
2 changes: 1 addition & 1 deletion octomap/include/octomap/OcTreeBaseImpl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ namespace octomap {

// Note: this can be larger than the adressable memory
// - size_t may not be enough to hold it!
return ((size_x/resolution) * (size_y/resolution) * (size_z/resolution)
return (unsigned long long)((size_x/resolution) * (size_y/resolution) * (size_z/resolution)
* sizeof(root->getValue()));

}
Expand Down
7 changes: 6 additions & 1 deletion octomap/include/octomap/OcTreeDataNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ namespace octomap {
* This is the base class for nodes used in an OcTree. The used implementation
* for occupancy mapping is in OcTreeNode.#
* \tparam T data to be stored in the node (e.g. a float for probabilities)
*
*
* Note: If you derive a class (directly or indirectly) from OcTreeDataNode,
* you have to implement (at least) the following functions to avoid slicing
* errors and memory-related bugs:
* createChild(), getChild(), getChild() const, expandNode()
* See ColorOcTreeNode in ColorOcTree.h for an example.
*/
template<typename T> class OcTreeDataNode: public AbstractOcTreeNode {

Expand Down
4 changes: 2 additions & 2 deletions octomap/include/octomap/OcTreeKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ namespace octomap {
end_of_ray++;
}

unsigned int size() const { return end_of_ray - ray.begin(); }
unsigned int sizeMax() const { return 100000; }
size_t size() const { return end_of_ray - ray.begin(); }
size_t sizeMax() const { return 100000; }

typedef std::vector<OcTreeKey>::iterator iterator;
typedef std::vector<OcTreeKey>::const_iterator const_iterator;
Expand Down
Loading

0 comments on commit 03da11e

Please sign in to comment.