LARG / HFO

Half Field Offense in Robocup 2D Soccer
MIT License
232 stars 93 forks source link

added sleep between server start and agent connect #90

Closed douglasrizzo closed 4 years ago

douglasrizzo commented 4 years ago

If I start the server and connect an agent in the same command line, as stated in the README, the agent does not connect to the server, stating:

$ (./bin/HFO --offense-agents=1 --no-sync &) && ./example/hfo_example_agent

[...]

Waiting for player-controlled agent base_left-0: config_dir=/home/user/Code/HFO/bin/teams/base/config/formations-dt, server_port=6000, server_addr=localhost, team_name=base_left, play_goalie=False
 -1: waited 5 seconds. server down??
[ConnectToServer] Server Down!

By adding a call to sleep between the command that starts the server and the one that connects the agent, this error does not occur:

$ (./bin/HFO --offense-agents=1 --no-sync &) && sleep 1 && ./example/hfo_example_agent