#contents

* Test 1 [#mac35c2d]

** Execution of SIGVerse [#t5321241]
Execute SIGVerse server on the server. 
  $ cd ~/sigverse-<version>/bin

You can execute the SIGVerse server, using shell script sigserver.sh put on ~/sigverse-<version>/bin. You should specify a port number with -p option to be used for server/client connection. You should choose free port number. Over 9000 is recommendation.
  $ ./sigserver.sh -p 9001

 [SYS]  data directory :
 [SYS]   [1]  /home/<username>/sigverse-100317/share/sigverse/data/xml/
 [SYS]   [2]  /home/<username>/sigverse-100317/share/sigverse/data/shape/
 [SYS]  world file : MyWorld.xml
 [SYS]  reading /home/<username>/sigverse-  100317/share/sigverse/data/shape/sample3.x3d...
 read /home/<username>/sigverse-100317/share/sigverse/etc/X3DParser.cfg
 *** JavaVMOption ***
 options[0].optionString = (-Djava.class.path=/home/okamoto/sigverse-  
 
 &b100317/share/sigverse/jar/X3DParser.jar:/home/<username>/sigverse- 
 
 100317/share/sigverse/jar/xj3d-all.jar)
 options[1].optionString = (-Djava.library.path=/tmp)
 Java VM start ok
 all done.[SYS]  waiting for connection...

The above messages indicates that the SIGVerse server have started.

Puch Ctrl-z to suspend the server to progress the next step.


** Stop of SIGVerse server [#s82876bf]

If you didn't quit the SIGVerse server, the port number used in the process will be blocked. You should quit the process with kill command.

The following shell script is one of the useful solution.
 $ cd ~
 $ emacs kill.sh

 #!/bin/bash
 
 for i in `ps aux | grep sig | grep <username> | awk '{print $2}'`; do
     echo process id: $i
     kill -9 $i
 done
 
// for i in `ps aux | grep sigserver | grep <username> | awk '{print $2}'`; do
//     echo process id: $i
//     kill -9 $i
// done

<username> indicates your account ID.

 $ chmod 744 kill.sh
 $ ./kill.sh
     :
 [1]+  Stopped           ./sigserver.sh -p 9001  (wd: ~/sigverse-100908/bin)
The following message indicates quit of the process.

If you don't know detail mechanism of process management, you should execute kill.sh after you used the SIGVerse on host server.



//**SIGViewerの起動 [#k2157e91]
//
//インストールが完了したら、サーバ側でまずSIGVerseを起動します。
//
//$ cd ~/sigverse-<version>/bin
//$ ./sigserver.sh -p 9001

//次にSIGViewerを起動し、"Connection"の枠の中にある"server host name"に接続するサーバのホスト名、"server port No"にサーバで-pオプションを使って指定したポート番号を入力します。ポートフォワーディングによる接続方法は[[こちら>ポートフォワーディングでサーバに接続する方法]]

//次にサーバ側でSIGVerseを起動した状態でSIGViewerの"Connect to SimServer"ボタンを押してサーバに接続します。

//※この時firewallによるブロックを行いますかと聞かれることがあります。ここではfirewallによるブロックを解除するを選択してください。firewallによるブロックをすると一部使えない機能があります。


//#ref(inst_1.jpg)

//ここでSIGViewerで接続しても現時点では何も見えないと思います。

//SIGViewerを終了するときは、Disconnect SimServerボタンをクリックして接続を断ってから終了します。

//**SIGViewerの設定 [#r909f8c1]

//SIGViewerの設定はインストールした場所
//(デフォルトではc:\Program Files)
//の

//SIGViewer_*.*\release\
//
//にあるstartup.cfgで行います。
//
//このファイルではSIGViewerのカメラの位置や視線の方向などの設定を行えます。


*Test 2 [#s6aed4d4]

Next, try to put several objects on virtual environment using world file.

** Making of world file [#gde6249c]
 $ cd ~/sigverse-<version>/share/sigverse/data/xml
You should put the world file on this directory. The world file is described in XML format; it configures properties of objects and agents

 $ emacs test.xml

test.xml

 <?xml version="1.0" encoding="utf8"?>
 <world name="myworld">
 
   <!--gravity parameter-->  
   <gravity x="0.0" y="-9.8" z="0.0"/> 
   
   <!--Create instance of agents-->
   <instanciate class="seToy_D.xml">
 
         <!--Name of agent-->
         <set-attr-value name="name" value="Toy_D"/>
         
         <!--Switching of dynamics calculation-->
         <set-attr-value name="dynamics" value="false"/>
        
         <!--Set language of controller: C++ -->
         <set-attr-value name="language" value="c++"/>
 
   </instanciate>
 </world>

The above world file will put one penguin agent in the virtual environment.

** Execution [#zb401a43]
Execute the SIGVerse server by the following commands.

 $ cd ~/sigverse-<version>/bin
 $ ./sigserver.sh -w test.xml -p 9001 &

The world file created on the previous section is specified by -w option.

Next, input host server name and port number on SIGViewer; Click "Connect to SimServer" to connect to the server.

#ref(test_1.jpg)

You must see the penguin agent.

You can see the following messages after the establishment of connection. (if you uses port forwarding)
 all done.[SYS]  waiting for connection...
 [SYS]  attach view : polling
 [SYS]  127.0.0.1 connected
 [SYS]  SIGViewerDataPort : dataport
 [SYS]  127.0.0.1 connected
 [SYS]  127.0.0.1:8000  : service provider
 [SYS]  127.0.0.1 connected

You can change the direction of eyesight, with pushing Ctrl button and click right button of the mouse with putting the mouse pointer on the frame of SIGViwer.

//それではSIGViewer、メインサーバを一度終了します。(この時先ほど作成したkill.shを実行します。)

** Attachment of controller to agent. [#g5d2f358]

Controller should be attached on every agents to control.
You can attach several sample controllers. Let's test the attachment with this sample controllers.

//まずSIGVerseを起動します。
// $ cd ~/sigverse-<version>/bin
// $ ./sigserver.sh -w test.xml -p 9001 &

// all done.[SYS]  waiting for connection...

//この状態ではメインサーバではエージェントがアタッチされるのを待っています。

Input the following commands when you can see the penguin agent.
This commands read a controller module and attach it to the agent.

 $ ./sigrunac -l ../share/sigverse/samples/GoRound.so -n Toy_D -p 9001

If you can see the below message, attachment is succeeded.

 [SYS]  Controller attached to "Toy_D"
 [SYS]  127.0.0.1 connected
 [SYS]  Toy_D : dataport
 [SYS]  127.0.0.1 connected

sigrunac attaches the specified controller module to a agent. Controller module is specified by the -l option; a name of target agent should be specified by -n option.
You can use several sample controllers put on the
following directory.
 sigverse-<version>/share/sigverse/samples/
For example, GoRound.so controls make an agent roll at initial position; Toy_D is the name of penguin like agent.

** Confirmation of control by SIGViewer [#e8a2a1fe]
Next is confirmation of agent control by SIGViewer

Click Send button after changing the status of SIM_CTRL_CMD frame to START.

#ref(test_2.jpg)

You should see the penguin agent is rolling in the SIGViewer.

If you want to quit the SIGVerse server, click the Send button after changing SIM_CTRL_CMD frame to STOP.

Let's go to the next section, how to make the controller.

LEFT:[[Back>Tutorial]]
RIGHT:[[Next (Sample of dynamics simulation) >Samples/Dynamics simulation]]


Front page   New List of pages Search Recent changes   Help   RSS of recent changes