Exemplo n.º 1
0
class Camera:
	def __init__(self):
		self.cameraPipe = PipeReader('./image')
		self.detectBlock = False
		self.blockDistance = 0
		self.blockAngle = 0

	def update(self):
		message = self.cameraPipe.read(20)
		#message=""
		if message:
			#print("Recieved: '%s'" % message)
			if message[:2] == 'no':
				self.detectBlock=False
			else:
				try:
					self.detectBlock=True
					self.blockDistance, self.blockAngle = [number[:6] for number in message.split(',')]
					self.blockAngle = float(self.blockAngle)
				except:
					print "garbage message"
Exemplo n.º 2
0
	def __init__(self):
		self.cameraPipe = PipeReader('./image')
		self.detectBlock = False
		self.blockDistance = 0
		self.blockAngle = 0
Exemplo n.º 3
0
	def __init__(self):
		self.cameraPipe = PipeReader('./image')
		self.detectBlock = False
		self.blockDistance = 0
		self.blockAngle = 0