Example #1
0
    def _try_vision_serve(self):
        """ Serve vision data for the objects that exist """
        try:
            body = self.objects['blue'].body
            (x, y) = tuple(body.position)
            a = simpleAngle(body.angle)
            self.blueRobot[0] = x
            self.blueRobot[1] = y
            self.blueRobot[2] = a
        except KeyError:
            pass

        try:
            body = self.objects['yellow'].body
            (x, y) = tuple(body.position)
            a = simpleAngle(body.angle)
            self.yellowRobot[0] = x
            self.yellowRobot[1] = y
            self.yellowRobot[2] = a
        except KeyError:
            pass

        try:
            body = self.objects['ball'].body
            (x, y) = tuple(body.position)
            self.ball[0] = x
            self.ball[1] = y
        except KeyError:
            pass
Example #2
0
 def __init__(self, angle):
     self.angle = simpleAngle(radians(angle))