Up:[[Tutorial]]

----
#contents

This tutorial is valid only for SIGVerse later than v2.1.0.
This tutorial explains how to start up the SIGVerse server and connect to the server from the SIGViewer.

* Test 1 [#mac35c2d]

** Setting of environment variables (in case of bash) [#z73f2362]

Open the .bashrc to add configuration for the SIGVerse.

 $ emacs ~/.bashrc

Add the following three lines to the .bashrc

 export SIGVERSE_PATH=/home/<username>/sigverse-<version>
 export PATH=$PATH:$SIGVERSE_PATH/bin
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Set a path name of your SIGVerse directory to an environment variable SIGVERSE_PATH.
<username> and <version> should be replaced according to your configuration.

Initialize the bash environment.

 $ source ~/.bashrc

If you upgrade the SIGVerse, please modify the version number in your .bashrc file.


** Execution of SIGVerse server [#ia8d165b]

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 recommended.

$ sigserver.sh

 + '[' -z ']'
 + LD_LIBRARY_PATH=/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server
 + SIGVERSE_X3DPARSER_CONFIG=/home/hoge/sigverse- 2.1.0/share/sigverse/etc/X3DParser.cfg
 + SIGVERSE_RUNAC=/hoge/okamoto/sigverse-2.1.0/bin/sigrunac
 + SIGVERSE_DATADIR=/home/okamoto/sigverse-2.1.0/share/sigverse/data
 + export LD_LIBRARY_PATH SIGVERSE_X3DPARSER_CONFIG SIGVERSE_RUNAC  SIGVERSE_DATADIR
 + /home/hoge/sigverse-2.1.0/bin/sigserver
 [SYS]  ///////// //////////////////////////////////////////////////
 [SYS]  ////////////// World number 0  (port 9000) ///////////////
 [SYS]  ///////////////////////////////////////////////////////////
 [SYS]  data directory :
 [SYS]       [1]  /home/hoge/sigverse-2.1.0/share/sigverse/data/xml/
 [SYS]       [2]  /home/hoge/sigverse-2.1.0/share/sigverse/data/shape/
 [SYS]  world file : MyWorld.xml
 [SYS]  building entity (entName=(Robot-nii), className=(Robot), X3DFileName= (/home/hoge/sigverse-2.1.0/share/sigverse/data/shape/robot_nii_v2.x3d))
 read /home/hoge/sigverse-2.1.0/share/sigverse/etc/X3DParser.cf g
 *** JavaVMOption ***
 options[0].optionString = (-Djava.class.path=/home/hoge/sigverse- 2.1.0/share/sigverse/jar/X3DParser.jar:/home/hoge/sigverse- 2.1.0/share/sigverse/jar/xj3d-all.jar)
 options[1].optionString = (-Djava.library.path=/tmp)
 Java VM start ok
 [SYS]  waiting for connection...

The above messages indicate that the SIGVerse server has started successfully.

If you did not specify a port number, the port number and world number are assigned automatically.
In the above case, world number 0 and port number 9000 are assigned.


////////////////////////////////////////////


** Connecting the SIGViewer to the server [#y7f89e99]

Next, execute the SIGViewer to connect to the server. Double click the SIGViewer.exe to start the SIGViewer.

*** Setting of a service name [#y1a99590]

Set a service name after the SIGViewer window opened.
Communication between the SIGVerse server are controlled by service name.
Especially, image capture function are embedded in the SIGViewer; transfer of image data requires service name.
In this case, put service name "SIGViewer" as the default name.


*** In a case not using SSH connection [#d2cca02a]

Input the hostname of SIGVerse server and the world number (or port number) assigned in the above process.

#ref(./connectServer1.PNG,60%)


If you cannot use general port number such as 9000 to connect to the server due to some security reasons, port forwarding between your server and client is required.

*** In a case that port forwarding is set by yourself [#f40300df]

If you always use your favorite port forwarding application. 
Input "localhost" in the hostname field; input the port number used in the port forwarding function.


#ref(./connectServer2.PNG,60%)

*** In a case that port forwarding should be set by SIGViewer [#f1d45246]

If you don't have any port forwarding application. You can use SSH connection function in the SIGViewer.
Finish the configuration written in [[SSH connection by SIGViewer]] before this tutorial.
Input the hostname of the SIGVerse server and the world (or port) number. Check the 'Connected by SSH'.
Next, input your account name and pass phrase of SSH connection.

#ref(./connectServer3.PNG,60%)

*** Connection [#tc808dc8]

You will see the following robot agent with clicking the "Connect" button.

#ref(./connectServer4.PNG,50%)

// SIGViewerの視点や方向を変えるには画面上でCtrl(もしくはShift)を押しながら右クリック、または右クリックした状態でマウスを動かします。
You can change the direction of eyesight, by pushing Ctrl button and click right button of the mouse while putting the mouse pointer over the frame of SIGViwer.

If the connection succeeded, the following messages should be appeared at the server side.
 [SYS]  waiting for connection...
 [SYS]  SIGViewer is connected
 [SYS]  Service: "SIGViewer" is available


////////////////////////////////////////


** Stop of SIGVerse server [#q41da429]

To pause the simulation, click the STOP button on the right buttom tray of the SIGViewer.
To quit the simulation, click the "Quit Simulation" button. You can terminate server process from the SIGViewer.

If you want to terminate the server process on the server side, click the "Disconnect" button.
Then, push Ctrl+C on the server's shell window. If the SIGVerse server keeps on running even though the termination, please terminate again using the following command:

 $ sigkill.sh
 
You can check running processes by the command:

 $ ps aux | grep $(whoami)

Up:[[Tutorial]]

#counter

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes