Package intera_interface :: Module camera :: Class Cameras
[hide private]
[frames] | no frames]

Class Cameras

source code

object --+
         |
        Cameras

Base class for the interface to the robot's Cameras.

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
bool
_camera_streaming_status(self, camera_name)
Private function to check if the camera is currently in streaming mode.
source code
[str]
list_cameras(self)
Return the list of all camera names on current robot.
source code
bool
verify_camera_exists(self, camera_name)
Verify if the given camera name is in the list of camera names or not.
source code
bool
is_camera_streaming(self, camera_name)
Check the given camera name is streaming or not.
source code
 
set_callback(self, camera_name, callback, callback_args=None, queue_size=10, rectify_image=True)
Setup the callback function to show image.
source code
bool
start_streaming(self, camera_name)
Start camera streaming for the given camera name, This only allows one camera open at one time and forces closed any other open cameras before open the wanted one.
source code
bool
stop_streaming(self, camera_name)
Stop camera streaming by given the camera name.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor.

Overrides: object.__init__

_camera_streaming_status(self, camera_name)

source code 

Private function to check if the camera is currently in streaming mode.

Parameters:
  • camera_name (str) - camera name
Returns: bool
True if the camera is streaming, False otherwise

list_cameras(self)

source code 

Return the list of all camera names on current robot.

Returns: [str]
ordered list of camera names

verify_camera_exists(self, camera_name)

source code 

Verify if the given camera name is in the list of camera names or not.

Parameters:
  • camera_name (str) - camera name
Returns: bool
True if the name exists in camera name list, False otherwise.

is_camera_streaming(self, camera_name)

source code 

Check the given camera name is streaming or not.

Parameters:
  • camera_name (str) - camera name
Returns: bool
True if the camera is streaming, False camera is not streaming, False with log error means camera name not exists in camera name list

set_callback(self, camera_name, callback, callback_args=None, queue_size=10, rectify_image=True)

source code 

Setup the callback function to show image.

Parameters:
  • camera_name (str) - camera name
  • callback (fn(msg, cb_args)) - function to call when data is received
  • callback_args (any) - additional arguments to pass to the callback
  • queue_size (int) - maximum number of messages to receive at a time
  • rectify_image (bool) - specify whether subscribe to the rectified or raw (unrectified) image topic

start_streaming(self, camera_name)

source code 

Start camera streaming for the given camera name, This only allows one camera open at one time and forces closed any other open cameras before open the wanted one.

Parameters:
  • camera_name (str) - camera name
Returns: bool
False if camera not exists in camera_name_list or the interface is not able to stop streaming other camera. Additionally, returns False if the interface is not able to start streaming the desired camera. Returns True if the camera already streaming or the camera successfully start streaming.

stop_streaming(self, camera_name)

source code 

Stop camera streaming by given the camera name.

Parameters:
  • camera_name (str) - camera name
Returns: bool
False if camera not exists in camera name list or not able to stop streaming camera. True if the camera not is streaming mode or the camera successfully stop streaming.