Skip to content

Commit a002ccb

Browse files
committed
Set blind range member variable
1 parent 25d9c23 commit a002ccb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/LIVMapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ void LIVMapper::readParameters(rclcpp::Node::SharedPtr &node)
179179
this->node->get_parameter("publish.pub_scan_num", pub_scan_num);
180180
this->node->get_parameter("publish.pub_effect_point_en", pub_effect_point_en);
181181
this->node->get_parameter("publish.dense_map_en", dense_map_en);
182+
183+
p_pre->blind_sqr = p_pre->blind * p_pre->blind;
182184
}
183185

184186
void LIVMapper::initializeComponents(rclcpp::Node::SharedPtr &node)

src/preprocess.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void Preprocess::set(bool feat_en, int lid_type, double bld, int pfilt_num)
4848
feature_enabled = feat_en;
4949
lidar_type = lid_type;
5050
blind = bld;
51+
blind_sqr = bld * bld;
5152
point_filter_num = pfilt_num;
5253
}
5354

@@ -119,6 +120,8 @@ void Preprocess::avia_handler(const livox_ros_driver2::msg::CustomMsg::SharedPtr
119120
pl_full[i].z = msg->points[i].z;
120121
pl_full[i].intensity = msg->points[i].reflectivity;
121122
pl_full[i].curvature = msg->points[i].offset_time / float(1000000); // use curvature as time of each laser points
123+
double range = pl_full[i].x * pl_full[i].x + pl_full[i].y * pl_full[i].y + pl_full[i].z * pl_full[i].z;
124+
if (range < blind_sqr) continue;
122125

123126
bool is_new = false;
124127
if ((abs(pl_full[i].x - pl_full[i - 1].x) > 1e-7) || (abs(pl_full[i].y - pl_full[i - 1].y) > 1e-7) ||
@@ -1077,4 +1080,4 @@ bool Preprocess::edge_jump_judge(const PointCloudXYZI &pl, vector<orgtype> &type
10771080
if (d1 > edgea * d2 || (d1 - d2) > edgeb) { return false; }
10781081

10791082
return true;
1080-
}
1083+
}

0 commit comments

Comments
 (0)