29 :
ObservationModel(nh, mapModel, rngEngine), m_sigma(0.2), m_maxObstacleDistance(0.5)
31 ROS_INFO(
"Using Endpoint observation model (precomputing...)");
37 ROS_ERROR(
"Sigma (std.dev) needs to be > 0 in EndpointModel");
52 #pragma omp parallel for 53 for (
unsigned i=0; i < particles.size(); ++i){
54 Eigen::Matrix4f globalLaserOrigin;
57 pcl::transformPointCloud(pc, pc_transformed, globalLaserOrigin);
59 std::vector<float>::const_iterator ranges_it = ranges.begin();
61 for (PointCloud::const_iterator it = pc_transformed.begin(); it != pc_transformed.end(); ++it, ++ranges_it){
67 sigma_scaled = (*ranges_it) * (*ranges_it) * (
m_sigma);
83 std::vector<double> heights;
85 if (heights.size() == 0)
91 heightError = std::numeric_limits<double>::max();
92 for (
unsigned i = 0; i< heights.size(); i++){
93 double dist = std::abs((heights[i] + poseHeight) - xyz.
getZ());
94 if (dist < heightError)
109 m_map->getMetricMin(x,y,z);
111 m_map->getMetricMax(x,y,z);
115 ROS_INFO(
"Distance map for endpoint model completed");
boost::shared_ptr< octomap::OcTree > m_map
bool getHeightError(const Particle &p, const tf::StampedTransform &footprintToBase, double &heightError) const
boost::mt19937 EngineT
Boost RNG engine:
void transformAsMatrix(const tf::Transform &bt, Eigen::Matrix4f &out_mat)
Particle consists of a pose and a weight.
TFSIMD_FORCE_INLINE const tfScalar & getY() const
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE const tfScalar & getZ() const
static double logLikelihood(double x, double sigma)
Helper function to compute the log likelihood.
boost::shared_ptr< MapModel > m_mapModel
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
TFSIMD_FORCE_INLINE const tfScalar & x() const
TFSIMD_FORCE_INLINE const tfScalar & z() const
TFSIMD_FORCE_INLINE const tfScalar & getX() const
virtual void setMap(boost::shared_ptr< octomap::OcTree > map)
EndpointModel(ros::NodeHandle *nh, boost::shared_ptr< MapModel > mapModel, EngineT *rngEngine)
std::vector< Particle > Particles
double m_maxObstacleDistance
boost::shared_ptr< DynamicEDTOctomap > m_distanceMap
pcl::PointCloud< pcl::PointXYZ > PointCloud
virtual void integrateMeasurement(Particles &particles, const PointCloud &pc, const std::vector< float > &ranges, float max_range, const tf::Transform &baseToSensor)