roborescue / adf-sample-agent-java

A sample team using RCRS Agent Development Framework
https://roborescue.github.io/rcrs-adf-sample/
BSD 3-Clause "New" or "Revised" License
11 stars 26 forks source link

Launching errors #9

Closed stanmoon closed 3 years ago

stanmoon commented 3 years ago

Hi, Following the manual instructions for launching the agents' simulation, there are some errors reported by the program. Below is the output of the terminal.

The server was started with the following command: ~/rcrs/rcrs-server/boot$ bash start-comprun.sh (Output of server is OK - no errors)

Thanks,

~/rcrs/rcrs-adf-sample$ bash launch.sh -all

> Task :launch
[ RCRS ADF Version 3.0.0 (build 20210313181747) ]

[START ] Connect to server (host:localhost, port:7000)
[FINISH] [ERROR ] Cannot Load FireStation Control !!
[FINISH] [ERROR ] Cannot Load AmbulanceCentre Control !!
[FINISH] [ERROR ] Cannot Load PoliceOffice Control !!
[FINISH] Connect FireStation (success:0)
[FINISH] Connect PoliceOffice (success:0)
[FINISH] Connect AmbulanceCentre (success:0)
[INFO  ] Connected - adf.agent.platoon.PlatoonAmbulance@28bc6f41 (PRECOMPUTED)
[INFO  ] Connected - adf.agent.platoon.PlatoonFire@65dad161 (PRECOMPUTED)
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@77ff37b3 (PRECOMPUTED)
[FINISH] [ERROR ] Cannot Load PoliceForce Control !!
[FINISH] Connect PoliceForce (success:1)
[FINISH] [ERROR ] Cannot Load FireBrigade Tactics !!
[FINISH] [ERROR ] Cannot Load AmbulanceTeam Tactics !!
[FINISH] Connect FireBrigade (success:1)
[FINISH] Connect AmbulanceTeam (success:1)
[FINISH] Done connecting to server (3 agents)
AaFishy commented 3 years ago

Our team also has encountered the exact same error! We also have an issue with running the precomputation with sample-adf.

Output from running: $ bash launch.sh -t 1,0,1,0,1,0 -h localhost -pre 1 & APID=$! ; sleep 120 ; kill

Returns either <Connecting to Daemon> or <Idle>

But expected output is:

[INFO] Connected - adf.agent.platoon.PlatoonFire@756ec19c (PRECOMPUTATION)
[INFO] Connected - adf.agent.platoon.PlatoonPolice@366bbbe (PRECOMPUTATION)
[INFO] Connected - adf.agent.platoon.PlatoonAmbulance@2a453513 (PRECOMPUTATION)
********************
[FINISH] Connect PoliceForce (success:1)
[FINISH] Connect AmbulanceTeam (success:1)
[FINISH] Connect FireBrigade (success:1)
[FINISH] Done connecting to server (3 agents)

[EDIT] Fixed precomp output issue by changing command to (removing "& APID=$!"): $ bash launch.sh -t 1,0,1,0,1,0 -h localhost -pre 1 ; sleep 120 ; kill

gnardin commented 3 years ago

Dear @stanmoon and @AaFishy

We have made some changes to the rcrs-adf-core but we have not concluded the necessary changes to the rcrs-adf-sample yet. The changes are planned to be released the corrected version soon.

Thank you for notifying us,

stanmoon commented 3 years ago

Dear @gnardin, thanks for your prompt reply. I am wondering if you have an estimated time for the update. Is there a previous running version I can work with meanwhile? Thanks a lot,

stanmoon commented 3 years ago

Dear @gnardin, I am working with the version labeled 2020 online competition (just in case there is any actual current inconsistency between this project and the core). After inspecting the logs and configuration files in the server project I've found out that the scenario.xml does not contain the central agent locations. I believe this might be the cause of the errors. I have found that by changing the default map the error goes away. For example, I ran the server as follows: bash start-comprun.sh -m ../maps/gml/kobe/map/ Then the central agents can connect. Screenshot from 2021-04-07 16-22-25 Moreover, the platoon agents just move back and forth. By changing the file launch.cfg in the rcrs-adf-sample project this behavior can be improved.

#adf.agent.moduleconfig.file: config/module_sample.cfg
adf.agent.moduleconfig.file: config/module.cfg

Thanks!

stanmoon commented 3 years ago

OK. I think the inconsistency is real. I tried again in the latest version and the following errors appear (I changed the scenario definition like in the previous post).

~/rcrs/latest-version/rcrs-adf-sample$ ./launch.sh -all

> Task :launch
[ RCRS ADF Version 3.0.0 (build 20210313181747) ]

[START ] Connect to server (host:localhost, port:7000)
[INFO  ] Connected - adf.agent.office.OfficePolice@5745c864 (NON_PRECOMPUTE)
[INFO  ] Connected - adf.agent.platoon.PlatoonFire@13637915 (NON_PRECOMPUTE)
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@60d41a20 (NON_PRECOMPUTE)
[INFO  ] Connected - adf.agent.platoon.PlatoonAmbulance@3c2f9d84 (NON_PRECOMPUTE)
[INFO  ] Connected - adf.agent.office.OfficeAmbulance@7f6c5489 (NON_PRECOMPUTE)
[INFO  ] Connected - adf.agent.office.OfficeFire@1a4b3d93 (NON_PRECOMPUTE)
[FINISH] [ERROR ] Cannot Load AmbulanceCentre Control !!
[FINISH] Connect AmbulanceCentre (success:1)
[SampleKMeans] Cluster : 1
[SampleKMeans] Cluster : 6
[FINISH] [ERROR ] Cannot Load FireStation Control !!
[SampleKMeans] Cluster : 1
[FINISH] Connect FireStation (success:1)
[FINISH] [ERROR ] Cannot Load PoliceOffice Control !!
[FINISH] Connect PoliceOffice (success:1)
[FINISH] [ERROR ] Cannot Load AmbulanceTeam Tactics !!
[FINISH] Connect AmbulanceTeam (success:1)
[FINISH] [ERROR ] Cannot Load FireBrigade Tactics !!
[FINISH] Connect FireBrigade (success:1)
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@3cdce8a9 (NON_PRECOMPUTE)
[SampleKMeans] Cluster : 6
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@435e279e (NON_PRECOMPUTE)
[SampleKMeans] Cluster : 6
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@2b48199c (NON_PRECOMPUTE)
[SampleKMeans] Cluster : 6
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@4ad916e1 (NON_PRECOMPUTE)
[SampleKMeans] Cluster : 6
[INFO  ] Connected - adf.agent.platoon.PlatoonPolice@43344003 (NON_PRECOMPUTE)
[SampleKMeans] Cluster : 6
[FINISH] [ERROR ] Cannot Load PoliceForce Control !!
[FINISH] Connect PoliceForce (success:6)
[FINISH] Done connecting to server (11 agents)
gnardin commented 3 years ago

Dear @stanmoon Thank you the updates and the tests. The problem is not the AmbulanceCentre, FireStation, and PoliceOffice not connecting to the server. These agents do not connect because the scenario does not include them as you identified. The problems are the errors in the FireBrigade Tactics and AmbulanceTeam Tactics modules. I am working on solving this problem now. Hopefully, I can upload a fixed version tonight. Thank you,

gnardin commented 3 years ago

Dear @stanmoon and @AaFishy

I debugged the rcrs-adf-sample and rcrs-adf-core code. The error messages are not actually errors, they were displayed as designed. Note that the last messages indicate that the number of successful connections is 1 to all agent types, which correspond to the number of agents defined in the Test scenario.

[FINISH] Connect PoliceForce (success:1)
[FINISH] Connect AmbulanceTeam (success:1)
[FINISH] Connect FireBrigade (success:1)

Although misleading, these messages indicate that all agents of the specific type defined in the scenario were successfully loaded and connected to the server whenever the rcrs-adf-sample is launched with the number of agents of each type equals to -1.

The number of agents to connect can be defined in the command line when launch the team or in the config/launch.cfg file in the following parameter:

adf.team.office.ambulance.count: -1
adf.team.platoon.ambulance.count: -1
adf.team.office.fire.count: -1
adf.team.platoon.fire.count: -1
adf.team.office.police.count: -1
adf.team.platoon.police.count: -1

To avoid future misleading, I changed the connectors in the adf.launcher.connect package in the rcrs-adf-core to not show any ERROR message when agents cannot connect to the server. The elimination of the error message does not prevent the developer to identify that something when wrong in the connection because the developer can use the number of successfully connected agents of each types as a reference to confirm that all agents connected to the server.

Please let me know if you have any further question or comment.

Kind Regards,

stanmoon commented 3 years ago

Great, thanks so much!