Usage of World Simulators

OpenHRI has a virtual simulation environments to test human robot interaction function without using real robot.

In this chapter we explain the usage of the world simulators.

../_images/blocksworld.png

Install

Windows platform

  1. Install OpenHRIWorlds package

Download and run the installer from following URL:

http://openhri.net/getinstaller.php

The installer will show the current available packages. Select “OpenHRIWorlds” package.

  1. Install OpenHRPSDK

Download and run the “OpenHRP SDK Windows” installer available from following URL:

http://openrtp.info/openhrp3/jp/download.html

Ubuntu platform

Ubuntu version is currently not available.

BlocksWorld Simulator

In BlocksWorld simulator, we can examine the scenario of handling boxes using Mitsubishi Heavy Industries PA10 arm robot.

Running the simulation

  1. Run OpenHRP

Open the explorer and double click the “GrxUI.exe” in “C:\Program Files (x86)\OpenHRPSDK\GrxUI” folder.

Note

We recommend to create a shortcut of GrxUI.exe on the desktop for later use.

  1. Run BlocksWorld simulator
Choose “BlocksWorld” from “Start Menu > OpenHRI > worlds”.

Please confirm multiple blocks and PA10 arm will show up on the view panel of OpenHRP (the robot should perform single pick-and-place demonstrative movement).

Note

When the BlocksWorld simulator fails to run

It may happen that the BlocksWorld simulator fails to run (we are still investigating the reason yet). In that case, please follow the next procedure:

  1. Load sample OpenHRP project.

    Select “GrxUI > Read Project” from the menu. Load “PA10Sample” from “C:\Program Files (x86)\OpenHRPSDK\share\OpenHRP-3.1\sample\project”.

  2. Run OpenHRP simulation once.

    Press “Start” button to run the simulation (you can stop any time).

  3. Clear the OpenHRP view.

    Select “GrxUI > New Project” from the menu.

  4. Run the BlocksWorld simulator.

    Now, run the BlocksWorld simulator again and check the behavior.

Function of the BlocksWorld Component

BlocksWorld simulator provides OpenRTM port interface to communicate with the other component.

PA10 arm of the BlocksWorld simulator can be controlled by sending following text commands to the “command” port:

grasp
Grasp hand to pick object.
release
Release hand to place object.
moveHandToBox [name]
Move hand above the block specified by the [name]. You can specify “box1”, “box2” and “box3”.
moveHandXY [X] [Y]
Move hand to [X][Y] meters relative to the current position.

Test Script

Here, we show the example of controlling PA10 arm using voice commands.

  1. Speech recognition grammar:
<?xml version="1.0" encoding="UTF-8" ?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/06/grammar
                             http://www.w3.org/TR/speech-grammar/grammar.xsd"
         xml:lang="en"
         version="1.0" mode="voice" root="command">
  <rule id="command">
    <one-of>
      <item>
	<item repeat="0-1">little more</item>
	<one-of>
	  <item>front</item>
	  <item>back</item>
	  <item>left</item>
	  <item>right</item>
	</one-of>
      </item>
      <item>
	<one-of>
	  <item>red</item>
	  <item>blue</item>
	  <item>green</item>
	</one-of>
	<item repeat="0-1">box</item>
      </item>
      <item>pick it</item>
      <item>put it</item>
    </one-of>
  </rule>
</grammar>
  1. Dialogue script:
<?xml version="1.0" encoding="UTF-8"?>
<seatml>
  <general name="sample">
    <agent name="speechin" type="rtcin" datatype="TimedString" />
    <agent name="command" type="rtcout" datatype="TimedString" />
  </general>
  <state name="OPEN">
    <rule>
      <key>pick it</key>
      <command host="command">grasp</command>
    </rule>
    <rule>
      <key>place it</key>
      <command host="command">release</command>
    </rule>
    <rule>
      <key>green [box]</key>
      <command host="command">moveHandToBox box1</command>
    </rule>
    <rule>
      <key>red [box]</key>
      <command host="command">moveHandToBox box2</command>
    </rule>
    <rule>
      <key>blue [box]</key>
      <command host="command">moveHandToBox box3</command>
    </rule>
    <rule>
      <key>forward</key>
      <command host="command">moveHandXY 0.1 0.0</command>
    </rule>
    <rule>
      <key>back</key>
      <command host="command">moveHandXY -0.1 0.0</command>
    </rule>
    <rule>
      <key>left</key>
      <command host="command">moveHandXY 0.0 0.1</command>
    </rule>
    <rule>
      <key>right</key>
      <command host="command">moveHandXY 0.0 -0.1</command>
    </rule>
    <rule>
      <key>little more forward</key>
      <command host="command">moveHandXY 0.05 0.0</command>
    </rule>
    <rule>
      <key>little more back</key>
      <command host="command">moveHandXY -0.05 0.0</command>
    </rule>
    <rule>
      <key>little more left</key>
      <command host="command">moveHandXY 0.0 0.05</command>
    </rule>
    <rule>
      <key>little more right</key>
      <command host="command">moveHandXY 0.0 -0.05</command>
    </rule>
  </state>
</seatml>

Load each files to Julius component and SEAT component. And connect “command” port of SEAT component to “command” port of BlocksWorld component.