Giter Site home page Giter Site logo

rcrs-server's Introduction

Robocup Rescue Simulation Server

(Linux) Instructions to download, build and run the RoboCup Rescue Simulator (RCRS)

Software Pre-Requisites

  • Git

  • OpenJDK Java 17

Installation

Download project from GitHub

$ git clone [email protected]:roborescue/rcrs-server.git

Compile the project

$ cd rcrs-server

$ ./gradlew completeBuild

Execute the Rescue Simulation Server

Open a terminal window, navigate to the rcrs-server root directory and execute

$ cd scripts

$ ./start.sh -m ../maps/test/map -c ../maps/test/config

Tools

Map Editor

Open a terminal window, navigate to the rcrs-server root directory and execute

$ ./gradlew gmlEditor --args='<map file path>'

where --args=<map file path> is optional.

Example

./gradlew gmlEditor --args='maps/test/map/map.gml'

Scenario Editor

Open a terminal window, navigate to the rcrs-server root directory and execute

$ ./gradlew scenarioEditor --args='<scenario path>'

where --args=<scenario path> is optional.

Example

./gradlew scenarioEditor --args='maps/test/map'

Random Scenario

Open a terminal window, navigate to the rcrs-server root directory and execute

$ ./gradlew randomScenario --args="'<map path>' <options>"

where <map path> is the path to the map directory and <options> are the minimum and maximum value for each entity in the scenario. The <options> are optional.

Example

./gradlew randomScenario --args="'../maps/test/map' -civ 0 100 -fb 0 10 -fs 0 1 -pf 0 10 -po 0 1 -at 0 5 -ac 0 0 -refuge 0 2 -fire 0 0"

Log Viewer

Open a terminal window, navigate to the rcrs-server root directory and execute

$ ./gradlew logViewer --args="'-c' '<config file>' '<log path>'"

where <config file> is the path to the log viewer configuration file, default config/logviewer.cfg. The <log path> is the rescue log file path, default logs/log/rescue.log.

Example

./gradlew logViewer --args="'-c' 'config/logviewer.cfg' 'logs/log/rescue.log'"

osm2gml

Open a terminal window, navigate to the rcrs-server root directory and execute

$ ./gradlew osm2gml --args="'<osm map path>' '<gml map path>'"

The <osm map path> is the path to the OSM map file and the <gml map path> is the destination GML map path.

Example

./gradlew osm2gml --args="'/home/user/newmap.osm' '/home/user/newmap.gml'"

Known Problems

Slow agent connection

If the scenario have many agents, the agents connection to the server may slow down at certain moment. To overcome this issue, you should

  1. Install the rng-tools package

  2. Edit the ` /etc/defaults/rng-tools` and add the line HRNGDEVICE=/dev/urandom

  3. Start the rng daemon /etc/init.d/rng-tools start

Important
This instructions are valid for Ubuntu. The package name and initialization commands may change on other distributions.

Support

To report a bug, suggest improvements or request support, please open an issue at GitHub https://github.com/roborescue/rcrs-server/issues.

rcrs-server's People

Contributors

alim1369 avatar amiraslanaslani avatar armanaxh avatar arminkz avatar camski avatar ffaraji avatar gnardin avatar kandeh avatar modaresimr avatar okanasik avatar oscar-lima avatar pooria avatar salimm avatar taikusa avatar tkmnet avatar uiiaoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rcrs-server's Issues

Agents refuse to connect to server

When I attempt to run the server and launch the sample-agents an error occurs. I've been having trouble figuring out the reason, so any help is greatly appreciated.
computer: hp
os: ubuntu 20.0.4 virtual machine
java: openjdk version "17.0.4" 2022-07-19
gradle: Gradle 7.5.1
git: git 2.25.1
logs:
logs.zip

rcrs issues

start.sh arguments wrong

The usage instructions to run the RCRS do no correspond exactly to the available options and required arguments.

ProtoBuf not completely implimented

I have take a look at this class. You can see that the main part is still in the traditional way.
I think we should change it.
/rcrs-server/modules/rescuecore2/src/rescuecore2/connection/AbstractConnection.java

The bed continues occupied

I want to treat the civilian who has suffered more critical damage. Therefore, I tried to move the civilian who is already in bed by the "load" command.
But, the following happens:

  • Treatment for another civilian in the queue does not start because the loaded civilian continue to occupy the bed.
  • The loaded civilian's Damage property increases gradually at each step.
  • The bed continues occupied if the loaded civilian's HP property reaches 0.

Question about 'merge nodes' functionality in rcrs-server's gml-editor.

I am creating maps in RRS and have a question about the gml-editor functionality implemented in rcrs-server.

The question is regarding the function "merge nodes" within gml-editor. From its name, I expected it to merge one node with another node. However, it actually appears to be a process of superimposing one node on another.

It seems that using this "merge nodes" function causes errors in the nodes that overlap in the "validate map" (a function that can check the location of bugs that occur during simulation). Is there any documentation on what conditions each feature works under or is there any documentation on it?


merge_node

gradle clean command gives error

Terminal log:

user@user-pc:rcrs-server $ gradle clean

FAILURE: Build failed with an exception.

* Where:
Build file '/home/oscar/repos_cloned/rcrs-server/build.gradle' line: 10

* What went wrong:
A problem occurred evaluating root project 'rcrs-server'.
> Could not find method implementation() for arguments [directory '/home/oscar/repos_cloned/rcrs-server/lib'] on root project 'rcrs-server'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.671 secs

Why ProtoBuf uses urn id?

I understand the urn id saves more memory than using string and I completely agree with that however I think it would be better to use enum in protobuf.
I think this will be more consistent and we can consider and maintain all enums ids in protobuf file.

resq-fire.wind_speed parameter not working properly

If the value of the parameter resq-fire.wind_speed is greater than 0, the fire spreads too fast and it does not make difference if the value is 1 or a greater value.
To observe and reproduce the problem, run any scenario with the parameter resq-fire.wind_speed in the resq-fire.cfg set to 0 and then run the same scenario with the same parameter set to 1.

Problems when trying to start the server

When we use the command bash start.sh , the terminal keeps showing "Still waiting for 'Listening for connections'...". We tried for a long time but couldn't figure out what the problem was

Compatibility of log files on the new server with the previous server

JapanOpen 2021 will be held next week.
We want to use our web viewer, which my student in RoboCup 2021 presented, in the event.
But, we guess that we can not use the web viewer because it seems that log files of the new server lack compatibility with the previous server.
Can the latest server output the old-style log file?
If it is possible, we can use the web viewer.
In the sight of reusability, it is important to keep compatibility with past resources such as log files and some programs.
At least, we need an option to use the old one.

My students said they found the descriptions for outputting the old-style log file in the server.
Can you activate them?

Request for Modification Regarding Map Score Calculation Method

Hello, I'm a student at Nobuhiro's lab.
I'm involved in map creation. I have a question related to maps.
It is about the method of calculating scores for maps.
In the score.cfg file of each map, the score calculation method is set to

score.function : rescuecore2.standard.score.LegacyScoreFunction

However, I think this method also affects the score of fires that are not currently occurring.
Therefore, by using the following program, it is possible to calculate the score based only on the health of the citizens.

score.function : rescuecore2.standard.score.RSL21ScoreFunction

Could you please confirm and make the necessary modifications ?

Why time step is slow?

When I run the simulator based on introduction manual(start.sh -m ../maps/gml/Kobe2013/maps -c ../maps/gml/Kobe2013/config), it takes 5 seconds for each time steps.
Does it usually take five seconds for each step? Is there a way to change it?

Installation error

Cloning the RCRS-Server repository and running the commands
ant clean
ant
generates the following error

BUILD FAILED
/home/gnardin/rcrs-server/build-javadoc.xml:5: javax.script.ScriptException: ReferenceError: "importClass" is not defined in at line number 3
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:109)
at org.apache.tools.ant.util.ReflectWrapper.invoke(ReflectWrapper.java:81)
at org.apache.tools.ant.util.optional.JavaxScriptRunner.evaluateScript(JavaxScriptRunner.java:103)
at org.apache.tools.ant.util.optional.JavaxScriptRunner.executeScript(JavaxScriptRunner.java:67)
at org.apache.tools.ant.taskdefs.optional.Script.execute(Script.java:53)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:854)
at org.apache.tools.ant.Main.startAnt(Main.java:236)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
Caused by: :3 ReferenceError: "importClass" is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
at jdk.nashorn.internal.objects.Global.noSuchProperty(Global.java:1441)
at jdk.nashorn.internal.scripts.Script$^eval_.:program(:3)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
... 29 more

Total time: 6 seconds

_

Move bug

On map "Berlin1" of IranOpen2015, there is a an angent(ID: 891293044), located in a road (ID: 16555) which contains some blockades, which can not handle move command properly from cycle 11 to 37.
As we followed , this is happening due to calling getPathElements2
function in line 388 ("steps.addAll(getPathElements2(human, currentArea, lastEdge, nextArea, edge));") in "handleMove" method in "rescue2014/modules/traffic3/src/traffic3/simulator/TrafficSimulator.java" file.
This is interesting that using "getPathElements" instead of "getPathElements2" fixes the problem.
Attached is the log which contains this bug.

https://sourceforge.net/p/roborescue/bugs/117/attachment/Berlin1.log.7z

Creator: Rozhina Pourmoghaddam (https://sourceforge.net/p/roborescue/bugs/117/)

logextract and logviewer bug

Hi, The last issue is completely resolved! Thank you again.

There seems to be a bug in logextract.sh and logviewer.sh.
When I type the command ./logextract.sh logs/traffic-out.log ./ ,
Exception in thread "main" java.lang.IllegalArgumentException: Unrecognised RecordType: 1414676803
at rescuecore2.log.RecordType.fromID(RecordType.java:48)
at rescuecore2.log.FileLogReader.index(FileLogReader.java:181)
at rescuecore2.log.FileLogReader.(FileLogReader.java:64)
at rescuecore2.log.FileLogReader.(FileLogReader.java:50)
at rescuecore2.log.LogExtractor.main(LogExtractor.java:179)
An error such as is shown on the last output line.

Also, type the ./logviewer.sh ./logs/civilian.log ,
The basic class sample.SampleLogViewer cannot found.
Is it a bug or is it not yet implemented? I want to know the location of the citizens in real time when running simulations.

Best regards,

Run server without any UI elements

Expected Behaviour:
using --nogui parameters should have everything running without any graphical interfaces.

Behaviour:
Even if using --nogui on simulators, kernel and viewers the SampleViewer will start on postConnect.

LogViewer cannot read rescue.log.xz.

I ran the simulation according to the README in this repository and got rescue.log.xz.
I ran LogViewer with rescue.log.xz as input and got the following error message:

スクリーンショット 2022-03-08 14 30 36

The following is a list of commands executed before this error occurred.

server side (rcrs-server)

$ cd rcrs-server/scripts
$ ./gradlew completeBuild
$ ./start.sh -m ../maps/test/map -c ../maps/test/config

After the simulation is over.

$./gradlew logViewer --args="'-c' 'maps/test/config/logviewer.cfg' 'logs/log/rescue.log.xz'"

client side (adf-sample-agent-java)

$ cd adf-sample-agent-java
$ ./gradlew clean
$ ./gradlew build
$ ./launch.sh -all

Please refer to the attached file: rcrs-sever/logs/log
logs.zip

Compiling error: ant cannot perform a complete-build

I git clone this repository and checked my version of ant and java:
Apache Ant(TM) version 1.10.5 compiled on July 10 2018
java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

so I meet the prerequisites

cd in my local rcrs-server directory
ant clean-all is successful
however
ant complete-build gives me the following error

BUILD FAILED
.\rcrs-server\build-javadoc.xml:5: org.mozilla.javascript.EcmaError: ReferenceError: "load" is not defined.

why is this happening?

Thanks

Feature request: WebApi to control the server

I think it would be nice if we can have an API that controls the simulation server.

use case:
In WebViewer we want to simulate the current run, stop, step buttons of the kernel and to connect WebViewer to the kernel.

possible solution:
preparing a port dedicated to web API and WebSocket in the kernel.

the run, stop and step can be done using a simple web API query.
the web viewer can be connected using WebSocket.

ProtoBuf branch is not compatibile with the logs of traditional version

I have seen that in the ProtoBuf branch URN_PREFIX has been eliminated. This will make an inconsistency in the old version logs. However, I agree that the prefix is useless and maybe waste a lot of memory.
I think two ways exist to have compatibility with traditional version of the simulator:

  • provide a wrapper to convert old logs to protobuf format and use it
  • use the old URN_PREFIX

Error launching `scenarioEditor` using Gradle

@gnardin

Yes, We knew that the same tools can be run via Gradle.
By the way, these scripts are for the time that we do not use Gradle or having problem with Gradle.
I tried to run the tools using Gradle and faced problem and could not run the tools, so started to write these shell scripts.
By the way, I should mention that I could not run the tools using gradlew as follow
$ ./gradlew scenarioEditor
But I could run the tools as follow
$ gradle scenarioEditor
Screenshot from 2020-06-11 00-26-45
Screenshot from 2020-06-11 00-26-45

This issue was opened by the request of @ffaraji

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.