1 / 114

GT 2005 Software Architecture

GT 2005 Software Architecture. Study & Analysis. Team Members. Vision And Localization. Ahmad salam alrefai. Image Processor.

Download Presentation

GT 2005 Software Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GT 2005 Software Architecture Study & Analysis

  2. Team Members

  3. Vision And Localization Ahmad salamalrefai

  4. Image Processor • ImageProcessorInterfaces (current image for example) as a parameter to the constructor. It has two virtual methods one called execute which is called on every captured image. And the other called handleMessage which handles an incoming message. • There are also two private methods that call scan method, namely scan colomns which scan the vertical lines which are more dense near the horizon since objects are further away and hence smaller. The other methods called scan rows which calculate the horizontal lines and call scan.

  5. Image Processor • static const double minAngleBetweenFlagAndGoal; • double xFactor, /**< Factor to convert the pixel coordinate space to the anglular coordinate space. */ • yFactor; /**< Factor to convert the pixel coordinate space to the anglular coordinate space. */ • int yThreshold; /**< Brightness increase threshold. */ • int vThreshold; /**< Brightness decrease threshold. */ • int orangeCount, /**< Number of columns with ball points. */ • noOrangeCount, /**< Number of columns without a ball point. */ • noRedCount, /**< Number of columns without a red robot point. */ • noBlueCount, /**< Number of columns without a blue robot point. */ • noGoalCount, /**< Number of columns without a opponent goal seen. */ • closestBottom; /**< Closest bottom point on the grid. */ • Vector2<int> firstRed, /**< First red robot point in a cluster. */ • closestRed, /**< Closest red robot point in a cluster. */ • lastRed, /**< Last red robot point in a cluster. */ • firstBlue, /**< First blue robot point in a cluster. */ • closestBlue, /**< Closest blue robot point in a cluster. */ • lastBlue, /**< Last blue robot point in a cluster. */ • firstFlag, /**< First flag point in a cluster. */ • lastFlag, /**< Last flag point in a cluster. */ • lastRedMidPoint, /** Needed for debug drawings */ • lastBlueMidPoint; /** Needed for debug drawings */ • bool goalAtBorder; /**< Is the first goal point at the image border? */

  6. Image Processor • boolgoalAtBorder; /**< Is the first goal point at the image border? */ • /** Useful information about the current image that is calculated by the ImageProcessor • object and may be used by the specialist (avoiding recalculation) like the horizon, • etc. */ • ImageInfoimageInfo; • intlongestBallRun; • Vector2<int> ballCandidate; • GT2005Clustering ballClustering; • GT2005LineFinder_DeterministicApproach lineFinder; • GT20050CenterCircleFinder circleFinder; • CameraMatrixcmTricot, /**< Camera matrix without tricot height. */ • prevCmTricot; /**< The tricot matrix of the previous image. */ • // prevCameraMatrix moved to ImageInfo! • ColorCorrectorcolorCorrector; /**< The color correction tool. */ • /** Goal specialists to recognize the goals (one for each color). */ • GT2005GoalRecognizer goalSpecialistY, goalSpecialistB; • /** Other specialists. */ • GT2005BeaconDetector beaconDetector; /**< The beacon detector */ • GT2005BallSpecialist ballSpecialist; /**< The ball specialist. */ • GT2005EdgeSpecialist edgeSpecialist; /**< The edge specialist. */ • GT2005PlayerSpecialist playerSpecialist; /**< The player specialist. */

  7. Some functions • pixelsBelowHorizon() This function to a point to horizon and return true if below horizon. • filterPercept(); removes potential misreadings of percept • filterLinesPercept() removes potential misreading for a given line type. • calcEdgeAngle() calculate an edge at an edge point. • getCoords() converts an address of an image to pixel coordinates.

  8. Color Corrector Class • contains a class that represents a table used for color correction, it is a mixture among the BB2004 • DDD2004 and MSH2004 correction, Everything is static so it is loaded only once in the simulator.  • The function calcRadius it gets the x and y coordinates and returns the distance from the center of the image • We have three correct functions one returns the correct intensity of a pixel and the other returns the corrected Color of a pixel (both depends on corrected table) and the last correct all pixels of image  • The function distort returns a disturbed color of a pixel from distortionTable in YUV format. • The function load loads the calibration image and computes the lookup table • The function disable, disables the color correction.

  9. Goal Recognizer • Contains class EdgeDetector Function inspectPixel investigates the next pixel and reports, whether and edge or repeated deviation of the pixel cololurs (without the indications of an edge) have detected. It is assumed that the edges are quite sharp and that the color beyond the edge is significantly different to the goal colour. In case of blurred edge or a steady color gradient the method will eventually return deviationWithoutEdge. • The function getLastPointInClass returns the last point in or near the target colour class. If inspectPixel returned • The value edge the returned point is located just before the edge. • The function clear() reset the edge detection state while keeping the reference colour • The function reset() reset the reference colour and the ege detector state. • The function setReferenceColor() do so… • The function getReferenceColor() do so… • The function inverseCovarianceMatrix the inverse covariance matrix of the goal color variance • (needed for the Mahalanobis distance). • The function distance calculates the mahalanobis distance of the given colour to the reference color.

  10. The classThreashold is the maximum distance from the reference colour that is tolerated for a pixel • To be considered in the target colour class • The edgeThreshold is the minimum distance from the reference colour that pixels on the other side of an edge need to have. This value is greater than classThreshold. • targetColorClass: the colour class of the goal • ignoredClassification: ClourClass that is not considered as an indication for edge. • ReferenceColor: The reference color for distance calculations. It is an average of recent pixels • That were classified in the target colour class • deviationCounter: to detect the end of an area in target color without an edge • edgeCounter: to detect an edge • lastPointInClass: Last pixel in the target colour class (or within tolerable distance). • ConnectedToClass: Current pixel is connected via to a pixel in the target colour class only via pixels within tolerable distance, i.e. there hasn’t been a pixel with a distance greater than the classDistnace threshold since • The last pixel classified in the target class (without distance). As long as this variable is true, points with tolerable • Distance will be stored as lastPointInClass. • EdgePointList: arrays to store the edge points and their type. • GoalPost() constructs an empty goalpost hypothesis (endpoints top bottom, onGreen?, hight, visibleHieght, • strongEdgeCount,weakEdgeCount,nonexistence?, • color: average color of some pixels near the goalpost. This value is used to detect the free part of goal (is done in the interpretation after the entire image was scanned) or straightnes check. • GoalHypothesis: Construct empty goalHypothesis with default values • Goalpost[2] left and right goalpost CrossbarendpointCrossbarEndpointH, witdth, higth,

  11. Goal Recognizer • GT2005GoalRecognizer(colorClass, ImageProcessorInterfaces, ColorCorrector, ImageInfo) • notifyAboutNewImage(), notifyAboutFlags(), notifyAboutFinish(), • notifyAboutNewScanlin(vector2 scanLinestart)… • inspectPixl(vector2 point, colorClass) • inspectNeigborhood(point) • analyzeGoal(startpoint) • analyzeGoalPost(..), • scanCrossBar(…) • detectEdgeTwice() • detectEdge() • scanAlongLine(..) • scanOnImageBorder(..) • detectGreanBelowGoalPost(..) • nearImageBorder(..)? returns true if the point is within one pixel distance to the image border • mergeFragments(bool * deletedHypothesises) • interprestResults(..) • publishResults(..) • detectFreePartOfGoal(..) • lockArea(…) • calculteLockedPixels(..) check flag intersection, calculate locked pixels…

  12. Goal Recognizer Collaboration

  13. Goal Recognizer Includes

  14. Ball Specialist • Ball Specialist find a single ball in an image, • searchBall searches for the ball in the image, starting from the specified point • getSimilarityToOrange returns the similarity of the given color to orange • contains class BallPoint to represents a ball point • whether this point atBorder, greenClose, yelloClose, hardedge, • contains class BallPointList (list of ball points (maximum number)) • This class has scanforBallPoints which scan for the ball starting at a • Given trigger point.

  15. Ball Specialist • Also contains findEndOfBall which finds the end of the ball • Also createBallPerceptLevenbergMarqurdt tries to calculate the ball Percept by using the Levenberg-Marquardt algorithm. The function fails if less than 3 points are available. • Also checkIfPointsAreInsideBall checks if a list of points is inside a given circle • Also calculateDeviationOfBallPoints calculate the deviation of the points from the circle • The function addBallPercept checks whether a ball percept is plausible and will add it if so. • It gets as input image, cameraInfo, colorTable, cameraMatrix, prevCameraMatrix, center, radius, • considerBallPoints this function calculates the factor durabilityOfBallPoints that is needed to calculate reliability for the percept. • calculateReliablility calculates the reliability of the ball percept.

  16. Ball Specialist

  17. Ball Specialist

  18. Ball Specialist

  19. GT2005BeaconDetector

  20. Beacon Detector

  21. Beacon Detector

  22. Beacon Detector • Execute() executes the beacon detection • analyzeColorTable() gains information about pink from the current color table. • Addcandidate() add pink run to the list of current candidate. • scanForPink() scan along a line • scanForBeaconPart() • clusterPinkBeaconParts() cluster pink elements to find the pink beacon parts. • analyzeBeancon() tries to detect a beacon near a pink part • scanForBeaconEdges() looks for the vertical edges and the color type of a beacon

  23. Beacon Detector • This class also check from number of scanlines above and below the horizon. • horizontalOffsetModifier: the growth factor of the distance between two scan lines. • ClusteringDistanceTolerance: the maximum distance between the merged runs. • clusteringAspectRatio: The maximum verticalDistance of scanlines to be clustered over the estimated merged horizontal distance (half beacon aspect ratio is 1:1) • projectionAspectRatio: The minimum value for the ratio of the 2 dimensions of the pink part of the beacon, • to be used for projection on the unknown colored part. • minFlageConfidence: A confidence threshold used to determine if a target beacon, whose type is not completely clear, can be accepted or not. • FlagSpecialist…

  24. Edge Specialist • The EdgeSpecialistfinds a line- and border-edges in an image • checkpoint(..) check point in camera-coordinates with given color on scanline if interesting changes • addCandidate(..) add a point in camera-coordinates which is a candidate for an edge point • getEdgesPercept(...) searches for the edges based on the points and return edge-percepts from those .It gets as input cameraMatrix and prevCameraMatrix and the image, returns the percept.

  25. Edge Specialist

  26. Edge Specialist

  27. Player Specialist • Execute() executes the specialist. • detectRedRobot(), detectBlueRobots() search for more robot properties • findRed/BlueFootPointYaxis() finds the foot point of a robot leg. To compare the results the Y-axis is used. • clusterRobotLinesPercept() clusters the linespercepts in different robots. Maximum 4 robots and 30 pixel space between them. • checkForWhiteLineBetweenRed/Blue(..) check if the line between 2 points is mostly white or accepted color • inspectColorArea(position,direction) inspect a color quad of the color proportion.

  28. Player Specialist

  29. Player Specialist

  30. GT2005LineFinder DeterministicApproach • considerLinePoint(pointOnline, normalToline) add a linePoint for later consideration • execute(…) calculates lines and crossing out of the given linePoints • the found information are stored in linePercept. • Another overlapped method considered given information about the center circle • getNumberOflines(..) returns the number of found lines. • getLine(..) returns the line by number, • findLineFragments() calculates line fragments out of the given LinePoints. • findLines(..) Calculate lines out of the previously calculated line fragments. • findIntersections(..) Calculates crossings out of the previously calculated lines. • AddCrossingPercept(..) Adds the crossing to the linesPercept including some characteristics found by additional scanning • handleCenterCircle(…) Filters out some line fragments, that may be caused by a center circle. • addCenterCirclePercept(…) writes the centerCircle (if found by one of the attempts) to the linesPercept • linesPerpendicularOnField(..)? Very rough calculation if lines are perpendicular on the field (used for validating crossing) • calculateLineOnField(…) calculates the projected line on the field • doVerificationScan(..) verify the projected line on the field • doVerificationScanForCircle(..) verifies if the found circle really is one.  • LinePoint(pointOnline,normaltoLine,belongsToLineNo) Structure, • LineFragment(base,normal,start,end,avergagestep,numberofPoints) Structure

  31. GT2005CenterCircleFinder • addCandidate(..) candidates which are inside the are of interest, will be added to the array candidatePoints • determineCirclePoint(..) uses Hough-Transformation, in order to determine the midpoint of the center-circle • getCircle(..)? • circle()? • transformArrayToField(...) transforms the indices of the array houghSpace to corresponding field coordinates. • transformfromFieldToArray(…) transform the field-position inside the area of interest to the corresponding array-index. • checkCircleMidpoint2(…) same as checkCircleMidpoint, but with more than one candidate. • scanSurrrounding(…)? • Scan(…) • cameraMatrix and image will only be used in order to transform the results from field-coordinates to image-coordinates, • which will display the result.

  32. Players Percept • Contains class SinglePlayersPercept which contains information about a single perceived robot. • offsetOnField : offset to the robot, relative to own robot • directionOnfield: direction of the perceived robot • positionInImage: position of the robot in the image • orientation • validitiy: The validitiy of this percept. • Class PlayersPercept is a collection of singlePlayerPercept for red and blue dressed robots • addRedPlayer(…) adds a red player percept • addBluePlayer(…) • redPlayers[], bluePlayers[], numberOfRedPlayers,numberOfBluePlayers, frameNumber

  33. Players Percept

  34. BallPercept • Add(…) The function adds a seen ball to the percept • addHighRes(…) adds a seen ball to the percept, specifying its center and radius in image cords and additionally its reliability • ballWasSean? • OffsetOnField: Ball offset based interpolated between size based and bearing based. • bearingBasedOffsetOnField: Ball offset based on intersection with field plan. • sizeBasedOffsetOnField: Ball offset based on the size in the image. • centerInImage: The center of the ball in image coordinates • radiusInImage: The center of the ball in image coordinates • reliability: The reliability of the percept,, frameNumber • mulitiplePercepts<MultipleBallPerceptList>[] array stores the multiple ball percepts ordered by reliability.

  35. Ball Percept

  36. Landmarks Percept • Contains class conditional Boundary: represents a rectangular landmark boundary, it also encodes which edges of the boundary touch the image border. • addX(),addY()The function adds a point to the boundary • isOnBorder(..)? return the specified edge touch the image border • Contains Class Flag which extends conditionalBoundary • pinkAboveYellow, pinkAboveSkyblue, • yellowAbovePink, skyblueAbovePink

  37. Landmarks Percept • Type, position, distance, angle, distanceValidity and angle validity. • Contains Class Goal which extends ConditionalBoundary • Color,leftpost, rightpost, distanceValidity • Class LandMarksPercept • Flags[4] • numberofFlags (number of actually stored flag in array) • goals[2] • numberOfGoals • viewAngle: The estimated viewing angle in field cords • viewAngleValid? Tells the self locator if the view angle is valid • cameraOffset relative to position of the robot’s neck • addFlag(..) • estimateOffsetForFlags(.) calculates the distance and angle for each flag • addGoal(..) adds a goal to the goal array • estimateOffsetAndValidatesForGoal(..) calculate distance and angle for each goal

  38. Lines Percept • The class represents a percepted line on the field with its type and a Vector of points belon

  39. Obstacle Percept • The class represents perceived obstacles on the field • Cotains class FreePartOfGoal • Which has method setFreePartOfGoal(..)

  40. Players Locator • Contains class PlayerLocatorInterfaces • RobotPose, estimated postion of the robot • teamMessageCollection, teamMessages from the other robots • odemetryData, odometrydata that was calculated by the motion modules • gtCamWorldState, The worldstate generated by the GTCam • ballModel, the ball model of the ball locator, it is used by the particle system to propagate the players position • PlayersPercept (input) • PlayerPoseCollectionThe player positions to be calculated • playersModel, • passCorridorCollection, the available pass corridors • playersModel, the players model which hold the information about the opponent players. • playersPercept, the detected players

  41. Ball Locator • This class contains a ballLocator implementation using particle filters • measurementUpdate(…) to update position and velocity separately, • First the positions are updated and the estimated ball position is calculated • And this information is used to calculate the velocities. • setBallSymbols() sets the state of the ball in the BallSymbols • timeChange: the time between the last and the current frame (s): • dFieldDiagonalLength: The maximum length possible for two points on the field • framesNoBallSeenThreshold: Some constant values which might evolved.

  42. Ball Locator • ballX/Y/P,ballVX/Y/P, the estimated ball position and velocity with the calculated probability • getTimeFactor() This functions returns the factor by which the probability of the particle will be decreased depend on the time which the ball was not seen. • currentSystemTime The current system time: (s) • noNonsenseParticles(): This function eliminates particles with nonsense ball positions • isNonSensePos: Determine nonsense ball positions • initilizeParticles(..) A function that initializes particles depending on the position where the ball will be placed at (for example kickoff position). • calculateDistanceValue(…) calculates depending on the distance to a percept the approximative error. • calculatePanningVelocityValue(..) calculates depending on the panning velocity the approximative error • calculateRobotSpeedValue(…)

  43. GT2005SelfLocator • Contains class cell which represents a cell in a cube that is used to to determine the largest sample cluster. • Count: the number of samples in this cube • First: the first sample in this cube • sampleSet: the sample set • teamColorBlue? • linePointZAngleMotionDependentVarience • Angles Truest, center circle trust, center circle orientation angle trust • Flag angle trust, goal angle trust, all for Y and Z • Last odometry (2): the last odometry, used to calculate the delta_odometry • Timestamp • ObservationUpdateDone? A flage indicating if an observation update was done during the • Current run of execute

  44. GT2005SelfLocator • averagePerceptTypeProb: the average probability for each perceptType and all samples • sampleTempleteGenerator: encapsulates the template generation • lineCrossingTable: • eigenVec0, eigenVec1: eigenvectors of particle distribution covariance matrix • varienceCovarianceMatrix • stdDevRot, averageX/Y/l0/l1, • eigenSwap, averageRot • Gaussian(d) the function distributes the parameter in a Gaussian way • D: is a value that shall be distributed, return a transformation of d according to a Gaussian • motionUpdate() updates the samples by the odometry offset, • input odometry: the motion since the last call to this function • updateByFlag(flagfieldposition,sideofFlag) the function updtes the samples by a signle edge of a flag recognized • updateByGoalPost(…) The function updates the samples by a single goal post recognized • landmarksObservationUpdate(landmarkspercept) the function updates the samples by the • recognized landmarks (goal, flags etc…), triggers updateByFlag and UpdateByGoalPost

  45. GT2005SelfLocator • updateByCenterCircle(…) observationUpdate by the center circle • updateByPoint(…) observationUpdate using the linecrossing percept • lineObservationUpdate(…) the function updates the samples by recognized lines • calcAveragePerceptTypeProbabilities(…) calculates the average possibility for each perceptType • and all samples and returns the product over all averages, this function return product over • all average perceptype-probabilities • resample() redistribution of the sampelSet according to the probabilities of the samples • calcDistributionValidityBySandardDeviation() calculates the localization validity by • standard deviation. • calcDistributionValidityByEntropy() calculates the localization validiy by entropy. • calcPoseFromSubCube(…) The function calculates a pose by averaging the sample poses in a sub cube of the • pose-room. • calcPose(…) the function determines the most probable pose from the sample distribution • updteVariancesBySpeed the function calculates the variances and trust values from the current speed. • calculateTrust(…) the function calculates the trust values from variance and weight parameters. • resetSamples(…) reset all samples to random positions (or to a given position!) • resetSamplesWhenPenalized(…) reset all samples when robot is penalized • 25% samples are placed on each side of the field at the center line respectively, • 50% at random positions

  46. Obstacle Locator • relativeOrientation • obstacles[] • timestamps[] • lastOdometry<OdometryData> • odometry<Pose2D> • headTiltClipPSD: head tilt angle below which psd percepts are ignored. • Execute(); • usePSD? • useLinesPercept? • useObstaclesPercep? • useAging? • setObstacleMode(…) • moveObstaclesByOdometry()

More Related