Skip to main content

Fault Tree to Behavior Tree Converter

Overview

This project focuses on the conversion of fault trees, represented in draw.io diagram XML files, into behavior tree XML files compatible with the BehaviorTree.CPP library. It enables users to transform their fault tree diagrams into actionable behavior trees, facilitating integration with systems that utilize the BehaviorTree.CPP framework for managing complex behaviors.

Installation

Install with PyPI:

pip install ft2bt

Usage

The tool is designed to convert fault trees from draw.io diagram XML files into behavior tree XML files compatible with the BehaviorTree.CPP library. Here's how to use it:

Preparing Your Fault Tree Diagram

  1. Create or Open Your Fault Tree Diagram in Draw.io:
    • First, visit draw.io to create or edit your fault tree diagram. You may refer to their documentation for guidance on using the tool.
  2. Diagram Structure & Symbols:
    • Hazards: Represent hazards using rectangles. This is a required element in your diagram.
    • Events: Depict events using circles. These are also required elements.
    • Actions: Actions can be represented by processes. Including actions is optional but helpful to clarify how the hazard should be handled.
    • AND/OR Gates: Use the respective symbols for AND/OR gates in your diagram. These are required for depicting logical relationships in the fault tree.
  3. Exporting the Diagram as XML:
    • Once your fault tree diagram is ready, you need to export it in XML format. In draw.io, go to File > Export as > XML to save your diagram as an XML file.
  4. Save the XML File in the /fault_trees Folder:
    • After exporting your diagram as an XML file, save it in the /fault_trees folder within the project directory.

Warning!: All the fault tree elements need to be connected by directional arrows. Ensure that all of them are physically attached to their related elements.

Input Example: Fault Tree Diagram

Below is an example of a fault tree diagram generated in a Draw.io file:

Fault Tree Example

Running the Conversion Tool

Run the conversion command:

ft2bt [-h] -f FTA_FILENAME [-v] [-c] [-r] [-o]

Where:

  • -f: (Required) Specifies the XML global filepath name of the draw.io diagram.
  • -v: (Optional) Automatically shows and saves the renders. Defaults to false.
  • -c: (Optional) Generate a cpp ROS node template for the behavior tree. Defaults to false.
  • -r: (Optional) Replaces current code if previously generated and -c is set to True.
  • -o: (Optional) Specifies the global folder path, where the behavior tree XML diagram is saved.

Output Example: Behavior Tree Diagram

Below is an example of the behavior tree diagrams generated from the fault tree. The XML file is loaded using Groot:

The order of the events is randomly selected in this version of the software. Future versions will sort the events by probability of occurrence.

Behavior Tree Conversion Example

Contact Information and Acknowledgement

For further information regarding this project, please feel free to reach out to Carlos Conejo.

This project was developed at the Institut de Robòtica i Informàtica Industrial (IRI), a joint university research center of the Polytechnic University of Catalonia (UPC) and the Spanish National Research Council (CSIC).

Research partially funded by the Spanish State Research Agency (AEI) and the European Regional Development Fund (ERFD) through the SaCoAV project (ref. PID2020-114244RB-I00). Also funded by Renault Group through the Industrial Doctorate "Safety of Autonomous Vehicles" (ref. C12507).

Release files for ft2bt 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ft2bt 0.1.3
File Size Uploaded
ft2bt-0.1.3.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ft2bt 0.1.3
File Interpreter ABI Platform
ft2bt-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 55.0 kB

Release files / ft2bt-0.1.3.tar.gz

Download URL ft2bt-0.1.3.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
beb7bcceda8cbfba816ddf1481fad2cb9cc3d27ba1c892fe0c02d23d6960ebc7
BLAKE2b-256 checksum
How to use checksums
8b78d45f00e1b396dec672be834bea4670ef94d3d98a46ca79cecaabb6bdaddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Release files / ft2bt-0.1.3-py3-none-any.whl

Download URL ft2bt-0.1.3-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a68e629b16c0de13cbd07c04e99afa24c49959e048b35f53cca5407cbf69efff
BLAKE2b-256 checksum
How to use checksums
7d5a19095e0c220f3392e7d6f55098a9f36c7589e2289126f5798a79daa512b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.7

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page