RoboCup Rescue Simulation using Google Earth
RoboCup Rescue Simulation using Google Earth

This documentation is written for version 1.0.0 of RoboCup Rescue Simulation using Google Earth(RCRSuGE).
The files are found this web site(http://sakura.meijo-u.ac.jp/~sato2008/Robocup/document/RCRSuGE.zip)
The tool can do following,
- Generate Map of Rescue Simulation from GIS data.
- View log files of Rescue Simulation on GoogleEarth.
Required environment
Microsoft Windows XP/Vista, Linux, java (later 1.5), ruby(later 1.8), postgreSQL(later 8.0), GoogleEarth.
The tool uses Windows, because ruby AP that can access GoogleEarth are available only Windows.
|
Windows |
Linux |
| java |
|
|
| ruby |
|
~ |
| postgreSQL |
|
|
| GoogleEarth |
|
~ |
RCRSuGE.zip contains following files,
- Windows
- src
- RCR.rb
- ConvertToBin.bat
- method.rb
- mcenter_4.rb
- kml.rb
- RCRS-GE
- GML
- BuildingInsertSql.rb
- GetBuilding.rb
- RCRTOOL
- RCRsql
- Linux
Installation
Setup System
Run the RCRSuGE
Now problem
Future works
Installation
Running RCRSuGE requires followings,
- postgreSQL
- ruby
- java
- GoogleEarth
- RoboCup Rescue Simulation
RCRSuGE uses postgreSQL to manage map data.
Install on Windows.
Refer postgreSQL's HP.
Select Country, and download postgreSQL installer.
Run the postgreSQL installer.
RCRSuGE uses ruby.
Install on windows.
- Refer RUBYFORGE, and download ruby186-26.exe(08/7/19).
- Run the ruby186-26.exe.
- Check installed ruby.
If terminal outputs following sentence, your computer installed ruby.
C:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
|
- Install ruby-postgres
Install ruby-postgres using rubygems, because ruby is going to be able to access postgreSQL.
- Click [windows menu->all programs->ruby->rubygems->rubygems package manager]
You need to setup proxy of rubygems, when your network uses proxy.
| C:\ruby>
set http_proxy=http://YourProxyAddress:port |
YourProxyAddress and port are your status.
C:\ruby>
gem install ruby-postgres
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i386-mswin32)
1. ruby-postgres 0.7.1.2006.04.06 (ruby)
2. ruby-postgres 0.7.1.2006.04.06 (mswin32)
3. ruby-postgres 0.7.1.2006.04.05 (ruby)
4. ruby-postgres 0.7.1.2006.04.05 (mswin32)
5. Skip this gem
6. Cancel installation
> 2 |
- Check installed ruby-postgres.
-
When terminal outputs following sentence, your computer installed ruby-postgres.
C:\ruby>
gem list
ruby-postgres (0.7.1.2006.04.06)
Ruby extension library providing an API to PostgreSQL |
- Refer java's HP
- Run the java installer.
java is used RCRSuGE and Robocup Rescue Simulation.
If you use Windows and Linux, you install java both Windows and Linux.
- Refer GoogleEarth's HP.
The tool uses GoogleEarth COM API, because it is going to be able to access GoogleEarth.
- Refer Google COM API, and save earth.idl.
- Put earth.idl onto directory "C:\Program Files\Google\Google Earth\ "
- Input following command with terminal, so the tool can use GoogleEarth COM API.
| C:\>
"C:\Program Files\Google\Google Earth\googleearth.exe" /RegServer |
| RoboCup Rescue Simulation |
Refer RescueAgents HP
Setup system
Set environment to use RCRSuGE.
| To set environment variables. |
Set following environment variables.
RUBYOPT=-rubygems
PGLIB=C:\hogehoge\PostgreSQL\8.2\lib
Path=c:\hogehoge\ruby\bin;c:\hogehoge\PostgreSQL\8.2\bin
|
| To create databases and tables. |
Create databases to manage map data.
Example
C:\>
cd \"Program Files"\PostgreSQL\8.2\bin
C:\Program Files\PostgreSQL\8.2\bin>
|
- Create a database.
In example, DBNAME is the name of database to create. USERNAME is the name of the username.
C:\Program Files\PostgreSQL\8.2\bin>
createdb -U USERNAME DBNAME
Password:
Input password
CREATE DATABASE |
- Access a database.
C:\Program
Files\PostgreSQL\8.2\bin>psql
-U USERNAME -h localhost DBNAME
Password for user postgres::Input password
|
When terminal outputs following messages, You can use SQL command.
Type: \copyright for distribution
terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
maplist=# |
- Create following dabatases and tables to store map data and to manage scope.
Use command list to create tables in maplist.
Use command list to create tables in Robocup.
- maplist
Database named maplist manages scope and areas status.
- areaoffset
A table named areaoffset manages areas status.
The tool creates following datas, when you insert map data.
Column | Type | Modifiers
-------------+---------+-----------
area | integer | not null
offset_x | integer |
offset_y | integer |
nodenum | integer |
roadnum | integer |
buildingnum | integer |
Indexes:
"areaoffset_pkey" PRIMARY KEY, btree (area)
|
- scope
A table named scope manages latitudes and longitudes of objects maps.
A column named 'area' related table named maplist.
The tool insert following datas within a scope that you set.
Column | Type | Modifiers
---------+----------------+-----------
area | integer |
x_under | numeric(20,10) |
x_top | numeric(20,10) |
y_under | numeric(20,10) |
y_top | numeric(20,10) |
id | text | not null
Indexes:
"scope_pkey" PRIMARY KEY, btree (id)
|
- Robocup
following tables correspond to the files of RCRS.
- aichi_test
The table contains building's apexs.
Column | Type | Modifiers
----------+-----------------------+-----------
id | integer |
outlinex | character varying(20) |
outliney | character varying(20) |
|
- building
The table contains building's properties.
Column | Type | Modifier
--------------+-----------------------+---------
id | integer | not null
x | character varying(20) |
y | character varying(20) |
connectid | integer |
buildingarea | character varying(20) |
Indexes:
"building_pkey" PRIMARY KEY, btree (id)
|
- road
The table contains road's properties.
Column | Type | Modifiers
--------+---------+-----------
headid | integer |
tailid | integer |
id | integer | not null
width | integer |
Indexes:
"road_pkey" PRIMARY KEY, btree (id)
|
- node
The table contains node's properties.
Column | Type | Modifiers
--------+-----------------------+-----------
id | integer | not null
x | character varying(20) |
y | character varying(20) |
Indexes:
"node_pkey" PRIMARY KEY, btree (id)
|
Conditions of map data to use are following,
- Map data contains apex of building.
- Map data contains point of node.
- Data of road in map data contains same as headid and tailid.
- Map data is written in same as XML.
- Latitudes and longitudes are written in World Geodetic System 1984(WGS84).
- Get source for windows,
and put directory: windows/src onto "C:\Program Files\Google\Google Earth\googleearth\ ".
- Data of building
- Data of node and road
When you insert map data which you get in database,
- ID of map data may not be unique.
- You must change program.
Please wait version up.
Copy programs, in directory:Linux/src, onto name accords Directories in Robocup Rescue Simulation.
Run the RCRSuGE
- Run the RCR.rb.
- Run the ConvertToBin.bat.
- Copy Map data of RCRS.
- Run the RCRS.
- Copy snapshots.
- Run the RCRprint.rb
- View logfile of RCRS on GoogleEarth.
- Run the RCR.rb
C:\>
cd C:\Program Files\Google\Google Earth\googleearth\src
C:\Program Files\Google\Google Earth\googleearth\src\>
ruby RCR.rb |
- Viewing KML file(building ,road) on GoogleEarth.
Viewing KML file of building in GML/building and road in RCRS-GE/output on GoogleEarth.
Create scope:1
Delete one scope:2
Delete all scope:3
Convert to txt files from GIS:4
Open kml file:5
Put scope on GoogleEarth:6#un-supported
Exit number:99
Input:5
"kmlfile of Building"
[".", "..", "building_23116_2.kml"]
Input filename of kml:
building_23116_2.kml
"kmlfile of road"
[".", "..", "23623node.kml", "23623road.kml"]
Input filename of kml:
23623road.kml
Do one more ? yes / no:
|
- Save scope
Save scope into table named scope.
Elements of scope are latitudes and longitudes of scope outputting window of GoogleEarth.
C:\Program Files\Google\Google Earth\googleearth\src\>ruby RCR.rb
Manage MAP of Robocup simulation Using GoogleEarth
Create scope:1
Delete one scope:2
Delete all scopes:3
Open kml file:5
Put scope on GoogleEarth:6#un-supported
exit:99
input:1 |
Save point of Simulation.
Set scope yourself.
|
When you set a scope,viewing location is point viewed direct above.Check it seeing upper right-hand compass.
Or the tool may not create map data of RCRS.
Ready? yes or no:yes
x-width:2529.98385362676(m)
y-width:1943.37507611534(m)
Input ID's name this scope:****
Do one more ? yes / no: |
- Conversion to txt file from map data in database in scope to select.
The tool outputs onto output/scopename? txt file of building, buildingcenter, road, node, offset.log, galpolydata.dat and shindopoly.dat.
These txt files contain following,
(example)
- Txt file of building contains building ID and building apex.
- Txt file of buildingcenter contains building ID and center point of building.
- Txt file of road contains tailid, headid, road ID, and width(constant).
- Txt file of node contains node ID and point of road.
The offset.log contains following,
(example)
- Offset.log decide when Area of scope match area of areaoffset.
- Offset.log is column offset_x,offset_y in table areaoffset.
The galpolydata.dat and shindopoly.dat contains following,
(example)
- Two dat files are size of scope.
scopename? is the name of the scope.
Do one more ? yes / no:
yes
Create scope:1
Delete one scope:2
Delete all scopes:3
Convert to txt file from GIS:4
Open kml file:5
Put scope on GoogleEarth:6#un-supported
Exit:99
Input number:4
Input username on database:****
Input password:****
["tenpaku-small", "tenpaku", "tenpaku-big", "atsumi3", "atsumi2"]
Select Scope Converting:****
Make galpolyfile
Make shindopolyfile
Make offsetfile
Make nodefile,node count 238
Make roadfile,road count 349
Make buildingfile,building count 298
|
- Run the ConvertToBin.bat
- Select a directory to create txt files.
The tool Converts BIN files of RCRS from txt files.
c:\Program files\Google\Google Earth\src>ConvertToBin.bat
atsumi2
atsumi3
select directory:directoryname?
|
directoryname? is the name of the directory.
- Automatic random generation at gisini.txt.
* is arbitrarily number.
Number of IgnitionPoints, Fire Stations, AmbulanceCenters and PoliceOffices aren't over number of building.
Input the number of Civilians :*
Input the number of FireBrigades :*
Input the number of Ambulances :*
Input the number of PoliceForces :*
Input percentage of Agents in Building (Integer):*
Input the number of IgnitionPoints :*
Input the number of Refuges :*
Input the number of FireStations :*
Input the number of AmbulanceCenters :*
Input the number of PoliceOffices :*
|
The tool outputs MAP files in Directory: src/output/hogehoge/MAP.
Map files contains following;
- building.bin
- node.bin
- road.bin
- galpolydata.dat
- shindopolydata.dat
- gisini.txt
The tool doesn't create brockades.lst.
- Copy MAP data of RCRS
Create arbitrarily Directory in Directory: RCRS/maps/.(Now Directory's name is atsumi)
Copy output MAP files onto Directory: RCRS/maps/atsumi/
- Run the RCRS
hogehoge@$
cd home/hogehoge/0.49plus/boot
hogehoge ~hogehoge/0.49plus/boot$
./all.sh atsumi
wait a minutesEEE
hogehoge ~hogehoge/0.49plus/boot$
./sampleagent.sh
|
The tool outputs snapshots onto Directory: boot/viewer42/robocupsample every step.
You can change config of snapshot, if you edit viewer.conf on Diretory:boot/viewer42.
- Copy snapshots
Copy snapshots which are got in Linux onto src/RCRsql/output/atsumi/image (Now Directory's name is atsumi).
- Run the RCRprint.rb
|
C:\>
cd c:\Program Files\Google\GoogleEarth\src\RCRsql
C:\Program Files\Google\GoogleEarth\src\RCRsql:>
ruby RCRprint.rb
|
The tool outputs KML file viewing on GoogleEarth onto Directory: src/RCRsql/output/atusmi/image/.
- View logfile of RCRS on Googleearth.
You view KML file on GoogleEarth, and view logfile of RCRS on GoogleEarth.
Now problem.
Future work.
- Convert to KML file from rescue.log.
- Edit that Course of action become more smooth.
- Run Linux only.