MAVSDK-Python icon indicating copy to clipboard operation
MAVSDK-Python copied to clipboard

ComponentInformation plugin "UNIMPLEMENTED"

Open carlsondev opened this issue 3 years ago • 1 comments

When running the attached code, and connecting to the headless px4 docker container (jonasvautherin/px4-gazebo-headless) I receive this error.

Traceback (most recent call last):
  File "/Users/fibonacci/Desktop/Mines/Fall-2022/Field-Session/MAVSDK-Python/custom_examples/component_infomation.py", line 22, in <module>
    loop.run_until_complete(run())
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/Users/fibonacci/Desktop/Mines/Fall-2022/Field-Session/MAVSDK-Python/custom_examples/component_infomation.py", line 12, in run
    float_params : List[FloatParam] = await drone.component_information.access_float_params()
  File "/usr/local/lib/python3.10/site-packages/mavsdk/component_information.py", line 436, in access_float_params
    response = await self._stub.AccessFloatParams(request)
  File "/usr/local/lib/python3.10/site-packages/aiogrpc/channel.py", line 40, in __call__
    return await fut
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.UNIMPLEMENTED
	details = ""
	debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B::1%5D:50051 {created_time:"2022-10-10T13:55:59.443155-06:00", grpc_status:12, grpc_message:""}"
>

Based on a prior reported issue (#394), I think this might be some simple issue with the library.

Code

import asyncio
from mavsdk import System
from typing import List
from mavsdk.component_information import FloatParam


async def run():

    drone = System()
    await drone.connect(system_address="udp://:14540")

    float_params : List[FloatParam] = await drone.component_information.access_float_params()

    for param in float_params:
        print(param)


if __name__ == "__main__":
    # Start the main function
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(run())

carlsondev avatar Oct 10 '22 19:10 carlsondev

I think I didn't want to expose the component information plugins in Python yet because it was still work in progress. I had done an initial implementation in C++ but the protocol had slightly changed after that, and I haven't had time to work through that yet.

Plus, the language wrappers might not yet properly work with server plugins. I need to verify that too.

julianoes avatar Oct 10 '22 23:10 julianoes