flojoy-ai / blocks

Flojoy Standard Blocks Library (now merged into flojoy-ai/studio)
https://blocks.flojoy.ai
4 stars 1 forks source link

[BLO-90] ROS 2 [RFC]: Conditional Drop-Down Menus #31

Open IsabelParedes opened 9 months ago

IsabelParedes commented 9 months ago

Context

ROS 2 supports several message types and users can also create custom message definitions. The [common_interfaces](https://github.com/ros2/common_interfaces) includes several ROS 2 packages which encapsulate the most commonly used message definitions.

Problem

When creating a publisher, the user should be able to select what type of message will be published to a specific topic. For example, if the user wants to publish string messages, the user would want to select the String message definition from the std_msgs package.


from std_msgs.msg import String

ros_node.create_publisher(String, 'ros_topic')

Similarly, when creating a subscriber. The user selects the message definition for a given topic.

ros_node.create_subscription(String, 'ros_topic', subscription_callback, 10)

Proposed Solution

One solution could be to create a block for each message definition, but this would not scale nicely and it would not be possible to support custom messages.

A better solution is to have a single block with two drop-down menus.

Challenges:

References

From SyncLinear.com | BLO-90