feature:support save lvx file for lidar;

This commit is contained in:
Livox-SDK
2019-05-06 12:33:55 +08:00
parent 2c5b72a589
commit a490a93b20
907 changed files with 10205 additions and 5141 deletions
+18 -2
View File
@@ -90,7 +90,7 @@ typedef enum {
#pragma pack(1)
#define LIVOX_SDK_MAJOR_VERSION 1
#define LIVOX_SDK_MINOR_VERSION 1
#define LIVOX_SDK_MINOR_VERSION 2
#define LIVOX_SDK_PATCH_VERSION 0
#define kBroadcastCodeSize 16
@@ -110,6 +110,14 @@ typedef struct {
uint8_t reflectivity; /**< Reflectivity */
} LivoxRawPoint;
/** Spherical coordinate format. */
typedef struct {
uint32_t depth; /**< Radial distance, Unit:mm */
uint16_t theta; /**< Polar angle, Unit:0.01rad */
uint16_t phi; /**< Azimuthal angle, Unit:0.01rad */
uint8_t reflectivity; /**< Reflectivity */
} LivoxSpherPoint;
/** Standard point cloud format */
typedef struct {
float x; /**< X axis, Unit:m */
@@ -144,7 +152,7 @@ typedef struct {
uint8_t handle; /**< Device handle. */
uint8_t slot; /**< Slot number used for connecting LiDAR. */
uint8_t id; /**< LiDAR id. */
uint32_t type; /**< Device type, refer to \ref DeviceType. */
uint8_t type; /**< Device type, refer to \ref DeviceType. */
uint16_t data_port; /**< Point cloud data UDP port. */
uint16_t cmd_port; /**< Control command UDP port. */
char ip[16]; /**< IP address. */
@@ -389,6 +397,14 @@ typedef struct {
ReturnCode ret_state_list[1]; /**< Return code */
} HubRainFogSuppressResponse;
/**
* The response body of getting hub slots' power state.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint16_t slot_power_state; /**< Slot power status. */
} HubQuerySlotPowerStatusResponse;
#pragma pack()
#endif // LIVOX_DEF_H_
+27 -11
View File
@@ -146,18 +146,21 @@ uint8_t QueryDeviceInformation(uint8_t handle, DeviceInformationCallback cb, voi
/**
* Callback function for receiving point cloud data.
* @param handle device handle.
* @param data device's data.
* @param data_num number of points in data.
* @param handle device handle.
* @param data device's data.
* @param data_num number of points in data.
* @param client_data user data associated with the command.
*/
typedef void (*DataCallback)(uint8_t handle, LivoxEthPacket *data, uint32_t data_num);
typedef void (*DataCallback)(uint8_t handle, LivoxEthPacket *data, uint32_t data_num, void *client_data);
/**
* Set the callback to receive point cloud data. Only one callback is supported for a specific device. Set the point
* cloud data callback before beginning sampling.
* @param handle device handle.
* @param cb callback to receive point cloud data.
* @param client_data user data associated with the command.
*/
void SetDataCallback(uint8_t handle, DataCallback cb);
void SetDataCallback(uint8_t handle, DataCallback cb, void *client_data);
/**
* Function type of callback with 1 byte of response.
@@ -371,16 +374,11 @@ typedef void (*HubGetExtrinsicParameterCallback)(uint8_t status,
/**
* Get extrinsic parameters of LiDAR units connected to the Livox Hub.
* @param req the LiDAR units broadcast code list.
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
*/
uint8_t HubGetExtrinsicParameter(HubGetExtrinsicParameterRequest *req,
uint16_t length,
HubGetExtrinsicParameterCallback cb,
void *client_data);
uint8_t HubGetExtrinsicParameter(HubGetExtrinsicParameterCallback cb, void *client_data);
/**
* Turn on or off the calculation of extrinsic parameters.
@@ -418,6 +416,24 @@ uint8_t HubRainFogSuppress(HubRainFogSuppressRequest *req,
HubRainFogSuppressCallback cb,
void *client_data);
/**
* @c HubQuerySlotPowerStatus response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus 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(*HubQuerySlotPowerStatusCallback)(uint8_t status, uint8_t handle, HubQuerySlotPowerStatusResponse *response, void *client_data);
/**
* Get the power supply state of each hub slot.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
*/
uint8_t HubQuerySlotPowerStatus(HubQuerySlotPowerStatusCallback cb, void *client_data);
/**
* Start LiDAR sampling.
* @param handle device handle.