Point cloud generator for simple shapes. More...
#include <point_generator.h>
Public Types | |
typedef pcl::PointCloud< PointT > | PointCloud |
typedef boost::shared_ptr < const PointCloud > | PointCloudConstPtr |
typedef boost::shared_ptr < PointCloud > | PointCloudPtr |
Public Member Functions | |
void | generateBox (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_1, const Eigen::Vector3f &direction_2, const float &corner_size, const float &height) |
Generates a box. | |
void | generateBox (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_1, const Eigen::Vector3f &direction_2, const Eigen::Vector3f &direction_3, const float &corner_size) |
Generates a box. | |
void | generateCircle (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &rotation_axis, const Eigen::Vector3f &radius, const float &angle=2 *M_PI, const uint32_t &color=0xffffff) |
Generates points in a circle. | |
void | generateCirclePlane (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &rotation_axis, const float &radius) |
Generates a circle shaped plane. | |
void | generateCirclePlane (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &rotation_axis, const Eigen::Vector3f &radius, const float &angle=2 *M_PI) |
Generates a filled arc. | |
void | generateCone (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction, const float &radius_base, const float &radius_peak=0.0f) |
Generates a full cone. | |
void | generateCorner (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_1, const Eigen::Vector3f &direction_2, const Eigen::Vector3f &direction_3, const float &corner_size=0.0f) |
Generates a corner. | |
void | generateCylinder (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction, const float &radius) |
Generates a full cylinder. | |
void | generateCylinder (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction, const Eigen::Vector3f &radius, const float &angle) |
Generates a cylinder. | |
void | generateEdge (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_edge, const Eigen::Vector3f &direction_depth) |
Generates an edge shaped from two perpendicular planes. | |
void | generateEdge (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_edge, const Eigen::Vector3f &direction_1, const Eigen::Vector3f &direction_2) |
Generates an edge shaped by two intersecting planes. | |
void | generateHandle (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &rotation_axis, const Eigen::Vector3f &radius_curvature, const float &radius_handle, const float &angle) |
Generates a handle (or a torus) | |
void | generateLine (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction, const uint32_t &color=0xffffff) |
Generates points in a line. | |
void | generatePlane (const float &step_size, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction_1, const Eigen::Vector3f &direction_2) |
Generates quadrangle plane. | |
void | generateSphere (const float &step_size, const Eigen::Vector3f ¢er, const Eigen::Vector3f &rotation_axis, const float &radius, const float &angle=M_PI) |
Generates a hemisphere. | |
void | generateSphere (const float &step_size, const Eigen::Vector3f ¢er, const float &radius) |
Generates a full sphere. | |
PointGenerator () | |
float | random () |
void | setGaussianNoise (const float &sigma) |
Define a Gaussian noise on the shapes to be generated. | |
void | setOutputCloud (PointCloudPtr &cloud) |
Set the pointer to the output point cloud. | |
~PointGenerator () | |
Protected Member Functions | |
void | addSinglePoint (const Eigen::Vector3f &point, const uint32_t &color=0xffffff) |
Eigen::Vector3f | getArbitraryPerpendicularNormalized (const Eigen::Vector3f &vector) |
produces a random normalized arbitrary prependicular vector | |
Eigen::Vector3f | randomVector () |
int | round (float f) |
Protected Attributes | |
PointCloudPtr | cloud_ |
boost::normal_distribution< float > | n_dist_ |
boost::variate_generator < boost::mt19937 &, boost::normal_distribution < float > > | n_rng_ |
float | noise_ |
int | rgba_index_ |
boost::mt19937 | rng_ |
Point cloud generator for simple shapes.
Provides a set of functions to add synthetic shapes to a existing point cloud. Combining some functions allows to create whole artificial scenes.
Definition at line 86 of file point_generator.h.
typedef pcl::PointCloud<PointT> cob_3d_mapping_tools::PointGenerator< PointT >::PointCloud |
Definition at line 95 of file point_generator.h.
typedef boost::shared_ptr<const PointCloud> cob_3d_mapping_tools::PointGenerator< PointT >::PointCloudConstPtr |
Definition at line 97 of file point_generator.h.
typedef boost::shared_ptr<PointCloud> cob_3d_mapping_tools::PointGenerator< PointT >::PointCloudPtr |
Definition at line 96 of file point_generator.h.
PointGenerator::PointGenerator | ( | ) |
Empty constructor
Definition at line 73 of file point_generator.cpp.
PointGenerator::~PointGenerator | ( | ) |
Empty destructor
Definition at line 80 of file point_generator.cpp.
void PointGenerator::addSinglePoint | ( | const Eigen::Vector3f & | point, |
const uint32_t & | color = 0xffffff |
||
) | [protected] |
Definition at line 565 of file point_generator.cpp.
void PointGenerator::generateBox | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_1, | ||
const Eigen::Vector3f & | direction_2, | ||
const float & | corner_size, | ||
const float & | height | ||
) |
Generates a box.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting edge of the box |
[in] | direction_1 | the first direction vector |
[in] | direction_2 | the second direction vector |
[in] | corner_size | the size how big the corners should be labeled |
[in] | height | sets the size of the third direction, defined by the cross product of the first two vectors |
Definition at line 299 of file point_generator.cpp.
void PointGenerator::generateBox | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_1, | ||
const Eigen::Vector3f & | direction_2, | ||
const Eigen::Vector3f & | direction_3, | ||
const float & | corner_size | ||
) |
Generates a box.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting edge of the box |
[in] | direction_1 | the first direction vector |
[in] | direction_2 | the second direction vector |
[in] | direction_3 | the third direction vector |
[in] | corner_size | the size how big the corners should be labeled |
Definition at line 311 of file point_generator.cpp.
void PointGenerator::generateCircle | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | rotation_axis, | ||
const Eigen::Vector3f & | radius, | ||
const float & | angle = 2 * M_PI , |
||
const uint32_t & | color = 0xffffff |
||
) |
Generates points in a circle.
[in] | step_size | the distance between each generated point |
[in] | origin | the center of the circle |
[in] | rotation_axis | a vector defining the axis the circle is rotating around |
[in] | radius | a vector perpendicular to rotation_axis. Its length defines the size of the circle. |
[in] | angle | define a angle (in rad) to generate an arc starting at the radius vector. |
[in] | color | the color assigned to the generated points (default: white) |
Definition at line 120 of file point_generator.cpp.
void PointGenerator::generateCirclePlane | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | rotation_axis, | ||
const float & | radius | ||
) |
Generates a circle shaped plane.
[in] | step_size | the distance between each generated point |
[in] | origin | the chenter of the circle plane |
[in] | rotation_axis | a vector defining the axis the cicle is rotating around |
[in] | radius | defining the size of the circle in meters |
Definition at line 186 of file point_generator.cpp.
void PointGenerator::generateCirclePlane | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | rotation_axis, | ||
const Eigen::Vector3f & | radius, | ||
const float & | angle = 2 * M_PI |
||
) |
Generates a filled arc.
[in] | step_size | the distance between each generated point |
[in] | origin | the center of the arc |
[in] | rotation_axis | a vector defining the axis the circle is rotating around |
[in] | radius | a vector perpendicular to rotation_axis. Its length defines the size of the circle. |
[in] | angle | define a angle (in rad) to generate an arc starting at the radius vector. |
Definition at line 196 of file point_generator.cpp.
void PointGenerator::generateCone | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction, | ||
const float & | radius_base, | ||
const float & | radius_peak = 0.0f |
||
) |
Generates a full cone.
[in] | step_size | the distance between each generated point |
[in] | origin | the center of bottom |
[in] | radius_base | radius at the bottom |
[in] | radius_peak | radius at the top |
Definition at line 476 of file point_generator.cpp.
void PointGenerator::generateCorner | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_1, | ||
const Eigen::Vector3f & | direction_2, | ||
const Eigen::Vector3f & | direction_3, | ||
const float & | corner_size = 0.0f |
||
) |
Generates a corner.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting point of the corner |
[in] | direction_1 | the first direction vector relative to the origin |
[in] | direction_2 | the second direction vector relative to the origin |
[in] | direction_3 | the third direction vector relative to the origin |
[in] | corner_size | if not set, the length of direction_1 is used as the size |
Definition at line 264 of file point_generator.cpp.
void PointGenerator::generateCylinder | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction, | ||
const float & | radius | ||
) |
Generates a full cylinder.
[in] | step_size | the distance between each generated point |
[in] | origin | the center of bottom |
[in] | direction | the rotation axis of the cylinder, the length determines its height |
[in] | radius | the radius of the cylinder |
Definition at line 442 of file point_generator.cpp.
void PointGenerator::generateCylinder | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction, | ||
const Eigen::Vector3f & | radius, | ||
const float & | angle | ||
) |
Generates a cylinder.
[in] | step_size | the distance between each generated point |
[in] | origin | the center of bottom |
[in] | direction | the rotation axis of the cylinder, the length determines its height |
[in] | radius | the radius of the cylinder |
[in] | angle | the angle starting from the radius vector |
Definition at line 452 of file point_generator.cpp.
void PointGenerator::generateEdge | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_edge, | ||
const Eigen::Vector3f & | direction_depth | ||
) |
Generates an edge shaped from two perpendicular planes.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting point of the edge |
[in] | direction_edge | the direction vector pointing to the end point of the edge |
[in] | direction_depth | the vector defining the direction and length of the first of the planes. The other plane's direction is determined from the cross product of both. |
Definition at line 231 of file point_generator.cpp.
void PointGenerator::generateEdge | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_edge, | ||
const Eigen::Vector3f & | direction_1, | ||
const Eigen::Vector3f & | direction_2 | ||
) |
Generates an edge shaped by two intersecting planes.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting point of the edge |
[in] | direction_edge | the direction vector pointing to the end point of the edge |
[in] | direction_1 | ... |
[in] | direction_2 | ... |
Definition at line 243 of file point_generator.cpp.
void PointGenerator::generateHandle | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | rotation_axis, | ||
const Eigen::Vector3f & | radius_curvature, | ||
const float & | radius_handle, | ||
const float & | angle | ||
) |
Generates a handle (or a torus)
[in] | step_size | the distance between each generated point |
[in] | origin | the center of the torus |
[in] | rotation_axis | the rotation axis of the torus |
[in] | radius_curvature | the size of the torus |
[in] | radius_handle | the thickness of the torus |
[in] | angle | the rotation angle (in rad) starting at radius_curvature vector |
Definition at line 541 of file point_generator.cpp.
void PointGenerator::generateLine | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction, | ||
const uint32_t & | color = 0xffffff |
||
) |
Generates points in a line.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting point of the line |
[in] | direction | the direction relative from the origin pointing to the end of the line |
[in] | color | the color assigned to the generated points (default: white) |
Definition at line 84 of file point_generator.cpp.
void PointGenerator::generatePlane | ( | const float & | step_size, |
const Eigen::Vector3f & | origin, | ||
const Eigen::Vector3f & | direction_1, | ||
const Eigen::Vector3f & | direction_2 | ||
) |
Generates quadrangle plane.
[in] | step_size | the distance between each generated point |
[in] | origin | the starting edge of the plane |
[in] | direction_1 | the first direction vector relative to the origin |
[in] | direction_2 | the second direction vector relative to the origin |
Definition at line 213 of file point_generator.cpp.
void PointGenerator::generateSphere | ( | const float & | step_size, |
const Eigen::Vector3f & | center, | ||
const Eigen::Vector3f & | rotation_axis, | ||
const float & | radius, | ||
const float & | angle = M_PI |
||
) |
Generates a hemisphere.
[in] | step_size | the distance between each generated point |
[in] | center | of the sphere |
[in] | rotation_axis | the rotation axis vector |
[in] | radius | the size of the hemisphere |
[in] | angle | the height of the hemisphere |
Definition at line 504 of file point_generator.cpp.
void PointGenerator::generateSphere | ( | const float & | step_size, |
const Eigen::Vector3f & | center, | ||
const float & | radius | ||
) |
Generates a full sphere.
[in] | step_size | the distance between each generated point |
[in] | center | the center of the sphere |
[in] | radius | the radius of the sphere in meters |
Definition at line 533 of file point_generator.cpp.
Eigen::Vector3f cob_3d_mapping_tools::PointGenerator< PointT >::getArbitraryPerpendicularNormalized | ( | const Eigen::Vector3f & | vector | ) | [inline, protected] |
produces a random normalized arbitrary prependicular vector
[in] | vector | input vector |
Definition at line 359 of file point_generator.h.
float cob_3d_mapping_tools::PointGenerator< PointT >::random | ( | ) | [inline] |
Definition at line 337 of file point_generator.h.
Eigen::Vector3f cob_3d_mapping_tools::PointGenerator< PointT >::randomVector | ( | ) | [inline, protected] |
Definition at line 349 of file point_generator.h.
int cob_3d_mapping_tools::PointGenerator< PointT >::round | ( | float | f | ) | [inline, protected] |
Definition at line 344 of file point_generator.h.
void cob_3d_mapping_tools::PointGenerator< PointT >::setGaussianNoise | ( | const float & | sigma | ) | [inline] |
Define a Gaussian noise on the shapes to be generated.
[in] | sigma | strength of noise in meters |
Definition at line 119 of file point_generator.h.
void cob_3d_mapping_tools::PointGenerator< PointT >::setOutputCloud | ( | PointCloudPtr & | cloud | ) | [inline] |
Set the pointer to the output point cloud.
[out] | cloud | pointer to the output point cloud |
Definition at line 103 of file point_generator.h.
PointCloudPtr cob_3d_mapping_tools::PointGenerator< PointT >::cloud_ [protected] |
Definition at line 369 of file point_generator.h.
boost::normal_distribution<float> cob_3d_mapping_tools::PointGenerator< PointT >::n_dist_ [protected] |
Definition at line 377 of file point_generator.h.
boost::variate_generator<boost::mt19937&, boost::normal_distribution<float> > cob_3d_mapping_tools::PointGenerator< PointT >::n_rng_ [protected] |
Definition at line 379 of file point_generator.h.
float cob_3d_mapping_tools::PointGenerator< PointT >::noise_ [protected] |
Definition at line 372 of file point_generator.h.
int cob_3d_mapping_tools::PointGenerator< PointT >::rgba_index_ [protected] |
Definition at line 371 of file point_generator.h.
boost::mt19937 cob_3d_mapping_tools::PointGenerator< PointT >::rng_ [protected] |
Definition at line 375 of file point_generator.h.