![]() |
Xavia SDK c++ API 2.1.0
API description of the xavia library
|
Version: 2.0 Date: 24/12/2025
Contents:
The Xavia SDK is a C++ library to interact with the Xavia sensor. The SDK provides a set of objects that allow developers to easily integrate these sensors into their applications.
With this SDK you will be able to:
Main features:
Since a picture is worth more than 1000 words, here is a basic point cloud recorder that shows how to use the Xavia SDK:
This example shows the usage of the Sensor object to operate the status of the sensor during its lifetime. In this example only the Start and Stop functions are used, but you can use it to query different properties of the sensor.
The SensorFactory object is there to do the configuration before connecting to the sensor. In this example we only attached a point cloud callback function to handle the incoming data (which in this case we wrote as a lambda function). This callback will take the point cloud object, ask it to Serialize itself, and then writes those bytes to a file. Later, we could use the IPointCloud::Deserialize() method to read the point cloud from the buffers in the file and process them.
In a real time application, you would instead keep using the xavia::sdk::IPointCloud object to extract e.g. the measured distance or the xyz coordinates of the point cloud.
The SensorFactory::Build() function is overloaded to take several arguments that allow you to indicate which sensor you want to connect to. In this way, it is possible to configure the factory once and then use it to build multiple sensor objects, each connected to a different lidar in your network. In line with modern c++, this build method returns objects of type std::unique_ptr<xavia::sdk::isensor>, meaning that you will take full control over the lifetime of the sensor object. Proper RAII implementations will ensure that the sensor object is properly destroyed when it goes out of scope.
This example is a minimal software to record data. In a production environment you should add more robustness by also handling errors (which are all passed as std::exception derivatives).
Through the SDK, the following point cloud information is available:
This information is provided in a vectorized format per topic, grouped per row. This information is transmitted row per row at the measurement frequency, which is around 1120Hz.
Besides the point cloud data itself, every line is accompanied by 'metadata'. This includes:
Furthermore, the sensor includes an onboard IMU. In future releases this information will also become available:
The SDK is written in C++17 and compiled using MSVC143 and G++ 9.3.0. The target platforms are:
The SDK is supplied in the form of a precompiled library (.dll and .lib, or .a and .so files), together with the necessary header and documentation files. It is compatible with cmake.