Exemplo n.º 1
0
	def setUp(self):
		self.stationKeeping = stationkeeping.StationKeeping()
		topLeftCoord= datatypes.GPSCoordinate(50,-123)
		topRightCoord=datatypes.GPSCoordinate(50,-122)
		botLeftCoord=datatypes.GPSCoordinate(49,-123)
		botRightCoord=datatypes.GPSCoordinate(49,-122)
		self.boxCoords = standardcalc.setBoxCoords(topLeftCoord, topRightCoord, botLeftCoord, botRightCoord)  
		self.waypoints = self.stationKeeping.setWayPtCoords(self.boxCoords)
Exemplo n.º 2
0
    def run(self, wayList):
        
        boxCoords = standardcalc.setBoxCoords(wayList[0].coordinate, wayList[1].coordinate, wayList[2].coordinate, wayList[3].coordinate)
        self.wayPtCoords = self.setWayPtCoords(boxCoords)  #top, right, bottom, left
        gVars.logger.info("North waypoint: " + str(self.wayPtCoords[0]) + " East waypoint: " + str(self.wayPtCoords[1]) +" South waypoint: " + str(self.wayPtCoords[2]) + " West waypoint: " + str(self.wayPtCoords[3]) )
        
        spdList = [self.meanSpd] * 100
        boxDistList = self.getBoxDist(boxCoords)  #top, right, bottom, left
        
        self.currentWaypoint = self.getStartDirection(self.wayPtCoords)
        self.printDistanceLogs(boxDistList)

        gVars.logger.info("------CURRENT WAYPOINT=" + str(self.currentWaypoint)+" ---------")
        gVars.logger.info("Station Keeping Initialization finished. Now running Station Keeping Challenge")
         
        if (gVars.currentData.awa > 0):
            self.upwindWaypoint = (self.currentWaypoint + 1) % 4
        else:
            self.upwindWaypoint = (self.currentWaypoint + 3) % 4
            
        gVars.logger.info("------UPWIND WAYPOINT=" + str(self.upwindWaypoint)+" ---------")
            
        self.stationKeep(boxCoords, spdList)
 def testSetLSquare(self):
     self.coordlist5 = standardcalc.setBoxCoords(self.coord15, self.coord13, self.coord14, self.coord16)
     self.assertEqual((self.coordlist5[0] == self.coord15),1)
     self.assertEqual((self.coordlist5[1] == self.coord16),1)
     self.assertEqual((self.coordlist5[2] == self.coord13),1)
     self.assertEqual((self.coordlist5[3] == self.coord14),1)
 def testSetRSquare(self):
     self.coordlist4 = standardcalc.setBoxCoords(self.coord10, self.coord11, self.coord9, self.coord12)
     self.assertEqual((self.coordlist4[0] == self.coord10),1)
     self.assertEqual((self.coordlist4[1] == self.coord12),1)
     self.assertEqual((self.coordlist4[2] == self.coord11),1)
     self.assertEqual((self.coordlist4[3] == self.coord9),1)
 def testSetDiamond2(self):
     self.coordlist3 = standardcalc.setBoxCoords(self.coord5, self.coord6, self.coord8, self.coord7)
     self.assertEqual((self.coordlist3[0] == self.coord8),1)
     self.assertEqual((self.coordlist3[1] == self.coord7),1)
     self.assertEqual((self.coordlist3[2] == self.coord6),1)
     self.assertEqual((self.coordlist3[3] == self.coord5),1)
 def testSetDiamond1(self):
     self.coordlist2 = standardcalc.setBoxCoords(self.coord7, self.coord8, self.coord6, self.coord5)
     self.assertEqual((self.coordlist2[0] == self.coord8),1)
     self.assertEqual((self.coordlist2[1] == self.coord7),1)
     self.assertEqual((self.coordlist2[2] == self.coord6),1)
     self.assertEqual((self.coordlist2[3] == self.coord5),1)
 def testSetSquare(self):
     self.coordlist1 = standardcalc.setBoxCoords(self.coord2, self.coord4, self.coord3, self.coord1)
     self.assertEqual((self.coordlist1[0] == self.coord1),1)
     self.assertEqual((self.coordlist1[1] == self.coord2),1)
     self.assertEqual((self.coordlist1[2] == self.coord3),1)
     self.assertEqual((self.coordlist1[3] == self.coord4),1)              
Exemplo n.º 8
0
 def testCase3(self):
     self.coordlist1 = standardcalc.setBoxCoords(self.coord0, self.coord2, self.coord1, self.coord3)        
     self.assertIs(self.coordlist1[0],self.coord1)
     self.assertIs(self.coordlist1[3],self.coord0)
     self.assertIs(self.coordlist1[2],self.coord3)
     self.assertIs(self.coordlist1[1],self.coord2)
Exemplo n.º 9
0
 def initialize(self, c0, c1, c2, c3):
     self.roundBuoyCR = roundbuoychaserace.RoundBuoyChaseRace()
     self.boxCoords = standardcalc.setBoxCoords(c0, c1, c2, c3)
     self.currentWaypoint = self.getStartDirection(self.boxCoords)
     gVars.logger.info("Current Waypoint is " + str(self.currentWaypoint))
Exemplo n.º 10
0
 def initialize(self,c0, c1, c2, c3):
     self.roundBuoyCR = roundbuoychaserace.RoundBuoyChaseRace()
     self.boxCoords = standardcalc.setBoxCoords(c0, c1, c2, c3)
     self.currentWaypoint = self.getStartDirection(self.boxCoords)
     gVars.logger.info("Current Waypoint is "+str(self.currentWaypoint))