Skip to content

Commit

Permalink
增加TIA支持
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanyiaini committed Dec 9, 2024
1 parent 78f9528 commit 6bdbe78
Show file tree
Hide file tree
Showing 21 changed files with 5,145 additions and 521 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(ydlidar_sdk C CXX)
# version
set(YDLIDAR_SDK_VERSION_MAJOR 1)
set(YDLIDAR_SDK_VERSION_MINOR 2)
set(YDLIDAR_SDK_VERSION_PATCH 8)
set(YDLIDAR_SDK_VERSION_PATCH 9)
set(YDLIDAR_SDK_VERSION ${YDLIDAR_SDK_VERSION_MAJOR}.${YDLIDAR_SDK_VERSION_MINOR}.${YDLIDAR_SDK_VERSION_PATCH})

##########################################################
Expand All @@ -16,7 +16,7 @@ ELSE()
SET(CMAKE_MRPT_WORD_SIZE 32)
ENDIF()
##################################################
#c++ 11
# Add c++11 Flag
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

##########################################################
Expand Down
1 change: 0 additions & 1 deletion core/base/thread.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "v8stdint.h"
#include "timer.h"

#ifdef _WIN32
#include <conio.h>
#include <windows.h>
Expand Down
39 changes: 31 additions & 8 deletions core/common/DriverInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <core/base/datatype.h>
#include "ydlidar_protocol.h"
#include "ydlidar_def.h"
#include "ydlidar_config.h"


namespace ydlidar
Expand Down Expand Up @@ -43,6 +44,8 @@ namespace ydlidar
PropertyBuilderByName(bool, Debug, protected);
// 扫描频率
PropertyBuilderByName(float, ScanFreq, protected);
// 采样率
PropertyBuilderByName(float, SampleRate, protected);
// 是否底板优先
PropertyBuilderByName(bool, Bottom, protected);
// 是否已获取到设备信息
Expand Down Expand Up @@ -183,23 +186,29 @@ namespace ydlidar
* static function
* @return Version
*/
virtual std::string getSDKVersion() = 0;
virtual std::string getSDKVersion() {
return YDLIDAR_SDK_VERSION_STR;
}

/**
* @brief Is the Lidar in the scan \n
* @return scanning status
* @retval true scanning
* @retval false non-scanning
*/
virtual bool isscanning() const = 0;
virtual bool isscanning() const {
return m_isScanning;
}

/**
* @brief Is it connected to the lidar \n
* @return connection status
* @retval true connected
* @retval false Non-connected
*/
virtual bool isconnected() const = 0;
virtual bool isconnected() const {
return m_isConnected;
}

/**
* @brief Is there intensity \n
Expand All @@ -222,7 +231,9 @@ namespace ydlidar
* true support
* false no support
*/
virtual void setAutoReconnect(const bool &enable) = 0;
virtual void setAutoReconnect(const bool &enable) {
isAutoReconnect = enable;
}

/**
* @brief Get current scan update configuration.
Expand Down Expand Up @@ -286,16 +297,23 @@ namespace ydlidar
* @retval RESULT_FAILE failed
* @note Just turn it on once
*/
virtual result_t startScan(bool force = false,
uint32_t timeout = DEFAULT_TIMEOUT) = 0;
virtual result_t startScan(
bool force = false,
uint32_t timeout = DEFAULT_TIMEOUT) {
UNUSED(force);
UNUSED(timeout);
return RESULT_FAIL;
}

/**
* @brief turn off scanning \n
* @return result status
* @retval RESULT_OK success
* @retval RESULT_FAILE failed
*/
virtual result_t stop() = 0;
virtual result_t stop() {
return RESULT_FAIL;
}

/**
* @brief Get a circle of laser data \n
Expand Down Expand Up @@ -540,7 +558,11 @@ namespace ydlidar

YDLIDAR_T15 = 200, /**< T15 LiDAR Model. */

YDLIDAR_Tail,
YDLIDAR_TIA = 210, //TIA雷达
YDLIDAR_TIA_H = 211, //TIA-H雷达
YDLIDAR_TIA_X = 212, //TIA-X雷达

YDLIDAR_Tail = 255,
};

enum YDLIDAR_RATE
Expand Down Expand Up @@ -573,6 +595,7 @@ namespace ydlidar
/// Parse Data thread
Thread _thread; //线程对象
std::thread* m_thread = nullptr; //STD线程对象
std::thread* m_thread2 = nullptr; //STD线程对象
/// command locker(不支持嵌套)
Locker _cmd_lock;
/// driver error locker(不支持嵌套)
Expand Down
7 changes: 4 additions & 3 deletions core/common/ydlidar_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ typedef enum {

/** Lidar Type ID */
typedef enum {
TYPE_TOF = 0,/**< TG TX LiDAR.*/
TYPE_TRIANGLE = 1,/**< G4. G6. G2 LiDAR.*/
TYPE_TOF_NET = 2,/**< T15 LiDAR.*/
TYPE_TOF = 0, //TG系列雷达
TYPE_TRIANGLE = 1, //S2、S2 Pro、S4、G4、G6、G2、Tmini等三角协议雷达
TYPE_TOF_NET = 2, //T系列雷达
TYPE_GS = 3, //GS系列雷达(目前只有GS2)
TYPE_SCL = 4, //SCL雷达
TYPE_SDM = 5, //SDM15单点雷达
TYPE_SDM18 = 6, //SDM18单点雷达
TYPE_TIA = 7, //TIA系列雷达
TYPE_Tail,
} LidarTypeID;

Expand Down
Loading

0 comments on commit 6bdbe78

Please sign in to comment.