-
Notifications
You must be signed in to change notification settings - Fork 53
Description
I'm working on a project where I'll be sending some custom data over MAVLink to a companion computer on my drone. I wanted to use PARAM_EXT_SET to prototype my setup before looking into creating a custom message since I'm just wanting to send a short string. But I've run into an issue trying to use the param plugin. Here's a snippet:
Param param = system.getParam();
Disposable d = param.selectComponent(191, Param.ProtocolVersion.EXT).subscribe(
() -> {
Disposable d2 = param.setParamCustom("MY_PARAM", "MY_VALUE").subscribe(
() -> Timber.d("Updated parameter"),
e -> Timber.e(e, "Failed to update parameter")
);
},
e -> Timber.e(e, "Error selecting companion computer for setting parameters")
);This code runs into an error in the param.selectComponent call:
Error selecting companion computer for setting parameters
io.mavsdk.param.Param$ParamException: UNKNOWN: Unknown
...
Changing the component ID to the autopilot (1) and using ProtocolVersion.V1 does not solve the issue. I can set parameters on my autopilot if I remove the selectComponent call since it's the default component selected. I can also send the PARAM_EXT_SET message fine with MAVLink direct to accomplish my goal, but then I would have to manually deal with resending the message if I don't receive an ACK.
Looking at the MAVSDK source for the plugin, I can see that ParamImpl::select_component always returns Param::Result::Unknown. I haven't had time to try messing around with and building MAVSDK myself, but could the fix be as simple as changing this return value to a success?