point_tool.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // Created by zx on 2021/5/11.
  3. //
  4. #ifndef ROBOT_CONTROL_FEATURE_EXTRA_SRC_POINT_TOOL_HPP_
  5. #define ROBOT_CONTROL_FEATURE_EXTRA_SRC_POINT_TOOL_HPP_
  6. #include <iostream>
  7. #include <pcl/point_types.h>
  8. #include <pcl/point_cloud.h>
  9. #include <pcl/io/pcd_io.h>
  10. #include <pcl/segmentation/sac_segmentation.h>
  11. #include <pcl/ModelCoefficients.h>
  12. #include <pcl/filters/extract_indices.h>
  13. #include <pcl/segmentation/extract_clusters.h>
  14. #include <opencv2/opencv.hpp>
  15. bool string2point(std::string str,pcl::PointXYZ& point);
  16. pcl::PointCloud<pcl::PointXYZ>::Ptr ReadTxtCloud(std::string file);
  17. void save_cloud_txt(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,std::string file);
  18. void save_cloud_txt(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud,std::string file);
  19. double distance(cv::Point2f p1, cv::Point2f p2);
  20. bool isRect(std::vector<cv::Point2f>& points);
  21. std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> segmentation(pcl::PointCloud<pcl::PointXYZ>::Ptr sor_cloud);
  22. void rpy_to_rotation_matrix();
  23. void rotation_matrix_to_rpy();
  24. void reverse_test();
  25. //计算cloud2到cloud1的变换
  26. Eigen::Matrix4f ndt_match(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud1,pcl::PointCloud<pcl::PointXYZ>::Ptr cloud2);
  27. #endif //ROBOT_CONTROL_FEATURE_EXTRA_SRC_POINT_TOOL_HPP_