Graphical State Space Programming (GSSP) Tutorials
Home -> GSSP Tutorials -> Section 3.1 The Meta-controller System

Section 3.1 The Meta-controller System

The above is a diagram of the meta-controller system. The meta-controller (red) is the center of the system that coordinates all the other entities in the system. The meta-controller consists of an infinite loop. Each time through the loop, the meta-controller does the following.

  1. Get the current state of the robot from the Robot Controller (blue) that is being used. Each unique robot requires its own driver and you need to tell the meta-controller which driver to use when running a GSSP program. We will talk about creating robot drivers in Section 3.2 Creating Robot Drivers.
  2. Get the set of regions and boolean regions from the DataBoard (green).
  3. Figure out which regions the robot is in.
  4. For each region the robot is in, initiate the execution of the code attached to it if it has not already been done. A new Task Thread (purple) is created when initiating the code attached to a region. Each Task Thread may initiate more task Threads to handle goTo functions and waypoint sets. Each Task Thread inherits the priority of the Task Thread that initiated it. The meta-controller keeps track of all the Task Threads in a list.
  5. Order all the Task Threads by their priority from lowest to highest, and put them in a list. If two Task Threads have the same priority, the one that is started later comes later in the list, meaning that the Task Thread that is started later gets higher priority.
  6. Go through the ordered list of Task Threads, starting with the lowest priority Task Thread. Find out the desired state changes of each Task Thread and write it to the StateBoard. Task Threads processed later will overwrite the the desired state changes of Task Threads processed earlier in case of conflict. Observe that since higher priority Task Threads are processed later than lower priority Task Threads, the higher priority Task Threads get the final say in what the robot should do. Task Threads run concurrently and use information from the DataBoard (waypoint sets, regions) and the StateBoard (current state of the robot) to compute desired state changes.
  7. Send the final desired state changes to the Robot Controller.