-
Notifications
You must be signed in to change notification settings - Fork 20
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
RFE: Support for VSS structs #124
Comments
Hi @engelmi So currently as you have seen KUKSA is based on GRPC (protobuf) definition of data structures. While that of course WOULD work fine with vspec structs, the catch 22 is, taht those structs would be avaulable at "compile time" for KUKSA and its clients, however we try to keek KUKSA (the "binary") seperate from from the VSS model (config). I see two potetnial "easy"? options to add structs without breaking the API too mich
There may be other options, but those I can remember from discussions in the past. Happy to hear other ideas take PRs :D Basically, as today structs are not supported we would be relatively open wrt to how exactly this is solved, in case a PR is provided, if it does not break the current API and code paths for the primitive types (too much) |
Adding / removing signals requires databroker to reload its configuration, but it's not necessarily a bad way of accomplishing what you want to do.
Adding a new data type ( I.e. adding something like this: message Struct {
map<string, Value> fields = 1;
}
message Value {
oneof typed_value {
string string = 11;
bool bool = 12;
...
DoubleArray double_array = 28;
Struct struct = 30;
}
}
enum DataType {
DATA_TYPE_STRUCT = 40;
} There are perhaps other ways to define the message Field {
FieldId id = 1;
Value value = 2;
}
message Struct {
repeated Fields fields = 1;
} Introducing JSON as a parallel serialization inside of the already existing protobuf serialization seems totally inappropriate for a multitude of reasons (I can elaborate, but I'm not sure it's needed). Having a bespoke |
I think we agree that in any case, this needs to be added as "DataType enum DataType {
...
DATA_TYPE_STRUCT = 40;
} The other questions is then how it is encoded. I was not aware of the When using .proto files directly to describe vss structs (especially since there is at least some code around in vss-tools doing that already I think), has the advantage that on the "provider" and "subscriber" side you would get a (depending on language) dataclass from your code generator to work with that might be easier than using the dictionary-like generic structs (where you would need logic like "if field xyz exists: access it). But of course you need to deal with those proto files. It hink databroker-wise the effort is almost similar, either No need to elaborate why JSON(schema) is the worse generic solution, adding yet another required techstack. For individual projects that are living in the Python/JS something world it might be easier than dealing with proto. But then maybe for those use cases just use a VSS String where the understanding is "This contains JSON" (Similar to how existing "string" Signals in VSS such as DTCs or ISO timestamps already expect a certain format of the string) |
I think you misunderstood me as there is no such thing as a But yes, the question is how this should be encoded. |
Ah I was thinking (googling) you were referring maybe referring to https://protobuf.dev/reference/protobuf/google.protobuf/#struct This is I think basically what you proposed, but it also seems already "built-in"? Which might be one feasible way to support "unknown/dynamic" data structures in a protobuf way. It is basically a nestable Map (key,value) of proto types If I understood it correctly |
Haha 😄
There's also the |
But a fundamental difference is that the |
Seems we have everything in the toolbox to build a "not-dumb" solution for that. Not sure yet how exactly it would look like but going down the rabbit whole stumbled across this blog, that lines out the tradeoffs between any and struct-style appriaches quite well: https://blog.envoyproxy.io/dynamic-extensibility-and-protocol-buffers-dcd0bf0b8801 |
Thank you for the positive feedback and your discussion to this RFE @argerus @SebastianSchildt |
Please describe what you would like to see
Currently, VSS supports the definition of custom structs. Kuksa, however, does not support those at the moment according to #14.
If possible, I'd like the struct support being implemented in Kuksa.
If struct support in Kuksa makes sense and is desired, I can give it a try and implement it (with a bit of guidance since I am not familiar with the project code, yet).
Please describe your use case
I'd like to integrate BlueChi with Kuksa. Specifically, the goal is to propagate all state changes observed by BlueChi of ECUs (online/offline) and applications (running, stopping, etc.) to Kuksa. This would allow VSS to be used as a standardized data format also for software state changes across the vehicle and Kuksa would be the centralized broker for it.
This requires a translation between BlueChi, VSS and Kuksa - which I started working on here and defined an initial VSS model for BlueChi. Using VSS structs for this use case seems more appropriate than generating a .vspec (with primitive types) on the fly when starting BlueChi and passing that to Kuksa. But maybe there is different, more simple solution, so feedback is highly appreciated.
The text was updated successfully, but these errors were encountered: