Test 1

Execution of SIGVerse

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

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

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.

Test 2

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

Making of world file

$ 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

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.

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.

Attachment of controller to agent.

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

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

Next is confirmation of agent control by SIGViewer

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

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.

Back?
Next (Sample of dynamics simulation) ?

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