예제 #1
0
 def resetEncoders(self):
     control_val = mark1Rpi.directRead(self.encoder_control_address, 2)
     control_val[0] = control_val[0] | 0x03
     mark1Rpi.directWrite(self.encoder_control_address,
                          control_val)  # going high
     control_val[0] = control_val[0] & 0xFC
     mark1Rpi.directWrite(self.encoder_control_address,
                          control_val)  # going low
예제 #2
0
	def setColorLut(self, lut_file):
		f = open(lut_file, "rb")
		values_tuple = ()
		tuple_size = 0
		try:
			byte = f.read(1)
			while byte != "":
				values_tuple = values_tuple + byte
				values_tuple = values_tuple + 0x00
				tuple_size = tuple_size + 2
				byte = f.read(1)
			mark1Rpi.directWrite(self.classifier_lut_base_address, values_tuple, tuple_size);
		finally:
			f.close()
예제 #3
0
	def setColorLut(self, lut_file):
		f = open(lut_file, "rb")
		values_tuple = ()
		tuple_size = 0
		try:
			byte = f.read(1)
			while byte != "":
				values_tuple = values_tuple + byte
				values_tuple = values_tuple + 0x00
				tuple_size = tuple_size + 2
				byte = f.read(1)
			mark1Rpi.directWrite(self.classifier_lut_base_address, values_tuple, tuple_size);
		finally:
			f.close()
예제 #4
0
	def setColorLut(self, lut_file):
		f = open(lut_file, "rb")
		values_tuple = ()
		try:
			byte = f.read(1)
			while byte != "":
				#print byte
				unpacked_val = struct.unpack('B',byte)
                                values_tuple = values_tuple + unpacked_val
				#values_tuple = values_tuple + unpacked_val
				byte = f.read(1)
			#print values_tuple
			print 'sending : ', str(len(values_tuple)), 'in the color lut'
			#print hex(values_tuple[0]),hex(values_tuple[1]),hex(values_tuple[2])
			mark1Rpi.directWrite(self.classifier_lut_base_address, values_tuple);
			print 'done !\n'
		finally:
			f.close()
예제 #5
0
 def setColorLut(self, lut_file):
     f = open(lut_file, "rb")
     values_tuple = ()
     try:
         byte = f.read(1)
         while byte != "":
             #print byte
             unpacked_val = struct.unpack('B', byte)
             values_tuple = values_tuple + unpacked_val
             #values_tuple = values_tuple + unpacked_val
             byte = f.read(1)
         #print values_tuple
         print 'sending : ', str(len(values_tuple)), 'in the color lut'
         #print hex(values_tuple[0]),hex(values_tuple[1]),hex(values_tuple[2])
         mark1Rpi.directWrite(self.classifier_lut_base_address,
                              values_tuple)
         print 'done !\n'
     finally:
         f.close()
예제 #6
0
	def enableEncoders(self):
		control_val =  mark1Rpi.directRead(self.encoder_control_address, 2)
		control_val[0] = control_val[0] | 0x0C 
		mark1Rpi.directWrite(self.encoder_control_address, control_val) # high enable bits
예제 #7
0
	def resetEncoders(self):
		control_val =  mark1Rpi.directRead(self.encoder_control_address, 2)
		control_val[0] = control_val[0] | 0x03 
		mark1Rpi.directWrite(self.encoder_control_address, control_val) # going high
		control_val[0] = control_val[0] & 0xFC 
		mark1Rpi.directWrite(self.encoder_control_address, control_val) # going low
예제 #8
0
	def setLeds(self, val):
		mark1Rpi.directWrite(self.leds_base_address, (val,0));
예제 #9
0
	def setServoPulse(self, index, pos):	
		mark1Rpi.directWrite(self.servo_base_address[index], (pos,self.servo_failsafe[index]));
예제 #10
0
 def enableEncoders(self):
     control_val = mark1Rpi.directRead(self.encoder_control_address, 2)
     control_val[0] = control_val[0] | 0x0C
     mark1Rpi.directWrite(self.encoder_control_address,
                          control_val)  # high enable bits
예제 #11
0
	def setSpeed(self, speed):
		byte_speed = int(speed)
		mark1Rpi.directWrite(self.pid_address, ((byte_speed & 0x00FF),((byte_speed & 0xFF00) >> 8))) 
예제 #12
0
	def setLeds(self, val):
		mark1Rpi.directWrite(self.leds_base_address, (val,0));
예제 #13
0
	def setServoPulse(self, index, pos):	
		mark1Rpi.directWrite(self.servo_base_address[index], (pos,0));
예제 #14
0
 def setP(self, p_coeff):
     byte_coef = int(p_coeff * 256)
     mark1Rpi.directWrite(
         self.pcoef_address((byte_coef & 0x00FF),
                            ((byte_coef & 0xFF00) >> 8)))
예제 #15
0
 def setSpeed(self, speed):
     byte_speed = int(speed)
     mark1Rpi.directWrite(self.pid_address, ((byte_speed & 0x00FF),
                                             ((byte_speed & 0xFF00) >> 8)))
예제 #16
0
 def resetWatchdog(self):
     mark1Rpi.directWrite(self.watchdog_address, (0x01, 0x00))  # going high
예제 #17
0
 def disableEncoders(self):
     control_val = mark1Rpi.directRead(self.encoder_control_address, 2)
     control_val[0] = control_val[0] & 0xF3
     mark1Rpi.directWrite(self.encoder_control_address,
                          control_val)  # low enable bits
예제 #18
0
	def disableEncoders(self):
		control_val =  mark1Rpi.directRead(self.encoder_control_address, 2)
		control_val[0] = control_val[0] & 0xF3 
		mark1Rpi.directWrite(self.encoder_control_address, control_val) # low enable bits
예제 #19
0
	def resetWatchdog(self):
		mark1Rpi.directWrite(self.watchdog_address, (0x01, 0x00)) # going high
예제 #20
0
	def setI(self, i_coeff):
		byte_coef = int(i_coeff*256)
		mark1Rpi.directWrite(self.icoeff_address, ((byte_coef & 0x00FF),((byte_coef & 0xFF00) >> 8))) 
예제 #21
0
	def setP(self, p_coeff):
		byte_coef = int(p_coeff*256)
		mark1Rpi.directWrite(self.pcoef_address ((byte_coef & 0x00FF),((byte_coef & 0xFF00) >> 8))) 
예제 #22
0
 def setD(self, d_coeff):
     byte_coef = int(d_coeff * 256)
     mark1Rpi.directWrite(self.dcoeff_address,
                          ((byte_coef & 0x00FF),
                           ((byte_coef & 0xFF00) >> 8)))
예제 #23
0
	def setD(self, d_coeff):
		byte_coef = int(d_coeff*256)
		mark1Rpi.directWrite(self.dcoeff_address, ((byte_coef & 0x00FF),((byte_coef & 0xFF00) >> 8))) 
예제 #24
0
 def setI(self, i_coeff):
     byte_coef = int(i_coeff * 256)
     mark1Rpi.directWrite(self.icoeff_address,
                          ((byte_coef & 0x00FF),
                           ((byte_coef & 0xFF00) >> 8)))