Skip to content

LabCeGoR 2021

Tarik Viehmann edited this page Dec 6, 2021 · 14 revisions

Lab course at the KBSG in the winter term 2021/2022, see also the KBSG website.

Meetings

Setup instructions

Setting up your account and VNC

See instructions here: KBSG-VNC

Workspace setup

See instructions here: Simulation-Setup

Group Assignment

  • Group 1: Anna, Jonathan, Tarek
  • Group 2: Christina, Dominik
  • Group 3: Alessandra, David
  • Group 4: Achim, Donijor

The Tasks

Task 1: Visit-All

In order to get used to working with the Clips Executive, the first task is to write an agent that visits all machines on the field. You can use the fawkes-robotino branch common/labcegor21 as baseline. There you can find an agent that lets the first robot drive to a base station. The configuration for the agent can be found in fawkes-robotino/cfg/conf.d/visitall-agent.yaml

a) Get familiar with the current behavior of that agent, focus on the main components that are located in fawkes-robotino/src/clips-specs/visit-all/

b) Adapt the agent to control a robot, such that it visits all machines of your team

c) Use more than one robot to visit all machines of your team

If you completed the tasks above, provide me with a link to a corresponding buildkite build and move on to task 2.

Task 2: Production

Pull the latest revision of common/labcegor21 and the latest fawkes master. There you find a similar structure to the one from the visitall task:

  1. The default agent that is started by the clips-executive is now called rcll-labcegor21 (see fawkes-robotino/cfg/conf.d/clips-executive.yaml)
  2. The agent specification for that agent can be found in fawkes-robotino/cfg/conf.d/labcegor21-agent.yaml.
  3. Some skeleton code can be found in fawkes-robotino/src/clips-specs/rcll-labcegor21/, which lets a robot drive to the cap station C-CS1 to buffer a cap. You might find the fixed-sequence.clp helpful as it contains plans for most of the sub-tasks you need to solve. You can of course change them as you please.
  4. The old refbox-shell is now replaced by a webfrontend (rcll-refbox-frontend). In order to use it, make sure to add the correct path to your .bashrc (by adding a line export RCLL_REFBOX_FRONTEND_DIR=~/rcll-refbox-frontend).

Your task is to build an agent that can produce the orders that are given by the refbox, the rules of the game can be found here. You can follow along the following milestones to achieve this:

a) Get familiar with the current behavior of that agent

b) Adapt the agent to control a robot to produce a simple product to completion

c) Collaborate with multiple robots to complete a product

d) Build multiple orders simultaneously

General Debugging Tips

You have 3 different sources of information when debugging available to you:

  1. The running terminal sessions: Straightforward, try to keep the terminal output free from spam so you can quickly spot important messages
  2. The debug logs: debug11_latest.log contains detailed information about the last agent execution, including all rules that fired and facts that changed (except unwatched rules/facts). A fast text editor with regular expression search support is strongly recommended. For vim users i recommend https://vim.fandom.com/wiki/Searching and https://vim.fandom.com/wiki/Power_of_g
  3. Frontends: The refbox frontend runs on localhost:8080, the fawkes frontend for the central agent runs on localhost:8091. Make sure the frontend is actually deployed (in the fawkes submodule navigate to src/plugins/webview/frontend and run make deploy if it does not show up when running the simulation). Frontends are very handy to look into the running system. Be mindful that they will not show anything once you terminated the execution. The fawkes frontend provides two especially useful views when working with the agent, the Goal graph and access to the current Clips fact list. It also supports continuous refreshes. A useful tip: Before stopping your agent, go the the fawkes frontend and open the clips fact list without continuous refresh. Once you close the agent, the list can still be accessed as it is loaded on the page (until you refresh the page or the fact list, of course).

Q&A

Q: Does fact <fact> exist in the current working memory?

A: If the agent is still running: Fawkes webview -> Clips -> search for <fact> Else: Search in the debug log from bottom to top to find last occurrence of '' (e.g., in vim: jump to begin of file with gg followed by a backwards search ?<fact>)

Q: Did rule <rule> fire?

A: Search the log for FIRE followed later by <rule> (e.g., in vim /FIRE.*<rule>)

Q: A rule <rule> fired, that i did not write, where does it come from?

A: A good starting point is your specs folder (e.g., src/clips-specs/rcll-labcegor21). Navigate there and search the files for the rule name (e.g., using grep: grep -r "<rule>". If the rule is defined elsewhere, you may want to check your agent configuration in cfg/conf.d/labcegor21-agent.yaml to see a list of loaded files. The files are specified relative to src/clips-specs/ or fawkes/src/plugins/clips-executive/clips.

Clone this wiki locally