Param¶
- class mavsdk.param.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.CustomParam(name, value)¶
Bases:
object
Type for custom parameters
- Parameters:
name (std::string) – Name of the parameter
value (std::string) – Value of the parameter (max len 128 bytes)
- class mavsdk.param.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.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.Param(async_plugin_manager)¶
Bases:
AsyncBase
Provide raw access to get and set parameters.
Generated by dcsdkgen - MAVSDK Param API
- async get_all_params()¶
Get all parameters.
- Returns:
params – Collection of all parameters
- Return type:
- async get_param_custom(name)¶
Get 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:
ParamError – If the request fails. The error contains the reason for the failure.
- async get_param_float(name)¶
Get 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:
ParamError – If the request fails. The error contains the reason for the failure.
- async get_param_int(name)¶
Get 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:
ParamError – If the request fails. The error contains the reason for the failure.
- name = 'Param'¶
- async select_component(component_id, protocol_version)¶
Select component ID of parameter component to talk to and param protocol version.
Default is the autopilot component (1), and Version (0).
- Parameters:
component_id (int32_t) – MAVLink component Id of component to select
protocol_version (ProtocolVersion) – Protocol version
- Raises:
ParamError – If the request fails. The error contains the reason for the failure.
- async set_param_custom(name, value)¶
Set a custom parameter.
If the type is wrong, the result will be WRONG_TYPE.
- Parameters:
name (std::string) – Name of the parameter to set
value (std::string) – Value the parameter should be set to
- Raises:
ParamError – If the request fails. The error contains the reason for the failure.
- async set_param_float(name, value)¶
Set a float parameter.
If the type is wrong, the result will be WRONG_TYPE.
- Parameters:
name (std::string) – Name of the parameter to set
value (float) – Value the parameter should be set to
- Raises:
ParamError – If the request fails. The error contains the reason for the failure.
- async set_param_int(name, value)¶
Set an int parameter.
If the type is wrong, the result will be WRONG_TYPE.
- Parameters:
name (std::string) – Name of the parameter to set
value (int32_t) – Value the parameter should be set to
- Raises:
ParamError – If the request fails. The error contains the reason for the failure.
- exception mavsdk.param.ParamError(result, origin, *params)¶
Bases:
Exception
Raised when a ParamResult is a fail code
- class mavsdk.param.ParamResult(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
- TIMEOUT
Request timed out
- CONNECTION_ERROR
Connection error
- WRONG_TYPE
Wrong type
- PARAM_NAME_TOO_LONG
Parameter name too long (> 16)
- NO_SYSTEM
No system connected
- PARAM_VALUE_TOO_LONG
Param value too long (> 128)
- FAILED
Operation failed.
- CONNECTION_ERROR = 3¶
- FAILED = 8¶
- NO_SYSTEM = 6¶
- PARAM_NAME_TOO_LONG = 5¶
- PARAM_VALUE_TOO_LONG = 7¶
- SUCCESS = 1¶
- TIMEOUT = 2¶
- UNKNOWN = 0¶
- WRONG_TYPE = 4¶