def tick(self, blackboard): body = actioncommand.standStraight() head = actioncommand.head(0, 0, False, 1, 1) leds = actioncommand.leds() req = robot.BehaviourRequest() req.actions = actioncommand.compose(head, body, leds) return req
def tick(self): body = actioncommand.standStraight() head = actioncommand.head(0, 0, False, 1, 1) leds = actioncommand.leds() self.world.b_request.actions = actioncommand.compose(head, body, leds)
def tick(self, blackboard): self.numFramesTracked += 1 # get ball into centre of frame self.lostBall = (blackboard.localisation.ballLostCount > 60) request = robot.BehaviourRequest() request.actions = robot.All() neckRelative = blackboard.localisation.ballNeckRelative self.targetPitch = self.calculateDesiredPitch(neckRelative) if len(blackboard.vision.balls) > 0: ball = blackboard.vision.balls[0] imgCoords = blackboard.vision.balls[0].imageCoords if blackboard.vision.balls[0].topCamera: CONSTANT_X = 1280.0 / 1.06290551 xDiff = -(imgCoords[0] - 640) / CONSTANT_X else: CONSTANT_X = 640.0 / 1.06290551 xDiff = -(imgCoords[0] - 640 / 2) / CONSTANT_X self.targetYaw = xDiff if blackboard.localisation.ballLostCount < 3: factor = abs(self.targetYaw) / 1.06290551 speed = 0.75 * factor # 10.0 * factor * factor request.actions.head = actioncommand.head(self.targetYaw, self.targetPitch, True, speed, 0.2) else: self.ballYaw = self.calculateDesiredYaw(neckRelative) self.targetYaw = self.ballYaw request.actions.head = actioncommand.head(self.targetYaw, self.targetPitch, False, 0.25, 0.2) return request
def tick(self, blackboard): self.numFramesTracked += 1 # get ball into centre of frame self.lostBall = (blackboard.localisation.ballLostCount > 60) request = robot.BehaviourRequest() request.actions = robot.All() neckRelative = blackboard.localisation.ballNeckRelative self.targetPitch = self.calculateDesiredPitch(neckRelative) if len(blackboard.vision.balls) > 0: ball = blackboard.vision.balls[0] imgCoords = blackboard.vision.balls[0].imageCoords if blackboard.vision.balls[0].topCamera: CONSTANT_X = 1280.0 / 1.06290551 xDiff = -(imgCoords[0] - 640) / CONSTANT_X else: CONSTANT_X = 640.0 / 1.06290551 xDiff = -(imgCoords[0] - 640/2) / CONSTANT_X self.targetYaw = xDiff if blackboard.localisation.ballLostCount < 3: factor = abs(self.targetYaw) / 1.06290551 speed = 0.75 * factor #10.0 * factor * factor request.actions.head = actioncommand.head(self.targetYaw, self.targetPitch, True, speed, 0.2) else: self.ballYaw = self.calculateDesiredYaw(neckRelative) self.targetYaw = self.ballYaw request.actions.head = actioncommand.head(self.targetYaw, self.targetPitch, False, 0.25, 0.2) return request
def tick(self): body = actioncommand.motionCalibrate() head = actioncommand.head(0, 0, False, 1, 1) leds = actioncommand.leds() self.world.b_request.actions = actioncommand.compose(head, body, leds)