bit-bots / humanoid_league_misc

MIT License
0 stars 2 forks source link

team_comm: Fix parsing of protobuf without extensions #119

Closed jaagut closed 1 year ago

jaagut commented 2 years ago

Proposed changes

Compiles both protobuf protocols robocup_extension.proto (as previously) and robocup.proto. We try to parse incoming proto messages as an robocup_extension.proto. In case it fails (presumably because the incoming message has no extensions or other extensions, that do not match ours), we try to parse the message as a robocup.proto. This will only parse the standard fields without extensions.

Related issues

Resolves #93

Still needs testing

texhnolyze commented 1 year ago

This does not actually work, as both protobuf files would use the same namespace. Actually launching team comm leads to errors like this:

[team_comm.py-1] TypeError: Couldn't build proto file into descriptor pool!
[team_comm.py-1] Invalid proto descriptor for file "robocup.proto":
[team_comm.py-1]   robocup.humanoid.fvec2.x: "robocup.humanoid.fvec2.x" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec2.y: "robocup.humanoid.fvec2.y" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec2: "robocup.humanoid.fvec2" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec3.x: "robocup.humanoid.fvec3.x" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec3.y: "robocup.humanoid.fvec3.y" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec3.z: "robocup.humanoid.fvec3.z" is already defined in file "robocup_extension.proto".
[team_comm.py-1]   robocup.humanoid.fvec3: "robocup.humanoid.fvec3" is already defined in file "robocup_extension.proto".

As far as I understand protobuf it should also not be needed as I explained in #93.