Skip to content

Commit 37dfde3

Browse files
committed
Cleaned up extra params left over from GP
1 parent 7a89560 commit 37dfde3

File tree

6 files changed

+58
-83
lines changed

6 files changed

+58
-83
lines changed

config/methods/bgkoctomap.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ block_depth: 3 # Test-data octree depth (see Wang & Englot ICRA 2016)
99
sf2: 10.0 # Actually sigma_0 in sparse kernel
1010
ell: 0.3 # Length scale of the sparse kernel
1111

12-
# Old params from GP
13-
noise: 0.01 # From GP
14-
l: 100 # From GP
15-
16-
# Variances
17-
max_var: 1000
18-
min_var: 0.001
19-
max_known_var: 0.02
20-
2112
# Sampling resolutions
2213
free_resolution: 0.5 # Free space sampling resolution
2314
ds_resolution: 0.1 # Downsampling factor
@@ -29,4 +20,4 @@ var_thresh: 1000.0 # Threshold on variance to distinguish known/unknown
2920

3021
# BGK Inference positive and negative class prior pseudocounts
3122
prior_A: 0.001 # Positive class (occupied)
32-
prior_B: 0.001 # Negative class (unoccupied)
23+
prior_B: 0.001 # Negative class (unoccupied)

config/methods/octomap.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,6 @@ topic: /occupied_cells_vis_array
55
resolution: 0.1
66
block_depth: 3 # Test-data octree depth (see Wang & Englot ICRA 2016)
77

8-
# Kernel parameters
9-
sf2: 10.0 # Actually sigma_0 in sparse kernel
10-
ell: 0.3 # Length scale of the sparse kernel
11-
12-
# Old params from GP
13-
noise: 0.01 # From GP
14-
l: 100 # From GP
15-
16-
# Variances
17-
max_var: 1000
18-
min_var: 0.001
19-
max_known_var: 0.02
20-
218
# Sampling resolutions
229
free_resolution: 0.5 # Free space sampling resolution
2310
ds_resolution: 0.1 # Downsampling factor
@@ -26,7 +13,3 @@ ds_resolution: 0.1 # Downsampling factor
2613
free_thresh: free_thresh
2714
occupied_thresh: 0.7
2815
var_thresh: 1000.0 # Threshold on variance to distinguish known/unknown
29-
30-
# BGK Inference positive and negative class prior pseudocounts
31-
prior_A: 0.001 # Positive class (occupied)
32-
prior_B: 0.001 # Negative class (unoccupied)

include/bgkoctomap.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ namespace la3dm {
4747
* @param free_thresh free threshold for Occupancy probability (default 0.3)
4848
* @param occupied_thresh occupied threshold for Occupancy probability (default 0.7)
4949
*/
50-
BGKOctoMap(float resolution, unsigned short block_depth, float sf2, float ell, float noise, float l,
51-
float min_var,
52-
float max_var, float max_known_var, float free_thresh, float occupied_thresh,
53-
float var_thresh,
54-
float prior_A,
55-
float prior_B);
50+
BGKOctoMap(float resolution,
51+
unsigned short block_depth,
52+
float sf2,
53+
float ell,
54+
float free_thresh,
55+
float occupied_thresh,
56+
float var_thresh,
57+
float prior_A,
58+
float prior_B);
5659

5760
~BGKOctoMap();
5861

src/bgkoctomap.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,26 @@ std::cout << "Debug: " << msg << std::endl; }
1717

1818
namespace la3dm {
1919

20-
BGKOctoMap::BGKOctoMap() : BGKOctoMap(0.1f, 4, 1.0, 1.0, 0.01, 100, 0.001f, 1000.0f, 0.02f, 0.3f, 0.7f, 1.0f, 1.0f, 1.0f) { }
21-
22-
BGKOctoMap::BGKOctoMap(float resolution, unsigned short block_depth, float sf2, float ell, float noise, float l,
23-
float min_var,
24-
float max_var, float max_known_var, float free_thresh, float occupied_thresh,
25-
float var_thresh,
26-
float prior_A,
27-
float prior_B)
20+
BGKOctoMap::BGKOctoMap() : BGKOctoMap(0.1f, // resolution
21+
4, // block_depth
22+
1.0, // sf2
23+
1.0, // ell
24+
0.3f, // free_thresh
25+
0.7f, // occupied_thresh
26+
1.0f, // var_thresh
27+
1.0f, // prior_A
28+
1.0f // prior_B
29+
) { }
30+
31+
BGKOctoMap::BGKOctoMap(float resolution,
32+
unsigned short block_depth,
33+
float sf2,
34+
float ell,
35+
float free_thresh,
36+
float occupied_thresh,
37+
float var_thresh,
38+
float prior_A,
39+
float prior_B)
2840
: resolution(resolution), block_depth(block_depth),
2941
block_size((float) pow(2, block_depth - 1) * resolution) {
3042
Block::resolution = resolution;

src/bgkoctomap_static_node.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ int main(int argc, char **argv) {
2828
int block_depth = 4;
2929
double sf2 = 1.0;
3030
double ell = 1.0;
31-
double noise = 0.01;
32-
double l = 100;
33-
double min_var = 0.001;
34-
double max_var = 1000;
35-
double max_known_var = 0.02;
3631
double free_resolution = 0.5;
3732
double ds_resolution = 0.1;
3833
double free_thresh = 0.3;
@@ -53,11 +48,6 @@ int main(int argc, char **argv) {
5348
nh.param<int>("block_depth", block_depth, block_depth);
5449
nh.param<double>("sf2", sf2, sf2);
5550
nh.param<double>("ell", ell, ell);
56-
nh.param<double>("noise", noise, noise);
57-
nh.param<double>("l", l, l);
58-
nh.param<double>("min_var", min_var, min_var);
59-
nh.param<double>("max_var", max_var, max_var);
60-
nh.param<double>("max_known_var", max_known_var, max_known_var);
6151
nh.param<double>("free_resolution", free_resolution, free_resolution);
6252
nh.param<double>("ds_resolution", ds_resolution, ds_resolution);
6353
nh.param<double>("free_thresh", free_thresh, free_thresh);
@@ -79,10 +69,6 @@ int main(int argc, char **argv) {
7969
"block_depth: " << block_depth << std::endl <<
8070
"sf2: " << sf2 << std::endl <<
8171
"ell: " << ell << std::endl <<
82-
"l: " << l << std::endl <<
83-
"min_var: " << min_var << std::endl <<
84-
"max_var: " << max_var << std::endl <<
85-
"max_known_var: " << max_known_var << std::endl <<
8672
"free_resolution: " << free_resolution << std::endl <<
8773
"ds_resolution: " << ds_resolution << std::endl <<
8874
"free_thresh: " << free_thresh << std::endl <<
@@ -95,7 +81,7 @@ int main(int argc, char **argv) {
9581
"prior_B: " << prior_B
9682
);
9783

98-
la3dm::BGKOctoMap map(resolution, block_depth, sf2, ell, noise, l, min_var, max_var, max_known_var, free_thresh, occupied_thresh, var_thresh, prior_A, prior_B);
84+
la3dm::BGKOctoMap map(resolution, block_depth, sf2, ell, free_thresh, occupied_thresh, var_thresh, prior_A, prior_B);
9985

10086
ros::Time start = ros::Time::now();
10187
for (int scan_id = 1; scan_id <= scan_num; ++scan_id) {

src/octomap_static_node.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,33 @@ int main(int argc, char **argv) {
7474
ROS_INFO_STREAM("Mapping finished in " << (end - start).toSec() << "s");
7575

7676
///////// Compute Frontiers /////////////////////
77-
ROS_INFO_STREAM("Computing frontiers");
78-
la3dm::MarkerArrayPub f_pub(nh, "frontier_map", resolution);
79-
for (auto it = oc.begin_leafs(); it != oc.end_leafs(); ++it) {
80-
if (oc.isNodeOccupied(*it))
81-
continue;
82-
83-
if (it.getZ() > 1.0 || it.getZ() < 0.3)
84-
continue;
85-
86-
octomap::OcTreeKey key = it.getKey();
87-
octomap::OcTreeKey nkey;
88-
int n_unknown = 0;
89-
for (nkey[2] = key[2] - 1; nkey[2] <= key[2] + 1; ++nkey[2]) {
90-
for (nkey[1] = key[1] - 1; nkey[1] <= key[1] + 1; ++nkey[1]){
91-
for (nkey[0] = key[0] - 1; nkey[0] <= key[0] + 1; ++nkey[0]){
92-
if (key != nkey){
93-
octomap::OcTreeNode* node = oc.search(nkey);
94-
n_unknown += node == NULL;
95-
}
96-
}
97-
}
98-
}
99-
if (n_unknown >= 4) {
100-
f_pub.insert_point3d(it.getX(), it.getY(), it.getZ());
101-
}
102-
}
103-
f_pub.publish();
77+
// ROS_INFO_STREAM("Computing frontiers");
78+
// la3dm::MarkerArrayPub f_pub(nh, "frontier_map", resolution);
79+
// for (auto it = oc.begin_leafs(); it != oc.end_leafs(); ++it) {
80+
// if (oc.isNodeOccupied(*it))
81+
// continue;
82+
83+
// if (it.getZ() > 1.0 || it.getZ() < 0.3)
84+
// continue;
85+
86+
// octomap::OcTreeKey key = it.getKey();
87+
// octomap::OcTreeKey nkey;
88+
// int n_unknown = 0;
89+
// for (nkey[2] = key[2] - 1; nkey[2] <= key[2] + 1; ++nkey[2]) {
90+
// for (nkey[1] = key[1] - 1; nkey[1] <= key[1] + 1; ++nkey[1]){
91+
// for (nkey[0] = key[0] - 1; nkey[0] <= key[0] + 1; ++nkey[0]){
92+
// if (key != nkey){
93+
// octomap::OcTreeNode* node = oc.search(nkey);
94+
// n_unknown += node == NULL;
95+
// }
96+
// }
97+
// }
98+
// }
99+
// if (n_unknown >= 4) {
100+
// f_pub.insert_point3d(it.getX(), it.getY(), it.getZ());
101+
// }
102+
// }
103+
// f_pub.publish();
104104

105105
///////// Publish Map /////////////////////
106106
la3dm::MarkerArrayPub m_pub(nh, map_topic, resolution);

0 commit comments

Comments
 (0)