feat:support Mid70 and Avia
This commit is contained in:
@@ -34,7 +34,9 @@ typedef enum {
|
||||
kDeviceTypeHub = 0, /**< Livox Hub. */
|
||||
kDeviceTypeLidarMid40 = 1, /**< Mid-40. */
|
||||
kDeviceTypeLidarTele = 2, /**< Tele. */
|
||||
kDeviceTypeLidarHorizon = 3 /**< Horizon. */
|
||||
kDeviceTypeLidarHorizon = 3, /**< Horizon. */
|
||||
kDeviceTypeLidarMid70 = 6, /**< Livox Mid-70. */
|
||||
kDeviceTypeLidarAvia = 7 /**< Avia. */
|
||||
} DeviceType;
|
||||
|
||||
/** Lidar state. */
|
||||
@@ -66,6 +68,12 @@ typedef enum {
|
||||
kLidarStaticIpMode = 1 /**< Static IP. */
|
||||
} LidarIpMode;
|
||||
|
||||
/** Lidar Scan Pattern. */
|
||||
typedef enum {
|
||||
kNoneRepetitiveScanPattern = 0, /**< None Repetitive Scan Pattern. */
|
||||
kRepetitiveScanPattern = 1, /**< Repetitive Scan Pattern. */
|
||||
} LidarScanPattern;
|
||||
|
||||
/** Function return value definition. */
|
||||
typedef enum {
|
||||
kStatusSendFailed = -9, /**< Command send failed. */
|
||||
@@ -110,6 +118,8 @@ typedef enum {
|
||||
kDualExtendCartesian, /**< Dual extend cartesian coordinate point cloud. */
|
||||
kDualExtendSpherical, /**< Dual extend spherical coordinate point cloud. */
|
||||
kImu, /**< IMU data. */
|
||||
kTripleExtendCartesian, /**< Triple extend cartesian coordinate point cloud. */
|
||||
kTripleExtendSpherical, /**< Triple extend spherical coordinate point cloud. */
|
||||
kMaxPointDataType /**< Max Point Data Type. */
|
||||
} PointDataType;
|
||||
|
||||
@@ -117,7 +127,8 @@ typedef enum {
|
||||
typedef enum {
|
||||
kFirstReturn, /**< First single return mode . */
|
||||
kStrongestReturn, /**< Strongest single return mode. */
|
||||
kDualReturn /**< Dual return mode. */
|
||||
kDualReturn, /**< Dual return mode. */
|
||||
kTripleReturn, /**< Triple return mode. */
|
||||
} PointCloudReturnMode;
|
||||
|
||||
/** IMU push frequency. */
|
||||
@@ -129,8 +140,8 @@ typedef enum {
|
||||
#pragma pack(1)
|
||||
|
||||
#define LIVOX_SDK_MAJOR_VERSION 2
|
||||
#define LIVOX_SDK_MINOR_VERSION 1
|
||||
#define LIVOX_SDK_PATCH_VERSION 1
|
||||
#define LIVOX_SDK_MINOR_VERSION 2
|
||||
#define LIVOX_SDK_PATCH_VERSION 0
|
||||
|
||||
#define kBroadcastCodeSize 16
|
||||
|
||||
@@ -209,6 +220,40 @@ typedef struct {
|
||||
uint8_t tag2; /**< Tag */
|
||||
} LivoxDualExtendSpherPoint;
|
||||
|
||||
/** Triple extend cartesian coordinate format. */
|
||||
typedef struct {
|
||||
int32_t x1; /**< X axis, Unit:mm */
|
||||
int32_t y1; /**< Y axis, Unit:mm */
|
||||
int32_t z1; /**< Z axis, Unit:mm */
|
||||
uint8_t reflectivity1; /**< Reflectivity */
|
||||
uint8_t tag1; /**< Tag */
|
||||
int32_t x2; /**< X axis, Unit:mm */
|
||||
int32_t y2; /**< Y axis, Unit:mm */
|
||||
int32_t z2; /**< Z axis, Unit:mm */
|
||||
uint8_t reflectivity2; /**< Reflectivity */
|
||||
uint8_t tag2; /**< Tag */
|
||||
int32_t x3; /**< X axis, Unit:mm */
|
||||
int32_t y3; /**< Y axis, Unit:mm */
|
||||
int32_t z3; /**< Z axis, Unit:mm */
|
||||
uint8_t reflectivity3; /**< Reflectivity */
|
||||
uint8_t tag3; /**< Tag */
|
||||
} LivoxTripleExtendRawPoint;
|
||||
|
||||
/** Triple extend spherical coordinate format. */
|
||||
typedef struct {
|
||||
uint16_t theta; /**< Zenith angle[0, 18000], Unit: 0.01 degree */
|
||||
uint16_t phi; /**< Azimuth[0, 36000], Unit: 0.01 degree */
|
||||
uint32_t depth1; /**< Depth, Unit: mm */
|
||||
uint8_t reflectivity1; /**< Reflectivity */
|
||||
uint8_t tag1; /**< Tag */
|
||||
uint32_t depth2; /**< Depth, Unit: mm */
|
||||
uint8_t reflectivity2; /**< Reflectivity */
|
||||
uint8_t tag2; /**< Tag */
|
||||
uint32_t depth3; /**< Depth, Unit: mm */
|
||||
uint8_t reflectivity3; /**< Reflectivity */
|
||||
uint8_t tag3; /**< Tag */
|
||||
} LivoxTripleExtendSpherPoint;
|
||||
|
||||
/** IMU data format. */
|
||||
typedef struct {
|
||||
float gyro_x; /**< Gyroscope X axis, Unit:rad/s */
|
||||
@@ -502,6 +547,8 @@ typedef struct {
|
||||
typedef enum {
|
||||
kKeyDefault = 0, /**< Default key name. */
|
||||
kKeyHighSensetivity = 1, /**< Key to get/set LiDAR' Sensetivity. */
|
||||
kKeyScanPattern = 2, /**< Key to get/set LiDAR' ScanPattern. */
|
||||
kKeySlotNum = 3, /**< Key to get/set LiDAR' Slot number. */
|
||||
} DeviceParamKeyName;
|
||||
|
||||
/**
|
||||
@@ -529,6 +576,15 @@ typedef struct {
|
||||
uint16_t key[1]; /*< Key, refer to \ref DeviceParamKeyName. */
|
||||
} GetDeviceParameterRequest;
|
||||
|
||||
/**
|
||||
* The request body for the command of resetting device's parameters.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t flag; /*< 0: for resetting all keys, 1: for resetting part of keys. */
|
||||
uint8_t key_num; /*< number of keys to reset. */
|
||||
uint16_t key[1]; /*< Keys to reset, refer to \ref DeviceParamKeyName. */
|
||||
} ResetDeviceParameterRequest;
|
||||
|
||||
/**
|
||||
* The request body for the command of setting Livox LiDAR's parameters.
|
||||
*/
|
||||
|
||||
@@ -163,6 +163,11 @@ typedef void (*DataCallback)(uint8_t handle, LivoxEthPacket *data, uint32_t data
|
||||
* cloud data callback before beginning sampling.
|
||||
* @param handle device handle.
|
||||
* @param cb callback to receive point cloud data.
|
||||
* @note 1: Don't do any blocking operations in callback function, it will affects further data's receiving;
|
||||
* 2: For different device handle, callback to receive point cloud data will run on its own thread. If you bind
|
||||
* different handle to same callback function, please make sure that operations in callback function are thread-safe;
|
||||
* 3: callback function's data pointer will be invalid after callback fuction returns. It's recommended to
|
||||
* copy all data_num of point cloud every time callback is triggered.
|
||||
* @param client_data user data associated with the command.
|
||||
*/
|
||||
void SetDataCallback(uint8_t handle, DataCallback cb, void *client_data);
|
||||
@@ -332,6 +337,7 @@ typedef void (*SetDeviceParametersCallback)(livox_status status,
|
||||
|
||||
/**
|
||||
* LiDAR Enable HighSensitivity.
|
||||
* @note \ref LidarEnableHighSensitivity only support for Tele/Avia.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
@@ -341,6 +347,7 @@ livox_status LidarEnableHighSensitivity(uint8_t handle, SetDeviceParametersCallb
|
||||
|
||||
/**
|
||||
* LiDAR Disable HighSensitivity.
|
||||
* @note \ref LidarDisableHighSensitivity only support for Tele/Avia.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
@@ -363,6 +370,7 @@ typedef void (*GetDeviceParametersCallback)(livox_status status,
|
||||
|
||||
/**
|
||||
* LiDAR Get HighSensitivity State.
|
||||
* @note \ref LidarGetHighSensitivityState only support for Tele/Avia.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
@@ -370,6 +378,82 @@ typedef void (*GetDeviceParametersCallback)(livox_status status,
|
||||
*/
|
||||
livox_status LidarGetHighSensitivityState(uint8_t handle, GetDeviceParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* LiDAR Set Scan Pattern.
|
||||
* @note \ref LidarSetScanPattern only support for Avia.
|
||||
* @param handle device handle.
|
||||
* @param pattern scan pattern of LiDAR, see \ref LidarScanPattern for detail.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status LidarSetScanPattern(uint8_t handle, LidarScanPattern pattern, SetDeviceParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* LiDAR Get Scan Pattern.
|
||||
* @note \ref LidarGetScanPattern only support for Avia.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status LidarGetScanPattern(uint8_t handle, GetDeviceParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* LiDAR Set Slot Number.
|
||||
* @note \ref LidarSetSlotNum only support for Mid70/Avia.
|
||||
* @param handle device handle.
|
||||
* @param slot slot number of LiDAR, range from 1 to 9.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status LidarSetSlotNum(uint8_t handle, uint8_t slot, SetDeviceParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* LiDAR Get Slot Number.
|
||||
* @note \ref LidarGetSlotNum only support for Mid70/Avia.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status LidarGetSlotNum(uint8_t handle, GetDeviceParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* @c DeviceResetParameters' response callback function.
|
||||
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
|
||||
* error code.
|
||||
* @param handle device handle.
|
||||
* @param response response from the device.
|
||||
* @param client_data user data associated with the command.
|
||||
*/
|
||||
typedef void (*DeviceResetParametersCallback)(livox_status status,
|
||||
uint8_t handle,
|
||||
DeviceParameterResponse *response,
|
||||
void *client_data);
|
||||
|
||||
/**
|
||||
* Reset LiDAR/Hub's All Parameters, see \ref DeviceParamKeyName for all parameters.
|
||||
* @param handle device handle.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status DeviceResetAllParameters(uint8_t handle, DeviceResetParametersCallback cb, void *client_data);
|
||||
|
||||
/**
|
||||
* Reset LiDAR/Hub's Parameters, see \ref DeviceParamKeyName for all parameters.
|
||||
* @param handle device handle.
|
||||
* @param keys keys to reset, see \ref DeviceParamKeyName for all parameters.
|
||||
* @param num num of keys to reset.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
|
||||
*/
|
||||
livox_status DeviceResetParameters(uint8_t handle, DeviceParamKeyName * keys, uint8_t num, DeviceResetParametersCallback cb, void *client_data);
|
||||
|
||||
|
||||
/**
|
||||
* @c HubQueryLidarInformation response callback function.
|
||||
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
|
||||
@@ -882,7 +966,7 @@ livox_status LidarGetImuPushFrequency(uint8_t handle, LidarGetImuPushFrequencyCa
|
||||
* Set GPRMC formate synchronization time.
|
||||
* @note \ref LidarSetRmcSyncTime is not supported for Mid40/100 firmware version < 03.07.0000.
|
||||
* @param handle device handle.
|
||||
* @param rmc GPRMC\GNRMC format data.
|
||||
* @param rmc GPRMC/GNRMC format data.
|
||||
* @param rmc_length lenth of gprmc.
|
||||
* @param cb callback for the command.
|
||||
* @param client_data user data associated with the command.
|
||||
|
||||
Reference in New Issue
Block a user