Skip to content

open-rmf/crossflow

 
 

Repository files navigation

style ci_linux ci_windows ci_web Crates.io Version

Important

You are on a branch with experimental support for ROS 2 via rclrs. This will require more steps to set up than usual, so installation instructions for the necessary packages are below:

  1. Install ROS Jazzy according to the normal installation instructions.

  2. Install Rust according to the normal installation instructions.

  3. Run these commands to set up the workspace with the message bindings:

sudo apt install -y git libclang-dev python3-pip python3-vcstool # libclang-dev is required by bindgen
pip install git+https://github.com/colcon/colcon-cargo.git --break-system-packages
pip install git+https://github.com/colcon/colcon-ros-cargo.git --break-system-packages

For now we need a fork of cargo-ament-build until this PR is merged and released:

cargo install --git https://github.com/mxgrey/cargo-ament-build

Create a workspace with the necessary repos:

mkdir -p workspace/src && cd workspace
git clone https://github.com/open-rmf/crossflow src/crossflow -b ros2
vcs import src < src/crossflow/ros2-feature.repos

Source the ROS distro and build the workspace:

source /opt/ros/jazzy/setup.bash
colcon build --allow-overriding action_msgs builtin_interfaces common_interfaces composition_interfaces example_interfaces geometry_msgs lifecycle_msgs nav_msgs rcl_interfaces rosgraph_msgs rosidl_default_generators rosidl_default_runtime sensor_msgs sensor_msgs_py service_msgs statistics_msgs std_msgs std_srvs trajectory_msgs type_description_interfaces unique_identifier_msgs visualization_msgs
  1. After colcon build has finished, you should see a .cargo/config.toml file inside your workspace, with [patch.crates-io.___] sections pointing to the generated message bindings. Now you should source the workspace using
source install/setup.bash

Now you can run the ROS 2 example. You can also create your own crate in this colcon workspace and link as shown in the example.

Reactive Programming for Bevy

This library provides sophisticated reactive programming for the bevy ECS. In addition to supporting one-shot chains of async operations, it can support reusable workflows with parallel branches, synchronization, races, and cycles. These workflows can be hierarchical, so a workflow can be used as a building block by other workflows.

sense-think-act workflow

Why use crossflow?

There are several different categories of problems that crossflow sets out to solve. If any one of these use-cases is relevant to you, it's worth considering crossflow as a solution:

  • Coordinating async activities (e.g. filesystem i/o, network i/o, or long-running calculations) with regular bevy systems
  • Calling one-shot systems on an ad hoc basis, where the systems require an input value and produce an output value that you need to use
  • Defining a procedure to be followed by your application or by an agent or pipeline within your application
  • Designing a complex state machine that gradually switches between different modes or behaviors while interacting with the world
  • Managing many parallel threads of activities that need to be synchronized or raced against each other

Helpful Links

Compatibility

Crossflow may be supported across several releases of Bevy, although we only have one for the time being:

bevy crossflow
0.16 0.0.1

The main branch currently targets bevy version 0.16 (crossflow 0.0.x). We will try to keep main up to date with the latest release of bevy, but you can expect a few months of delay.

Dependencies

This is a Rust project that often uses the latest language features. We recommend installing rustup and cargo using the installation instructions from the Rust website: https://www.rust-lang.org/tools/install

Ubuntu Dependencies

For Ubuntu specifically you can run these commands to get the dependencies you need:

  • To install rustup and cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Make sure you have basic compilation tools installed
sudo apt-get install build-essential

Build

Once dependencies are installed you can run the tests:

cargo test

You can find some illustrative examples for building workflows out of diagrams:

To use crossflow in your own Rust project, you can run

cargo add crossflow

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages