Vehicle Lidar Calibration API

Introduction

The API requires the client to upload the PCD, and configuration for vehicle lidar setup in a zip file (.zip extension) in the format defined below. The contents of the zip file are called a dataset.

  1. The client makes an Upload and calibrate API call, which uploads their files and runs the calibration algorithm on the lidar files for the given configuration.

  2. The calibration process is completed without errors if the Upload and calibrate API call response contains dataset_id, extrinsic_parameters, and error_stats.

  3. The client can call the Get Extrinsic Parameters API using the dataset_id obtained from the Upload and calibrate API. This API responds with dataset_id, extrinsic_parameters, and error_stats.

Folder Structure

We require lidar frames for a given calibration.

  1. Place the Lidar data captured from the LiDAR in a folder.

  2. config.json contains configuration details of the calibration (intrinsic parameters, calibration name, etc.)

Note: Folder structure is optional. Users can place all files in the main directory and zip it.

Note

  1. The names of the folders and the lidar files shown here are for demonstration purposes. Users should avoid using space in the folder and the lidar filename.

  2. The name of the JSON file should be config.json (case sensitive)

config.json for multitarget

{
    "calibration_name": "Lidar vehicle testing ",
    "calibration_type": "lidar_vehicle_calibration",
    "calibration_group_id": "xxxxxxxxxxxxxxxxxx",
    "is_lidar_tilted": false,
    "lidar_ground_height": 1.24,
    "vehicle_configuration":
    {
        "vehicle_shape": "rectangle",
        "wheelbase": 1.2,
        "track": 1.2,
        "front_wheel_overhang": 0,
        "rear_wheel_overhang": 0
    },
    "is_targetless_3d_lidar": false,
    "is_2d_lidar": false,
    "auto_detect_lidar_board": true,
    "multi_target": true,
    "targets":
    {
        "left":
        {
            "length": 1.2,
            "width": 1.8
        },
        "right":
        {
            "length": 1.2,
            "width": 1.8
        },
        "front":
        {
            "length": 1.2,
            "width": 1.8
        }
    },
    "use_bounding_box_on_board_detection_failure": false,
    "bounding_box":
    {
        "left":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        },
        "right":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        },
        "front":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        }
    },
    "all_lidar_data":
    [
        {
            "lidar_name": "Main Lidar",
            "laser_channels": 16,
            "lidar_type": "directional",
            "lidar_fov_direction": "front",
            "board_configuration_data":
            {
                "front_board_distance": 1.8,
                "left_board_distance": 0.6,
                "right_board_distance": 0.6
            }
        }
    ],
    "data":
    {
        "files":
        {
            "file": "lidar/lidardata.pcd"
        }
    }
}

Sample config.json

config.json for a Single target

{
    "calibration_name": "Lidar vehicle testing ",
    "calibration_type": "lidar_vehicle_calibration",
    "calibration_group_id": "xxxxxxxxxxxxxxxxxx",
    "vehicle_configuration":
    {
        "vehicle_shape": "rectangle",
        "wheelbase": 1.2,
        "track": 1.2,
        "front_wheel_overhang": 0.9,
        "rear_wheel_overhang": 0.86
    },
    "is_targetless_3d_lidar": false,
    "is_2d_lidar": false,
    "auto_detect_lidar_board": true,
    "multi_target": false,
    "is_lidar_tilted": false,
    "lidar_ground_height": 1.24,
    "targets":
    {
        "left":
        {
            "length": 1,
            "width": 0.6
        },
        "right":
        {
            "length": 1,
            "width": 0.6
        },
        "front":
        {
            "length": 1,
            "width": 0.6
        }
    },
    "use_bounding_box_on_board_detection_failure": false,
    "bounding_box":
    {
        "left":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        },
        "right":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        },
        "front":
        {
            "xmin": 1,
            "xmax": 1,
            "ymin": 1,
            "ymax": 1,
            "zmin": 1,
            "zmax": 1
        }
    },
    "all_lidar_data":
    [
        {
            "lidar_name": "Main Lidar",
            "lidar_config": 16,
            "lidar_type": "directional",
            "lidar_fov_direction": "front",
            "board_configuration_data":
            {
                "front_board_distance": 0.5,
                "left_board_distance": 0.5,
                "right_board_distance": 0.5
            }
        }
    ],
    "data":
    {
        "files":
        {
            "left": "lidar/left_0.5.pcd",
            "right": "lidar/right_0.5.pcd",
            "front": "lidar/front_0.5.pcd"
        }
    }
}

Sample config.json

config.json key description

KeyTypeDescription

calibration_name

string

Name of the calibration

calibration_type

string

Non-editable field.*Value should be lidar_vehicle_calibration

calibration_group_id

string

This is an optional key. Provide valid calibration_group_id to add the dataset to calibration group.

multi_target

boolean

true: if multiple targets are used false: if single target is used

lidar_name

string

It is the name given by the client to the lidar. The client can modify it as willed.

targets

Object

It is a dictionary of dictionary with each dictionary having target properties. Accepted keys are 1. left 2. right 3. front 4. rear

length

double

length of the board of the target in meters

width

double

width of the board of the target in meters

tilted

Boolean

true: if the board is tilted false: if the board is not tilted

data

Object

It stores the data related to files of the lidar

files

Object

It is an Object, where each key is a string which is "file" in case of multi-target and "left", "right", "front" or "rear" containing the path to the file.

wheelbase

double

The length from the mid of the rear wheel to the mid of the front wheel on the same side

track

double

The length from the right mid of the wheel in front of vehicle to left mid of the wheel in front of the vehicle or The length from the right mid of the wheel in rear of vehicle to left mid of the wheel in rear of the vehicle

vehicle_configuration

Object

Object which has all the measurements 1. vehicle_shape 2. wheelbase 3. track 4. front_wheel_overhang 5. rear_wheel_overhang

vehicle_shape

string

rectangle or trapezoid based on the shape of the vehicle

breadth

double

breadth of the board of the target in meters

front_wheel_overhang

double

Overhang from the middle of the front wheels to the front end part of the vehicle in meters

rear_wheel_overhang

double

Overhang from the middle of the rear wheels to the rear end part of the vehicle in meters

is_targetless_3d_lidar

boolean

true if the calibration is targetless false for target-based calibration

is_2d_lidar

boolean

true if the calibration is 2d- lidar false if the calibration is 3d-lidar

auto_detect_lidar_board

boolean

true for auto detecting the board in the point cloud false otherwise In most cases when using api it is true other than if bounding box is provided

use_bounding_box_on_board_detection_failure

boolean

true if bounding box should be used when detection fails

bounding_box

Object of Objects

This is an object of objects with key corresponding to the target whose details are provided. Need to be provided if we want to use bounding box forboard detection The keys which gives the bounding box for a target 1. xmin 2. xmax 3. ymin 4. ymax 5. zmin 6. zmax The key refers to the corners of minimum and maximum values in all axis to create the bounding box within which the target is identified. These values are in the lidar frame.

all_lidar_data

Object

Object with all the lidar data and board configration

lidar_type

string

directional or 360 if there are 4 boards and 3 boards respectively

laser_channels

Integer

Number of channels the lidar has.

lidar_fov_direction

string

If the lidar is directional then this defines which direction with respect to the vehicle is the lidar present. Supports

  1. front

  2. rear

  3. left

  4. right

front_board_distance

double

Distance from front direction of the car to the board

left_board_distance

double

Distance from left direction of the car to the board

right_board_distance

double

Distance from right direction of the car to the board

rear_board_distance

double

Distance from rear direction of the car to the board

target_distance

double

Approximate distance between the lidar and the centroid of the board to differentiate the boards in case more than one are of similar size. needed only of the sizes are same in multiple boards

is_lidar_tilted

Boolean

If the lidar is tilted autodetection happends else if the lidar ground heigh is given then ground is detected at that much distance from ground

lidar_ground_height

number

distance from ground to the lidar when lidar is parallel to ground

Quickstart

Before invoking the APIs, the client must obtain the clientId and auth token from Deepen AI. If you are a calibration admin, you can create different Access Tokens using the UI and use those instead. clientId is part of the path parameters in most API calls, and the auth token should be prefixed with “Bearer “ and passed to the ‘Authorization’ header in all API requests. How to get Access Tokens can be found on the following link: Access token for APIs

Upload file and calibrate

This POST api call sends a zip file to the server and runs the calibration algorithm. Returns dataset_id, extrinsic_parameters, and error_stats to the user as the response.

https://tools.calibrate.deepen.ai/api/v2/external/clients/{clientId}/calibration_dataset

Request

Path parameters

Parameter nameParameter typeDescription

clientId

string

ClientId obtained from Deepen AI

Body

KeyValueDescription

file

.zip file

Zip file containing config and pcd in a suitable format

Response

{
    "dataset_id": "XXXXXXXXXXXXXXXXX",
    "calibration_algorithm_version": "target_based:v1.01",
    "extrinsic_parameters": {
        "roll": 0.11618719284657622,
        "pitch": 16.0300957665656,
        "yaw": 0.39630825451294216,
        "px": 1.6981482368157552,
        "py": -0.16870946105733092,
        "pz": 1.411771066176465
    },
    "error_stats": {
        "distance_error": {
            "average": 0.016561422963971915,
            "front_plane": 0.005801826261770239,
            "rear_plane": null,
            "right_plane": 0.007627213567991918,
            "left_plane": 0.03803306081172632,
            "ground_plane": 0.014783591214399178
        },
        "angle_error": {
            "average": 6.645093770858262,
            "front_plane": 0.3282866337907041,
            "rear_plane": null,
            "right_plane": 0.34793152531147714,
            "left_plane": 9.873651140968278,
            "ground_plane": 16.03050578336259
        }
    }
}
KeyDescription

dataset_id

A unique value to identify the dataset. dataset_id can be used to retrieve the extrinsic parameters.

calibration_algorithm_version

The version of the algorithm used to calculate extrinsic parameters. This value can be used to map extrinsic parameters to a specific algorithm version.

extrinsic_parameters

roll, pitch, and yaw are given in degrees and px, py, and pz are given in meters.

error_stats

plane_distance_error is the mean of the distance between the plane LiDAR points to the respective planes.

Get Extrinsic Parameters

This GET api call returns dataset_id, extrinsic_parameters, and error_stats.

https://tools.calibrate.deepen.ai/api/v2/external/datasets/{datasetId}/extrinsic_parameters

Request

Path parameters

Parameter nameParameter typeDescription

datasetId

string

datasetId obtained from the response of Upload file and calibrate API.

Response

{
    "dataset_id": "XXXXXXXXXXXXXXXXX",
    "calibration_algorithm_version": "target_based:v1.01",
    "extrinsic_parameters": {
        "roll": 0.11618719284657622,
        "pitch": 16.0300957665656,
        "yaw": 0.39630825451294216,
        "px": 1.6981482368157552,
        "py": -0.16870946105733092,
        "pz": 1.411771066176465
    },
    "error_stats": {
        "distance_error": {
            "average": 0.016561422963971915,
            "front_plane": 0.005801826261770239,
            "rear_plane": null,
            "right_plane": 0.007627213567991918,
            "left_plane": 0.03803306081172632,
            "ground_plane": 0.014783591214399178
        },
        "angle_error": {
            "average": 6.645093770858262,
            "front_plane": 0.3282866337907041,
            "rear_plane": null,
            "right_plane": 0.34793152531147714,
            "left_plane": 9.873651140968278,
            "ground_plane": 16.03050578336259
        }
    }
}
KeyDescription

dataset_id

A unique value to identify the dataset. dataset_id can be used to retrieve the extrinsic parameters.

calibration_algorithm_version

The version of the algorithm used to calculate extrinsic parameters. This value can be used to map extrinsic parameters to a specific algorithm version.

extrinsic_parameters

roll, pitch, and yaw are given in degrees and px, py, and pz are given in meters.

error_stats

plane_distance_error is the mean of the distance between the plane LiDAR points to the respective planes.

Note

The setup should be so that there are no false detections, i.e., other plane surfaces of similar shape may be identified as a board, which might give false solutions. You can always check the identified boards from the web application.

Last updated