def run(self): global NUMTARGS NUMTARGS = 2 global T1 T1 = util.getConfig(self,'Target 1', 'Swordfish')#naturally swordfish is not an actual color, but irregardless global T2 T2 = util.getConfig(self,'Target 2', 'Swordfish')#naturally swordfish is not an actual color, but irregardless
def run(self): #define variables for counting how many windows have been seen #the default is 1 window(which is just seeing the window) global WindowSeenCount global totalWindowSeen totalWindowSeen = 0 WindowSeenCount = util.getConfig(self,'WindowSeenCount',1)
def enter(self): self.visionSystem.buoyDetectorOn()#change to torpedo once ready #initialize global variables for this set of states #set the two window target events(may require some additional work) #this is an appropriate use of global variables, these will only ever be read global WindowTarget1 WindowTarget1 = util.getConfig(self,'Target1',-1) global WindowTarget2 WindowTarget2 = util.getConfig(self,'Target2',-1) #some additional parsing likely required windowDepth = util.getConfig(self,'windowDepth', -1) if windowDepth == -1: raise LookupError, "windowDepth not specified" #dive to depth for this task util.dive(self,windowDepth,self._diveRate)
def exit(self): util.freeze(self) self.motionManager.stopCurrentMotion()
def stop(self): self.motionManager._controller.moveVel(0,0,0) util.freeze(self)
def DONE(self,event): util.freeze(self)
def exit(self): utility.freeze(self) self.motionManager.stopCurrent()