Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Telemetry Server #394

Closed
sensoarltd opened this issue Oct 8, 2021 · 6 comments
Closed

How to use Telemetry Server #394

sensoarltd opened this issue Oct 8, 2021 · 6 comments
Labels

Comments

@sensoarltd
Copy link

sensoarltd commented Oct 8, 2021

I've not managed to find any examples of using TelemetryServer() and I noticed the plugin isn't included in the mavsdk system.py. I have added the missing lines but I suspect it should be implemented this way @JonasVautherin. I'm trying to send an alert from onboard computer via PX4 and back to QGC. With the added plugin lines I'm then seeing an error. Any hints how to do this without taking the uOrb approach in C++.

Many thanks for any assistance

import asyncio
from mavsdk import System
from mavsdk.telemetry_server import (StatusText,StatusTextType)

async def run():
 
    drone = System()
    await drone.connect(system_address="serial:///dev/ttyACM0:115200")

    await drone.telemetry_server.publish_status_text(StatusText(StatusTextType.ALERT,"FOUND MISSING PERSON!"))

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(run())

File "mavlinkSend.py", line 10, in run
await drone.telemetry_server.publish_status_text(StatusText(StatusTextType.ALERT,"FOUND MISSING PERSON!"))
File "/home/david/anaconda3/lib/python3.8/site-packages/mavsdk/telemetry_server.py", line 3461, in publish_status_text
response = await self._stub.PublishStatusText(request)
File "/home/david/anaconda3/lib/python3.8/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 = "{"created":"@1633706862.357854593","description":"Error received from peer ipv6:[::1]:50051","file":"src/core/lib/surface/call.cc","file_line":1069,"grpc_message":"","grpc_status":12}"

@julianoes
Copy link
Collaborator

Thanks for the issue.

status = StatusCode.UNIMPLEMENTED

It looks like it might be missing from the mavsdk_server:
https://github.com/mavlink/MAVSDK/blob/d966b419682b620c045c490cce49d846e732ae56/src/mavsdk_server/src/grpc_server.cpp#L40

We have to fix the server and make a new release. It should happen sometime this week.

@julianoes julianoes added the bug label Oct 11, 2021
@sensoarltd
Copy link
Author

Thanks for confirming @julianoes - I'm crowbaring a solution really. Do you think it would be worth me putting in a feature request for custom mavlink messages in MAVSDK-Python or do you think it's out of scope. My intention is to deliver messages based on autonomy sensors inference to the ground station PC from the drone onboard PC via mavlink. Such signaling really overlaps into ROS.

@julianoes
Copy link
Collaborator

Do you think it would be worth me putting in a feature request for custom mavlink messages in MAVSDK-Python or do you think it's out of scope.

That's not so easy. If you need a feature I suggest you add an issue in https://github.com/mavlink/MAVSDK and we can see if that is already in MAVLink. If it is not, then we will have to add it to the mavlink spec first.

@sensoarltd
Copy link
Author

Hi @julianoes, is there any plan on adding the changes to grpc_server.cpp and releated code any time soon and releasing via update? thank you.

@julianoes
Copy link
Collaborator

I'm planning to update the Python part, yes. Hopefully next week, otherwise feel free to make a PR yourself.

@julianoes
Copy link
Collaborator

Coming in #401.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants