Go to the documentation of this file.
11 cout <<
"occupancy probability at " << query <<
":\t " << node->
getOccupancy() << endl;
12 cout <<
"color of node is: " << node->
getColor()
16 cout <<
"occupancy probability at " << query <<
":\t is unknown" << endl;
25 for (
int x=-20; x<20; x++) {
26 for (
int y=-20; y<20; y++) {
27 for (
int z=-20; z<20; z++) {
28 point3d endpoint ((
float) x*0.05f+0.01f, (
float) y*0.05f+0.01f, (
float) z*0.05f+0.01f);
30 n->
setColor(z*5+100,x*5+100,y*5+100);
36 for (
int x=-30; x<30; x++) {
37 for (
int y=-30; y<30; y++) {
38 for (
int z=-30; z<30; z++) {
39 point3d endpoint ((
float) x*0.02f+2.0f, (
float) y*0.02f+2.0f, (
float) z*0.02f+2.0f);
51 const size_t initialSize = tree.
size();
59 std::cout <<
"\nWriting to / from file\n===============================\n";
60 std::string filename (
"simple_color_tree.ot");
61 std::cout <<
"Writing color tree to " << filename << std::endl;
67 cout <<
"Reading color tree from "<< filename <<
"\n";
80 cout <<
"Performing some queries:" << endl;
85 std::cout <<
"READ: ";
87 std::cout <<
"WRITE: ";
95 result = tree.
search (query);
96 result2 = read_color_tree->
search (query);
98 std::cout <<
"READ: ";
100 std::cout <<
"WRITE: ";
108 result = tree.
search (query);
109 result2 = read_color_tree->
search (query);
111 std::cout <<
"READ: ";
113 std::cout <<
"WRITE: ";
123 std::cout <<
"\nPruning / expansion\n===============================\n";
126 std::cout <<
"Initial size: " << tree.
size() << std::endl;
134 std::cout <<
"Size after expansion: " << tree.
size() << std::endl;
147 std::cout <<
"\nCreating / deleting nodes\n===============================\n";
148 size_t initialSize = tree.
size();
150 std::cout <<
"Initial size: " << initialSize << std::endl;
152 point3d newCoord(-2.0, -2.0, -2.0);
157 const size_t insertedSize = tree.
size();
158 std::cout <<
"Size after one insertion: " << insertedSize << std::endl;
169 for (
size_t i = 1; i < 8; ++i){
std::string getTreeType() const
returns actual class name as string for identification
virtual NODE * updateNode(const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
virtual bool pruneNode(ColorOcTreeNode *node)
virtual size_t size() const
size_t calcNumNodes() const
Traverses the tree to calculate the total number of nodes.
void deleteNodeChild(NODE *node, unsigned int childIdx)
Deletes the i-th child of the node.
virtual void expandNode(NODE *node)
void updateInnerOccupancy()
bool write(const std::string &filename) const
Write file header and complete tree to file (serialization)
#define EXPECT_TRUE(args)
This class represents a three-dimensional vector.
NODE * search(double x, double y, double z, unsigned int depth=0) const
double getResolution() const
virtual double getResolution() const =0
#define EXPECT_FLOAT_EQ(a, b)
bool nodeChildExists(const NODE *node, unsigned int childIdx) const
bool nodeHasChildren(const NODE *node) const
virtual std::string getTreeType() const =0
returns actual class name as string for identification
virtual size_t size() const =0
void print_query_info(point3d query, ColorOcTreeNode *node)
double getOccupancy() const
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
#define EXPECT_FALSE(args)
unsigned int getTreeDepth() const
octomap
Author(s): Kai M. Wurm
, Armin Hornung
autogenerated on Tue Dec 12 2023 03:39:40