BetFSM
General Description
Robot applications need coordination to synchronize different components and allow robots to perform their tasks and recuperate from errors succesfully. There are several
To handle discrete-level coordination of skills, KU Leuven developed BetFSM: A behavior tree and finite state machine framework in Python using cooperative multitasking where new state machines or behavior-tree nodes can be easily specified. This not only allows coordination of tasks to create skills but also allows fine coordination of ROS2 and non-ROS2 nodes/components (e.g. the eTaSL ROS2 node) and activation and deactivation of peripherals such as cameras and grippers. It provides:
- Hierarchical (composite) states
- Parametrizable and reusable states
- Easy to build state machines by composing other existing state machines using Behavior-tree composition blocks (e.g. Sequence, Fallback, ConcurrentSequence, ConcurrentFallback, Repeat).
- Implementation of 'ticking' states, i.e. states that takes a longer time, but cooperatively yields the initiative back to the caller (cooperative concurrency).
- Easily extendable using Python's generators and yield.
- On-line visualization of the tree-structure.
To provide a simple-to-use high-level interface to a skill, KU Leuven developed a ROS2 action server that provides interaction with the BetFSM finite state machines. To ensure rapid development of new skills, a generic action interface has been chosen, where parameters to the skill are given as a string in JSON-format. JSON-schema is used to validate these parameters in a generic way and to facilitate the reconfiguration of the skill. These parameters are then reflected in the blackboard of the state-machine where they can be used by the skill implementation.
Mechanisms to create and re-use skill libraries are currently being developed.
Resource | Link |
---|---|
Source code | Link to source code |
Demo Video | Link to video |
✔️ Generate a GIF with screenshots or images that represent the main functionalities of the component and add it to the it img subfolder, and link it in the image below.
Contact
The following table includes contact information of the main developers in charge of the component:
Name | Organisation | |
---|---|---|
Erwin Aertbeliën | erwin.aertbelien@kuleuven.be | ![]() |
Santiago Iregui | santiago.iregui@kuleuven.be | ![]() |
Federico Ulloa | federico.ulloarios@kuleuven.be | ![]() |
License
GNU General Public License v3.0
Technical Foundations
✔️ Describe the technical foundations of your component. Describe in detail the models, algorithms, or methods you use. If the documentation is available in a different source, for instance, an open access paper, provide here a high-level overview and links to external references.
Code blocks
You can enter block codes in Markdown cells surrounding the text you want to display as code using triple quotes (````) and adding the language name. For instance, the following code block will display some python code styled using Python language syntax:
# This is a comment
print("Hello, world!")
Tables
You can add a table like this in your document:
| This | is |
|------|------|
| a | table|
will display the following table:
This | is |
---|---|
a | table |
The table cells are delimited by the (|) character. The first row and first column are used to determine the width of the table, so it is important to insert spaces if you want to control the table width and text alignment across the table. Also, note that the first row is used as headers, and that there is a separator between the header and the table body.
Note that the text in the table is automatically aligned to the left. You can control the alignment of the text using colons (:) after the column delimiter. For instance, the code:
```markdown
| Right aligned |centered aligned |
|----------------------------------:|:------------------------:|
| This is a right aligned column | and this one is centered |
```
see:
Right aligned | centered aligned |
---|---|
This is a right aligned column | and this one is centered |
Lists
You can build itemized lists using the -
character, and nested sublists using the tabulator or insert some spaces before the -
character. For instance, the code:
- Item list number one
- Sublist number one
- This is a sublist item
- Sublist number two
- This is a sublist item
- And this is another
- Item list number two
- This is another sublist item
- Here, just one more sublist:
- One item
- And one more!
Creates the following list:
- Item list number one
- Sublist number one
- This is a sublist item
- Sublist number two
- This is a sublist item
- And this is another
- Sublist number one
- Item list number two
- This is another sublist item
- Here, just one more sublist:
- One item
- And one more!
You can also create numbered nested lists just using numbers before a '.' character. For instance:
1. Here we go
1. Sublist item 1
2. Sublist item 2
2. Here we go again
1. Sublist item 1
2. Sublist item 2
Will create this sublist: 1. Here we go 1. Sublist item 1 2. Sublist item 2 2. Here we go again 1. Sublist item 1 2. Sublist item 2
LaTeX equations
You can include mathematical expressions using LaTex notation wrapped using the dollar symbol as a delimiter. You can insert equations inline (in the same line) as text like:
This is an inline equation $e^{i\pi} + 1 = 0$
````
This is an inline equation $e^{i\pi} + 1 = 0$
You can also use the dollar symbol to include equations standalone in a new line. For instance, the code:
```markdown
$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$
Will introduce an equation in a new line, like this:
$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$
Latex cheat sheet
You can find a comprehensive cheat sheet for LaTeX equations here. You can also use Overleaf to find tutorials and edit equations online. However, we hope this table contains the most common LaTeX commands and symbols.
Symbol | LaTex Command | Description | Example |
---|---|---|---|
$x^y$ | ^{x} |
Exponent. The expression in the exponent is passed between curly brackets ({}) | $x^{y+1}$ |
$x_i$ | _{i} |
Subscript. The expression in the subscript is passed between curly brackets | $x_{i+1}$ |
$\sum$ | \sum |
Summation. You can add subscripts and exponents to determine the range of the summation | $\sum_{i=0}^{10}{i!}$ |
$\frac{x}{y}$ | \frac |
Fraction. Pass first the numerator and then the denominator using curly brackets | $\frac{1}{2}$ |
$\int$ | \int |
Integration. Pass the expression to integrate and the variable to integrate over | $\int x^2 dx$ |
$\sqrt{x}$ | \sqrt |
Square root. Pass the expression to square root using curly brackets | $\sqrt{x^2}$ |
$\geq$ | \geq |
Greater than or equal to. | $\geq x^2 dx$ |
$\leq$ | \leq |
Less than or equal to. | $\leq x^2 dx$ |
$\neq$ | \neq |
Not equal to. | $\neq x^2 dx$ |
$\alpha$ | \alpha |
Any greek symbol, using its english name (e.g. alpha). | $\alpha$ |
$\beta$ | \beta |
Beta is another popular greek symbol. | $\beta$ |
$\gamma$ | \gamma |
Gamma is another great greek symbol. | $\gamma$ |
$\omega$ | \omega |
But Omega as in Omega level mutant is my favourite. | $\omega$ |
Matrices and vectors in LaTeX
You can just use brackets to insert vectors in LaTex, which is quite convenient. For instance, the code:
x = [1, 2, 3]
Defines a row vector x with the values 1, 2, 3.
Writing a matrix in LaTex is a bit more complicated. You can use the following syntax:
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}
To write a matrix like:
\begin{bmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix}
Note that we write the matrix row-by-row, using two backslashes to separate rows, and the & symbol to separate cells in a row.
Integrated and Open Source Components
This section outlines both pre-existing technologies and open-source components that have been integrated into the component. It provides details on their sources, purposes, modifications, and compliance with licensing terms.
Overview
✔️ Provide a high-level overview of the integrated and open-source components. Provide a high-level description of the funding received in previous projects and what is the progress in AI-PRISM.
Pre-existing Components
None
How to install
It is installed as any other ROS2 colcon/ament package.
How to use
Add usage guidelines describing how to use your component.