Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
helenol committed Sep 19, 2018
1 parent 4d5a6f5 commit 69d49a3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion voxblox/include/voxblox/integrator/esdf_integrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class EsdfIntegrator {
float min_weight = 1e-6;
// Number of buckets for the bucketed priority queue.
int num_buckets = 20;
// Whether to push stuff to the queue multiple times.
// Whether to push stuff to the open queue multiple times, with updated
// distances.
bool multi_queue = false;
// Whether to add an outside layer of occupied voxels. Basically just sets
// all unknown voxels in the allocated blocks to occupied.
Expand Down
10 changes: 3 additions & 7 deletions voxblox/src/integrator/esdf_integrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ void EsdfIntegrator::updateFromTsdfBlocks(const BlockIndexList& tsdf_blocks,
if (!incremental && config_.add_occupied_crust) {
// Create a little crust of occupied voxels around.
EsdfVoxel& esdf_voxel = esdf_block->getVoxelByLinearIndex(lin_index);
VoxelIndex voxel_index =
esdf_block->computeVoxelIndexFromLinearIndex(lin_index);
GlobalIndex global_index = getGlobalVoxelIndexFromBlockAndVoxelIndex(
block_index, voxel_index, voxels_per_side_);
esdf_voxel.distance = -config_.default_distance_m;
esdf_voxel.observed = true;
esdf_voxel.hallucinated = true;
Expand All @@ -166,7 +162,7 @@ void EsdfIntegrator::updateFromTsdfBlocks(const BlockIndexList& tsdf_blocks,
GlobalIndex global_index = getGlobalVoxelIndexFromBlockAndVoxelIndex(
block_index, voxel_index, voxels_per_side_);

bool tsdf_fixed = isFixed(tsdf_voxel.distance);
const bool tsdf_fixed = isFixed(tsdf_voxel.distance);
// If there was nothing there before:
if (!esdf_voxel.observed || esdf_voxel.hallucinated) {
// Two options: ESDF is in the fixed truncation band, or outside.
Expand Down Expand Up @@ -296,7 +292,7 @@ void EsdfIntegrator::processRaiseSet() {
GlobalIndexVector neighbors;

while (!raise_.empty()) {
GlobalIndex global_index = raise_.front();
const GlobalIndex global_index = raise_.front();
raise_.pop();

EsdfVoxel* voxel = esdf_layer_->getVoxelPtrByGlobalIndex(global_index);
Expand Down Expand Up @@ -436,7 +432,7 @@ void EsdfIntegrator::processOpenSet() {
}
// Final case is if the signs are different.
} else {
FloatingPoint potential_distance =
const FloatingPoint potential_distance =
voxel->distance - signum(voxel->distance) * distance;
if (std::abs(potential_distance - neighbor_voxel->distance) >
distance) {
Expand Down
12 changes: 10 additions & 2 deletions voxblox/src/simulation/simulation_world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ void SimulationWorld::getPointcloudFromViewpoint(
}
}
}
if (ray_valid && !ray_intersect.array().isNaN().any()) {
if (ray_valid) {
if (ray_intersect.array().isNaN().any()) {
LOG(ERROR) << "Simulation ray intersect is NaN!";
continue;
}
ptcloud->push_back(ray_intersect);
colors->push_back(ray_color);
}
Expand Down Expand Up @@ -164,7 +168,11 @@ void SimulationWorld::getNoisyPointcloudFromViewpoint(
}
}
}
if (ray_valid && !ray_intersect.array().isNaN().any()) {
if (ray_valid) {
if (ray_intersect.array().isNaN().any()) {
LOG(ERROR) << "Simulation ray intersect is NaN!";
continue;
}
// Apply noise now!
FloatingPoint noise = getNoise(noise_sigma);
ray_dist += noise;
Expand Down
2 changes: 1 addition & 1 deletion voxblox_ros/src/tsdf_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void TsdfServer::processPointCloudMessageAndInsert(
icp_->runICP(tsdf_map_->getTsdfLayer(), points_C,
icp_corrected_transform_ * T_G_C, &T_G_C_refined);
if (verbose_) {
ROS_INFO("ICP refinement performed %u successful update steps",
ROS_INFO("ICP refinement performed %zu successful update steps",
num_icp_updates);
}
icp_corrected_transform_ = T_G_C_refined * T_G_C.inverse();
Expand Down

0 comments on commit 69d49a3

Please sign in to comment.