Page 11
be referenced for migration & development of applications on other platforms.
1) SDK consists of following file or folders:
examples: examples of using SDK, including source codes and makefile;
include: header files for using SDK;
src: source codes of SDK;
makefile: compile command file for compiling SDK into shared object file (.so file) in Linux system;
README: operation instructions as well as other relevant information and instructions of SDK.
2) Globel variables in SDK:
unsigned short gRawDistMatrix[]: original data obtained from LiDAR, arranged in form of
one-dimensional array;
float gCameraMatrix[9]: internal parameters matrix of LiDAR, arranged in form of one-dimensional array
and in the sequence {f/dx, skew, u0, 0, f/dy, v0, 0, 0, 1};
float gDistCoffs[5]: distortion parameters of LiDAR, arranged in the sequence of {k1, k2, p1, p2, k3}.
3) Methods contained in SDK:
bool initDevice(int &_sd, float *_mapX, float *_mapY, int _height, int _width)
Parameter:
_sd socket handle
_mapX projection map, coordinates along x-axis
_mapY projection map, coordinates along y-axis
_height height of output depth image, should be set to 24
_width width of output depth image, should be set to 320 or 480
In this method, gCameraMatrix [9], gDistCoffs[5], mapX[], mapY[], socket and TCP/IP connection
are initialized. LiDAR is literally put into service by invoking such method. The size of projection map is
set to _height * _width, so as the output depth images' resolution.
When set _width to 320, output depth image has the same aspect ration with device's original output
but only keep a field of view of 102*9 degree; when set _width to 480, output depth image can keep the
max field of vew of 112*9 degree but the left and right edges would be a little blurred.
bool getDistanceData(int _sd, unsigned short *_dst, float *_mapX, float *_mapY, int _height, int
_width)
Parameter:
_sd socket handle
_dst data of undistorted depth image
_mapX projection map, coordinates along x-axis
_mapY projection map, coordinates along y-axis
_height the height of ROI in pixels, cannot be bigger than 24
_width the width of ROI in pixels, cannot be bigger than 480
In this method, original data from LiDAR is accessed and saved in gRawDistMatrix[]. Also the