Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

[BLO-137] ROS 2 [RFC]: Simpler primitive types for DataContainers #28

Open
IsabelParedes opened this issue Nov 16, 2023 · 0 comments
Open
Labels
Improvement Created by Linear-GitHub Sync

Comments

@IsabelParedes
Copy link
Member

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 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

References

From SyncLinear.com | BLO-137

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant