ParamServer

class mavsdk.param_server.AllParams(int_params, float_params, custom_params)

Bases: object

Type collecting all integer, float, and custom parameters.

Parameters:
  • int_params ([IntParam]) – Collection of all parameter names and values of type int

  • float_params ([FloatParam]) – Collection of all parameter names and values of type float

  • custom_params ([CustomParam]) – Collection of all parameter names and values of type custom

class mavsdk.param_server.CustomParam(name, value)

Bases: object

Type for float parameters.

Parameters:
  • name (std::string) – Name of the parameter

  • value (std::string) – Value of the parameter

class mavsdk.param_server.FloatParam(name, value)

Bases: object

Type for float parameters.

Parameters:
  • name (std::string) – Name of the parameter

  • value (float) – Value of the parameter

class mavsdk.param_server.IntParam(name, value)

Bases: object

Type for integer parameters.

Parameters:
  • name (std::string) – Name of the parameter

  • value (int32_t) – Value of the parameter

class mavsdk.param_server.ParamServer(async_plugin_manager)

Bases: AsyncBase

Provide raw access to retrieve and provide server parameters.

Generated by dcsdkgen - MAVSDK ParamServer API

async changed_param_custom()

Subscribe to changed custom param.

Yields:

param (CustomParam) – Param that changed

async changed_param_float()

Subscribe to changed float param.

Yields:

param (FloatParam) – Param that changed

async changed_param_int()

Subscribe to changed int param.

Yields:

param (IntParam) – Param that changed

name = 'ParamServer'
async provide_param_custom(name, value)

Provide a custom parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:
  • name (std::string) – Name of the parameter to provide

  • value (std::string) – Value the parameter should be set to

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

async provide_param_float(name, value)

Provide a float parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:
  • name (std::string) – Name of the parameter to provide

  • value (float) – Value the parameter should be set to

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

async provide_param_int(name, value)

Provide an int parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:
  • name (std::string) – Name of the parameter to provide

  • value (int32_t) – Value the parameter should be set to

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

async retrieve_all_params()

Retrieve all parameters.

Returns:

params – Collection of all parameters

Return type:

AllParams

async retrieve_param_custom(name)

Retrieve a custom parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:

name (std::string) – Name of the parameter

Returns:

value – Value of the requested parameter

Return type:

std::string

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

async retrieve_param_float(name)

Retrieve a float parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:

name (std::string) – Name of the parameter

Returns:

value – Value of the requested parameter

Return type:

float

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

async retrieve_param_int(name)

Retrieve an int parameter.

If the type is wrong, the result will be WRONG_TYPE.

Parameters:

name (std::string) – Name of the parameter

Returns:

value – Value of the requested parameter

Return type:

int32_t

Raises:

ParamServerError – If the request fails. The error contains the reason for the failure.

exception mavsdk.param_server.ParamServerError(result, origin, *params)

Bases: Exception

Raised when a ParamServerResult is a fail code

class mavsdk.param_server.ParamServerResult(result, result_str)

Bases: object

Result type.

Parameters:
  • result (Result) – Result enum value

  • result_str (std::string) – Human-readable English string describing the result

class Result(value)

Bases: Enum

Possible results returned for param requests.

Values

UNKNOWN

Unknown result

SUCCESS

Request succeeded

NOT_FOUND

Not Found

WRONG_TYPE

Wrong type

PARAM_NAME_TOO_LONG

Parameter name too long (> 16)

NO_SYSTEM

No system available

PARAM_VALUE_TOO_LONG

Parameter name too long (> 128)

NOT_FOUND = 2
NO_SYSTEM = 5
PARAM_NAME_TOO_LONG = 4
PARAM_VALUE_TOO_LONG = 6
SUCCESS = 1
UNKNOWN = 0
WRONG_TYPE = 3