Skip to content

Tutorial: Text Based Demo

Sean Trott edited this page Jun 7, 2016 · 18 revisions

This demo allows a user to issue natural language commands via a command line interface. The output is text printed out to the Terminal or Command Prompt, informing the user of what actions have been taken, such as:

>> Robot1, move to the big red box!
FED1_ProblemSolver: robot1_instance is moving to (6.0, 6.0, 0.0)

The same Robot Problem Solver that's used in the text demo can be used for the Morse/ROS demos -- just with different API calls.

System Requirements

This demo has the same requirements as the ecg-framework-code. Follow the guidelines there (including downloading the other ECG repositories, such as ecg_grammars), and once you've installed the dependencies, you can proceed.

Setup and Install

To download the ecg_robot_code repository, clone it in the same directory as ecg_framework_code and ecg_grammars:

git clone https://github.com/icsi-berkeley/ecg_robot_code

This repository contains app versions of the various core components in the framework (details on the "core" code can be found here).

Initializing the Analyzer

Like ecg_framework_code, there is a bash script called analyzer.sh. Also like ecg_framework_code, it assumes the ecg_grammars repository is installed in the same directory, adjacent to ecg_robot_code. Unlike the framework version, however, this initializes the ECG Analyzer with the compRobots grammar. The compRobots grammar is distinct from the research grammar because it: 1) contains vocabulary specific to the robot application, and 2) imports more of the inactive packages defined in "core".

Run the Analyzer with the following command:

./analyzer.sh

Note that by default, the Jython command to run the Analyzer looks like this:

jython -m analyzer ../ecg_grammars/compRobots.prefs

Depending on your computer's processing power, you might need to run a variant of the command (also found in analyzer.sh), which allocates virtual memory to the Jython process:

jython -J-Xmx4g -m analyzer ../ecg_grammars/compRobots.prefs

You can change the number in the command to change how much memory you allocate, but beware that allocating too much of your machine's memory resources could affect the behavior of other applications.

Initializing the Text-Based System

Once the Analyzer is running, you can start the text-based system by running:

./setup.sh

This initializes the following Agents:

  1. Robot Problem Solver: receives n-tuple, solves problem
  2. UI-Agent: receives text, produces n-tuple with help from Analyzer and Specializer (also sets up a proxy connection to the localhost on which the Analyzer runs)
  3. Text-Agent: prompts user for input, sends text to UI-Agent