Skip to content

Commit

Permalink
Merge branch 'devel' for 1.8.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahornung committed Apr 20, 2016
2 parents 54c3137 + 0d174e9 commit 12fe991
Show file tree
Hide file tree
Showing 101 changed files with 10,221 additions and 12,161 deletions.
7 changes: 5 additions & 2 deletions dynamicEDT3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENABLE_TESTING()

# version (e.g. for packaging)
set(DYNAMICEDT3D_MAJOR_VERSION 1)
set(DYNAMICEDT3D_MINOR_VERSION 7)
set(DYNAMICEDT3D_PATCH_VERSION 2)
set(DYNAMICEDT3D_MINOR_VERSION 8)
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})

Expand Down Expand Up @@ -50,6 +50,9 @@ find_package(octomap REQUIRED
HINTS ${CMAKE_SOURCE_DIR}/lib/cmake/octomap
${CMAKE_SOURCE_DIR}/../octomap/lib/cmake/octomap
)
MESSAGE(STATUS "Found octomap version: " ${octomap_VERSION})
MESSAGE(STATUS "octomap libraries: ${OCTOMAP_LIBRARIES}")

INCLUDE_DIRECTORIES(${OCTOMAP_INCLUDE_DIRS})

ADD_SUBDIRECTORY(src)
Expand Down
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.2</version>
<version>1.8.0</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="sprunkc@informatik.uni-freiburg.de">Christoph Sprunk</author>
Expand Down
3 changes: 2 additions & 1 deletion increase_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
print "Finished writing package.xml and CMakeLists.txt files.\n"
print "Now check the output, adjust CHANGELOG, and \"git commit\".\nFinally, run:"
print " git checkout master && git merge --no-ff devel && git tag v%s" % new_version_str
print " git push && git push --tags"
print " git push origin master devel && git push --tags"
print "\n(adjust when not on the \"devel\" branch)\n"



Expand Down
5 changes: 4 additions & 1 deletion octomap/AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ Further contributors:
* R. Bogdan Rusu, Willow Garage Inc.
* C. Dornhege, University of Freiburg
* F-M. de Rainville, Universite Laval Quebec
* B. Jensen, TU Munich
* B. Jensen, TU Munich
* A. Ecins, University of Maryland
* C. Brew
* F. Boniardi, University of Freiburg
28 changes: 28 additions & 0 deletions octomap/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
v1.8.0: 2016-04-20
==================
- Fixed #98: The tree structure in memory is now maintained in OcTreeBaseImpl to
enable safely deriving custom node classes. The following functions were
moved from OcTreeDataNode into OcTreeBaseImpl:
createChild(...) -> OcTreeBaseImpl::createNodeChild(...)
getChild(...) -> OcTreeBaseImpl::getNodeChild(...)
expandNode() -> OcTreeBaseImpl::expandNode(...)
pruneNode() -> OcTreeBaseImpl::pruneNode(...)
hasChildren() -> OcTreeBaseImpl::nodeHasChildren(...)
childExists(...) -> OcTreeBaseImpl::nodeChildExist(...)
collapsible() -> OcTreeBaseImpl::isNodeCollapsible(...)
If you use custom derived node classes, you need to adjust your code to the
new API (have a look at ColorOcTree.h as an example). In particular, you
should no longer use the above node member functions in your nodes.
- Extended unit tests for the new memory management
- Added valgrind memcheck suppression file with known ("wanted") leaks due to
StaticMemberInitializer.
- Replaced `unsigned short int` for key values with octomap::key_type
(=uint16_t) and unsigned char with uint8_t in API.
- Cleaned up OcTreeKey and KeyRay API (used internally)
- Reduced unneeded memory for StaticMemberInitializer
- Cleaned up const refs to primitive types in ColorOcTree interface
- Removed deprecated insertScan functions (replaced by insertPointCloud)
- Removed no longer used ROS logging macros and unmaintained OcTreeLUT,
OcTreeBaseSE classes
- octovis: Internal version of libQGLViewer updated to 2.6.3

v1.7.2: 2016-03-26
==================
- BBX iterators fixed for empty trees (point3d version)
Expand Down
4 changes: 2 additions & 2 deletions octomap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENABLE_TESTING()

# version (e.g. for packaging)
set(OCTOMAP_MAJOR_VERSION 1)
set(OCTOMAP_MINOR_VERSION 7)
set(OCTOMAP_PATCH_VERSION 2)
set(OCTOMAP_MINOR_VERSION 8)
set(OCTOMAP_PATCH_VERSION 0)
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
77 changes: 40 additions & 37 deletions octomap/include/octomap/ColorOcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,26 @@

namespace octomap {

// forward declaraton for "friend"
class ColorOcTree;

// node definition
class ColorOcTreeNode : public OcTreeNode {
public:
friend class ColorOcTree; // needs access to node children (inherited)

class Color {
public:
Color() : r(255), g(255), b(255) {}
Color(unsigned char _r, unsigned char _g, unsigned char _b)
Color(uint8_t _r, uint8_t _g, uint8_t _b)
: r(_r), g(_g), b(_b) {}
inline bool operator== (const Color &other) const {
return (r==other.r && g==other.g && b==other.b);
}
inline bool operator!= (const Color &other) const {
return (r!=other.r || g!=other.g || b!=other.b);
}
unsigned char r, g, b;
uint8_t r, g, b;
};

public:
Expand All @@ -68,26 +72,14 @@ namespace octomap {
return (rhs.value == value && rhs.color == color);
}

// children
inline ColorOcTreeNode* getChild(unsigned int i) {
return static_cast<ColorOcTreeNode*> (OcTreeNode::getChild(i));
}
inline const ColorOcTreeNode* getChild(unsigned int i) const {
return static_cast<const ColorOcTreeNode*> (OcTreeNode::getChild(i));
void copyData(const ColorOcTreeNode& from){
OcTreeNode::copyData(from);
this->color = from.getColor();
}

bool createChild(unsigned int i) {
if (children == NULL) allocChildren();
children[i] = new ColorOcTreeNode();
return true;
}

bool pruneNode();
void expandNode();


inline Color getColor() const { return color; }
inline void setColor(Color c) {this->color = c; }
inline void setColor(unsigned char r, unsigned char g, unsigned char b) {
inline void setColor(uint8_t r, uint8_t g, uint8_t b) {
this->color = Color(r,g,b);
}

Expand All @@ -104,8 +96,8 @@ namespace octomap {
ColorOcTreeNode::Color getAverageChildColor() const;

// file I/O
std::istream& readValue (std::istream &s);
std::ostream& writeValue(std::ostream &s) const;
std::istream& readData(std::istream &s);
std::ostream& writeData(std::ostream &s) const;

protected:
Color color;
Expand All @@ -124,38 +116,48 @@ namespace octomap {
ColorOcTree* create() const {return new ColorOcTree(resolution); }

std::string getTreeType() const {return "ColorOcTree";}


/**
* Prunes a node when it is collapsible. This overloaded
* version only considers the node occupancy for pruning,
* different colors of child nodes are ignored.
* @return true if pruning was successful
*/
virtual bool pruneNode(ColorOcTreeNode* node);

virtual bool isNodeCollapsible(const ColorOcTreeNode* node) const;

// set node color at given key or coordinate. Replaces previous color.
ColorOcTreeNode* setNodeColor(const OcTreeKey& key, const unsigned char& r,
const unsigned char& g, const unsigned char& b);
ColorOcTreeNode* setNodeColor(const OcTreeKey& key, uint8_t r,
uint8_t g, uint8_t b);

ColorOcTreeNode* setNodeColor(const float& x, const float& y,
const float& z, const unsigned char& r,
const unsigned char& g, const unsigned char& b) {
ColorOcTreeNode* setNodeColor(float x, float y,
float z, uint8_t r,
uint8_t g, uint8_t b) {
OcTreeKey key;
if (!this->coordToKeyChecked(point3d(x,y,z), key)) return NULL;
return setNodeColor(key,r,g,b);
}

// integrate color measurement at given key or coordinate. Average with previous color
ColorOcTreeNode* averageNodeColor(const OcTreeKey& key, const unsigned char& r,
const unsigned char& g, const unsigned char& b);
ColorOcTreeNode* averageNodeColor(const OcTreeKey& key, uint8_t r,
uint8_t g, uint8_t b);

ColorOcTreeNode* averageNodeColor(const float& x, const float& y,
const float& z, const unsigned char& r,
const unsigned char& g, const unsigned char& b) {
ColorOcTreeNode* averageNodeColor(float x, float y,
float z, uint8_t r,
uint8_t g, uint8_t b) {
OcTreeKey key;
if (!this->coordToKeyChecked(point3d(x,y,z), key)) return NULL;
return averageNodeColor(key,r,g,b);
}

// integrate color measurement at given key or coordinate. Average with previous color
ColorOcTreeNode* integrateNodeColor(const OcTreeKey& key, const unsigned char& r,
const unsigned char& g, const unsigned char& b);
ColorOcTreeNode* integrateNodeColor(const OcTreeKey& key, uint8_t r,
uint8_t g, uint8_t b);

ColorOcTreeNode* integrateNodeColor(const float& x, const float& y,
const float& z, const unsigned char& r,
const unsigned char& g, const unsigned char& b) {
ColorOcTreeNode* integrateNodeColor(float x, float y,
float z, uint8_t r,
uint8_t g, uint8_t b) {
OcTreeKey key;
if (!this->coordToKeyChecked(point3d(x,y,z), key)) return NULL;
return integrateNodeColor(key,r,g,b);
Expand All @@ -181,6 +183,7 @@ namespace octomap {
public:
StaticMemberInitializer() {
ColorOcTree* tree = new ColorOcTree(0.1);
tree->clearKeyRays();
AbstractOcTree::registerTreeType(tree);
}

Expand Down
17 changes: 3 additions & 14 deletions octomap/include/octomap/CountingOcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,11 @@ namespace octomap {

CountingOcTreeNode();
~CountingOcTreeNode();
bool createChild(unsigned int i);

inline CountingOcTreeNode* getChild(unsigned int i) {
return static_cast<CountingOcTreeNode*> (OcTreeDataNode<unsigned int>::getChild(i));
}

inline const CountingOcTreeNode* getChild(unsigned int i) const {
return static_cast<const CountingOcTreeNode*> (OcTreeDataNode<unsigned int>::getChild(i));
}


inline unsigned int getCount() const { return getValue(); }
inline void increaseCount() { value++; }
inline void setCount(unsigned c) {this->setValue(c); }

// overloaded:
void expandNode();
};


Expand All @@ -82,8 +71,7 @@ namespace octomap {
* Count is recursive, parent nodes have the summed count of their
* children.
*
* \note In our mapping system this data structure is used in
* the sensor model only. Do not use, e.g., insertScan.
* \note Was only used internally, not used anymore
*/
class CountingOcTree : public OcTreeBase <CountingOcTreeNode> {

Expand Down Expand Up @@ -113,6 +101,7 @@ namespace octomap {
public:
StaticMemberInitializer() {
CountingOcTree* tree = new CountingOcTree(0.1);
tree->clearKeyRays();
AbstractOcTree::registerTreeType(tree);
}

Expand Down
1 change: 1 addition & 0 deletions octomap/include/octomap/OcTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace octomap {
public:
StaticMemberInitializer() {
OcTree* tree = new OcTree(0.1);
tree->clearKeyRays();
AbstractOcTree::registerTreeType(tree);
}

Expand Down
Loading

0 comments on commit 12fe991

Please sign in to comment.