point_cloud_generator.cpp
Go to the documentation of this file.
1 //
2 // Created by MatÄ›j Boxan on 2024-05-02.
3 //
4 
6 
8 
9 namespace python
10 {
11  namespace pointmatcher
12  {
13 
20  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation,
21  DataPoints& pointCloud)
22  {
23  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
24  Generator::applyTransformation(translation, quaternion, pointCloud);
25  }
26 
37  const ScalarType length, const ScalarType width, const ScalarType height, const DataPoints::Index numberOfPoints,
38  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation)
39  {
40  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
41  return Generator::generateUniformlySampledBox(length, width, height, numberOfPoints, translation, quaternion);
42  }
43 
52  const StaticCoordVector& dimensions, const DataPoints::Index numberOfPoints,
53  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation)
54  {
55  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
56  return Generator::generateUniformlySampledPlane(dimensions, numberOfPoints, translation, quaternion);
57  }
58 
68  const ScalarType radius, const ScalarType height, const DataPoints::Index numberOfPoints,
69  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation)
70  {
71  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
72  return Generator::generateUniformlySampledCylinder(radius, height, numberOfPoints, translation, quaternion);
73  }
74 
83  const ScalarType radius, const DataPoints::Index numberOfPoints,
84  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation)
85  {
86  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
87  return Generator::generateUniformlySampledCircle(radius, numberOfPoints, translation, quaternion);
88  }
89 
97  const ScalarType radius, const DataPoints::Index numberOfPoints,
98  const StaticCoordVector& translation, const Eigen::Matrix<ScalarType, 4, 1>& rotation)
99  {
100  PM::Quaternion quaternion(rotation(0), rotation(1), rotation(2), rotation(3));
101  return Generator::generateUniformlySampledSphere(radius, numberOfPoints, translation, quaternion);
102  }
103 
104  void pybindPointCloudGenerator(py::module& p_module)
105  {
106  py::class_<Generator>(p_module, "PointCloudGenerator", "Class containing methods to generate point clouds in the shape of geometric primitives.")
107  .def_static("buildUpTransformation",
108  &Generator::buildUpTransformation,
109  py::arg("translation"),
110  py::arg("rotation"))
111  .def_static("addEmpty3dPointFields", &Generator::addEmpty3dPointFields, py::arg("numberOfPoints"), py::arg("pointCloud"))
112  .def_static("applyTransformation", &applyTransformation, py::arg("translation"), py::arg("rotation"), py::arg("pointCloud"))
113  .def_static("computeNormalOfAxisAlignedPlane", &Generator::computeNormalOfAxisAlignedPlane, py::arg("axisAlignedPlaneDimensions"))
114  .def_static("generateUniformlySampledSphere", &generateUniformlySampledSphere, py::arg("radius"), py::arg("numberOfPoints"), py::arg("translation"),
115  py::arg("rotation"))
116  .def_static("generateUniformlySampledCircle", &generateUniformlySampledCircle, py::arg("radius"), py::arg("numberOfPoints"), py::arg("translation"),
117  py::arg("rotation"))
118  .def_static("generateUniformlySampledCylinder", &generateUniformlySampledCylinder, py::arg("radius"), py::arg("height"), py::arg("numberOfPoints"),
119  py::arg("translation"), py::arg("rotation"))
120  .def_static("generateUniformlySampledPlane", &generateUniformlySampledPlane, py::arg("dimensions"), py::arg("numberOfPoints"),
121  py::arg("translation"), py::arg("rotation"))
122  .def_static("generateUniformlySampledBox", &generateUniformlySampledBoxWrapper, py::arg("length"), py::arg("width"), py::arg("height"),
123  py::arg("numberOfPoints"), py::arg("translation"), py::arg("rotation"));
124  }
125  }
126 }
python::pointmatcher::applyTransformation
void applyTransformation(const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation, DataPoints &pointCloud)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:19
python::pointmatcher::generateUniformlySampledSphere
DataPoints generateUniformlySampledSphere(const ScalarType radius, const DataPoints::Index numberOfPoints, const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:96
python::pointmatcher::generateUniformlySampledBoxWrapper
DataPoints generateUniformlySampledBoxWrapper(const ScalarType length, const ScalarType width, const ScalarType height, const DataPoints::Index numberOfPoints, const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:36
icp.rotation
rotation
Definition: icp.py:74
PointMatcher::DataPoints
A point cloud.
Definition: PointMatcher.h:207
icp.translation
translation
Definition: icp.py:73
python
Definition: add_descriptor.cpp:5
point_cloud_generator.h
PointMatcher::DataPoints::Index
Matrix::Index Index
An index to a row or a column.
Definition: PointMatcher.h:218
python::pointmatcher::generateUniformlySampledCircle
DataPoints generateUniformlySampledCircle(const ScalarType radius, const DataPoints::Index numberOfPoints, const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:82
python::pointmatcher::generateUniformlySampledPlane
DataPoints generateUniformlySampledPlane(const StaticCoordVector &dimensions, const DataPoints::Index numberOfPoints, const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:51
python::pointmatcher::pybindPointCloudGenerator
void pybindPointCloudGenerator(py::module &p_module)
Definition: point_cloud_generator.cpp:104
ScalarType
PM::ScalarType ScalarType
Definition: pypoint_matcher_helper.h:54
PointMatcher.h
public interface
python::pointmatcher::generateUniformlySampledCylinder
DataPoints generateUniformlySampledCylinder(const ScalarType radius, const ScalarType height, const DataPoints::Index numberOfPoints, const StaticCoordVector &translation, const Eigen::Matrix< ScalarType, 4, 1 > &rotation)
Wrapper class that converts general Eigen::Matrix, convertible from numpy array, to Eigen::Quaternion...
Definition: point_cloud_generator.cpp:67
StaticCoordVector
Generator::StaticCoordVector StaticCoordVector
Definition: pypoint_matcher_helper.h:69
PointMatcher< float >::Quaternion
Eigen::Quaternion< float > Quaternion
A quaternion over ScalarType.
Definition: PointMatcher.h:165


libpointmatcher
Author(s):
autogenerated on Mon Sep 16 2024 02:24:09