Wizard

In the wizard page, you can directly control Furhat by assigning certain actions to buttons. This is useful for "wizard of oz" type interactions, when you want a human operator to trigger certain actions. An example would be a stage presentation where you want something more robust than voice activation.

Adding buttons

To add and edit buttons, click the edit tab and you will be presented with an XML document similar to Skill Flows. This XML flow has several tags:

Tag Purpose Options Children
Tab Used to group buttons in a tab Label Sections, buttons
Section Creates a vertical section to group buttons None None
Button A button that triggers one action Label, Key say, gesture, event

Actions

Type Parameters Children
say - Text
gesture name -
event name param (with name parameter and Text children)

Several actions can be listed for the same button. In this case, the actions will be randomized. If you instead want several actions to be triggered in sequence, you will have to throw an event that you catch in the Flow of the Skill you are running.

Example wizard script

<wizard>
  <tab label="MyTab">
        <section>Interaction</section>

    <!-- Says _ONE OF_ the greetings (randomized). This button can be triggered by clicking the H button on a keyboard -->
    <button label="(H)ello" key="H">
            <say>Hello there</say>
      <say>Hi there</say>
        </button>

    <!-- Gesticulates a smile -->
    <button label="Smile">
            <gesture name="smile"/>
        </button>

    <section>Configuration</section>

    <!-- Changes skill to Presentation skill -->
    <button label="Go to Presentation">
            <event name="action.skill">
                <param name="entry">PresentationSkill</param>
            </event>
        </button>

    <!-- Changes to female voice -->
    <button label="Change to female voice">
            <event name="action.voice">
                <param name="gender">female</param>
            </event>
        </button>
  </tab>
</wizard>

Controlling skill with wizard buttons

Wizard scripts can be a powerful tool when combined with the Flow. Instead of having automatic transitions between different states in the Flow, you can trigger events that in turn is picked up in your flow to do transitions OR trigger certain actions.

In the following example, the skill does not do anything on startup. Instead, it listens for events that trigger the start of the presentation. It also has a Smile and Lookaround event that combines a few actions. Note that this event will only be picked up in the Idle state in our example below, since only Idle has a listener for the event.

In wizard script:

<tab label="Skill specific">
  <section>Presentation skill</section>

  <button label="Start swedish">
    <event name="start.swedish"/>
  </button>

  <button label="Start english">
    <event name="start.english"/>
  </button>

  <button label="Smile and Lookaround">
    <event name="smile_lookaround"/>
  </button>
</tab>

In PresentationFlow.xml:

<state name="Idle">
  <onevent name="start.swedish">
    <goto state="Start" p:language="'swedish'"/>
  </onevent>

  <onevent name="start.english">
    <goto state="Start" p:language="'english'"/>
  </onevent>

  <onevent name="smile_lookaround">
    <agent:gesture name="'smile'"/>
    <agent:attend x="0" y="0" z="1"/>
    <wait msec="1000"/>
    <agent:attend x="1" y="0" z="0"/>
  </button>
</state>

<state name="Start">
  <param type="String" name="language"/>
  <onentry>
    <if cond="eq(language, 'swedish'")>
      <agent:say>Välkommen</agent:say>
    <else/>
      <agent:say>Welcome</agent:say>
    </if>
    <!-- To be followed -->
  </onentry>
</state>

Wizarding Furhat's gaze and speech

If you Furhat is equipped with a visual sensor (Microsoft Kinect), you will be able to conveniently use the video screen to direct Furhat's attention. Click on a person or object to have Furhat attend to it.

You can also use the text to speech box to make Furhat speak. One additional feature here is to record sound which you then in turn can have Furhat speak. This is done through the Rec button.

Packaging wizard scripts with Skill

It is possible to package wizard scripts with a skill. If you want to do so:

  1. Create an XML file with a wizard script similar to the below in your package root, or in a subfolder if you prefer.
  2. Call the handler.loadWizardScript() method from the init() method of your skill.
  3. When your skill is started, your wizard script will be loaded in the Wizard tab.
<!-- YourWizardScript.xml -->
<?xml version="1.0" encoding="utf-8"?>
<wizard>
    <tab label="Example">
        <section>Example</section>
        <button label="Example">
            <say>Example</say>
        </button>
    </tab>
</wizard>
// YourSkill.java
public void init() throws Exception {
        SkillHandler handler = getSkillHandler();
        // ...
        handler.loadWizardScript(getPackageFile("YourWizardScript.xml"));
    // ...
  }