Connecting an agent during for example PlayOn outputs something like this:
[Msg] GameState::AddAgent() error: Invalid playmode, PlayOn
[Msg] (34.422) failed to add agent to game state: 2_magmaOffenburg
If the agent is then stopped, the terminal is spammed with the following message, seemingly each frame:
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
RCPServer::Send() Socket not found.
[...]
This is annoying because it makes it difficult to notice any other output until gazebo-robocup3ds is restarted.
The suspected cause: Agents are removed from gamestate in one thread while cleaning up the sockets corresponding to that agent is done in a separate thread. Since both threads are running in parallel, it is possible for the following order of events to occur:
RCPServer calls OnDisconnection() (thread 1)
RCPServer cleans up socket (thread 1)
UpdatePerceptor is called (calls RCPServer::Send()) (thread 2)
UpdateEffector is called (deletes agent from gamestate) (thread 2)
When this happens, we will receive a warning mesage in the console: "RCPServer::Send() Socket not found". This is due to the fact that for a short period of time, the socket is cleaned up, but the corresponding agent object (with socket id) still exists. This issue does not seem to affect functionality of the server.
A simple solution would be to add a time delay of 0.1 seconds between calling OnDisconnection() in RCPServer and closing the socket, which gives UpdateEffector() (in main thread) enough time to remove the Agent from gamestate.
It seems that unlike SimSpark, the plugin only allows agents to connect while the game is not running.
Original report (archived issue) by jasonzliang NA (Bitbucket: jasonzliang).
Connecting an agent during for example
PlayOn
outputs something like this:If the agent is then stopped, the terminal is spammed with the following message, seemingly each frame:
This is annoying because it makes it difficult to notice any other output until gazebo-robocup3ds is restarted.
The suspected cause: Agents are removed from gamestate in one thread while cleaning up the sockets corresponding to that agent is done in a separate thread. Since both threads are running in parallel, it is possible for the following order of events to occur:
When this happens, we will receive a warning mesage in the console: "RCPServer::Send() Socket not found". This is due to the fact that for a short period of time, the socket is cleaned up, but the corresponding agent object (with socket id) still exists. This issue does not seem to affect functionality of the server.
A simple solution would be to add a time delay of 0.1 seconds between calling OnDisconnection() in RCPServer and closing the socket, which gives UpdateEffector() (in main thread) enough time to remove the Agent from gamestate.
It seems that unlike SimSpark, the plugin only allows agents to connect while the game is not running.