Devices
The devices module provides interfaces for various robotic platforms and devices.
Device Interfaces
- class sic_framework.devices.device.SICLibrary(name, lib_path='', download_cmd='', req_version=None, lib_install_cmd='')[source]
Bases:
objectA library to be installed on a remote device.
- class sic_framework.devices.device.SICDeviceManager(*args, **kwargs)[source]
Bases:
objectAbstract class to facilitate property initialization for SICConnector properties. This way components of a device can easily be used without initializing all device components manually.
- __init__(ip, sic_version=None, username=None, passwords=None, port=22)[source]
Connect to the device and ensure an up to date version of the framework is installed :param ip: the ip adress of the device :param username: the ssh login name :param passwords: the (list) of passwords to use
- ssh_command(command, create_thread=False, **kwargs)[source]
Executes the given command and logs any errors from the SSH session.
- Parameters:
command (str) – command to run on ssh client
**kwargs – Additional keyword arguments to pass to ssh.exec_command (e.g., get_pty=False, timeout=30)
- Returns:
(stdin, stdout, stderr) file-like objects from the SSH session
- Return type:
tuple
- Raises:
Various SSH exceptions if connection fails –
- check_if_lib_installed(pip_freeze, lib)[source]
Check to see if a python library name + version is in the ‘pip freeze’ output of a remote device.
Robot Platforms
- class sic_framework.devices.pepper.Pepper(*args, **kwargs)[source]
Bases:
NaoqiWrapper for Pepper device to easily access its components (connectors)
- __init__(ip, sic_version=None, stereo_camera_conf=None, depth_camera_conf=None, pepper_motion_conf=None, **kwargs)[source]
Connect to the device and ensure an up to date version of the framework is installed :param ip: the ip adress of the device :param username: the ssh login name :param passwords: the (list) of passwords to use
- sic_install()[source]
Installs SIC on the Pepper
This function: 1. gets rid of old directories for clean install 2. curl github repository 3. pip install –no-deps git repo 4. install dependencies from _LIBS_TO_INSTALL
- create_test_environment()[source]
Creates a test environment on the Pepper
To use test environment, you must pass in a repo to the device initialization. For example: - Pepper(ip, dev_test=True, test_repo=PATH_TO_REPO) OR - Pepper(ip, dev_test=True)
If you do not pass in a repo, it will assume the repo to test is already installed in a test environment on the Pepper.
Instead of creating a virtual environment, we will just copy the repo over to the test directory and install from there.
- property stereo_camera
- property depth_camera
- property tablet_display_url
- property tactile_sensor
- class sic_framework.devices.nao.Nao(*args, **kwargs)[source]
Bases:
NaoqiWrapper for NAO device to easily access its components (connectors)
- __init__(ip, sic_version=None, dev_test=False, test_repo=None, **kwargs)[source]
Initialize the Nao device wrapper.
- Parameters:
ip (str) – The IP address of the NAO robot.
sic_version (str or None, optional) – The version of the SIC framework to use. Default is None which uses the same version as your local environment.
dev_test (bool, optional) – Whether to use the device in development/testing mode. Default is False.
test_repo (str or None, optional) – Path to the test repository that you want zipped and installed on the Nao. Default is None.
- create_test_environment()[source]
Creates a test environment on the Nao
To use test environment, you must pass in a repo to the device initialization. For example:
Nao(ip, dev_test=True, test_repo=PATH_TO_REPO) OR
Nao(ip, dev_test=True)
If you do not pass in a repo, it will assume the repo to test is already installed in a test environment on the Nao.
This function:
checks to see if test environment exists
if test_venv exists and no repo is passed in (self.test_repo), return True (no need to do anything)
if test_venv exists but a new repo has been passed in:
uninstall old version of social-interaction-cloud on Nao
zip the provided repo
scp zip file over to nao, to ‘sic_to_test’ folder
unzip repo and install
if test_venv does not exist:
check to make sure a test repo has been passed in to device initialization. If not, raise RuntimeError
if repo has been passed in, create a new .test_venv and install repo
- class sic_framework.devices.desktop.Desktop(*args, **kwargs)[source]
Bases:
SICDeviceManager- __init__(camera_conf=None, mic_conf=None, speakers_conf=None, tts_conf=None)[source]
Connect to the device and ensure an up to date version of the framework is installed :param ip: the ip adress of the device :param username: the ssh login name :param passwords: the (list) of passwords to use
- property camera
- property mic
- property speakers
- property tts
- property spacemouse
franka.py
This module provides the Franka device class and starts Franka-related components automatically.
- sic_framework.devices.franka.start_franka_components()[source]
Initialize and run the Franka component manager
- class sic_framework.devices.franka.Franka(*args, **kwargs)[source]
Bases:
SICDeviceManagerFranka device interface that automatically starts the component manager in a background thread on first initialization.
- __init__(motion_conf=None)[source]
Initialize the Franka device with the given motion configuration :param motion_conf: Configuration for the Franka motion component
- property motion_recorder
Get the Franka motion recorder connector. :return: The FrankaMotionRecorder connector.
- property motion
Get the Franka motion connector. :return: The FrankaMotion connector.