Introduction

In Install > Sample Simulation, we loaded its sample project(SampleRobotPD.xml) and checked operations of OpenHRP3.
Here we show the procedure how to make your own project and do simulation.

To make OpenHRP3 available, you need to make a robot model and controller. In this procedure, we use the same names as SampleRobotPD.xml for our descriptions:
Robot model: OpenHRP3/etc/sample.wrl
Controller: OpenHRP3/Controller/server/PDcontroller


PDcontroller is a controller which reads and runs the next files:

PD gain file: OpenHRP3/Controller/server/etc/PDgain.dat
Walking pattern file: OpenHRP3/Controller/server/etc/angle.dat

Launch GrxUI

You can launch GrxUI by this command:

$ cd src/OpenHRP3/bin/unix/
$ ./GrxUI.sh


fig.1: Initial Window

Load of models you use and initial set up

Models are loaded on ItemView as described in fig.2.


fig.2: load models


Some View which deals with model items distingush robot models and environmental models, which are switched by the context menu of Item View as in fig.3.


fig.3: Robot model to Environmental model


Loaded modeles are displayed on 3DView, and their position, attitude, and joint angle become editable.
Content you have edited is set in a property of each model as its initial condition.
You can see joint angles which you are editing in RobotStateView.


fig.4: 3DView and RobotStateView

In the joint angle edit mode , you can rotate each joint by your mouse operations, in addition you adjust joint angels by your cursor key operations.
Here, you set it up to the initial position of the movement file which is loaded by PDcontroller. Please set up seeing the joint angle in the left upper figure.

You also use PropertyView to enter values directly and edit joint angles.

Set up of controllers

If you hava robot models, you can associate them with controllers on OpenHRP/Controller tab.

Controller
Specify CORBA object id of the controller which will be connected.
This time, use "PDcontroller".

Control Time[s]
Specify the execution cycle of controllers.
This time, since the movement pattern is 0.002[s], use 0.002.


fig.5: Edit Controller Settings

Setup of the collision detection pairs

You can edit the collision detection pairs on OpenHRP/Collision tab.
Once you press Add button which exists at center left side, lower half of Collision tab becomes operatable.
If you cannot press Add button, firstly please make sure that models are loaded.


fig.5: Edit Collision Pair

Select models from comboxes Object1 and Object2, and specify links which collision detections are occured at Link1 and Link2.
If you select none at Link, all links in th model are targeted for collision detections.

In this example, we specify collision detections between robot model sample and environmental model longfloor.
Select sample and longfloor from Object1 and Object2 respectively, and press OK button.

Setup of execution condition

On OpenHRP/Simulation, you configure simulation time and so on.
Configurated items are stored in WorldState item, so create WorldStateItem at first.


fig.6: create WorldStateItem

Total Time[s]
Sample controller reads the walking pattern file which has created on ahead, and drives a robot.
Since the execution time of the pattern file is 13.4, specify the value as 13.4.

Integration Step[s]
Similarly, the time step of the pattern file is 0.002, specify 0.002 here.

Loggin Step[s]
Change to Logging Step will reduce file access by recording result, so simulation time can be cut down too.
Here, we specigy 0.002[s] the same value as Integration Step. If the value of Loggin Step[s] is under one of Integration Step, the value of Integration Step will be used instead.


fig.7: Edit Collision Pair

Save of project

States of each item which has been set up by now, can be saved in a project file. Select File->Save Project from the menu to save.


fig.10: Edit Collision Pair

Then, when the dialog of the next figure is displayed, choose whether you save screen configurations.


fig.11: Edit Collision Pair

Setup of Process Manager

In the sample project SampleRobotPD.xml, descriptions are added to run OpenHRP3/bin/unix/PDController.sh automatically when its simulation is started.
Currenty, this configuration cannot be set on GUI.
Thus, after you save your project, please open the project file by a text editor, add the following line in it.

<process id="PDcontroller" com="$(BIN_DIR)/PDController$(BIN_SFX)" dir="$(BIN_DIR)/" hasshutdown="true" autostart="false"/>

Once the line is added, please reload the project for the change to be effected.

Start of Simulation

Please press the button to start the simulation, which is enclosed in as red box.
Model items and CollisionPair items which are selected on Item View at the point you press this button are effective during the simulation.


fig.8: Edit Collision Pair

If the controller which has been set up on OpenHRP/Controller tab is not running, OpenHRP tries to launch it automatically.
In this case, if it is successful to connect the controller, the simulation starts to run.
If it fail to connct, the dialog of the next figure will be displayed to choose one of options:
1. Wait a little more.
2. Start the simulation without a controller.
3. Cancel.


fig.9: Edit Collision Pair

Stop and Quit of Simulation

Simulation Start button changes to Stop/Quit button during simulation.
When Stop/Quit button is pressed, the simulation is stopped and the dialog which answers whether you want to quit appears.
If you press OK button in this dialog, the simulation will quit.

Use of playback function

Simulation results can be played back by using Play, Slow, Forward, Rewind buttons which exist on upper window , and so on.
Simulation results are stored in a WorldState item, and the data at the time which is on the slider is displayed on several views such as 3DView, Graph, RobotStat.

Graph function

Items which are display on graphs are stored in a GraphContents item.
At first, create a GraphContents item on Item View.


fig.10: Create Graph Contents

Next, press Series button on Graph view, and select items to be displayed.
You can select those items after simulations.
Items which you have registered are displayed during playbacks or next simulations.


fig.10: Create Graph Contents