36 #include <pcl/point_types.h> 50 const std::string& name)
54 int num_points, num_points_global;
55 pnh.
param(
"num_points", num_points, 96);
56 pnh.
param(
"num_points_global", num_points_global, 8);
60 double clip_near, clip_far;
61 pnh.
param(
"clip_near", clip_near, 0.5);
62 pnh.
param(
"clip_far", clip_far, 10.0);
66 double clip_z_min, clip_z_max;
67 pnh.
param(
"clip_z_min", clip_z_min, -2.0);
68 pnh.
param(
"clip_z_max", clip_z_max, 2.0);
73 pnh.
param(
"match_weight", match_weight, 5.0);
76 double match_dist_min, match_dist_flat;
77 pnh.
param(
"match_dist_min", match_dist_min, 0.2);
78 pnh.
param(
"match_dist_flat", match_dist_flat, 0.05);
83 const size_t num_particles,
84 const size_t current_num_particles)
86 if (current_num_particles <= num_particles)
98 typename pcl::PointCloud<LidarMeasurementModelBase::PointType>::Ptr
100 const typename pcl::PointCloud<LidarMeasurementModelBase::PointType>::ConstPtr& pc)
const 112 pcl::PointCloud<LidarMeasurementModelBase::PointType>::Ptr pc_filtered(
113 new pcl::PointCloud<LidarMeasurementModelBase::PointType>);
116 std::remove_if(pc_filtered->begin(), pc_filtered->end(), local_points_filter), pc_filtered->end());
117 pc_filtered->width = 1;
118 pc_filtered->height = pc_filtered->points.size();
125 const typename pcl::PointCloud<LidarMeasurementModelBase::PointType>::ConstPtr& pc,
126 const std::vector<Vec3>& origins,
133 pcl::PointCloud<LidarMeasurementModelBase::PointType>::Ptr pc_particle(
134 new pcl::PointCloud<LidarMeasurementModelBase::PointType>);
135 std::vector<int> id(1);
136 std::vector<float> sqdist(1);
138 float score_like = 0;
142 for (
auto& p : pc_particle->points)
154 const float match_ratio =
static_cast<float>(num) / pc_particle->points.size();
LidarMeasurementResult measure(ChunkedKdtree< PointType >::Ptr &kdtree, const pcl::PointCloud< PointType >::ConstPtr &pc, const std::vector< Vec3 > &origins, const State6DOF &s) const
void transform(pcl::PointCloud< PointType > &pc) const
std::shared_ptr< ChunkedKdtree > Ptr
void setGlobalLocalizationStatus(const size_t num_particles, const size_t current_num_particles)
size_t num_points_global_
pcl::PointCloud< PointType >::Ptr filter(const pcl::PointCloud< PointType >::ConstPtr &pc) const
void loadConfig(const ros::NodeHandle &nh, const std::string &name)
int radiusSearch(const POINT_TYPE &p, const float &radius, std::vector< int > &id, std::vector< float > &dist_sq, const size_t &num)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
PointCloudRandomSampler sampler_
pcl::PointCloud< POINT_TYPE >::Ptr sample(const typename pcl::PointCloud< POINT_TYPE >::ConstPtr &pc, const size_t num) const
size_t num_points_default_