Skip to main content

RDI API Reference

RDI (Raptor Drone Integration) API

Macros

NameDescription
RDI_PLUGIN_EXPORT
RDI_API_VERSION

Macro Details

RDI_PLUGIN_EXPORT

#define RDI_PLUGIN_EXPORT __attribute__((visibility("default")))

RDI_API_VERSION

#define RDI_API_VERSION (1000)

Types

NameDescription
rdi_result_tGeneral plugin function result
rdi_image_format_tType of image format Note: Images are expected to be in non-linear color space (gamma-encoded)
rdi_image_type_tType of sensor image
rdi_lens_model_tLens model types
rdi_lq_tLink quality (LQ)
rdi_position_sPosition information
rdi_orientation_sOrientation information
rdi_image_sImage used for a frame.
rdi_lens_sLens parameters with model-specific parameters
rdi_frame_sFrame containing image and metadata Allocate a frame using the alloc() function.
rdi_context_sContext for the current stream const char* is pointer to null-terminated UTF-8 string.
rdi_func_sRDI functions
rdi_plugin_decl_sRDI declaration

Type Aliases

NameDescription
rdi_plugin_func_tFunction signature

Functions

NameDescription
rdi_get_plugin_declGet the declaration of the RDI plugin (return static data).

rdi_result_t

enum rdi_result_t

General plugin function result

RDI_RESULT_OK

RDI_RESULT_STREAM_COMPLETED : Clean end of stream (e.g., EOF for file, graceful RTSP close)

RDI_RESULT_ERROR

RDI_RESULT_ERROR_STREAM_DISRUPTED : Stream broken/disconnected (e.g., network error, connection lost)


rdi_image_format_t

enum rdi_image_format_t

Type of image format

Note: Images are expected to be in non-linear color space (gamma-encoded)


rdi_image_type_t

enum rdi_image_type_t

Type of sensor image


rdi_lens_model_t

enum rdi_lens_model_t

Lens model types


rdi_lq_t

enum rdi_lq_t

Link quality (LQ)


rdi_position_s

struct rdi_position_s

Position information

Variables

NameDescription
lat_degLatitude in degrees (WGS84)
lon_degLongitude in degrees (WGS84)
alt_mAltitude in meters (above sea level)

Variable Details

alt_m

double alt_m

Altitude in meters (above sea level)

lat_deg

double lat_deg

Latitude in degrees (WGS84)

lon_deg

double lon_deg

Longitude in degrees (WGS84)


rdi_orientation_s

struct rdi_orientation_s

Orientation information

Variables

NameDescription
yaw_degYaw angle in degrees (0 = north, 90 = east)
pitch_degPitch angle in degrees (positive = up)
roll_degRoll angle in degrees (positive = right)

Variable Details

pitch_deg

double pitch_deg

Pitch angle in degrees (positive = up)

roll_deg

double roll_deg

Roll angle in degrees (positive = right)

yaw_deg

double yaw_deg

Yaw angle in degrees (0 = north, 90 = east)


rdi_image_s

struct rdi_image_s

Image used for a frame.

Allocating a frame, using rdi_frame_alloc(), will also allocate and initialize the image data buffer.

Variables

NameDescription
format[const] Image format
width[const] Image width in pixels
height[const] Image height in pixels
stride[const] Bytes per row
typeImage type
bufferImage data buffer

Variable Details

buffer

void* buffer

Image data buffer

format

rdi_image_format_t format

[const] Image format

height

uint32_t height

[const] Image height in pixels

stride

uint32_t stride

[const] Bytes per row

type

rdi_image_type_t type

Image type

width

uint32_t width

[const] Image width in pixels


rdi_lens_s

struct rdi_lens_s

Lens parameters with model-specific parameters

Variables

NameDescription
modelLens model
width[const] Image width in pixels
height[const] Image height in pixels
pinholePinhole lens parameters
distoredDistorted lens parameters
fisheyeFisheye lens parameters

Variable Details

distored

rdi_lens_param_distored_t distored

Distorted lens parameters

fisheye

rdi_lens_param_fisheye_t fisheye

Fisheye lens parameters

height

uint32_t height

[const] Image height in pixels

model

rdi_lens_model_t model

Lens model

pinhole

rdi_lens_param_pinhole_t pinhole

Pinhole lens parameters

width

uint32_t width

[const] Image width in pixels


rdi_frame_s

struct rdi_frame_s

Frame containing image and metadata

Allocate a frame using the alloc() function.

Variables

NameDescription
timestamp_usCapture timestamp in microseconds
frame_numberShould be increasing per frame in a stream
lensLens models with parameters
imageImage data
positionPosition information
orientationOrientation information

Variable Details

frame_number

uint64_t frame_number

Should be increasing per frame in a stream

image

rdi_image_t image

Image data

lens

rdi_lens_t lens

Lens models with parameters

orientation

rdi_orientation_t orientation

Orientation information

position

rdi_position_t position

Position information

timestamp_us

int64_t timestamp_us

Capture timestamp in microseconds


rdi_context_s

struct rdi_context_s

Context for the current stream

const char* is pointer to null-terminated UTF-8 string. The pointer might be NULL.

Variables

NameDescription
userdataPointer to userdata (optional).
identifierUsed to identify a specific stream.
filepathAbsolute file path on file system.
urlComplete URL, see below for broken into parts.
url_schemeURL scheme
url_usernameURL username
url_passwordURL password
url_hostnameURL hostname
url_portPort extracted from the url, or 0 if not specified (no default port by scheme).
url_pathURL path
url_queryURL query (Percent-encoded)
url_fragmentURL fragment

Variable Details

filepath

const char* filepath

Absolute file path on file system. NULL if not used.

identifier

const char* identifier

Used to identify a specific stream. Empty string if not used.

url

const char* url

Complete URL, see below for broken into parts. file:// will be treated as a URL.

url_fragment

const char* url_fragment

URL fragment

url_hostname

const char* url_hostname

URL hostname

url_password

const char* url_password

URL password

url_path

const char* url_path

URL path

url_port

unsigned int url_port

Port extracted from the url, or 0 if not specified (no default port by scheme).

url_query

const char* url_query

URL query (Percent-encoded)

url_scheme

const char* url_scheme

URL scheme

url_username

const char* url_username

URL username

userdata

void* userdata

Pointer to userdata (optional). Handled freely by plugin.


rdi_func_s

struct rdi_func_s

RDI functions

Variables

NameDescription
frame_alloc
frame_submit
frame_drop
parse_iso_time_usParse time into microseconds (UTC) from ISO8601 time. Returns -1 on error.
current_time_usGet current time in microseconds (UTC).

Variable Details

frame_alloc

rdi_frame_t* (*frame_alloc)(rdi_context_t* context, rdi_image_format_t format, uint32_t width, uint32_t height)

frame_submit

void (*frame_submit)(rdi_context_t* context, rdi_frame_t* frame, const char* stream_id)

frame_drop

void (*frame_drop)(rdi_context_t* context, rdi_frame_t* frame, const char* stream_id, const char* reason)

parse_iso_time_us

int64_t (*parse_iso_time_us)(const char* time_str)

Parse time into microseconds (UTC) from ISO8601 time. Returns -1 on error.

current_time_us

int64_t (*current_time_us)()

Get current time in microseconds (UTC).


rdi_plugin_func_t

typedef rdi_result_t (*rdi_plugin_func_t)(rdi_func_t*, rdi_context_t*)

Function signature


rdi_plugin_decl_s

struct rdi_plugin_decl_s

RDI declaration

Variables

NameDescription
api_versionAPI version
initInit function
runRun function
shutdownShutdown function
namePlugin name
versionPlugin version
descriptionPlugin description
configPointer to null-terminated UTF-8 string containing a JSON document

Variable Details

api_version

unsigned int api_version

API version

config

const char* config

Pointer to null-terminated UTF-8 string containing a JSON document

description

const char* description

Plugin description

init

rdi_plugin_func_t init

Init function

name

const char* name

Plugin name

run

rdi_plugin_func_t run

Run function

shutdown

rdi_plugin_func_t shutdown

Shutdown function

version

const char* version

Plugin version


rdi_get_plugin_decl

function

RDI_PLUGIN_EXPORT const rdi_plugin_decl_t* rdi_get_plugin_decl(void);

Get the declaration of the RDI plugin (return static data).