41 #include <pcl/common/impl/common.hpp>
42 #include <pcl/filters/extract_indices.h>
43 #include <pcl/filters/filter_indices.h>
44 #include <pcl/filters/conditional_removal.h>
46 #include <pcl/io/pcd_io.h>
61 template <
typename Po
intT>
66 using Ptr = shared_ptr<WorldModel<PointT> >;
67 using ConstPtr = shared_ptr<const WorldModel<PointT> >;
77 using FieldList =
typename pcl::traits::fieldList<PointT>::type;
84 world_->is_dense =
false;
91 if(!world_->points.empty ())
93 PCL_WARN(
"Clearing world model\n");
94 world_->points.clear ();
101 void addSlice (
const PointCloudPtr new_cloud);
116 void getExistingData(
const double previous_origin_x,
const double previous_origin_y,
const double previous_origin_z,
117 const double offset_x,
const double offset_y,
const double offset_z,
131 void setSliceAsNans (
const double origin_x,
const double origin_y,
const double origin_z,
132 const double offset_x,
const double offset_y,
const double offset_z,
133 const int size_x,
const int size_y,
const int size_z);
139 world_->is_dense =
false;
155 return (world_->size () );
164 void getWorldAsCubes (
double size, std::vector<PointCloudPtr> &cubes, std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &transforms,
double overlap = 0.0);
170 PointCloudPtr world_;
176 inline void setIndicesAsNans (PointCloudPtr cloud,
IndicesConstPtr indices);
shared_ptr< ConditionAnd< PointT > > Ptr
shared_ptr< ConditionOr< PointT > > Ptr
shared_ptr< const FieldComparison< PointT > > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
WorldModel maintains a 3D point cloud that can be queried and updated via helper functions.
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< WorldModel< PointT > > Ptr
void setSliceAsNans(const double origin_x, const double origin_y, const double origin_z, const double offset_x, const double offset_y, const double offset_z, const int size_x, const int size_y, const int size_z)
Give nan values to the slice of the world.
void getWorldAsCubes(double size, std::vector< PointCloudPtr > &cubes, std::vector< Eigen::Vector3f, Eigen::aligned_allocator< Eigen::Vector3f > > &transforms, double overlap=0.0)
Returns the world as two vectors of cubes of size "size" (pointclouds) and transforms.
typename pcl::FieldComparison< PointT >::ConstPtr FieldComparisonConstPtr
std::size_t getWorldSize()
Returns the number of points contained in the world.
void getExistingData(const double previous_origin_x, const double previous_origin_y, const double previous_origin_z, const double offset_x, const double offset_y, const double offset_z, const double volume_x, const double volume_y, const double volume_z, pcl::PointCloud< PointT > &existing_slice)
Retrieve existing data from the world model, after a shift.
void cleanWorldFromNans()
Remove points with nan values from the world.
typename pcl::ConditionAnd< PointT >::Ptr ConditionAndPtr
void reset()
Clear the world.
void addSlice(const PointCloudPtr new_cloud)
Append a new point cloud (slice) to the world.
WorldModel()
Default constructor for the WorldModel.
typename pcl::traits::fieldList< PointT >::type FieldList
typename pcl::ConditionOr< PointT >::Ptr ConditionOrPtr
PointCloudPtr getWorld()
Returns the world as a point cloud.
shared_ptr< const WorldModel< PointT > > ConstPtr
Defines all the PCL implemented PointT point type structures.
void removeNaNFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, Indices &index)
Removes points with x, y, or z equal to NaN.
shared_ptr< const Indices > IndicesConstPtr
IndicesAllocator<> Indices
Type used for indices in PCL.