Some frameworks and libraries use primitive Python and C types.
For instance, ROS 2 has a simple message specification¹.
Problem
Currently there is an impedance mismatch between Flojoy's DataContainers and those primitive Python and C types.
For instance, in the case of ROS 2, handling the standard libraries' messages in subscriber and publisher Blocks would be significantly more difficult. Primitive types need to be boxed behind subclasses of DataContainer, which would mean that one would have to create a plethora of DataContainer and adaptations.
Also if users were to define ROS 2 messages themselves for their application, they would need to define a custom DataContainer.
Another potential major project which is used in variety of applications to transfer data between stack and which would face a similar problem is [protobuf](https://protobuf.dev/).
Proposed Solutions
have a generic ROS2Message subclass DataContainer:
pros:
would allow defining and using two Blocks for publishing and subscribing to ROS 2
cons:
make the underlying data opaque
would need Blocks to convert some DataContainer to/from ROS2Message
allow Blocks to accept something else than DataContainer as inputs, e.g. simple Python list or tuple etc.
pros:
have the flexibility to pass simpler primitive types and containers from one Block to another
use the Python type annotation to perform type checking
cons:
potentially a lot more complexity to maintain overtime
Context
Some frameworks and libraries use primitive Python and C types.
For instance, ROS 2 has a simple message specification¹.
Problem
Currently there is an impedance mismatch between Flojoy's
DataContainers
and those primitive Python and C types.For instance, in the case of ROS 2, handling the standard libraries' messages in subscriber and publisher Blocks would be significantly more difficult. Primitive types need to be boxed behind subclasses of
DataContainer
, which would mean that one would have to create a plethora ofDataContainer
and adaptations.Also if users were to define ROS 2 messages themselves for their application, they would need to define a custom
DataContainer
.Another potential major project which is used in variety of applications to transfer data between stack and which would face a similar problem is
[protobuf](https://protobuf.dev/)
.Proposed Solutions
ROS2Message
subclassDataContainer
:Blocks
for publishing and subscribing to ROS 2Blocks
to convert someDataContainer
to/fromROS2Message
Blocks
to accept something else thanDataContainer
as inputs, e.g. simple Python list or tuple etc.Block
to anotherReferences
From SyncLinear.com | BLO-137