Understanding the Behaviour Tree: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Which nodes are used in the BHT)
(Prerequisites)
Zeile 2: Zeile 2:
 
=Prerequisites=
 
=Prerequisites=
 
This chapter has the aim to explain you, how the Behavioiur Tree (BHT) in the Raindancer firmware works logical. It will not expalain, how to programm/change it.
 
This chapter has the aim to explain you, how the Behavioiur Tree (BHT) in the Raindancer firmware works logical. It will not expalain, how to programm/change it.
 +
 
To understand this chapter, you need to know the core principles of Behaviour Trees.
 
To understand this chapter, you need to know the core principles of Behaviour Trees.
 +
 
There are lot of sides in the internet. I suggest the following side to read:
 
There are lot of sides in the internet. I suggest the following side to read:
 +
 
http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php
 
http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php
  

Version vom 27. Mai 2018, 12:27 Uhr

Prerequisites

This chapter has the aim to explain you, how the Behavioiur Tree (BHT) in the Raindancer firmware works logical. It will not expalain, how to programm/change it.

To understand this chapter, you need to know the core principles of Behaviour Trees.

There are lot of sides in the internet. I suggest the following side to read:

http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php

You can download the BHT from https://github.com/kwrtz/Raindancer/tree/master/Documentation File: RaindancerBHT.spl7

To view the files of the BHT the following free software can be used: https://www.electronic-software-shop.com/index.php?seo_c=support%2F&seo=kostenlose-datei-viewer

Which nodes are used in the BHT

Leaf: These are the lowest level node type, and are incapable of having any children.

In a leaf stands the code wich do the action. For example: stop the motors, drive back 20cm, ...

Or it could be a condition, which checks a something. For example: is perimeter outside, was a flag on the blackboard set, ...

A condition only checks something. It never ever do actioin or sets a variable.

A node can return one ot three statuses:

 Success
 Failure
 Running

In the BHT you see on most leafs, what they return and under which conditions:

 running: rotating
 true: both coils inside
 false: na

Selector: Execute every child till one returns Success or Running. If none then it return Failure. In other words, it returns the value of the first child that complete his logic.

Sequence: Execute every child unless one of them return failure.

Memory Selector: Same as Selector, but if one child return Running then at the next run the BT will resume its execution on the node that returned Running.

Memory Sequence: Same logic as Memory Selector but applying the Sequence logic.

Parallel: executes the children parallel. Returns running if all children return running. If one child suceed or fail the entire operation suceeds or fails.

You can find the description in the first dheet: BHT Root in the file. NodeTypes.GIF

Blackboard

When a node is called, it has access to the variables on the Blackboard (BB) and can query the services through the black board.

The Blackboard (BB) is a class, where the leafs of the BHT stores their variables, which other nodes need. This means nodes communicate whith each other over variables on the BB..

How a leaf will be shown

In the picture below you see the presentation of a leaf. The pink arrows show to the variables which will read from the BB and which will change on the BB.

You see also the return values of the node. The node will return running while rotating andd success (true) if both coils inside. Failure (false) is not used.

The text below the picture explains, what the aim of the node is.

TRotateBothCoilsInside is the name of the node class. If you want to find the node in the code, you have to search for this class.

Furthermore, you see, that the node set an error, if it is running too long.

NodeDescription.JPG