鱼C论坛

 找回密码
 立即注册
查看: 3035|回复: 3

有关C++问题

[复制链接]
发表于 2022-12-30 20:19:22 | 显示全部楼层 |阅读模式
购买主题 本主题需向作者支付 10 鱼币 才能浏览
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-12-30 20:19:54 | 显示全部楼层
这是头文件

  1. #ifndef _UTILITY_LIDAR_ODOMETRY_H_
  2. #define _UTILITY_LIDAR_ODOMETRY_H_


  3. #include <ros/ros.h>

  4. #include <sensor_msgs/Imu.h>
  5. #include <sensor_msgs/PointCloud2.h>
  6. #include <nav_msgs/Odometry.h>
  7. #include<nav_msgs/Path.h>
  8. #include<geometry_msgs/PoseStamped.h>
  9. #include<geometry_msgs/Pose2D.h>
  10. #include <geometry_msgs/Quaternion.h>
  11. #include "cloud_msgs/cloud_info.h"

  12. #include <opencv/cv.h>

  13. #include <pcl/point_cloud.h>
  14. #include <pcl/point_types.h>
  15. #include <pcl_ros/point_cloud.h>
  16. #include <pcl_conversions/pcl_conversions.h>
  17. #include <pcl/range_image/range_image.h>
  18. #include <pcl/filters/filter.h>
  19. #include <pcl/filters/voxel_grid.h>
  20. #include <pcl/kdtree/kdtree_flann.h>
  21. #include <pcl/common/common.h>
  22. #include <pcl/registration/icp.h>

  23. #include <tf/transform_broadcaster.h>
  24. #include <tf/transform_datatypes.h>

  25. #include <vector>
  26. #include <cmath>
  27. #include <algorithm>
  28. #include <queue>
  29. #include <deque>
  30. #include <iostream>
  31. #include <fstream>
  32. #include <ctime>
  33. #include <cfloat>
  34. #include <iterator>
  35. #include <sstream>
  36. #include <string>
  37. #include <limits>
  38. #include <iomanip>
  39. #include <array>
  40. #include <thread>
  41. #include <mutex>

  42. #define PI 3.14159265

  43. using namespace std;

  44. typedef pcl::PointXYZI  PointType;

  45. extern const string pointCloudTopic = "/lidar_points";
  46. extern const string imuTopic = "";

  47. // Save pcd
  48. extern const string fileDirectory = "/home/lizhiyuan/";

  49. // Using velodyne cloud "ring" channel for image projection (other lidar may have different name for this channel, change "PointXYZIR" below)
  50. extern const bool useCloudRing = false; // if true, ang_res_y and ang_bottom are not used

  51. // VLP-16
  52. //extern const int N_SCAN = 16;
  53. //extern const int Horizon_SCAN = 1800;
  54. //extern const float ang_res_x = 0.2;
  55. //extern const float ang_res_y = 2.0;
  56. //extern const float ang_bottom = 15.0+0.1;
  57. //extern const int groundScanInd = 7;

  58. // HDL-32E
  59. // extern const int N_SCAN = 32;
  60. // extern const int Horizon_SCAN = 1800;
  61. // extern const float ang_res_x = 360.0/float(Horizon_SCAN);
  62. // extern const float ang_res_y = 41.33/float(N_SCAN-1);
  63. // extern const float ang_bottom = 30.67;
  64. // extern const int groundScanInd = 20;

  65. //C-Fans-32
  66. // extern const int N_SCAN = 32;
  67. // extern const int Horizon_SCAN =600;
  68. // extern const float ang_res_x = 0.2;
  69. // extern const float ang_res_y =0.6;
  70. // extern const float ang_bottom = 10.2;
  71. // extern const int groundScanInd = 10;

  72. //R-Fans-32
  73. // extern const int N_SCAN = 32;
  74. // extern const int Horizon_SCAN =2000;
  75. // extern const float ang_res_x = 0.18;
  76. // extern const float ang_res_y =1;
  77. // extern const float ang_bottom = 20;
  78. // extern const int groundScanInd = 10;
  79. //R-fans-32M
  80. extern const int N_SCAN = 32;
  81. extern const int Horizon_SCAN =2000;
  82. extern const float ang_res_x = 0.18;
  83. //extern const float ang_res_y =0.87;
  84. extern const float ang_bottom = 16.9;
  85. extern const int groundScanInd = 10;
  86. //HDL-64
  87. // extern const int N_SCAN = 64;
  88. // extern const int Horizon_SCAN =4000;
  89. // extern const float ang_res_x = 0.09;
  90. // extern const float ang_res_y =0.4;
  91. // extern const float ang_bottom = 24.8;
  92. // extern const int groundScanInd = 20;



  93. // VLS-128
  94. // extern const int N_SCAN = 128;
  95. // extern const int Horizon_SCAN = 1800;
  96. // extern const float ang_res_x = 0.2;
  97. // extern const float ang_res_y = 0.3;
  98. // extern const float ang_bottom = 25.0;
  99. // extern const int groundScanInd = 10;

  100. // Ouster users may need to uncomment line 159 in imageProjection.cpp
  101. // Usage of Ouster imu data is not fully supported yet (LeGO-LOAM needs 9-DOF IMU), please just publish point cloud data
  102. // Ouster OS1-16
  103. // extern const int N_SCAN = 16;
  104. // extern const int Horizon_SCAN = 1024;
  105. // extern const float ang_res_x = 360.0/float(Horizon_SCAN);
  106. // extern const float ang_res_y = 33.2/float(N_SCAN-1);
  107. // extern const float ang_bottom = 16.6+0.1;
  108. // extern const int groundScanInd = 7;

  109. // Ouster OS1-64
  110. // extern const int N_SCAN = 64;
  111. // extern const int Horizon_SCAN = 1024;
  112. // extern const float ang_res_x = 360.0/float(Horizon_SCAN);
  113. // extern const float ang_res_y = 33.2/float(N_SCAN-1);
  114. // extern const float ang_bottom = 16.6+0.1;
  115. // extern const int groundScanInd = 15;

  116. extern const bool loopClosureEnableFlag = false;
  117. extern const double mappingProcessInterval = 0.3;

  118. extern const float scanPeriod = 0.1;
  119. extern const int systemDelay = 0;
  120. extern const int imuQueLength = 200;

  121. extern const float sensorMinimumRange = 1.0;
  122. extern const float sensorMountAngle = 0.0;
  123. extern const float segmentTheta = 60.0/180.0*M_PI; // decrese this value may improve accuracy
  124. extern const int segmentValidPointNum = 5;
  125. extern const int segmentValidLineNum = 3;
  126. extern const float segmentAlphaX = ang_res_x / 180.0 * M_PI;
  127. extern const float segmentAlphaY = 1/ 180.0 * M_PI;


  128. extern const int edgeFeatureNum = 2;
  129. extern const int surfFeatureNum = 4;
  130. extern const int sectionsTotal = 6;
  131. extern const float edgeThreshold = 0.1;
  132. extern const float surfThreshold = 0.1;
  133. extern const float nearestFeatureSearchSqDist = 25;


  134. // Mapping Params
  135. extern const float surroundingKeyframeSearchRadius = 50.0; // key frame that is within n meters from current pose will be considerd for scan-to-map optimization (when loop closure disabled)
  136. extern const int   surroundingKeyframeSearchNum = 50; // submap size (when loop closure enabled)
  137. // history key frames (history submap for loop closure)
  138. extern const float historyKeyframeSearchRadius = 7.0; // key frame that is within n meters from current pose will be considerd for loop closure
  139. extern const int   historyKeyframeSearchNum = 25; // 2n+1 number of hostory key frames will be fused into a submap for loop closure
  140. extern const float historyKeyframeFitnessScore = 0.3; // the smaller the better alignment

  141. extern const float globalMapVisualizationSearchRadius = 500.0; // key frames with in n meters will be visualized


  142. struct smoothness_t{
  143.     float value;
  144.     size_t ind;
  145. };

  146. struct by_value{
  147.     bool operator()(smoothness_t const &left, smoothness_t const &right) {
  148.         return left.value < right.value;
  149.     }
  150. };

  151. /*
  152.     * A point cloud type that has "ring" channel
  153.     */
  154. struct PointXYZIR
  155. {
  156.     PCL_ADD_POINT4D
  157.     PCL_ADD_INTENSITY;
  158.     uint16_t ring;
  159.     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
  160. } EIGEN_ALIGN16;

  161. POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIR,  
  162.                                    (float, x, x) (float, y, y)
  163.                                    (float, z, z) (float, intensity, intensity)
  164.                                    (uint16_t, ring, ring)
  165. )

  166. /*
  167.     * A point cloud type that has 6D pose info ([x,y,z,roll,pitch,yaw] intensity is time stamp)
  168.     */
  169. struct PointXYZIRPYT
  170. {
  171.     PCL_ADD_POINT4D
  172.     PCL_ADD_INTENSITY;
  173.     float roll;
  174.     float pitch;
  175.     float yaw;
  176.     double time;
  177.     EIGEN_MAKE_ALIGNED_OPERATOR_NEW
  178. } EIGEN_ALIGN16;

  179. POINT_CLOUD_REGISTER_POINT_STRUCT (PointXYZIRPYT,
  180.                                    (float, x, x) (float, y, y)
  181.                                    (float, z, z) (float, intensity, intensity)
  182.                                    (float, roll, roll) (float, pitch, pitch) (float, yaw, yaw)
  183.                                    (double, time, time)
  184. )

  185. typedef PointXYZIRPYT  PointTypePose;

  186. #endif
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-12-31 08:55:07 | 显示全部楼层
你搞成付费了,应该是悬赏
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2023-1-5 22:08:48 | 显示全部楼层
你弄个付费干啥
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-13 00:39

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表