Example #1
0
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     convertedPoint = mapCoordinatesAdjuster.convertPoint(map.robot.center)
     sequencer.setState(SendingBotToTreasureState())
     safeSpot = pathfinder.findGoodPoint((800, 250))
     return pathfinder.findPath(convertedPoint,
                                safeSpot), "detectTreasure", 180
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     treasurePosition, orientationToGo = map.getPositionInFrontOfTreasure()
     convertedRobotPosition = mapCoordinatesAdjuster.convertPoint(map.robot.center)
     convertedTreasurePosition = mapCoordinatesAdjuster.convertPoint(treasurePosition)
     sequencer.setState(SendingBotToTargetState())
     return  pathfinder.findPath(convertedRobotPosition, convertedTreasurePosition), "alignPositionToTreasure", orientationToGo
Example #3
0
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     treasurePosition, orientationToGo = map.getPositionInFrontOfTreasure()
     convertedRobotPosition = mapCoordinatesAdjuster.convertPoint(
         map.robot.center)
     convertedTreasurePosition = mapCoordinatesAdjuster.convertPoint(
         treasurePosition)
     sequencer.setState(SendingBotToTargetState())
     return pathfinder.findPath(
         convertedRobotPosition, convertedTreasurePosition
     ), "alignPositionToTreasure", orientationToGo
Example #4
0
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     convertedPoint = mapCoordinatesAdjuster.convertPoint(map.robot.center)
     sequencer.setState(DetectTreasureState())
     return pathfinder.findPath(
         convertedPoint, (885, 110)), "alignPositionToChargingStation", 270
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     convertedPoint = mapCoordinatesAdjuster.convertPoint(map.robot.center)
     sequencer.setState(DetectTreasureState())
     return pathfinder.findPath(convertedPoint, (885,110)), "alignPositionToChargingStation", 270
 def handle(self, sequencer, map, pathfinder):
     mapCoordinatesAdjuster = MapCoordinatesAjuster(map)
     convertedPoint = mapCoordinatesAdjuster.convertPoint(map.robot.center)
     sequencer.setState(SendingBotToTreasureState())
     safeSpot = pathfinder.findGoodPoint((800,250))
     return  pathfinder.findPath(convertedPoint,safeSpot), "detectTreasure", 180