Understanding the Behaviour Tree: Unterschied zwischen den Versionen

Aus www.wiki.ardumower.de
Wechseln zu: Navigation, Suche
(Which elemets used in the BHT)
Zeile 13: Zeile 13:
 
https://www.electronic-software-shop.com/index.php?seo_c=support%2F&seo=kostenlose-datei-viewer
 
https://www.electronic-software-shop.com/index.php?seo_c=support%2F&seo=kostenlose-datei-viewer
  
=Which elemets used in the BHT=
+
=Which nodes are used in the BHT=
  
 
Leaf:  
 
Leaf:  
Zeile 47: Zeile 47:
 
Returns running if all children return running. If one child suceed or fail the entire operation suceeds or fails.
 
Returns running if all children return running. If one child suceed or fail the entire operation suceeds or fails.
  
 +
[[Datei:NodeTypes.GIF]]
  
 
=Blackboard=
 
=Blackboard=
 
The Blackboard is a class, where variables are stored which belongs to the behaviourtree. When a node is called, it has access the variables on the black board and can query the services through the black board.
 
The Blackboard is a class, where variables are stored which belongs to the behaviourtree. When a node is called, it has access the variables on the black board and can query the services through the black board.

Version vom 27. Mai 2018, 11:47 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 stand 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 AI turn 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.

NodeTypes.GIF

Blackboard

The Blackboard is a class, where variables are stored which belongs to the behaviourtree. When a node is called, it has access the variables on the black board and can query the services through the black board.