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

MAVLink passthrough in language wrappers #1459

Open
julianoes opened this issue Jun 7, 2021 · 0 comments
Open

MAVLink passthrough in language wrappers #1459

julianoes opened this issue Jun 7, 2021 · 0 comments
Labels

Comments

@julianoes
Copy link
Collaborator

julianoes commented Jun 7, 2021

It would - of course - be nice to have MAVLink passthrough available in language wrappers.
However, that's not straightforward because it would mean we have to:

  1. Either generate .proto files for all MAVLink messages and then generate the API for all of them. This would be nicely type-safe in these languages but probably gets quite bloaty.
  2. Or expose some sort of interface that packs the MAVLink messages with runtime checks instead of compile team. We could do that with some sort of interface that allows you to set a message and all the fields using string setters/getters. Something along these lines:
service Passthrough Service {
    rpc SendMessage(SendMessageRequest) returns (SendMessageResponse)
    rpc SubscribeReceiveMessage(SubscribeReceiveMessageRequest) returns (stream ReceiveMessageResponse)
}

message SendMessageRequest {
    String msgid = 1;
    repeated Field fields = 2;
}
message SendMessageResponse {
    Result result = 1
}

message SubscribeReceiveMessageRequest {
    String msgid = 1;
}
message ReceiveMessageResponse {
    String msgid = 1;
    repeated Field fields = 2;
}

message Field {
    String fieldid = 1; // _x for arrays
    int64 int_data = 2;
    double float_data = 3;
    String string_data = 4;
}

message Result {
    enum PasshtroughResult {
        UNKNOWN
        SUCCESS
        WRONG_DATA_SET
        DATA_OBERFLOWN
        CONNECTION_ERROR
}

Note, we might also be able to use the oneof proto thing.

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

1 participant