-
Notifications
You must be signed in to change notification settings - Fork 2
[BLO-137] ROS 2 [RFC]: Simpler primitive types for DataContainers #28
Description
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 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
ROS2MessagesubclassDataContainer:- pros:
- would allow defining and using two
Blocksfor publishing and subscribing to ROS 2
- would allow defining and using two
- cons:
- make the underlying data opaque
- would need
Blocksto convert someDataContainerto/fromROS2Message
- pros:
- allow
Blocksto accept something else thanDataContaineras inputs, e.g. simple Python list or tuple etc.- pros:
- have the flexibility to pass simpler primitive types and containers from one
Blockto another - use the Python type annotation to perform type checking
- have the flexibility to pass simpler primitive types and containers from one
- cons:
- potentially a lot more complexity to maintain overtime
- pros:
References
From SyncLinear.com | BLO-137