24 #include "pcl_conversions/pcl_conversions.h" 25 #include <pcl_ros/point_cloud.h> 57 static void setPCpath(
const std::string& pointcloud_folder_path);
68 static bool getNormals(PointCloudRGB::Ptr& cloud,
double normal_radius, PointCloudNormal::Ptr& normals);
104 static bool isValidMesh(pcl::PolygonMesh::Ptr mesh);
113 static bool isValidCloudMsg(
const sensor_msgs::PointCloud2& cloud_msg);
132 static void colorizeCloud(PointCloudRGB::Ptr cloud_rgb,
int R,
int G,
int B);
143 static void cloudToXYZRGB(PointCloudXYZ::Ptr cloud, PointCloudRGB::Ptr cloud_rgb,
int R,
int G,
int B);
151 static void cloudToROSMsg(PointCloudRGB::Ptr cloud, sensor_msgs::PointCloud2& cloud_msg,
const std::string& frameid=
"world");
159 static void cloudToROSMsg(
const pcl::PCLPointCloud2& cloud, sensor_msgs::PointCloud2& cloud_msg,
const std::string& frameid=
"world");
190 static void printMatrix(
const Eigen::Ref<const Eigen::MatrixXf>& matrix,
const int size);
200 static void onePointCloud(PointCloudRGB::Ptr cloud,
int size,
201 PointCloudRGB::Ptr one_point_cloud);
212 static void translateCloud(PointCloudRGB::Ptr cloud_in, PointCloudRGB::Ptr cloud_out,
213 double x_offset = 0,
double y_offset = 0,
double z_offset = 0);
224 static void rotateCloud(PointCloudRGB::Ptr cloud_in, PointCloudRGB::Ptr cloud_out,
225 double roll,
double pitch,
double yaw);
235 Eigen::Vector3f& vector);
247 static bool searchForSameRows(Eigen::MatrixXd source_m, Eigen::MatrixXd target_m,
248 std::vector<int>& source_indx, std::vector<int>& target_indx);
260 const Eigen::VectorXd v2,
272 const Eigen::VectorXd v,
284 const Eigen::MatrixXd m,
static void printTransform(const Eigen::Matrix4f &transform)
Print on console transform values with matrix format.
static bool getNormals(PointCloudRGB::Ptr &cloud, double normal_radius, PointCloudNormal::Ptr &normals)
Get the normals for input cloud with specified normal's radius.
static bool isValidTransform(Eigen::Matrix4f transform)
Check whether transform contains valid data and is not NaN.
static void extractColFromMatrix(Eigen::MatrixXd &matrix, int col)
Supress col from matrix.
static bool searchForSameRows(Eigen::MatrixXd source_m, Eigen::MatrixXd target_m, std::vector< int > &source_indx, std::vector< int > &target_indx)
Check if both matrix have a coinciden row.
static void printMatrix(const Eigen::Ref< const Eigen::MatrixXf > &matrix, const int size)
Print on console matrix values with matrix format.
const std::string SOURCE_CLOUD_TOPIC
static int findOnVector(double value, const Eigen::VectorXd v, double threshold)
Find value on vector with given threshold. Returns index vector of value found. If not found returns ...
~Utils()
This class is not meant to be instantiated.
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
Utils()
This class is not meant to be instantiated.
static void cloudToXYZRGB(PointCloudXYZ::Ptr cloud, PointCloudRGB::Ptr cloud_rgb, int R, int G, int B)
Convert XYZ cloud to XYZRGB cloud with specified RGB values.
static void getVectorFromNormal(PointCloudNormal::Ptr normal, double idx, Eigen::Vector3f &vector)
Obtain normal values as a vector.
static void colorizeCloud(PointCloudRGB::Ptr cloud_rgb, int R, int G, int B)
Apply RGB values to cloud.
static bool isValidCloud(PointCloudXYZ::Ptr cloud)
Check whether cloud contains data and is not empty.
static void onePointCloud(PointCloudRGB::Ptr cloud, int size, PointCloudRGB::Ptr one_point_cloud)
Apply extract indices filter to input cloud with given indices.
static bool areSameVectors(const Eigen::VectorXd v1, const Eigen::VectorXd v2, double threshold)
Check if given vectors are equal with a given tolerance (threshold).
const std::string TARGET_CLOUD_TOPIC
pcl::PointCloud< pcl::Normal > PointCloudNormal
static void cloudToROSMsg(PointCloudRGB::Ptr cloud, sensor_msgs::PointCloud2 &cloud_msg, const std::string &frameid="world")
Convert XYZRGB cloud to PointCloud2.
static int findOnMatrix(const Eigen::VectorXd v, const Eigen::MatrixXd m, double threshold)
Find vector as row on matrix with given threshold. Returns index of matrix row. If not found returns ...
static void extractRowFromMatrix(Eigen::MatrixXd &matrix, int row)
Supress row from matrix.
static void translateCloud(PointCloudRGB::Ptr cloud_in, PointCloudRGB::Ptr cloud_out, double x_offset=0, double y_offset=0, double z_offset=0)
Apply translation to Cloud. Values given in [m].
static double computeCloudResolution(PointCloudXYZ::Ptr cloud)
Obtain the resolution of the cloud.
static void rotateCloud(PointCloudRGB::Ptr cloud_in, PointCloudRGB::Ptr cloud_out, double roll, double pitch, double yaw)
Apply rotation to cloud. Values given in [rad].
static bool isValidMesh(pcl::PolygonMesh::Ptr mesh)
Check whether mesh contains data and is not empty.
static bool isValidCloudMsg(const sensor_msgs::PointCloud2 &cloud_msg)
Check whether PointCloud2 contains data and is not empty.
static void setPCpath(const std::string &pointcloud_folder_path)
Set the pointcloud folder path object.
pcl::PointCloud< pcl::PointXYZ > PointCloudXYZ