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;
20 int main(
int argc,
char** argv) {
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);
52 std::string filename (
"simple_color_tree.ot");
53 std::cout <<
"Writing color tree to " << filename << std::endl;
59 cout <<
"Reading color tree from "<< filename <<
"\n";
69 cout <<
"Performing some queries:" << endl;
75 std::cout <<
"READ: ";
77 std::cout <<
"WRITE: ";
85 result = tree.
search (query);
86 result2 = read_color_tree->search (query);
88 std::cout <<
"READ: ";
90 std::cout <<
"WRITE: ";
98 result = tree.
search (query);
99 result2 = read_color_tree->search (query);
101 std::cout <<
"READ: ";
103 std::cout <<
"WRITE: ";
int main(int argc, char **argv)
virtual std::string getTreeType() const =0
returns actual class name as string for identification
virtual NODE * updateNode(const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)
std::string getTreeType() const
returns actual class name as string for identification
NODE * search(double x, double y, double z, unsigned int depth=0) const
virtual size_t size() const =0
void print_query_info(point3d query, ColorOcTreeNode *node)
#define EXPECT_FALSE(args)
#define EXPECT_FLOAT_EQ(a, b)
virtual double getResolution() const =0
bool write(const std::string &filename) const
Write file header and complete tree to file (serialization)
double getOccupancy() const
void updateInnerOccupancy()
This class represents a three-dimensional vector.
double getResolution() const
octomath::Vector3 point3d
Use Vector3 (float precision) as a point3d in octomap.
#define EXPECT_TRUE(args)
virtual size_t size() const