-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] ROS 2 + Flojoy #14
Comments
It looks like all the ROS libraries we could find require ROS to already be installed, so it may be OK if there is a requirement for the user to have ROS installed. For the Python interop library side, we can support any Python library of your choice being installed, with the same annotaion syntax we had before. |
This looks good, we can definitely work the types of message and topic in how we handle dynamic types in the stateful blocks RFC. We are still looking for how to do this best. One option is a getIns() / getOuts() / getParameters() methods in FJBlock which is used to get the types of the block's I/O, another way is to infer types at flowchart build time (so types are locked from the time the flowchart has run). We made a new issue / RFC for handling of flowchart typing and parameters - flojoy-ai/studio#1015 |
Do you have any plan as to how this might work? I was a bit confused reading the docs for ROS packages, and how they integrate with ROS nodes. From what I understand, a ROS package just specifies dependencies required for a ROS environment, then nodes are run inside of a package's environment? Then I guess we would (somehow) provide a frontend for managing the package's dependencies, and the ROS node for the python file would include the flow chart data + Flojoy runtime. Otherwise, everything looks good! Sasha, Joey and I have a good roadmap for implementing this at the block level, see the stateful blocks RFC and types RFC mentioned by Sasha earlier in the thread; we will be working on pushing that out in the coming months. |
Hi @JeffDotPng
Basic structure:
I'm not sure how easy it would be to implement a frontend for managing dependencies, but it may not be strictly necessary. Maybe the dependencies could be automatically added based on the blocks included in the flowchart. For example, if the flowchart has a ROS publisher block, that needs to depend on The dependencies will be greatly limited by the type of ROS blocks available. So it may not be necessary for the user to select the individual dependencies themselves.
Yes. We would need to find a way to populate the flojoy_ros_node.py file (above) with all this information. Does Flojoy currently have any options for exporting regular flowcharts? Or are there any plans for this? |
Hi @IsabelParedes, thanks for the detailed explanation! Everything is pretty clear now. @TheBigSasha, @itsjoeoui, and I will be working on the stateful blocks/typing RFCs to lay the foundation for the ROS integrations in the next few weeks.
This makes a lot of sense, it would be nicer to hide this information from the user. I'm imagining a system where block developers could specify arbitrary metadata for a block (not just for ROS), and this would be a good use case.
@izi-on has done something similar with current studio, which was used to run flowcharts on microcontrollers, I imagine we could do something similar with the reactive backend. |
Note: In the following ROS refers to ROS 2
Target Users
/cmd_vel
for exampleROS as a dependency
Options:
For non-standard ROS packages such as rxros2, it is not reasonable to expect the user to follow separate installation instructions and hope that it works with Flojoy. Instead, these additional dependencies should be updated and released (if permitted) so that they can be easily included in the conda environment.
ROS Blocks
Simulink implements a few ROS blocks which can serve as a basis for Flojoy.
Source: https://www.youtube.com/watch?v=BPj1bsnlDcQ
Blocks:
The idea would be that a Flojoy flowchart would represent one ROS node. The user could add subscribers to this node to retrieve data from the ROS network. The data could then be processed with any of the other blocks that Flojoy provides. And at the end of the flowchart, the user can chose to publish the processed data back to the ROS network.
A simplified example:$0.1m$ , then the robot should stop moving. At the end of the flowchart, there would be a ROS publisher block. If the comparison outputs true, then the publisher will send a message to the
The flowchart has a subscriber block which subscribes to a
/distance
measurement topic; it receives measurements from a distance sensor on the robot. Other blocks (not ROS specific) are added to the flowchart to compare this distance to a constant. Say if the distance is less than/cmd_vel
topic (or equivalent) to stop the robot.(Optional) Code Generation
It should be possible to make the flowchart exportable as a ROS package. It would start off with a bare-bones package template with a single executable for launching the ROS node. As blocks are added to the flowchart, the template will be populated.
Once the user has a working flowchart in Flojoy, which has been live tested with a robot. This flowchart is exported as a package to be carried over and installed on the robot itself. This would be the ideal situation for prototyping ROS nodes with Flojoy.
The text was updated successfully, but these errors were encountered: