Esempio n. 1
0
	def Execute(self):
		print("In Move")
		super(Move , self).CheckForCommand()
		print(self.Command)
		
		if self.RawCommand == "01":
			hardware_controller.forward(self.speed)
		if self.RawCommand == "02":
			hardware_controller.reverse(self.speed)
		if self.RawCommand == "03":
			hardware_controller.turnLeft(self.speed)
		if self.RawCommand == "04":
			hardware_controller.turnRight(self.speed)
		
		self.Data.next_Transition(self.Command)		
Esempio n. 2
0
	def Execute(self):
		super(Collision , self).CheckForCommand()
		hardware_controller.stop()
		
		if self.RawCommand == "01":
			if not hardware_controller.irFront():
				hardware_controller.forward(self.speed)
		if self.RawCommand == "02":
			if not hardware_controller.irBack():
				hardware_controller.reverse(self.speed)
		if self.RawCommand == "03":
			hardware_controller.turnLeft(self.speed)
		if self.RawCommand == "04":
			hardware_controller.turnRight(self.speed)		
			
		#print(self.Command)
		self.Data.next_Transition(self.Command)