48#include "simple_octree.h"
49#include "model_library.h"
50#include <pcl/pcl_exports.h>
147 inline std::map<const ModelLibrary::Model*,Entry>&
159 return (&res->second);
201 float min = -(AUX_PI_FLOAT + 0.000000001f), max = AUX_PI_FLOAT + 0.000000001f;
202 float bounds[6] = {min, max, min, max, min, max};
228 const std::vector<CellOctree::Node*>&
full_leaves = octree_.getFullLeaves ();
240 const std::set<CellOctree::Node*>&
neighs =
full_leaf->getNeighbors ();
274 const float *b = octree_.getBounds ();
275 printf (
"WARNING in 'RotationSpace::%s()': the provided axis-angle input (%f, %f, %f) is "
276 "out of the rotation space bounds ([%f, %f], [%f, %f], [%f, %f]).\n",
319 const std::list<RotationSpace*>&
322 std::list<RotationSpace*>&
359 pos_octree_.clear ();
360 rotation_space_creator_.
reset ();
363 inline std::list<RotationSpace*>&
366 return (rotation_space_creator_.getRotationSpaces ());
369 inline const std::list<RotationSpace*>&
372 return (rotation_space_creator_.getRotationSpaces ());
378 return (rotation_space_creator_.getNumberOfRotationSpaces ());
385 RotationSpaceOctree::Node*
leaf = pos_octree_.createLeaf (position[0], position[1], position[2]);
389 printf (
"WARNING in 'RigidTransformSpace::%s()': the input position (%f, %f, %f) is out of bounds.\n",
390 __func__, position[0], position[1], position[2]);
Iterator class for point clouds with or without given indices.
Stores some information about the model.
const float * getAxisAngle() const
const Entry & operator=(const Entry &src)
int getNumberOfTransforms() const
const float * getTranslation() const
const Entry & addRigidTransform(const float axis_angle[3], const float translation[3])
void computeAverageRigidTransform(float *rigid_transform=nullptr)
RotationSpaceCellCreator()
RotationSpaceCell * create(const SimpleOctree< RotationSpaceCell, RotationSpaceCellCreator, float >::Node *)
virtual ~RotationSpaceCellCreator()
const RotationSpaceCell::Entry & addRigidTransform(const ModelLibrary::Model *model, const float axis_angle[3], const float translation[3])
const RotationSpaceCell::Entry * getEntry(const ModelLibrary::Model *model) const
std::map< const ModelLibrary::Model *, Entry > model_to_entry_
std::map< const ModelLibrary::Model *, Entry > & getEntries()
virtual ~RotationSpaceCell()
RotationSpace * create(const SimpleOctree< RotationSpace, RotationSpaceCreator, float >::Node *leaf)
virtual ~RotationSpaceCreator()
std::list< RotationSpace * > rotation_spaces_
const std::list< RotationSpace * > & getRotationSpaces() const
void setDiscretization(float value)
int getNumberOfRotationSpaces() const
std::list< RotationSpace * > & getRotationSpaces()
This is a class for a discrete representation of the rotation space based on the axis-angle represent...
void setCenter(const float *c)
const float * getCenter() const
bool addRigidTransform(const ModelLibrary::Model *model, const float axis_angle[3], const float translation[3])
bool getTransformWithMostVotes(const ModelLibrary::Model *model, float rigid_transform[12]) const
RotationSpace(float discretization)
We use the axis-angle representation for rotations.
RotationSpaceCellCreator cell_creator_
void axisAngleToRotationMatrix(const T axis_angle[3], T rotation_matrix[9])
brief Computes a rotation matrix from the provided input vector 'axis_angle'.
void mult3(T *v, T scalar)
v = scalar*v.
void add3(T a[3], const T b[3])
a += b
void set3(T v[3], T value)
v[0] = v[1] = v[2] = value
void copy3(const T src[3], T dst[3])
dst = src