Param¶
- class mavsdk.param.AllParams(int_params, float_params, custom_params)¶
Bases:
objectType 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:
objectType 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:
objectType for float parameters.
- Parameters:
name (std::string) – Name of the parameter
value (float) – Value of the parameter
- class mavsdk.param.IntParam(name, value)¶
Bases:
objectType 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:
AsyncBaseProvide 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:
ExceptionRaised when a ParamResult is a fail code
- class mavsdk.param.ParamResult(result, result_str)¶
Bases:
objectResult type.
- Parameters:
result (Result) – Result enum value
result_str (std::string) – Human-readable English string describing the result
- class Result(*values)¶
Bases:
EnumPossible 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.
- DOES_NOT_EXIST
Parameter does not exist
- VALUE_OUT_OF_RANGE
Parameter value does not fit within accepted range
- PERMISSION_DENIED
Caller is not permitted to set the value of this parameter
- COMPONENT_NOT_FOUND
Unknown component specified
- READ_ONLY
Parameter is read-only
- TYPE_UNSUPPORTED
Parameter data type is not supported by flight stack
- TYPE_MISMATCH
Parameter type does not match expected type
- READ_FAIL
Parameter exists but reading failed
- COMPONENT_NOT_FOUND = 12¶
- CONNECTION_ERROR = 3¶
- DOES_NOT_EXIST = 9¶
- FAILED = 8¶
- NO_SYSTEM = 6¶
- PARAM_NAME_TOO_LONG = 5¶
- PARAM_VALUE_TOO_LONG = 7¶
- PERMISSION_DENIED = 11¶
- READ_FAIL = 16¶
- READ_ONLY = 13¶
- SUCCESS = 1¶
- TIMEOUT = 2¶
- TYPE_MISMATCH = 15¶
- TYPE_UNSUPPORTED = 14¶
- UNKNOWN = 0¶
- VALUE_OUT_OF_RANGE = 10¶
- WRONG_TYPE = 4¶