<add> 1. add per-point time-offset for raw dtof point cloud data; 2. add addtional entries for odometry data; 3. adapt new rgb image data format from device; 4. improved connection stability. also removed some deprecated api.

This commit is contained in:
xuwei
2025-09-06 16:39:26 +08:00
parent c99c399920
commit 43c003f3a0
7 changed files with 312 additions and 196 deletions
+27 -2
View File
@@ -28,7 +28,7 @@
#include <ros/package.h>
#include <ros/ros.h>
#endif
#define ros_driver_version "0.3.1"
#define ros_driver_version "0.4.0"
// Global variable declarations
static device_handle odinDevice = nullptr;
static std::atomic<bool> deviceConnected(false);
@@ -65,6 +65,26 @@ int g_sendcloudslam = 0;
int g_sendcloudrender = 0;
int g_sendrgb_compressed = 0;
class RosNodeControlImpl : public RosNodeControlInterface {
public:
void setDtofSubframeODR(int interval) override {
dtof_subframe_interval_time = interval;
}
int getDtofSubframeODR() const override {
return dtof_subframe_interval_time;
}
private:
int dtof_subframe_interval_time = 0;
};
static RosNodeControlImpl g_rosNodeControlImpl;
RosNodeControlInterface* getRosNodeControl() {
return &g_rosNodeControlImpl;
}
void clear_all_queues();
// detect USB3.0
@@ -406,7 +426,8 @@ static void lidar_device_callback(const lidar_device_info_t* device, bool attach
return;
}
if (lidar_start_stream(odinDevice, type)) {
uint32_t dtof_subframe_odr = 0;
if (lidar_start_stream(odinDevice, type, dtof_subframe_odr)) {
#ifdef ROS2
RCLCPP_ERROR(rclcpp::get_logger("device_cb"), "Start stream failed");
#else
@@ -418,6 +439,10 @@ static void lidar_device_callback(const lidar_device_info_t* device, bool attach
return;
}
if (dtof_subframe_odr > 0) {
g_rosNodeControlImpl.setDtofSubframeODR(dtof_subframe_odr);
}
if (g_sendrgb) {
lidar_activate_stream_type(odinDevice, LIDAR_DT_RAW_RGB);
}