RDI API Reference
RDI (Raptor Drone Integration) API
Macros
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| rdi_result_t | General plugin function result |
| 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 | Type of sensor image |
| rdi_lens_model_t | Lens model types |
| rdi_lq_t | Link quality (LQ) |
| rdi_position_s | Position information |
| rdi_orientation_s | Orientation information |
| rdi_image_s | Image used for a frame. |
| rdi_lens_s | Lens parameters with model-specific parameters |
| rdi_frame_s | Frame containing image and metadata Allocate a frame using the alloc() function. |
| rdi_context_s | Context for the current stream const char* is pointer to null-terminated UTF-8 string. |
| rdi_func_s | RDI functions |
| rdi_plugin_decl_s | RDI declaration |
Type Aliases
| Name | Description |
|---|---|
| rdi_plugin_func_t | Function signature |
Functions
| Name | Description |
|---|---|
| rdi_get_plugin_decl | Get 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
| Name | Description |
|---|---|
| lat_deg | Latitude in degrees (WGS84) |
| lon_deg | Longitude in degrees (WGS84) |
| alt_m | Altitude 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
| Name | Description |
|---|---|
| yaw_deg | Yaw angle in degrees (0 = north, 90 = east) |
| pitch_deg | Pitch angle in degrees (positive = up) |
| roll_deg | Roll 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
| Name | Description |
|---|---|
| format | [const] Image format |
| width | [const] Image width in pixels |
| height | [const] Image height in pixels |
| stride | [const] Bytes per row |
| type | Image type |
| buffer | Image 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
| Name | Description |
|---|---|
| model | Lens model |
| width | [const] Image width in pixels |
| height | [const] Image height in pixels |
| pinhole | Pinhole lens parameters |
| distored | Distorted lens parameters |
| fisheye | Fisheye 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
| Name | Description |
|---|---|
| timestamp_us | Capture timestamp in microseconds |
| frame_number | Should be increasing per frame in a stream |
| lens | Lens models with parameters |
| image | Image data |
| position | Position information |
| orientation | Orientation 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
| Name | Description |
|---|---|
| userdata | Pointer to userdata (optional). |
| identifier | Used to identify a specific stream. |
| filepath | Absolute file path on file system. |
| url | Complete URL, see below for broken into parts. |
| url_scheme | URL scheme |
| url_username | URL username |
| url_password | URL password |
| url_hostname | URL hostname |
| url_port | Port extracted from the url, or 0 if not specified (no default port by scheme). |
| url_path | URL path |
| url_query | URL query (Percent-encoded) |
| url_fragment | URL 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
| Name | Description |
|---|---|
| frame_alloc | |
| frame_submit | |
| frame_drop | |
| parse_iso_time_us | Parse time into microseconds (UTC) from ISO8601 time. Returns -1 on error. |
| current_time_us | Get 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
| Name | Description |
|---|---|
| api_version | API version |
| init | Init function |
| run | Run function |
| shutdown | Shutdown function |
| name | Plugin name |
| version | Plugin version |
| description | Plugin description |
| config | Pointer 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).