22 releases

0.4.1 Sep 16, 2024
0.4.0 Jul 8, 2024
0.3.1 Apr 7, 2024
0.3.0 Oct 29, 2023
0.1.7 Jul 29, 2023

#40 in Robotics

40 downloads per month
Used in f-tree

Custom license

2.5MB
12K SLoC

Contains (WOFF font, 99KB) fontawesome-webfont.woff, (WOFF font, 78KB) fontawesome-webfont.woff2, (WOFF font, 45KB) open-sans-v17-all-charsets-300.woff2, (WOFF font, 41KB) open-sans-v17-all-charsets-300italic.woff2, (WOFF font, 45KB) open-sans-v17-all-charsets-600.woff2, (WOFF font, 43KB) open-sans-v17-all-charsets-600italic.woff2 and 7 more.

Logo

Forester - A fast and modular orchestration engine, implementing behavior trees.

Visualization of the tree

About

Forester represents a framework that provides the toolkit to perform the effective task orchestrations. The tasks can be performed synchronously or asynchronously, locally or remotely. Forester takes care of the correct performance and distribution of the tasks. The main concept of the framework is the flow based on the behavior trees it can be effectively used in the game, ai, robotic areas, or anywhere where the workflow engine can be applied.

Example

The language is very simple

import "std::actions"

root main sequence {
    store("info", "initial")
    retryer(task({}), success())
    store("field","some_info")
}

fallback retryer(t:tree, default:tree){
    retry(5) t(..)
    fail("just should fail")
    default(..)
}

impl task(config: object);

and simulator test

#[test]
fn smoke() {
    let mut sb = SimulatorBuilder::new();

    let root = test_folder("simulator/smoke");

    sb.root(root);
    sb.profile(PathBuf::from("sim.yaml"));
    sb.main_file("main.tree".to_string());

    let mut sim = sb.build().unwrap();
    let tracer = &sim.forester.tracer;
    sim.run().unwrap();
}

or running from the console

forest sim --root tree\tests\simulator\smoke\  --profile sim.yaml

Why Forester

The main idea and the target of Forester is to make the process of chaining a complex logic of the different tasks together effective and easy.

The following set of features is summoned to highlight the framework among the others.

  • The dsl to describe the logic
  • The framework provides the ability to create async and sync tasks
  • The framework provides the ability to create remote and local tasks
  • The tooling to visualize and trace the execution of the tree
  • The simulation mode is supposed to aid with the design decisions
  • The optimizations and analysis of the tree
  • The validation engine allows the users to create the manually defined validations

Why behavior trees

Firstly, they provide a strong math abstraction over the orchestration logic
and enables to separate the business logic and the tree logic itself.

On the other hand, they have only a small set of logically conjucted components making the design easier, One of the great advantages of the behavior trees is that they provide a good conception of modularity.
Articles that introduce into the basics of the behavior trees

Documentation

The common documentation is available as a mini-book, describing all aspects of working with the framework

Publications

Contributing

Currently, the project is under active development (there are a lot of blind spots), so any help is highly appreciated. Any help is highly appreciated at any stage of the project but at now especially.

A guideline about contributing to Forester can be found in the CONTRIBUTING.md file.

License

Forester is released under the Apache License, Version 2.0.

The logo provided by bunny on Freepik

Dependencies

~21–35MB
~568K SLoC