limit scan range

This commit is contained in:
HViktorTsoi
2021-08-09 23:34:22 +08:00
parent a983c266b5
commit f640867ba3
3 changed files with 6 additions and 1 deletions

View File

@@ -732,6 +732,7 @@ int main(int argc, char** argv)
nh.param<double>("mapping/b_gyr_cov",b_gyr_cov,0.0001);
nh.param<double>("mapping/b_acc_cov",b_acc_cov,0.0001);
nh.param<double>("preprocess/blind", p_pre->blind, 0.01);
nh.param<double>("preprocess/max_range",p_pre->max_scan_range, 100.f);
nh.param<int>("preprocess/lidar_type", p_pre->lidar_type, AVIA);
nh.param<int>("preprocess/scan_line", p_pre->N_SCANS, 16);
nh.param<int>("point_filter_num", p_pre->point_filter_num, 2);

View File

@@ -154,8 +154,11 @@ void Preprocess::avia_handler(const livox_ros_driver::CustomMsg::ConstPtr &msg)
|| (abs(pl_full[i].z - pl_full[i-1].z) > 1e-7)
&& (pl_full[i].x * pl_full[i].x + pl_full[i].y * pl_full[i].y > blind))
{
if(pl_full[i].x * pl_full[i].x + pl_full[i].y * pl_full[i].y < max_scan_range * max_scan_range){
pl_surf.push_back(pl_full[i]);
}
// pl_surf.push_back(pl_full[i]);
}
}
}
}

View File

@@ -96,6 +96,7 @@ class Preprocess
vector<orgtype> typess[128]; //maximum 128 line lidar
int lidar_type, point_filter_num, N_SCANS;;
double blind;
double max_scan_range;
bool feature_enabled, given_offset_time;
ros::Publisher pub_full, pub_surf, pub_corn;