There is apparently support [1] in the WPI Struct encoding for fixed-length array fields, and there is an example implementation, VectorStruct [2]. I couldn't find a way to make this work with make_wpistruct, e.g. using "list" or "tuple". This isn't an urgent problem: the workaround for my case is many primitive fields, but it would be cleaner if it were an array.
So the FR is to add support for array fields to make_wpistruct. A good test case would be the python implementation of VectorStruct.
Just to be clear, I'm talking about a definition like this:
@wpistruct.make_wpistruct
@dataclasses.dataclass
class Payload:
foo: tuple[float, float, float]
[1] https://github.com/wpilibsuite/allwpilib/blob/main/wpiutil/doc/struct.adoc
[2] https://github.com/wpilibsuite/allwpilib/blob/a99c0903320f7e819b7d48ffc1b8b7145c663bc6/wpimath/src/main/java/org/wpilib/math/linalg/struct/VectorStruct.java#L45
There is apparently support [1] in the WPI Struct encoding for fixed-length array fields, and there is an example implementation,
VectorStruct[2]. I couldn't find a way to make this work withmake_wpistruct, e.g. using "list" or "tuple". This isn't an urgent problem: the workaround for my case is many primitive fields, but it would be cleaner if it were an array.So the FR is to add support for array fields to
make_wpistruct. A good test case would be the python implementation ofVectorStruct.Just to be clear, I'm talking about a definition like this:
[1] https://github.com/wpilibsuite/allwpilib/blob/main/wpiutil/doc/struct.adoc
[2] https://github.com/wpilibsuite/allwpilib/blob/a99c0903320f7e819b7d48ffc1b8b7145c663bc6/wpimath/src/main/java/org/wpilib/math/linalg/struct/VectorStruct.java#L45