MTILidar API Reference#

Classes#

MTILidar#

class MTILidar#

STATUS

Methods for querying Lidar device and MTILidar instance status

MTILidarError GetLastError()#
bool HasError()#
virtual ~MTILidar() = default#

CREATION AND TERMINATION

Constructor and Destructor of MTILidar instances

static MTILidar *CreateLidar(int lidarType = LIDAR_TYPE_SYMPL1)#

Create an instance of MTILidar.

static void DeleteLidar(MTILidar *lidar)#

Delete a previously instantiated instance of MTILidar.

POINT CONVERSION

Methods for converting points

static void PointsXYZtoSphere(const std::vector<PointXYZ> &pointsXYZ, std::vector<PointSphere> &pointsSphere)#

Convert vector of XYZ points into a vector of spherical points.

static void PointsSpheretoXYZ(const std::vector<PointSphere> &pointsSphere, std::vector<PointXYZ> &pointsXYZ)#

Convert vector of spherical points into a vector of XYZ points.

CONNECTION AND DISCONNECTION

Open the COM port and connect and disconnect to the Lidar device.

virtual void ConnectLidar(const std::string &portName) = 0#

Opens the COM port and connects to the addressed Lidar device.

virtual void ConnectLidar() = 0#

Opens the first available Lidar serial device and connects to it.

virtual void DisconnectLidar() = 0#

Stops communication with the Lidar and closes the COM port.

PARAMETERS

Methods for getting and setting Lidar parameters, scanning parameters, and data processing parameters

virtual LidarParameters GetLidarParameters() = 0#

Gets all LidarParameters from the Lidar device.

virtual void SetRasterParameters(const RasterParameters &rasterParameters) = 0#

Set the raster pattern variables.

virtual RasterParameters GetRasterParameters() = 0#

Get the raster pattern variables.

virtual void GenerateAndLoadRaster(const RasterParameters &rasterParameters) = 0#

Generate and load raster pattern.

virtual void GenerateAndLoadRaster() = 0#

Overload without arguments uses the raster parameters that were previously set with SetRasterParameters()

virtual void GetRasterData(std::vector<float> &xData, std::vector<float> &yData) = 0#
virtual void SetDataProcessingParameters(const DataProcessingParameters &dataProcessingParameters) = 0#

Data processing parameters are used to set the type of post-processing done on the point cloud Post-processing will be automatically done on all incoming data from the Lidar device according to the parameters set by this command.

virtual DataProcessingParameters GetDataProcessingParameters() = 0#

Returns the DataProcessingParameters that are being used to process incoming data from the Lidar device

OPERATION

Methods involved in operating the Lidar device

virtual void StartLidar() = 0#

Start the operation of the Lidar device.

virtual void StopLidar() = 0#

Stop the operation of the Lidar device.

virtual void GetFrame(std::vector<PointXYZ> &pointsXYZ, int timeoutMs) = 0#

Gets the most recent frame of 3D points that was scanned and returns the frame as described in Cartesian coordinates. See: PointXYZ If timoutMs=0, immediately returns if data is not available.

virtual void GetFrame(std::vector<PointSphere> &pointsSphere, int timeoutMs) = 0#

Gets the most recent frame of 3D points that was scanned and returns the frame as described in spherical coordinates. See: PointSphere If timoutMs=0, immediately returns if data is not available.

POINT AND RANGE

Methods for pointing and ranging

virtual void GoToPosition(float x, float y) = 0#

Direct the Lidar to point to a coordinate in X/Y format.

virtual float GetDistance() = 0#

Used in concert with GoToPosition Returns a distance for the Lidar’s current positional displacement

Structs#

DataProcessingParameters#

struct DataProcessingParameters#

Parameters used by ProcessData.

Public Members

OutlierHandling outlierHandling = OutlierHandling::INTERPOLATE#
bool smoothingFilterEnabled = true#
int smoothingFilterBandwidthHz = 3000#
bool integrationEnabled = false#
float integrationFactor = 0.7f#
bool cropDataEnabled = true#
float cropDataRangeMin = 0.0f#
float cropDataRangeMax = 0.0f#
int dataAlignmentAdjustment = 0#
bool removeRetraceData = 0#

LidarParameters#

struct LidarParameters#

Read-only parameters returned by querying the Lidar device.

Public Members

std::string lidarName#
std::string firmwareName#
float axisAngleMax#
int rangeLimit#
int sampleRate#
bool lidarOrientationPortrait#

PointSphere#

struct PointSphere#

A point in 3D space, described in a spherical coordinate system More information: https://en.wikipedia.org/wiki/Spherical_coordinate_system

Public Members

float radius#
float azimuth#
float elevation#

PointXYZ#

struct PointXYZ#

A point in 3D space, described in Cartesian coordinates.

Public Members

float x#
float y#
float z#

RasterParameters#

struct RasterParameters#

Parameters to be used in the construction of a raster scanning pattern.

Public Members

int numLines = 20#
float lineDuration = 0.01f#
float xAmplitude = 1.0f#
float yAmplitude = 1.0f#
float xOffset = 0.0f#
float yOffset = 0.0f#
FastAxisType fastAxis = FastAxisType::SINUSOIDAL#

Enums#

FastAxisType#

enum class mtilidar::FastAxisType#

Describes the type of waveform to be used for the generated scan pattern’s “fast axis”.

Values:

enumerator SINUSOIDAL#
enumerator TRIANGULAR#

LidarTypes#

enumerator LIDAR_TYPE_STUB#
enumerator LIDAR_TYPE_SYMPL1#