def __init__(self, hostname, username, password, width, height, frame_id, camera_info_url, use_encrypted_password, camera_id=1, auto_wakeup_camera=True, compression=0, fps=24, use_color=True, use_square_pixels=False):
    'Create the ROS-VAPIX interface.\n\n        :param hostname: Hostname of the camera (without http://, can be an IP address).\n        :type hostname: basestring\n        :param username: If login is needed, provide a username here.\n        :type username: :py:obj:`basestring` | None\n        :param password: If login is needed, provide a password here.\n        :type password: :py:obj:`basestring` | None\n        :param width: Width of the requested video stream in pixels (can be changed later). Must be one of the supported\n                      resolutions. If `None`, the resolution will be chosen by height only. If also `height` is `None`,\n                      then the default camera resolution will be used.\n        :type width: int|None\n        :param height: Height of the requested video stream in pixels (can be changed later). Must be one of the\n                       supported resolutions. If `None`, the resolution will be chosen by width only. If also `width` is\n                       `None`, then the default camera resolution will be used.\n        :type height: int|None\n        :param frame_id: The ROS TF frame assigned to the camera.\n        :type frame_id: basestring\n        :param camera_info_url: The URL pointing to the camera calaibration, if available.\n        :type camera_info_url: basestring\n        :param use_encrypted_password: Whether to use Plain HTTP Auth (False) or Digest HTTP Auth (True).\n        :type use_encrypted_password: bool\n        :param camera_id: ID (number) of the camera. Can be 1 to 4.\n        :type camera_id: int\n        :param auto_wakeup_camera: If True, there will be a wakeup trial after first unsuccessful network command.\n        :type auto_wakeup_camera: bool\n        :param compression: Compression of the image (0 - no compression, 100 - max compression).\n        :type compression: int\n        :param fps: The desired frames per second.\n        :type fps: int\n        :param use_color: If True, send a color stream, otherwise send only grayscale image.\n        :type use_color: bool\n        :param use_square_pixels: If True, the resolution will be stretched to match 1:1 pixels.\n                                  By default, the pixels have a ratio of 11:12.\n        :type use_square_pixels: bool\n        :raises: :py:exc:`ValueError` if the requested resolution (either the `resolution`, or `width`+`height`\n                 is not supported.\n        '
    self.video_params_changed = False
    self.__initializing = True
    self._hostname = hostname
    self._camera_id = camera_id
    self.diagnostic_updater = Updater()
    self.diagnostic_updater.setHardwareID(hostname)
    self._api = None
    while ((self._api is None) and (not rospy.is_shutdown())):
        try:
            self._api = VAPIX.get_api_for_camera(hostname, username, password, camera_id, use_encrypted_password)
        except (IOError, ValueError):
            rospy.loginfo(('Retrying connection to VAPIX on host %s, camera %d in 2 seconds.' % (hostname, camera_id)))
            rospy.sleep(2)
    if rospy.is_shutdown():
        return
    self._allowed_resolutions = self._get_allowed_resolutions()
    rospy.loginfo(('The following resolutions are available for camera %d:\n%s' % (camera_id, '\n'.join([str(res) for res in self._allowed_resolutions]))))
    rospy.set_param('~allowed_resolutions', [res.get_vapix_representation() for res in self._allowed_resolutions])
    self._auto_wakeup_camera = auto_wakeup_camera
    self._width = None
    self._height = None
    self._resolution = None
    self._compression = None
    self._fps = None
    self._use_color = None
    self._use_square_pixels = None
    width = (width if (width != '') else None)
    height = (height if (height != '') else None)
    if ((width is None) and (height is None)):
        self.set_resolution(self._allowed_resolutions[0])
    else:
        resolution = self.find_resolution_by_size(width, height)
        self.set_resolution(resolution.get_vapix_representation())
    self.set_compression(compression)
    self.set_fps(fps)
    self.set_use_color(use_color)
    self.set_use_square_pixels(use_square_pixels)
    change_enum_items(VideoStreamConfig, 'resolution', [{'name': (res.name if isinstance(res, CIFVideoResolution) else str(res)), 'value': res.get_vapix_representation(), 'description': str(res)} for res in self._allowed_resolutions], self._resolution.get_vapix_representation())
    self._video_stream_param_change_server = dynamic_reconfigure.server.Server(VideoStreamConfig, self.reconfigure_video)
    self._frame_id = frame_id
    self._camera_info_url = camera_info_url
    self._camera_name = camera_info_manager.genCameraName(self._hostname)
    self._camera_info = camera_info_manager.CameraInfoManager(cname=self._camera_name, url=self._camera_info_url)
    self._camera_info.loadCameraInfo()
    self._streaming_thread = None
    self._video_publisher_frequency_diagnostic = FrequencyStatusParam({'min': self._fps, 'max': self._fps})
    self._video_publisher = PausableDiagnosedPublisher(self, rospy.Publisher('image_raw/compressed', CompressedImage, self, queue_size=100), self.diagnostic_updater, self._video_publisher_frequency_diagnostic, TimeStampStatusParam())
    self._camera_info_publisher = PausableDiagnosedPublisher(self, rospy.Publisher('camera_info', CameraInfo, self, queue_size=100), self.diagnostic_updater, self._video_publisher_frequency_diagnostic, TimeStampStatusParam())
    self._snapshot_server = rospy.Service('take_snapshot', TakeSnapshot, self.take_snapshot)
    self.diagnostic_updater.add(FunctionDiagnosticTask('Camera parameters', self._camera_diagnostic_callback))
    self.username = username
    self.password = password
    self.use_encrypted_password = use_encrypted_password
    self.st = None
    self.pub = self._video_publisher
    self.caminfo_pub = self._camera_info_publisher
    self.__initializing = False
Create the ROS-VAPIX interface.

:param hostname: Hostname of the camera (without http://, can be an IP address).
:type hostname: basestring
:param username: If login is needed, provide a username here.
:type username: :py:obj:`basestring` | None
:param password: If login is needed, provide a password here.
:type password: :py:obj:`basestring` | None
:param width: Width of the requested video stream in pixels (can be changed later). Must be one of the supported
              resolutions. If `None`, the resolution will be chosen by height only. If also `height` is `None`,
              then the default camera resolution will be used.
:type width: int|None
:param height: Height of the requested video stream in pixels (can be changed later). Must be one of the
               supported resolutions. If `None`, the resolution will be chosen by width only. If also `width` is
               `None`, then the default camera resolution will be used.
:type height: int|None
:param frame_id: The ROS TF frame assigned to the camera.
:type frame_id: basestring
:param camera_info_url: The URL pointing to the camera calaibration, if available.
:type camera_info_url: basestring
:param use_encrypted_password: Whether to use Plain HTTP Auth (False) or Digest HTTP Auth (True).
:type use_encrypted_password: bool
:param camera_id: ID (number) of the camera. Can be 1 to 4.
:type camera_id: int
:param auto_wakeup_camera: If True, there will be a wakeup trial after first unsuccessful network command.
:type auto_wakeup_camera: bool
:param compression: Compression of the image (0 - no compression, 100 - max compression).
:type compression: int
:param fps: The desired frames per second.
:type fps: int
:param use_color: If True, send a color stream, otherwise send only grayscale image.
:type use_color: bool
:param use_square_pixels: If True, the resolution will be stretched to match 1:1 pixels.
                          By default, the pixels have a ratio of 11:12.
:type use_square_pixels: bool
:raises: :py:exc:`ValueError` if the requested resolution (either the `resolution`, or `width`+`height`
         is not supported.
def __init__(self, hostname, username, password, width, height, frame_id, camera_info_url, use_encrypted_password, camera_id=1, auto_wakeup_camera=True, compression=0, fps=24, use_color=True, use_square_pixels=False):
    'Create the ROS-VAPIX interface.\n\n        :param hostname: Hostname of the camera (without http://, can be an IP address).\n        :type hostname: basestring\n        :param username: If login is needed, provide a username here.\n        :type username: :py:obj:`basestring` | None\n        :param password: If login is needed, provide a password here.\n        :type password: :py:obj:`basestring` | None\n        :param width: Width of the requested video stream in pixels (can be changed later). Must be one of the supported\n                      resolutions. If `None`, the resolution will be chosen by height only. If also `height` is `None`,\n                      then the default camera resolution will be used.\n        :type width: int|None\n        :param height: Height of the requested video stream in pixels (can be changed later). Must be one of the\n                       supported resolutions. If `None`, the resolution will be chosen by width only. If also `width` is\n                       `None`, then the default camera resolution will be used.\n        :type height: int|None\n        :param frame_id: The ROS TF frame assigned to the camera.\n        :type frame_id: basestring\n        :param camera_info_url: The URL pointing to the camera calaibration, if available.\n        :type camera_info_url: basestring\n        :param use_encrypted_password: Whether to use Plain HTTP Auth (False) or Digest HTTP Auth (True).\n        :type use_encrypted_password: bool\n        :param camera_id: ID (number) of the camera. Can be 1 to 4.\n        :type camera_id: int\n        :param auto_wakeup_camera: If True, there will be a wakeup trial after first unsuccessful network command.\n        :type auto_wakeup_camera: bool\n        :param compression: Compression of the image (0 - no compression, 100 - max compression).\n        :type compression: int\n        :param fps: The desired frames per second.\n        :type fps: int\n        :param use_color: If True, send a color stream, otherwise send only grayscale image.\n        :type use_color: bool\n        :param use_square_pixels: If True, the resolution will be stretched to match 1:1 pixels.\n                                  By default, the pixels have a ratio of 11:12.\n        :type use_square_pixels: bool\n        :raises: :py:exc:`ValueError` if the requested resolution (either the `resolution`, or `width`+`height`\n                 is not supported.\n        '
    self.video_params_changed = False
    self.__initializing = True
    self._hostname = hostname
    self._camera_id = camera_id
    self.diagnostic_updater = Updater()
    self.diagnostic_updater.setHardwareID(hostname)
    self._api = None
    while ((self._api is None) and (not rospy.is_shutdown())):
        try:
            self._api = VAPIX.get_api_for_camera(hostname, username, password, camera_id, use_encrypted_password)
        except (IOError, ValueError):
            rospy.loginfo(('Retrying connection to VAPIX on host %s, camera %d in 2 seconds.' % (hostname, camera_id)))
            rospy.sleep(2)
    if rospy.is_shutdown():
        return
    self._allowed_resolutions = self._get_allowed_resolutions()
    rospy.loginfo(('The following resolutions are available for camera %d:\n%s' % (camera_id, '\n'.join([str(res) for res in self._allowed_resolutions]))))
    rospy.set_param('~allowed_resolutions', [res.get_vapix_representation() for res in self._allowed_resolutions])
    self._auto_wakeup_camera = auto_wakeup_camera
    self._width = None
    self._height = None
    self._resolution = None
    self._compression = None
    self._fps = None
    self._use_color = None
    self._use_square_pixels = None
    width = (width if (width != ) else None)
    height = (height if (height != ) else None)
    if ((width is None) and (height is None)):
        self.set_resolution(self._allowed_resolutions[0])
    else:
        resolution = self.find_resolution_by_size(width, height)
        self.set_resolution(resolution.get_vapix_representation())
    self.set_compression(compression)
    self.set_fps(fps)
    self.set_use_color(use_color)
    self.set_use_square_pixels(use_square_pixels)
    change_enum_items(VideoStreamConfig, 'resolution', [{'name': (res.name if isinstance(res, CIFVideoResolution) else str(res)), 'value': res.get_vapix_representation(), 'description': str(res)} for res in self._allowed_resolutions], self._resolution.get_vapix_representation())
    self._video_stream_param_change_server = dynamic_reconfigure.server.Server(VideoStreamConfig, self.reconfigure_video)
    self._frame_id = frame_id
    self._camera_info_url = camera_info_url
    self._camera_name = camera_info_manager.genCameraName(self._hostname)
    self._camera_info = camera_info_manager.CameraInfoManager(cname=self._camera_name, url=self._camera_info_url)
    self._camera_info.loadCameraInfo()
    self._streaming_thread = None
    self._video_publisher_frequency_diagnostic = FrequencyStatusParam({'min': self._fps, 'max': self._fps})
    self._video_publisher = PausableDiagnosedPublisher(self, rospy.Publisher('image_raw/compressed', CompressedImage, self, queue_size=100), self.diagnostic_updater, self._video_publisher_frequency_diagnostic, TimeStampStatusParam())
    self._camera_info_publisher = PausableDiagnosedPublisher(self, rospy.Publisher('camera_info', CameraInfo, self, queue_size=100), self.diagnostic_updater, self._video_publisher_frequency_diagnostic, TimeStampStatusParam())
    self._snapshot_server = rospy.Service('take_snapshot', TakeSnapshot, self.take_snapshot)
    self.diagnostic_updater.add(FunctionDiagnosticTask('Camera parameters', self._camera_diagnostic_callback))
    self.username = username
    self.password = password
    self.use_encrypted_password = use_encrypted_password
    self.st = None
    self.pub = self._video_publisher
    self.caminfo_pub = self._camera_info_publisher
    self.__initializing = False