Difference between revisions of "Category:Cognitao"

From cogniteam
Jump to: navigation, search
Line 65: Line 65:
  
 
=== XML plan definition support CogniTAO ===
 
=== XML plan definition support CogniTAO ===
 
 
Simple SCXML support
 
Simple SCXML support
 
<source lang="C++">
 
<source lang="C++">
Line 91: Line 90:
 
     </state>
 
     </state>
 
</state>
 
</state>
 +
</source>
 +
 +
Behaviour Tree XML support
 +
<source lang="C++">
 +
<plan>
 +
  <seq name="S">
 +
        <sel name="S1">
 +
              <seq name="S2">
 +
                    <tsk name="Test1" />
 +
                    <tsk name="Test2" />
 +
              </seq>
 +
              <tsk name="Test3" />
 +
        </sel>
 +
        <sel name="S3">
 +
              <seq name="S4">
 +
                    <tsk name="Test4" />
 +
                    <tsk name="Test5" />
 +
              </seq>
 +
              <tsk name="Test6" />
 +
        </sel>
 +
        <sel name="S5">
 +
              <seq name="S6">
 +
                    <tsk name="Test7" />
 +
                    <tsk name="Test8" />
 +
              </seq>
 +
              <tsk name="Test9" />
 +
        </sel>
 +
  </seq>
 +
</plan>
 
</source>
 
</source>

Revision as of 10:48, 19 September 2019

CogniTAO

HSM
BT

CogniTAO is a collection of decision making tools that include

  • A pure C++ Cx11 executive for (Windows 10, Linux Debian, Intel / ARM support)
    • Finite State Machines
    • Hierarchical State Machines
    • Behavior Trees
    • BDI models
  • A Web visualization pure Javascript tool for monitoring
  • A teamwork controller
  • A real-time planner

Simple task in CogniTAO (Synchronous execution)

<source lang="C++"> class TaskTrue: public Task{ public: virtual void run() { std::cout << "." << std::flush; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); setReturn(true); } }; </source>

Task preemption in CogniTAO (Asynchronous execution)

<source lang="C++"> class TaskIdle: public TaskThread { public: // Function to be executed by thread function void run() { // Check if thread is requested to stop ? while (stopRequested == false) { std::ostringstream strs; strs << "*"; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } } }; </source>

Behaviors in CogniTAO

Behavior tree support is for Sequencer / Selector / Parallel. More logic flow controllers can be easily defined. <source lang="C++"> class BehaviourTrue : public Behaviour { public: virtual bool action(){ std::cout << "." << std::flush; std::this_thread::sleep_for(std::chrono::milliseconds(2000)); return true; } }; </source>

World model access in CogniTAO

<source lang="C++"> WM::setVar("EVENT","E2"); </source>

XML plan definition support CogniTAO

Simple SCXML support <source lang="C++"> <state initial="A">

   <state id="A"> 
       <state initial="a1">
           <state id="a1">
               <transition event="COIN_A" target="a2"/>
           </state>
           <state id="a2">
           </state>
       </state>
       <transition event="CHANGE_M" target="B"/>
   </state>
   <state id="B">
       <state initial="b1">
           <state id="b1">
               <transition event="COIN_B" target="b2"/>
           </state>
           <state id="b2">
           </state>
       </state>
        <transition event="UNCHANGE_M" target="A"/>
   </state>

</state> </source>

Behaviour Tree XML support <source lang="C++"> <plan>

  <seq name="S"> 
        <sel name="S1"> 
              <seq name="S2"> 
                    <tsk name="Test1" />
                    <tsk name="Test2" />
              </seq>
              <tsk name="Test3" />
        </sel>
        <sel name="S3"> 
              <seq name="S4"> 
                    <tsk name="Test4" />
                    <tsk name="Test5" />
              </seq>
              <tsk name="Test6" />
        </sel>
        <sel name="S5"> 
              <seq name="S6"> 
                    <tsk name="Test7" />
                    <tsk name="Test8" />
              </seq>
              <tsk name="Test9" />
        </sel>
  </seq>

</plan> </source>

This category currently contains no pages or media.