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: object

A library to be installed on a remote device.

__init__(name, lib_path='', download_cmd='', req_version=None, lib_install_cmd='')[source]
sic_framework.devices.device.exclude_pyc(tarinfo)[source]
class sic_framework.devices.device.SICDevice(*args, **kwargs)[source]

Bases: object

Abstract 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

set_reservation()[source]

Set a reservation for the device to prevent other users from using it.

get_last_modified(root, paths)[source]
auto_install()[source]

Install the SICFramework on the device. :return:

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.

install_lib(lib)[source]

Download and install Python library on this remote device

_get_connector(component_connector, **kwargs)[source]

Get the active connection the component, or initialize it if it is not yet connected to.

Parameters:

component_connector – The component connector class to start, e.g. NaoCamera

Returns:

SICConnector

Robot Platforms

class sic_framework.devices.pepper.Pepper(*args, **kwargs)[source]

Bases: Naoqi

Wrapper 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

check_sic_install()[source]

Runs a script on Pepper to see if the sic_framework folder is there.

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
motion_streaming(input_source=None)[source]
property tactile_sensor
class sic_framework.devices.nao.Nao(*args, **kwargs)[source]

Bases: Naoqi

Wrapper 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.

check_sic_install()[source]

Runs a script on Nao to see if SIC is installed there

sic_install()[source]

Runs the install script specific to the Nao

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:

  1. uninstall old version of social-interaction-cloud on Nao

  2. zip the provided repo

  3. scp zip file over to nao, to ‘sic_to_test’ folder

  4. unzip repo and install

  • if test_venv does not exist:
    1. check to make sure a test repo has been passed in to device initialization. If not, raise RuntimeError

    2. if repo has been passed in, create a new .test_venv and install repo

motion_streaming(input_source=None)[source]
sic_framework.devices.desktop.start_desktop_components()[source]
class sic_framework.devices.desktop.Desktop(*args, **kwargs)[source]

Bases: SICDevice

__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

Shared Components

class sic_framework.devices.naoqi_shared.Naoqi(*args, **kwargs)[source]

Bases: SICDevice

__init__(ip, robot_type, venv, device_path, sic_version=None, dev_test=False, test_device_path='', test_repo=None, bypass_install=False, top_camera_conf=None, bottom_camera_conf=None, mic_conf=None, motion_conf=None, tts_conf=None, motion_record_conf=None, motion_stream_conf=None, stiffness_conf=None, speaker_conf=None, lookat_conf=None, username=None, passwords=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

abstractmethod check_sic_install()[source]

Naos and Peppers have different ways of verifying SIC is installed.

abstractmethod sic_install()[source]

Naos and Peppers have different ways of installing SIC.

run_sic()[source]

Starts SIC on the device.

stop()[source]
property top_camera
property bottom_camera
property mic
property motion
property tts
property motion_record
property stiffness
property autonomous
property leds
property speaker
property buttons
property tracker
property look_at