Interface Definition for AIBO worldmap: The worldmap will accept input from the vision and motion systems as well as receiving wireless data The worldmap will start by querying the vision system to identify the location of any two field posts. From there, AIBO's location will be determined via triangulation and approximation of distance based on the relative (as seen through the camera) size of the field posts. AIBO's position will then be maintained by monitoring the change in position/orientation as AIBO walks around the field. There will be a pre-defined level of acceptable uncertainty of AIBO's location. Each of the dogs on our team will be responsible for monitoring it's own position. It will then broadcast this to the other dogs so that they can all maintain the same table. As for the postion of the other teams dogs, this will be a little harder. There is no easy way to give an identifier to each dog and track them individually. Instead, each element of the array will hold the position of a dog. When populating the array, the Worldmap class will simply check to see if a dog is stored at or near the specified position. The worldmap will allow for the creation of a formal strategy. Additionally, it will make it much easier to determine what type of kick to perform and the direction to kick the ball. Private members: The worldmap will contain a structured array to store the position and orientation of all dogs on the field: -_DogPos[NUM_DOGS] : Position -_BallPos : Position Public members: +GetPosition(iDogId: int, &PnO : Position ); //function to retrieve the position (x, y) and orientation (angle) of a specified dog +SetPosition(iDogId: int, PnO : Position ); +GetBallPos(&ball: Position); //function to get the ball's coordinates +SetBallPos(ball: Position); //function to set the ball's position +FindPosition(); //function to find the local dog's position +FindBall(); //function to locate where the ball is //######################################################### structure Position{ double x; //x position double y; //Y position double angle; //angle of rotation double certainty; //fuzzy logic (either a percentage or enum==>(Very, somewhat, not_very) }; //######################################################### //######################################################### void GetPosition(int iDogId, Position PnO) { //Function to Get the postion of a given dog PnO = _DogPos[iDogId]; } void GetBallPos(Position ball) { ball = _BallPos; } //######################################################### //######################################################### void SetPosition(int iDogID, Position PnO) { //Function to set the position of a given dog switch (iDogID) { case Dog1: case Dog2: case Dog3: _DogPos[iDogID] = PnO; //set the value break; case Opponent: //some code to determine if we already have this position stored // break; case DOG_Unknown: //if AIBO is not sure what dog he is seeing perform some action (this will probably be the same thing //as Opponenet) ====> perhaps this could be used to dispute the position of another dog on our team.....perhaps break; case else: /*or whatever the syntax is*/ //report that bad information was passed to the member function }; } void SetBallPos(Position ball) { _BallPos = ball; } //######################################################### void FindPosition() { double x, y, angle, certainty; //function to find the executing dog's position //the basic idea is to move AIBO's head back and forth to find two goal posts //once a postion is calculated, set it: _DogPos[My_ID].x = x; _DogPos[My_ID].y = y; _DogPos[My_ID].angle = angle; _DogPos[My_ID].certainty = certainty; } void FindBall() { //function to move AIBO's head back and forth to look for the ball //chances are, this will only need to be run at the beginning of play //the rest of the time, if the ball is lost, we can rely on data from the other robots } //######################################################### Y -Direction ^ 90 Deg (Pi/2) | --------------------------------------------------------------------------------- (Xn, Yn) | | .| | | | | | | | | | | | | |--- -|- ---| | | / | \ | | 180Deg | | | | | | | 0Deg (0Pi) (Pi) | | \ | / | | |--- -|- ---| | | | | | | | | | | | | |.(0,0) | | --------------------------------------------------------------------------------------> X -Direction 270 Deg (3Pi/2)