Example #1
0
    def __init__(self, *args, **kwargs):
        """Takes arguments of serial port number (0-n) and camera
        number on daisy chain (1-9), a daisychain of 0 will send commands to
	all cameras on the port."""
	

        Camera.__init__(self, *args, **kwargs)

        # Some global values for the rs232 commands
        self._header = struct.pack('B',0xFF)
        self._footer = struct.pack('B',0xEF)

        self.sport = serial.Serial(self.port,                      #  port numbering starts at 0
                                   baudrate = 9600,                #
                                   bytesize = serial.EIGHTBITS,    #
                                   parity = serial.PARITY_NONE,    #
                                   stopbits = serial.STOPBITS_ONE, #
                                   timeout = 0.1,                  #
                                   xonxoff = 0,                    #  disablesoftware flow control
                                   rtscts = 1)                     # enable hardware flow control
	
        self.port = self._toParm(self.port,1)
        
	self.daisychain  = self._toParm(int(self.daisychain),1)
        self._dev  = struct.pack('2B',
                                 0x30,
                                 0x30+int(self.daisychain,16))
	
        self.movement_quanta=10
	

	if self.daisychain ==  "1": 
	    # if we're the first camera on the chain:
	    self._startup()  # comment out for speedier testing
Example #2
0
 def __init__(self, device_index, capture_fps, capture_size,
              classify_service):
     Camera.__init__(self, device_index, capture_fps, capture_size)
     self.__current_result_lock = threading.Lock()
     self.__current_result = None
     self.__classify_stop_flag = False
     self.__classify_thread = None
     self.__classify_service = classify_service
 def __init__(self, device_index, capture_fps, capture_size, result_cache_size, detect_service):
     Camera.__init__(self, device_index, capture_fps, capture_size)
     self.__result_cache_size = result_cache_size
     self.__result_cache_lock = threading.Lock()
     self.__result_cache = []
     self.__detect_stop_flag = False
     self.__detect_thread = None
     self.__detect_service = detect_service
Example #4
0
    def __init__(self, name, measureUnit, measureIface, writerUnit=None):
        '''constructor
        '''
        TotalStation.__init__(self, name, measureUnit, measureIface,
                              writerUnit)
        Camera.__init__(self, name, measureUnit, measureIface, writerUnit)
        #StepperMotor.__init__(self, stepperMotorUnit, speed, halfSteps)

        self._affinParams = None
Example #5
0
 def __init__(self, *args, **kwargs):
     Camera.__init__(self, *args, **kwargs)
     self.unit_sun_vect = self.sun_vect / np.linalg.norm(self.sun_vect)
     ## rotation_mobject lives in the phi-theta-distance space
     self.rotation_mobject = VectorizedPoint()
     ## moving_center lives in the x-y-z space
     ## It representes the center of rotation
     self.moving_center = VectorizedPoint(self.space_center)
     self.set_position(self.phi, self.theta, self.distance)
Example #6
0
    def __init__(self, name, measureUnit, measureIface, writerUnit = None):
        '''constructor
        '''
        TotalStation.__init__(self, name, measureUnit, measureIface, writerUnit)
        Camera.__init__(self, name, measureUnit, measureIface, writerUnit)
        #StepperMotor.__init__(self, stepperMotorUnit, speed, halfSteps)


        self._affinParams = None
 def __init__(self):
     Camera.__init__(self)
     self.image_publisher = rospy.Publisher('/image',
                                            ImageMsg,
                                            queue_size=10)
     self.image_subscriber = rospy.Subscriber(
         'raspicam_node/image/compressed', CompressedImage,
         self.on_image_received)
     self.bool_publiher = rospy.Publisher('/bool', Bool, queue_size=10)
     self.state_subscriber = rospy.Subscriber(
         '/life_cycle_state', Bool, self.on_life_cycle_state_changed)
     self.bridge = CvBridge()
     self.compressed_images = list()
Example #8
0
   def __init__(self, screen, game):
      Camera.__init__(self, screen)

      self.game = game

      self.walkontoTile = pygame.Surface(globs.TILESIZE)
      self.walkontoTile.fill((255,0,0))
      self.walkontoTile.set_alpha(127)

      self.investigateTile = pygame.Surface(globs.TILESIZE)
      self.investigateTile.fill((0,255,0))
      self.investigateTile.set_alpha(127)

      self.warpTile = pygame.Surface(globs.TILESIZE)
      self.warpTile.fill((0,0,255))
      self.warpTile.set_alpha(127)
Example #9
0
    def __init__(self, screen, game):
        Camera.__init__(self, screen)

        self.game = game

        self.walkontoTile = pygame.Surface(globs.TILESIZE)
        self.walkontoTile.fill((255, 0, 0))
        self.walkontoTile.set_alpha(127)

        self.investigateTile = pygame.Surface(globs.TILESIZE)
        self.investigateTile.fill((0, 255, 0))
        self.investigateTile.set_alpha(127)

        self.warpTile = pygame.Surface(globs.TILESIZE)
        self.warpTile.fill((0, 0, 255))
        self.warpTile.set_alpha(127)
Example #10
0
    def __init__(self, *args, **kwargs):
        """Takes arguments of serial port number (port=0-n) and camera
        number on daisy chain (daisychain=1-7) """

        Camera.__init__(self, *args, **kwargs)

        self.port = int(self.port)
        self.daisychain = int(self.daisychain)
        
        # Header, which camera we're talking to
        self._header = struct.pack('B',0x80+self.daisychain)

        #modes
        self._mode_control = struct.pack('B',0x01)
        self._mode_info    = struct.pack('B',0x09)
        self._mode_net     = struct.pack('B',0x00)

        #categorys (not rigidly defined in spec
        self._category_move = struct.pack('B',0x06)
        self._category_cam = struct.pack('B',0x04)
        
        # End of command
        self._terminator = struct.pack('B',0xFF)

        # set up the serial port
        self.sport = serial.Serial(self.port,                        
                                   baudrate = 9600,                
                                   bytesize = serial.EIGHTBITS,    
                                   parity = serial.PARITY_NONE,    
                                   stopbits = serial.STOPBITS_ONE, 
                                   timeout = 0.1,                  
                                   xonxoff = 0,                      
                                   rtscts = 1)

        self.movement_quanta=10
        # movement speed
        # to be controlled by Zoom eventually
        self._panSpeed = struct.pack('B',0x09)
        self._tiltSpeed = struct.pack('B',0x09)
        self._startup
        self._read()
        self._read()
        self._read()
Example #11
0
 def __init__(self, *args, **kwargs):
     Camera.__init__(self, *args, **kwargs)
     self.unit_sun_vect = self.sun_vect / np.linalg.norm(self.sun_vect)
Example #12
0
 def __init__(self, *args, **kwargs):
     Camera.__init__(self, *args, **kwargs)
     self.unit_sun_vect = self.sun_vect/np.linalg.norm(self.sun_vect)
Example #13
0
 def __init__(self, *args, **kwargs):
     Camera.__init__(self, *args, **kwargs)
     self.unit_sun_vect = self.sun_vect/np.linalg.norm(self.sun_vect)
     self.position_mobject = VectorizedPoint()
     self.set_position(self.phi, self.theta, self.distance)
Example #14
0
 def __init__(self):
     Camera.__init__(self)
     self.subCoordenadas = message_filters.Subscriber(
         'coordenadas_circulos', Vector3Stamped)
     self.subVitima = message_filters.Subscriber('tem_circulos',
                                                 BoolStamped)
Example #15
0
 def __init__(self):
     Camera.__init__(self)
     self.start_cameras()