Skip to Content
Developer guide for

FJD Trion SLAM SDK

Quick Start
Public Methods
Usage Example
Precautions

Overview

SLAM SDK is a C++ library for communicating with S2/P2/P1 devices, providing functions such as device discovery, map scanning, and data downloading.

Namespace

namespace fjminislam

Constant Definition

Port Configuration 

Constant nameValueDescription
BROADCAST_PORT29527Device broadcast port
PORT9090Device communication ports

Download Data Type Enumeration

enum DownloadDataType
{
    FJDSLAM = 1,   // FJDSLAM format data
    PLY     = 2,   // PLY format point cloud data
    PTS     = 3,   // PTS format point cloud data
    LAS     = 5,   // LAS format point cloud data
    FJDRTK  = 6,   // FJDRTK format data
    RTCM    = 9,   // RTCM format data
    INSV    = 99,  // INSV format data
};

Device Structure

struct Device{std::string serialno; // Device serial numberstd::string ip; // Device IP addressstd::string fwversion; // Firmware version};

SDK Class

Constructor and Destructor Function

SDK(); // Default constructor
~SDK(); // Destructor

Public Member Variable

std::vector<fjminislam::Device> device_list; // Device list

get_available_devices 

std::vector<fjminislam::Device> get_available_devices(int search_time=3);

Function: Search for available devices

Parameter

search_time

Search duration, unit: seconds, default: 3 seconds

Return value : Device list 

get_maplist 

json get_maplist(); 

Function: Get map list information

Return Value : Map information in JSON format, containing the following fields: 

Field nameTypeDescription
resultboolRequest result, true indicates success
values.has_cameraarray<int>With or without a camera, 1 means yes and 0 means no
values.maplistarray<string>List of map names
values.match_statusarray<int>Whether to continue scanning at a breakpoint, 1 means yes, 0 means no
values.rtk_locked_percentarray<int>RTK lock percentage
values.slam_dis_in_marray<int>Mission mileage, unit meters
values.task_time_in_secarray<int>Task time, in seconds
values.vec_data_types_for_downloadarray<int>Downloadable data type, 1 indicates existence

start_map 

json start_map(std::string mapname="");

Function: Start scanning task

Parameter

mapname

Custom map name, optional

Return value : The startup result in JSON format, containing the following fields: 

Field nameTypeDescription
resultboolRequest result, true indicates success
values.statusintTask status:
0 - Mission aborted
1 - Normal status
-1 - Initialization failed
-2 - Busy equipment
-4 - Task processing
-6 - Insta camera storage is insufficient

stop_map 

json stop_map();

Function: Stop scanning task

Return value : Stop result in JSON format, containing the following fields: 

Field nameTypeDescription
resultboolRequest result, true indicates success
values.messagestringMessage description
values.successboolWhether the stop was successful

check_device_task 

json check_device_task(bool force_check=true); 

Function: Obtain or execute device self-check

Parameter

force_check

Whether to enforce self-check, true indicates only obtaining the result, false indicates performing self-check

Return Value: Self-check result in JSON format, containing the following fields:

Field nameTypeDescription
resultboolRequest result, true indicates success
values.statusintDevice Status:
7 - All devices are fine
5 - LiDAR anomalies

download_map_data 

bool download_map_data(std::string mapname, fjminislam::DownloadDataType type, std::string save_path);

Function: Download scan data

Parameters

mapname
  • Map Name
type
  • Download data type, see enumeration:
DownloadDataType
save_path 
  • Data save path, e.g.: 
/tmp/

Return value : true indicates successful download, false indicates failed download 

time_syn 

json time_syn();

Function: Synchronize time to scanner

Return Value : Time synchronization result in JSON format, containing the following fields: 

Field nameTypeDescription
resultboolRequest result, true indicates success
values.left_timeintTime remaining
values.statusboolSynchronization status, true indicates success

check_scanner_connection 

bool check_scanner_connection();

Function: Check the scanner connection status

Return Value : true indicates normal connection, false indicates abnormal connection 

connect_device 

bool connect_device(fjminislam::Device device); 

Function: Connect to the specified device

Parameter

device

 Information of the device to be connected

Return value : true indicates successful connection, false indicates connection failure 

get_current_name 

std::string get_current_name();

Function: Get the name of the currently connected device

Return Value : Device Name 

get_version 

std::string get_version();

Function: Get SDK Version

Return Value : SDK Version Number 


Basic Usage Process 

#include "fjminislam_sdk.h"

int main() {
    fjminislam::SDK sdk = fjminislam::SDK();
    sdk.get_version();
    fjminislam::Device selected_scanner;
    std::vector<fjminislam::Device> devices_list = sdk.get_available_devices();
    if (devices_list.size() == 0) {
        printf("no scanner found\n");
        return 1;
    }
    selected_scanner = devices_list[0];
    printf("selectd device,serialno:%s ip:%s\n",selected_scanner.serialno.c_str(), selected_scanner.ip.c_str());

    std::string sdk_version = sdk.get_version();
    printf("sdk_version: %s\n", sdk_version.c_str());

    if (!sdk.connect_device(selected_scanner)) {
        printf("connect_device failed\n",);
        return 2;
    }

    if (!sdk.check_scanner_connection()) {
        printf("check_scanner_connection failed\n");
        return 3;
    }

    json time_syn_result = sdk.time_syn();
    printf("time_syn response: %s\n", time_syn_result.dump().c_str());

    json start_map_result = sdk.start_map("test1");
    printf("start_map response: %s\n", start_map_result.dump().c_str());
    
#ifdef _WIN32
    Sleep(30);
#else
    sleep(30);
#endif
    std::string cur_name = sdk.get_current_name();
    printf("cur_name: %s\n", cur_name.c_str());

    json stop_map_result = sdk.stop_map();
    printf("stop_map response: %s\n", stop_map_result.dump().c_str());

    json get_maplist_result = sdk.get_maplist();
    printf("get_maplist response: %s\n", get_maplist_result.dump().c_str());

    bool download_result = sdk.download_map_data(cur_name, fjminislam::DownloadDataType::LAS, "./");
    printf("download_map_data response: %d\n", download_result);
    return 0;
}


  1. Before using the SDK, please ensure that the device is properly connected to the network 

  2. Please keep the device stable during the scanning process and avoid sudden movements

  3. Please ensure there is sufficient space in the storage path when downloading data

  4. It is recommended to check the device connection status before calling the API 


Basic Usage Process 

#include "fjminislam_sdk.h"

int main() {
    fjminislam::SDK sdk = fjminislam::SDK();
    sdk.get_version();
    fjminislam::Device selected_scanner;
    std::vector<fjminislam::Device> devices_list = sdk.get_available_devices();
    if (devices_list.size() == 0) {
        printf("no scanner found\n");
        return 1;
    }
    selected_scanner = devices_list[0];
    printf("selectd device,serialno:%s ip:%s\n",selected_scanner.serialno.c_str(), selected_scanner.ip.c_str());

    std::string sdk_version = sdk.get_version();
    printf("sdk_version: %s\n", sdk_version.c_str());

    if (!sdk.connect_device(selected_scanner)) {
        printf("connect_device failed\n",);
        return 2;
    }

    if (!sdk.check_scanner_connection()) {
        printf("check_scanner_connection failed\n");
        return 3;
    }

    json time_syn_result = sdk.time_syn();
    printf("time_syn response: %s\n", time_syn_result.dump().c_str());

    json start_map_result = sdk.start_map("test1");
    printf("start_map response: %s\n", start_map_result.dump().c_str());
    
#ifdef _WIN32
    Sleep(30);
#else
    sleep(30);
#endif
    std::string cur_name = sdk.get_current_name();
    printf("cur_name: %s\n", cur_name.c_str());

    json stop_map_result = sdk.stop_map();
    printf("stop_map response: %s\n", stop_map_result.dump().c_str());

    json get_maplist_result = sdk.get_maplist();
    printf("get_maplist response: %s\n", get_maplist_result.dump().c_str());

    bool download_result = sdk.download_map_data(cur_name, fjminislam::DownloadDataType::LAS, "./");
    printf("download_map_data response: %d\n", download_result);
    return 0;
}

FJD Trion S1 Robot-dog Mount

Powered by a leading SLAM algorithm, the S1 builds your reality as you scan, so you don't miss any details.
Product Image

FJD Trion S1 Robot-dog Mount

Powered by a leading SLAM algorithm, the S1 builds your reality as you scan, so you don't miss any details.
Product Image

Data Structure

Device Structure

struct Device
{
std::string serialno; // Device serial number
std::string ip; // Device IP
addressstd::string fwversion; // Firmware version
};

SDK Class

Constructor

Constructor and Destructor Function

Public Member Variable

D

  1. Before using the SDK, please ensure that the device is properly connected to the network 

  2. Please keep the device stable during the scanning process and avoid sudden movements

  3. Please ensure there is sufficient space in the storage path when downloading data

  4. It is recommended to check the device connection status before calling the API 

Read More

How to Crop and Trim 3DGS Data

FJD Trion Model Features Tutorial

Read More

How to Use Auto Tree Species Identification

FJD Trion Model Features Tutorial

Read More

How to Create 3D Gaussian Splatting

FJD Trion Model Features Tutorial

Read More

How to Use the HyperDense+ Function

FJD Trion Model Features Tutorial

Read More

How to Use New Drawing Tools

FJD Trion Model Features Tutorial

Read More

How to Use Rectification Tools

FJD Trion Model Features Tutorial

Expand

FJD Trion S1 Robot-dog Mount

Powered by a leading SLAM algorithm, the S1 builds your reality as you scan, so you don't miss any details.
Product Image

FJD Trion S1 Robot-dog Mount

Powered by a leading SLAM algorithm, the S1 builds your reality as you scan, so you don't miss any details.
Product Image
FJD Trion SLAM SDK