39 #ifndef PCL_WORLD_MODEL_H_ 40 #define PCL_WORLD_MODEL_H_ 42 #include <pcl/common/impl/common.hpp> 43 #include <pcl/filters/extract_indices.h> 44 #include <pcl/filters/filter_indices.h> 45 #include <pcl/filters/crop_box.h> 46 #include <pcl/filters/conditional_removal.h> 48 #include <pcl/io/pcd_io.h> 63 template <
typename Po
intT>
68 typedef boost::shared_ptr<WorldModel<PointT> >
Ptr;
69 typedef boost::shared_ptr<const WorldModel<PointT> >
ConstPtr;
84 world_ (new PointCloud)
86 world_->is_dense =
false;
93 if(world_->points.size () != 0)
95 PCL_WARN(
"Clearing world model\n");
96 world_->points.clear ();
103 void addSlice (
const PointCloudPtr new_cloud);
118 void getExistingData(
const double previous_origin_x,
const double previous_origin_y,
const double previous_origin_z,
119 const double offset_x,
const double offset_y,
const double offset_z,
133 void setSliceAsNans (
const double origin_x,
const double origin_y,
const double origin_z,
134 const double offset_x,
const double offset_y,
const double offset_z,
135 const int size_x,
const int size_y,
const int size_z);
141 world_->is_dense =
false;
142 std::vector<int> indices;
157 return (world_->points.size () );
166 void getWorldAsCubes (
double size, std::vector<PointCloudPtr> &cubes, std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &transforms,
double overlap = 0.0);
172 PointCloudPtr world_;
178 inline void setIndicesAsNans (PointCloudPtr cloud,
IndicesConstPtr indices);
184 #endif // PCL_WORLD_MODEL_H_ void reset()
Clear the world.
pcl::traits::fieldList< PointT >::type FieldList
boost::shared_ptr< ConditionOr< PointT > > Ptr
void cleanWorldFromNans()
Remove points with nan values from the world.
boost::shared_ptr< ConditionAnd< PointT > > Ptr
This file defines compatibility wrappers for low level I/O functions.
void removeNaNFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, std::vector< int > &index)
Removes points with x, y, or z equal to NaN.
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 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.
pcl::ConditionOr< PointT >::Ptr ConditionOrPtr
WorldModel()
Default constructor for the WorldModel.
boost::shared_ptr< PointCloud< PointT > > Ptr
PointCloudPtr getWorld()
Returns the world as a point cloud.
void addSlice(const PointCloudPtr new_cloud)
Append a new point cloud (slice) to the world.
size_t getWorldSize()
Returns the number of points contained in the world.
PointCloud::Ptr PointCloudPtr
Defines all the PCL implemented PointT point type structures.
boost::shared_ptr< WorldModel< PointT > > Ptr
boost::shared_ptr< const FieldComparison< PointT > > ConstPtr
boost::shared_ptr< const PointCloud< pcl::PointXYZI > > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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.
pcl::PointCloud< PointT > PointCloud
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
pcl::ConditionAnd< PointT >::Ptr ConditionAndPtr
WorldModel maintains a 3D point cloud that can be queried and updated via helper functions.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const WorldModel< PointT > > ConstPtr
pcl::FieldComparison< PointT >::ConstPtr FieldComparisonConstPtr