9 #ifndef OCTOMAP_COLOR_OCTREE_H
10 #define OCTOMAP_COLOR_OCTREE_H
65 Color(
unsigned char _r,
unsigned char _g,
unsigned char _b)
66 :
r(_r),
g(_g),
b(_b) {}
68 return (
r==other.
r &&
g==other.
g &&
b==other.
b);
71 return (
r!=other.
r ||
g!=other.
g ||
b!=other.
b);
73 unsigned char r,
g,
b;
104 inline void setColor(
unsigned char r,
unsigned char g,
unsigned char b) {
121 std::istream&
readValue (std::istream &s);
122 std::ostream&
writeValue(std::ostream &s)
const;
144 const unsigned char& g,
const unsigned char& b);
147 const float& z,
const unsigned char& r,
148 const unsigned char& g,
const unsigned char& b) {
156 const unsigned char& g,
const unsigned char& b);
159 const float& z,
const unsigned char& r,
160 const unsigned char& g,
const unsigned char& b) {
168 const unsigned char& g,
const unsigned char& b);
171 const float& z,
const unsigned char& r,
172 const unsigned char& g,
const unsigned char& b) {
double resolution
in meters
bool operator==(const ColorOcTreeNode &rhs) const
Base implementation for Occupancy Octrees (e.g.
ColorOcTreeNode * averageNodeColor(const OcTreeKey &key, const unsigned char &r, const unsigned char &g, const unsigned char &b)
void updateInnerOccupancy()
OctoMap: A probabilistic, flexible, and compact 3D mapping library for robotic systems.
ColorOcTreeNode * integrateNodeColor(const float &x, const float &y, const float &z, const unsigned char &r, const unsigned char &g, const unsigned char &b)
ColorOcTree(double resolution)
Default constructor, sets resolution of leafs.
bool operator!=(const Color &other) const
ColorOcTreeNode * getChild(unsigned int i)
std::istream & readValue(std::istream &s)
std::ostream & writeValue(std::ostream &s) const
ColorOcTreeNode::Color getAverageChildColor() const
ColorOcTreeNode * setNodeColor(const float &x, const float &y, const float &z, const unsigned char &r, const unsigned char &g, const unsigned char &b)
Color(unsigned char _r, unsigned char _g, unsigned char _b)
bool createChild(unsigned int i)
Static member object which ensures that this OcTree's prototype ends up in the classIDMapping only on...
OcTreeDataNode< float > ** children
pointer to array of children, may be NULL
StaticMemberInitializer()
void writeColorHistogram(std::string filename)
void updateInnerOccupancyRecurs(ColorOcTreeNode *node, unsigned int depth)
ColorOcTreeNode * integrateNodeColor(const OcTreeKey &key, const unsigned char &r, const unsigned char &g, const unsigned char &b)
ColorOcTreeNode * averageNodeColor(const float &x, const float &y, const float &z, const unsigned char &r, const unsigned char &g, const unsigned char &b)
bool operator==(const Color &other) const
std::ostream & operator<<(std::ostream &out, ColorOcTreeNode::Color const &c)
user friendly output in format (r g b)
ColorOcTreeNode * setNodeColor(const OcTreeKey &key, const unsigned char &r, const unsigned char &g, const unsigned char &b)
bool coordToKeyChecked(const point3d &coord, OcTreeKey &key) const
Converts a 3D coordinate into a 3D OcTreeKey, with boundary checking.
std::string getTreeType() const
returns actual class name as string for identification
ColorOcTree * create() const
virtual constructor: creates a new object of same type (Covariant return type requires an up-to-date ...
OcTreeNode * getChild(unsigned int i)
T value
stored data (payload)
static void registerTreeType(AbstractOcTree *tree)
OcTreeKey is a container class for internal key addressing.
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
void setColor(unsigned char r, unsigned char g, unsigned char b)
ColorOcTreeNode(const ColorOcTreeNode &rhs)
Nodes to be used in OcTree.
void updateColorChildren()
static StaticMemberInitializer colorOcTreeMemberInit
static member to ensure static initialization (only once)
const ColorOcTreeNode * getChild(unsigned int i) const