GT RoboCup SSL
Soccer software, robot firmware
|
Coordinator of high-level logic. More...
Public Member Functions | |
GameplayModule (Context *const context) | |
SystemState * | state () const |
virtual void | run () |
runs the current play More... | |
void | setupUI () |
void | loadPlaybook (const std::string &playbookFile, bool isAbsolute=false) |
Loads a playbook file to enable specified plays. More... | |
void | savePlaybook (const std::string &playbookFile, bool isAbsolute=false) |
Saves the currently enabled plays to a playbook file If isAbsolute is false, the path is treated as relative to the playbooks directory. More... | |
void | clearPlays () |
bool | checkPlaybookStatus () |
void | goalieID (int value) |
int | goalieID () |
Geometry2d::TransformMatrix | ballMatrix () const |
Centered on the ball. | |
Geometry2d::TransformMatrix | centerMatrix () const |
Center of the field. | |
Geometry2d::TransformMatrix | oppMatrix () const |
Opponent's coordinates. | |
const std::set< OurRobot * > & | playRobots () const |
All robots on our team that are usable by plays. | |
void | sendFieldDimensionsToPython () |
void | calculateFieldObstacles () |
bool | hasFieldEdgeInsetChanged () const |
Geometry2d::ShapeSet | globalObstacles () const |
Returns the current set of global obstacles, including the field. More... | |
Geometry2d::ShapeSet | goalZoneObstacles () const |
Returns a ShapeSet containing both goal zones. | |
void | updateFieldDimensions () |
Resends the current field dimensions to python. More... | |
Static Public Member Functions | |
static void | createConfiguration (Configuration *cfg) |
Protected Member Functions | |
boost::python::object | getRootPlay () |
boost::python::object | getMainModule () |
gets the instance of the main.py module that's loaded at GameplayModule | |
Coordinator of high-level logic.
The gameplay module has an embedded python interpreter and serves as the bridge between our python and c++ code. The python side of things is responsible for high-level gameplay. At each iteration of the main run loop, the GameplayModule calls into python, which does all of the high-level planning, resulting in updated motion targets, etc for the robots. The GameplayModule then executes path planning for each OurRobot.
void Gameplay::GameplayModule::calculateFieldObstacles | ( | ) |
Make an obstacle to cover the opponent's half of the field except for one robot diameter across the center line.
Geometry2d::ShapeSet Gameplay::GameplayModule::globalObstacles | ( | ) | const |
Returns the current set of global obstacles, including the field.
returns the group of obstacles for the field
Add non floor obstacles
void Gameplay::GameplayModule::loadPlaybook | ( | const std::string & | playbookFile, |
bool | isAbsolute = false |
||
) |
Loads a playbook file to enable specified plays.
If isAbsolute is false, the path is treated as relative to the playbooks directory. Otherwise, it is treated as an absolute path.
|
virtual |
runs the current play
prepare each bot for the next iteration by resetting temporary things
Build a list of visible robots
Run the current play
visualize
void Gameplay::GameplayModule::savePlaybook | ( | const std::string & | playbookFile, |
bool | isAbsolute = false |
||
) |
Saves the currently enabled plays to a playbook file If isAbsolute is false, the path is treated as relative to the playbooks directory.
Otherwise, it is treated as an absolute path.
void Gameplay::GameplayModule::updateFieldDimensions | ( | ) |
Resends the current field dimensions to python.
This should be called whenever the current field dimensions change