test_lut.cpp
Go to the documentation of this file.
1 
2 #include <stdio.h>
3 #include <octomap/octomap.h>
4 #include <octomap/OcTreeLUT.h>
5 
6 using namespace std;
7 using namespace octomap;
8 using namespace octomath;
9 
10 
11 
12 int main(int argc, char** argv) {
13 
14  OcTreeLUT lut(16);
15 
16  // OcTreeKey start_key (32768, 32768, 32768);
17  OcTreeKey start_key (100, 100, 100);
18  OcTreeKey neighbor_key;
19 
20  cout << endl << "center key:" << endl;
21  cout << "[" << start_key.k[0] << "," << start_key.k[1] << "," << start_key.k[2] << "]" << endl;
22 
23  cout << endl << "face neighbor keys:" << endl;
24 
25  lut.genNeighborKey(start_key, OcTreeLUT::N, neighbor_key);
26  cout << "N -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
27 
28  lut.genNeighborKey(start_key, OcTreeLUT::S, neighbor_key);
29  cout << "S -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
30 
31  lut.genNeighborKey(start_key, OcTreeLUT::W, neighbor_key);
32  cout << "W -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
33 
34  lut.genNeighborKey(start_key, OcTreeLUT::E, neighbor_key);
35  cout << "E -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
36 
37  lut.genNeighborKey(start_key, OcTreeLUT::T, neighbor_key);
38  cout << "T -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
39 
40  lut.genNeighborKey(start_key, OcTreeLUT::B, neighbor_key);
41  cout << "B -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
42 
43  cout << endl << "some edge neighbor keys:" << endl;
44 
45  lut.genNeighborKey(start_key, OcTreeLUT::SE, neighbor_key);
46  cout << "SE -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
47 
48  lut.genNeighborKey(start_key, OcTreeLUT::SW, neighbor_key);
49  cout << "SW -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
50 
51  lut.genNeighborKey(start_key, OcTreeLUT::BS, neighbor_key);
52  cout << "BS -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
53 
54  cout << endl << "some vertex neighbor keys:" << endl;
55 
56  lut.genNeighborKey(start_key, OcTreeLUT::TNW, neighbor_key);
57  cout << "TNW -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
58 
59  lut.genNeighborKey(start_key, OcTreeLUT::BNW, neighbor_key);
60  cout << "BNW -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
61 
62  lut.genNeighborKey(start_key, OcTreeLUT::BSE, neighbor_key);
63  cout << "BSE -> [" << neighbor_key.k[0] << "," << neighbor_key.k[1] << "," << neighbor_key.k[2] << "]" << endl;
64 
65 
66  return 0;
67 }
bool genNeighborKey(const OcTreeKey &node_key, const signed char &dir, OcTreeKey &neighbor_key) const
Definition: OcTreeLUT.cpp:583
int main(int argc, char **argv)
Definition: test_lut.cpp:12
unsigned short int k[3]
Definition: OcTreeKey.h:94


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Mon Jun 10 2019 14:00:13