Skip to content
Permalink
Browse files

Adding in support for recognizing the new pass mode.

  • Loading branch information...
pmacalpine committed May 28, 2019
1 parent 329a4f5 commit a12c086e864a7b106254fb6d54312953838fe322
Showing with 16 additions and 0 deletions.
  1. +6 −0 behaviors/naobehavior.cc
  2. +2 −0 headers/headers.h
  3. +8 −0 parser/parser.cc
@@ -1003,6 +1003,9 @@ bool NaoBehavior::improperPlayMode(int pm) {
else if(pm == PM_DIRECT_FREE_KICK_RIGHT) {
return true;
}
else if(pm == PM_PASS_RIGHT) {
return true;
}
}
else if(worldModel->getSide() == SIDE_RIGHT) {

@@ -1027,6 +1030,9 @@ bool NaoBehavior::improperPlayMode(int pm) {
else if(pm == PM_DIRECT_FREE_KICK_LEFT) {
return true;
}
else if(pm == PM_PASS_LEFT) {
return true;
}
}

return false;
@@ -255,6 +255,8 @@ const double EPSILON = 0.0001;
#define PM_FREE_KICK_RIGHT 16
#define PM_DIRECT_FREE_KICK_LEFT 17
#define PM_DIRECT_FREE_KICK_RIGHT 18
#define PM_PASS_LEFT 19
#define PM_PASS_RIGHT 20

//Directions
#define DIR_LEFT 0
@@ -233,6 +233,14 @@ bool Parser::parseGameState(const string &str) {
playMode = PM_DIRECT_FREE_KICK_RIGHT;
playModeValid = true;
}
else if(!(playModeStr.compare("pass_left"))) {
playMode = PM_PASS_LEFT;
playModeValid = true;
}
else if(!(playModeStr.compare("pass_right"))) {
playMode = PM_PASS_RIGHT;
playModeValid = true;
}
else {
playModeValid = false;
cout << "Unknown play mode: " << playModeStr << "\n";

0 comments on commit a12c086

Please sign in to comment.
You can’t perform that action at this time.