42 #include <pcl/memory.h>
43 #include <pcl/pcl_macros.h>
44 #include <pcl/common/angles.h>
45 #include <pcl/segmentation/comparator.h>
55 template<
typename Po
intT,
typename Po
intNT>
66 using Ptr = shared_ptr<GroundPlaneComparator<PointT, PointNT> >;
67 using ConstPtr = shared_ptr<const GroundPlaneComparator<PointT, PointNT> >;
142 plane_coeff_d_ = pcl::make_shared<std::vector<float> >(plane_coeff_d);
146 const std::vector<float>&
193 bool depth_dependent =
false)
typename PointCloudN::ConstPtr PointCloudNConstPtr
shared_ptr< PointCloud< PointNT > > Ptr
float deg2rad(float alpha)
Convert an angle from degrees to radians.
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input normals.
typename PointCloud::ConstPtr PointCloudConstPtr
GroundPlaneComparator(shared_ptr< std::vector< float > > &plane_coeff_d)
Constructor for GroundPlaneComparator.
virtual void setAngularThreshold(float angular_threshold)
Set the tolerance in radians for difference in normal direction between neighboring points...
GroundPlaneComparator is a Comparator for detecting smooth surfaces suitable for driving.
PointCloudNConstPtr normals_
bool compare(int idx1, int idx2) const override
Compare points at two indices by their plane equations.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
float getAngularThreshold() const
Get the angular threshold in radians for difference in normal direction between neighboring points...
Comparator is the base class for comparators that compare two points given some function.
void setPlaneCoeffD(shared_ptr< std::vector< float > > &plane_coeff_d)
Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form.
shared_ptr< std::vector< float > > plane_coeff_d_
void setPlaneCoeffD(std::vector< float > &plane_coeff_d)
Provide a pointer to a vector of the d-coefficient of the planes' hessian normal form.
shared_ptr< const Comparator< PointT > > ConstPtr
void setDistanceThreshold(float distance_threshold, bool depth_dependent=false)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
float road_angular_threshold_
PointCloudNConstPtr getInputNormals() const
Get the input normals.
float distance_threshold_
void setInputCloud(const PointCloudConstPtr &cloud) override
Provide the input cloud.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setExpectedGroundNormal(Eigen::Vector3f normal)
Set the expected ground plane normal with respect to the sensor.
const std::vector< float > & getPlaneCoeffD() const
Get a pointer to the vector of the d-coefficient of the planes' hessian normal form.
shared_ptr< const PointCloud< PointNT > > ConstPtr
GroundPlaneComparator()
Empty constructor for GroundPlaneComparator.
shared_ptr< Comparator< PointT > > Ptr
virtual void setGroundAngularThreshold(float angular_threshold)
Set the tolerance in radians for difference in normal direction between a point and the expected grou...
PointCloudConstPtr input_
float getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points...
~GroundPlaneComparator() override=default
Destructor for GroundPlaneComparator.
typename PointCloudN::Ptr PointCloudNPtr
Eigen::Vector3f desired_road_axis_