MCPcopy Create free account
hub / github.com/brytsknguyen/slict / SensorSync

Class SensorSync

src/SensorSync.cpp:64–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62};
63
64class SensorSync
65{
66
67private:
68
69 // Node handler
70 ros::NodeHandlePtr nh_ptr;
71
72 // Subscribers
73 vector<ros::Subscriber> lidar_sub;
74 ros::Subscriber imu_sub;
75
76 mutex lidar_buf_mtx;
77 mutex lidar_leftover_buf_mtx;
78 mutex imu_buf_mtx;
79
80 deque<deque<CloudPacket>> lidar_buf;
81 deque<deque<CloudPacket>> lidar_leftover_buf;
82 deque<sensor_msgs::Imu::ConstPtr> imu_buf;
83
84 mutex merged_cloud_buf_mtx;
85 deque<CloudPacket> merged_cloud_buf;
86
87 ros::Publisher merged_pc_pub;
88 ros::Publisher data_pub;
89
90 // Lidar extrinsics
91 deque<Matrix3d> R_B_L;
92 deque<Vector3d> t_B_L;
93
94 // IMU extrinsics
95 Matrix3d R_B_I;
96 Vector3d t_B_I;
97
98 int MAX_THREAD = std::thread::hardware_concurrency();
99 int Nlidar;
100 int Nimu;
101
102 double cutoff_time = -1;
103 double cutoff_time_new = -1;
104 double min_range = 0.5;
105 vector<int> ds_rate = {1};
106
107 thread sync_lidar;
108 thread sync_data;
109
110 double imu_scale = 1.0;
111
112public:
113 // Destructor
114 ~SensorSync() {}
115
116 SensorSync(ros::NodeHandlePtr &nh_ptr_) : nh_ptr(nh_ptr_)
117 {
118 // Initialize the variables and subsribe/advertise topics here
119 Initialize();
120 }
121

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected