Skip to content
Decision Making System (DMS)
C++ CSS JavaScript HTML CMake C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake
include/cognitao
machines
src
www
.gitignore
.gitlab-ci.yml
CMakeLists.txt
CogniTAO_UI.gif
LICENCE
README.md
TODO.txt
cogniTao.jpeg
config_debug.json
config_lin.json
config_lin_a1.json
config_lin_a2.json
config_win.json
config_win_a1.json
config_win_a2.json
config_win_debug.json
config_win_debug_fsm.json
config_win_debug_patrol.json
locked.png
run.sh
run_debug.sh
unlocked.png

README.md




CogniTAO General DMS (Decision Making System)

CogniTAO is pure c++11 header only general decision making system for implementing reactive planning architectures.

Design goals

Our library had these design goals:

  • Simple integration. This library is pure c++11 platform neutral (Linux/Windows) header only library

  • Generic design. Enabling to combine various decision making models including FSM/HSM/BehaviourTrees/BDI

Research

We are releasing a CogniTAO light version which implements the main building blocks for various decision making systems

In hope to help improve and advance the reasearch in this field. Below is a partial list of current academic reseach that either

references cognitao directly or uses it in various environemnts (feel free to update us )

  • Keidar, Matan, et al. Robocup 2010 standard platform league team burst description. RoboCup (2010).
  • Kaminka, Gal A. "Autonomous agents research in robotics: A report from the trenches." 2012 AAAI Spring symposium series. 2012.
  • Lincoln, Nick K., et al. "Autonomous asteroid exploration by rational agents." ieee ComputatioNal iNtelligeNCe magaziNe 8.4 (2013): 25-38.
  • Kaminka, Gal A., et al. "On the use of teamwork software for multi-robot formation control." AAMAS. 2013.
  • Team RoBIU, Team Description for Humanoid KidSize League of RoboCup 2013 Dr. Eli Kolberg et. Al
  • Müller, Jörg P., and Klaus Fischer. "Application impact of multi-agent systems and technologies: A survey." Agent-oriented software engineering. Springer, Berlin, Heidelberg, 2014.
  • Hrabia, Christopher-Eyk, et al. "An autonomous companion UAV for the SpaceBot Cup competition 2015." Robot Operating System (ROS). Springer, Cham, 2017. 345-385.
  • Hrabia, Christopher-Eyk, Stephan Wypler, and Sahin Albayrak. "Towards goal-driven behaviour control of multi-robot systems." 2017 3rd International Conference on Control, Automation and Robotics (ICCAR). IEEE, 2017.‏

Integration

To use our library in your workspace add to your project file:

#include <CogniTAO.h>

CMake

To use this library from a CMake project- add to add_library() the path of the library.

# CMakeLists.txt
add_library(libraryLocation/include/)

Getting Started

To get a copy of the project up and running on your local machine use Download button.

If you work on linux you can clone it via terminal to your Home personal folder :

git clone "https://git.cogni.io/cognitao/dm.git"

Prerequisites

C++11 support.

Installing

FOR LINUX USERS: After download/clone the project get in to ["PROJECT/dm"] via terminal and run the "run.sh" script.

cd ~/ProjectName/dm
./run.sh

those commands compile the project and run the tests which choosed at the "config_lin.json".

Examples

To use the CogniTAO library, hare are some examples of how to use the system's basic structures

Using WM (World Model)

The WM is Static and global class, which is updated through a dataSource that the user can implement.

The default WM Datasource that should be used is the MapThreadSafeDataSource.

Additional Datasources for ROS are implemented in:

//create and initialize the word model(WM) 
WM::init(new MapThreadSafeDataSource());

//set variable at the WM's dataSource
WM::setVar("COIN_A","event");

//get the value of given variable from the WM's dataSource
WM::getVar("COIN_A");

Use State structure

Assume you want to create a new simple FSM/HSM machine that transists through states.

//create an empty structure of machine (null)
Machine m;

//create two diffrent states
auto s1 = new State("locked");
auto s2 = new State("unlocked");

//create an HSM state which contains a machine
auto s3 = new State(m,"stateMachine");

//create a new protocol transition(event)
auto E1 = new ProtocolTransition ({"PUSH"});

//create a new protocol transition of two events 
auto E2 = new ProtocolTransition ({"COIN_A,COIN_B"});

//link between states by protocol transition
m.addLink(s1,s2,E2);

//set the initial state of the machine(it must happen before the machine start!)
m.setInitialTask(s1);

//activate the machine which start from the initial state and derived from given events
m.start();

//make PUSH event happen
 WM::setVar("PUSH","event");

 //you can sleep but are not requires as the system is event based

//make COIN event happen
 WM::setVar("COIN","event");


//stop the machine
m.stop();

Use Behaviour structure

To create a Behaviour Tree structure:

//create a new Behaviour sequencer instance
auto rootSequencer = new BehaviourSequencer();

//create a new Behaviour selector instance
auto rootSelector = new BehaviourSelector();

//create a new Behaviour parallel instance
auto rootParallel = new BehaviourParallel();

//create a new Behaviour true(return "true") instance
auto b1 = new test::BehaviourTrue("B1");

//create a new Behaviour false(return "false") instance
auto b2 = new test::BehaviourFalse("B3");

//add BehaviourTrue to the rootSequencer's children list
rootSequencer->addChild(b2);

Create machine from XML

You also have the option to create a machine by providing an XML which describes the machine.

//the loadMachine method get path(string) to the XML and return the machine
Machine* m=loadMachine(path);

XML Behaviour Tree tags

  • root should be a single tag in it the tree hierarchy is described
  • <sequencer> sequencer
  • <selector> selector
  • <random_selector> random_selector
  • <parallel> parallel
  • <loop> loop
    • attribute :value (integer)
  • <behaviour> behaviour task
    • attribute name
  • <inverter> inverter
  • <succeder> succeder
  • <failer> failer
  • <wait> wait
    • attribute :value (integer/seconds)
  • <condition> condition
    • attribute :variable (WM)
    • attribute :operation =,>,<,>=,<=,!=
    • attribute :value
  • <set> set WM variable
    • attribute :variable (WM)
    • attribute :value

Graph visualization

The machine can be represented by a graph. UILink class holds a server which listens on a given port and an ip, Users can enter ip and port as they wish, if not, the server will connect to default ip and port(127.0.0.1/1234). To see the graph: open the browser with the suitable port. for example:

http://localhost:1234/
  • 1234--> port number

More options:

Show text description of the graph:

http://localhost:1234/graph

Show the current state of the machine:

http://localhost:1234/state

Show the word model:

http://localhost:1234/WM

Examples:

//create UILink with default parameters
auto ui=new UILink();

//create UILink with given base directory,ip,port  
auto uiLink=new UILink("./www","10.0.0.142",1235);

//the UILink webserver
ui.start();

------now you can let start a machine and see it at browser-------

//stop UILink webserver
ui.stop();

Graph explanation:

Each state is represnted as a node in the graph. The events are represented as arrows. From the moment the machine started,The graph will be painted according to the state of the machine. When an event occurs, you can see in the graph the change of the states.






Running the tests

this library include various tests which are located at ["dm/include/test"].

In ["dm/include/Config.h"] the tests deviding to groups by key names.

The user always can add tests and edit this file to run his new tests.

The file "config_lin.json"- is used as a JSON config file.

Contributing

Feel free to contact us at info@cogniteam.com if you wish to contribute code to the library

License

This project is licensed under the MIT License - see the LICENSE.md file for details

You can’t perform that action at this time.