-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Microservice Versioning Proof of Concept #13565
Conversation
@ItsTimmy Two points.
We didn't really resolve that - but clearly we need to identify things that are optional in some way and be able to query for support. |
That's your proposal but I don't see why we need to have two ways to do it. Yes, the original proposition needs one more message to be transmitted but it's clear and I don't understand why we should limit flexibility for an optimization that we don't know if we need it. |
I'm fine with either approach - they both make logical sense to me. But if I had to implement this I'd much rather do the second version. Anyway, the important thing is that Tim as implementer is convinced of the rightness of a particular approach. I don't mind so much what that is, as long as he tells me what was done, so I can make sure the docs match. |
src/modules/mavlink/mavlink_main.cpp
Outdated
microservice_versions::service_status & | ||
Mavlink::get_service_status(uint16_t service_id) | ||
{ | ||
// TODO microservice versions: Maybe we don't have to search, and can just always place service ID 2 at index 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that's easier.
} | ||
// if ((mavlink_mission_item->frame == MAV_FRAME_GLOBAL_INT || | ||
// mavlink_mission_item->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT_INT)) { | ||
// int_mode() = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here comes the catch: we somehow still need to be compatible to older ground stations which do not support micro services yet. So, we need some sort of "if no microservice version chosen, then try to guess if int or not".
****************************************************************************/ | ||
|
||
/** | ||
* @file mavlink_service_versions.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @file mavlink_service_versions.c | |
* @file mavlink_service_versions.cpp |
@@ -0,0 +1,74 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2012-2019 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2012-2019 PX4 Development Team. All rights reserved. | |
* Copyright (c) 2019 PX4 Development Team. All rights reserved. |
{ | ||
.service_id = MAVLINK_SERVICE_ID_CAMERA, | ||
.min_version = 3, | ||
.max_version = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😲
/** | ||
* This enum represents the current status of the microservice version handshake for one particular microservice. | ||
*/ | ||
enum handshake_status { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum handshake_status { | |
enum class HandshakeStatus { |
@hamishwillee ok we're lacking the context here. I suggest we discuss it on Slack or in the Google Sheet. |
My current implementation is as follows:
I think this does not put any significant burden on the autopilot. I can of course test this more thoroughly, but right now it only requires ~3 bytes of RAM per service per MAVLink connection, and in exchange we get the flexibility to support multiple versions on PX4. For example, right now, PX4 effectively already supports 2 versions of the mission protocol (as I have implemented it). As services are updated to newer versions, we can make the decision on a case-by-case basis whether to drop support for older versions of a service on PX4, if flash space or computational load demands it. I have also implemented the 'stream all services' functionality (QGC sends |
0556993
to
a2feda5
Compare
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
We can re-open this if we decide to make another effort for it. |
Here is the diff so we don't lose it:
|
Related:
This PR uses this common.xml, and this C library generated from it.
This is currently a minimum functioning prototype, meant to demonstrate the possible functionality of microservice versioning. If this is to be merged, there will likely be some necessary changes in response to community feedback.