You need to sign in or sign up before continuing.
Commit 4577c119 authored by Matthew Hausknecht's avatar Matthew Hausknecht

Added optional patch to rcssserver to allow for long action delays.

parent 52447fba
......@@ -13,6 +13,9 @@ HFO
2. `cmake .`
3. `make`
## (Optional) Patch rcssserver for longer decision making
It's necessary to patch rcssserver if the agent takes longer then two seconds to select an action. To apply the patch, run `patch your_path/rcssserver-15.2.2/src/stadium.cpp < stadium.patch`.
## Run
```bash
./bin/start.py
......
2527c2527
< const double max_msec_waited = 25 * 50;
---
> const double max_msec_waited = 25 * 5000;
2533a2534
> timeval tv_lastNotification;
2638a2640,2677
>
> // Start modifcation to prevent timeouts
> // get time difference with start of loop, first get time difference in seconds
> gettimeofday( &tv_now, NULL );
> double time_diff_notification
> = ( static_cast< double >( tv_now.tv_sec )
> + static_cast< double >( tv_now.tv_usec ) / 1000000 )
> - ( static_cast< double >( tv_lastNotification.tv_sec )
> + static_cast< double >( tv_lastNotification.tv_usec ) / 1000000 );
>
> if ((done == DS_FALSE) && (time_diff_notification > 1.0)) {
> const char *aliveMsg = "(ok say)";
> for ( int i = 0; i < MAX_PLAYER*2; ++i ) {
> if ( wait_players[i] && M_players[i]->connected() && M_players[i]->doneReceived()) {
> M_players[i]->send( aliveMsg );
> }
> }
>
> for ( int i = 0; i < 2; ++i ) {
> if ( wait_coach[i] && M_olcoaches[i]->connected() && M_olcoaches[i]->doneReceived()) {
> M_olcoaches[i]->send( aliveMsg );
> }
> }
>
> if ( wait_trainer && M_coach->connected() && M_coach->doneReceived()) {
> M_coach->send( aliveMsg );
> }
>
> for ( MonitorCont::iterator i = M_monitors.begin();
> i != M_monitors.end();
> ++i )
> {
> (*i)->sendShow();
> }
> gettimeofday( &tv_lastNotification, NULL );
>
> }
> // end modification to prevent timeouts
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment