Python interface for the DIGIT tactile sensor

Overview

DIGIT-INTERFACE

License: CC BY-NC 4.0 PyPI DIGIT-logo

Python interface for the DIGIT tactile sensor.

For updates and discussions please join the #DIGIT channel at the www.touch-sensing.org community.

Installation

The preferred way of installation is through PyPi:

pip install digit-interface

Alternatively, you can manually clone the repository and install the package using:

git clone https://github.com/facebookresearch/digit-interface.git 
cd digit-interface
pip install -r requirements.txt
python setup.py install

If you cannot access the device by serial number on your system follow adding DIGIT udev Rule

Usage

The default connection method to the DIGIT tactile sensor is through the unique device serial number. The serial number is found on the back of each DIGIT. See List all connected DIGIT's to find device serial numbers which are connected to the host.

Once you have the device serial number, reading data from the sensor should be as easy as

from digit_interface.digit import Digit
 
d = Digit("D12345") # Unique serial number
d.connect()
d.show_view()
d.disconnect()

Upon connection each DIGIT device initializes with a default stream resolution of VGA: 640x480 at 30fps

Further Usage

List all connected DIGIT's:

To list all connected DIGIT's and display sensor information:

from digit_interface.digit_handler import DigitHandler

digits = DigitHandler.list_digits()
Obtain a single frame:
from digit_interface.digit import Digit

d = Digit("D12345") # Unique serial number
d.connect()
frame = d.get_frame()
List supported stream formats:

Additional streams are supported, these streams vary in resolution and frames per second.

To list the available stream formats:

from digit_interface.digit_handler import DigitHandler

print("Supported streams: \n {}".format(DigitHandler.STREAMS))
Change resolution:
d.set_resolution(DigitHandler.STREAMS["QVGA"])
Change FPS,

Based on supported fps for each respective resolution. All streams support pre-defined resolutions which can be found in DigitHandler.STREAMS

d.set_fps(DigitHandler.STREAMS["QVGA"]["fps"]["15fps"])

Adding DIGIT udev Rule

Add your user to the plugdev group,

adduser username plugdev

Copy udev rule,

sudo cp ./udev/50-DIGIT.rules /lib/udev/rules.d/

Reload rules,

sudo udevadm control --reload
sudo udevadm trigger

Replug the DIGIT device into host.

License

This code is licensed under CC-by-NC, as found in the LICENSE file.

Citing

If you use this project in your research, please cite this paper:

@Article{Lambeta2020DIGIT,
  author  = {Lambeta, Mike and Chou, Po-Wei and Tian, Stephen and Yang, Brian and Maloon, Benjamin and Victoria Rose Most and Stroud, Dave and Santos, Raymond and Byagowi, Ahmad and Kammerer, Gregg and Jayaraman, Dinesh and Calandra, Roberto},
  title   = {{DIGIT}: A Novel Design for a Low-Cost Compact High-Resolution Tactile Sensor with Application to In-Hand Manipulation},
  journal = {IEEE Robotics and Automation Letters (RA-L)},
  year    = {2020},
  volume  = {5},
  number  = {3},
  pages   = {3838--3845},
  doi     = {10.1109/LRA.2020.2977257},
}
Comments
  • access the device by serial number

    access the device by serial number

    I am very appreciate of your work and I have tried to make a DIGIT following the guidance. However, when I tried to access the device by serial number, the device could not be recognized. The same problem happened again after adding DIGIT udev Rule. Then, I called the DigitHandler.list_digits() from digit_interface.digit_handler and it returned an empty list. I have no idea why this happened, since I used Ubuntu 18.04 in VirtualBox to operate and flashed firmware to DIGIT without encountering any error, which means that DIGIT could be recognized by my computer.

    opened by zengpy17 12
  • Set intensity of LEDs independently

    Set intensity of LEDs independently

    Thanks for sharing such awsome work! I have found the intensity setting function in digit.py. wonder is there a way to set intensity of LEDs independtly?

    enhancement 
    opened by lzyplayer 8
  • Image noise

    Image noise

    I have finished assembly a DIGIT PCB part. Here's what I got After flashing the firmwire, I was able to get status of DIGIT. However the image I got is a little wired which seems too noisy. I have tried different resolution and stream mode, bot none of them help. here's image I got: logs:

    >>> # Connect to a Digit device with serial number with friendly name
    ... 
    >>> digit = Digit("DXXXXX", "Left Gripper")
    DEBUG:digit_interface.digit:Digit object constructed with serial DXXXXX
    DEBUG:digit_interface.digit_handler:Finding udev devices with subsystem=video4linux, id_model=DIGIT
    DEBUG:digit_interface.digit_handler:Following udev devices found: 
    DEBUG:digit_interface.digit_handler:Device('/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/video4linux/video1')
    DEBUG:digit_interface.digit_handler:Searching for DIGIT with serial number DXXXXX
    >>> 
    >>> digit.connect()
    INFO:digit_interface.digit:DXXXXX:Connecting to DIGIT
    INFO:digit_interface.digit:DXXXXX:Setting stream defaults to QVGA, 60fps, maximum LED intensity.
    DEBUG:digit_interface.digit:Default stream to QVGA {'width': 320, 'height': 240}
    DEBUG:digit_interface.digit:DXXXXX:Stream resolution set to 240w x 320h
    DEBUG:digit_interface.digit:Default stream with 60 fps
    DEBUG:digit_interface.digit:DXXXXX:Stream FPS set to 60
    DEBUG:digit_interface.digit:Setting maximum LED illumination intensity
    DEBUG:digit_interface.digit:DXXXXX:LED intensity set to 255
    >>> # Print device info
    ... 
    >>> print(digit.info())
    Name: Left Gripper /dev/video1
            - Model: DIGIT
            - Revision: 0101
            - CV Device?: True
            - Connected?: True
    Stream Info:
            - Resolution: 320 x 240
            - FPS: 60
            - LED Intensity: 255
    

    Is there something wrong with my cam? Thanks for any reply!

    opened by lzyplayer 6
  • Ubuntu not seeing the digit

    Ubuntu not seeing the digit

    Hi,

    I bought two digit sensors and it seems I just cant make any of my PCs to see them. When I connect them, their light comes on however when I try to use lsusb to see if they are connected nothing shows up. I tried 3 different ubuntu 20.04 machines and none can detect them. I added the supplied udev rules as per your instruction and still nothing seems to change. My only suspicion is that I need a USB 3.0 cable but to my understanding there are no USB 3.0 cables with micro B male interface. Am I missing something. Thanks for your help in advance.

    opened by stoic-roboticist 4
  • Windows issue

    Windows issue

    Hi there,

    When I try to run the demo code you provided, there is an error "ModuleNotFoundError: No module named 'fcntl'". I searched that this module is only available on UNIX-based PC.

    Do you know how to solve it?

    Thanks a lot!

    opened by Rudy112 2
  • Capture errors in VGA mode

    Capture errors in VGA mode

    Hi!

    I'm trying to stream images from the DIGIT in 640x480 resolution. However, there seems to be occasional glitches in the frames along with a lateral translation of the entire frame. This doesn't occur for me in the 320 x 240 mode. I've attached a video below illustrating the problem, along with the minimal code example.

    Would you happen to know any reason this occurs? Any pointers would be much appreciated, thank you for your time!

    Code

    from digit_interface import Digit, DigitHandler
    
    connected_digit = DigitHandler.list_digits()[0]
    d = Digit(connected_digit['serial'])
    d.connect()
    d.set_resolution(Digit.STREAMS["VGA"])
    print(d.info())
    d.show_view()
    d.disconnect()
    

    Output

    Name: None /dev/video2
            - Model: DIGIT
            - Revision: 200
            - Connected?: True
    Stream Info:
            - Resolution: 320 x 240
            - FPS: 60
            - LED Intensity: 4095
    

    Video

    https://user-images.githubusercontent.com/20095927/158711162-4e569de8-9cd3-4777-b969-f6702ee13492.mp4

    bug 
    opened by suddhu 7
  • Error Opening video stream: /dev/video0

    Error Opening video stream: /dev/video0

    I'm getting "Error Opening video stream: /dev/video0" quite often when I want to call d.connect() and sometimes while already connected I'm getting "Unable to grab frame from D00123 - /dev/video0!", even though my Digit is recognized and video0 is actually active. First I thought it might be a loose contact, but I'm having the same issue when my Digit is just lying around and if I'm trying to connect again, a lot of times my Digit isn't recognized at all and then all of a sudden sometimes it's recognized again. The most reliable solution to get it running again is plugging it out and back in, but that's not a practical solution when trying to work with it.

    opened by roberttamas98 1
Owner
Facebook Research
Facebook Research
Source code of the paper PatchGraph: In-hand tactile tracking with learned surface normals.

PatchGraph This repository contains the source code of the paper PatchGraph: In-hand tactile tracking with learned surface normals. Installation Creat

Paloma Sodhi 11 Dec 15, 2022
A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks

SVHNClassifier-PyTorch A PyTorch implementation of Multi-digit Number Recognition from Street View Imagery using Deep Convolutional Neural Networks If

Potter Hsu 182 Jan 3, 2023
Neural network for digit classification powered by cuda

cuda_nn_mnist Neural network library for digit classification powered by cuda Resources The library was built to work with MNIST dataset. python-mnist

Nikita Ardashev 1 Dec 20, 2021
This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your username and app/website.

PasswordGeneratorAndVault This program generates a random 12 digit/character password (upper and lowercase) and stores it in a file along with your us

Chris 1 Feb 26, 2022
Transfer SemanticKITTI labeles into other dataset/sensor formats.

LiDAR-Transfer Transfer SemanticKITTI labeles into other dataset/sensor formats. Content Convert datasets (NUSCENES, FORD, NCLT) to KITTI format Minim

Photogrammetry & Robotics Bonn 64 Nov 21, 2022
Official code for "EagerMOT: 3D Multi-Object Tracking via Sensor Fusion" [ICRA 2021]

EagerMOT: 3D Multi-Object Tracking via Sensor Fusion Read our ICRA 2021 paper here. Check out the 3 minute video for the quick intro or the full prese

Aleksandr Kim 276 Dec 30, 2022
An air quality monitoring service with a Raspberry Pi and a SDS011 sensor.

Raspberry Pi Air Quality Monitor A simple air quality monitoring service for the Raspberry Pi. Installation Clone the repository and run the following

rydercalmdown 24 Dec 9, 2022
MaRS - a recursive filtering framework that allows for truly modular multi-sensor integration

The Modular and Robust State-Estimation Framework, or short, MaRS, is a recursive filtering framework that allows for truly modular multi-sensor integration

Control of Networked Systems - University of Klagenfurt 143 Dec 29, 2022
Demo code for ICCV 2021 paper "Sensor-Guided Optical Flow"

Sensor-Guided Optical Flow Demo code for "Sensor-Guided Optical Flow", ICCV 2021 This code is provided to replicate results with flow hints obtained f

null 10 Mar 16, 2022
Fast and robust clustering of point clouds generated with a Velodyne sensor.

Depth Clustering This is a fast and robust algorithm to segment point clouds taken with Velodyne sensor into objects. It works with all available Velo

Photogrammetry & Robotics Bonn 957 Dec 21, 2022
DeepLearning Anomalies Detection with Bluetooth Sensor Data

Final Year Project. Constructing models to create offline anomalies detection using Travel Time Data collected from Bluetooth sensors along the route.

null 1 Jan 10, 2022
Scikit-event-correlation - Event Correlation and Forecasting over High Dimensional Streaming Sensor Data algorithms

scikit-event-correlation Event Correlation and Changing Detection Algorithm Theo

Intellia ICT 5 Oct 30, 2022
ROS-UGV-Control-Interface - Control interface which can be used in any UGV

ROS-UGV-Control-Interface Cam Closed: Cam Opened:

Ahmet Fatih Akcan 1 Nov 4, 2022
High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Chao Ma 3k Jan 3, 2023
High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Chao Ma 2.8k Feb 12, 2021
PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io

PyStan NOTE: This documentation describes a BETA release of PyStan 3. PyStan is a Python interface to Stan, a package for Bayesian inference. StanĀ® is

Stan 229 Dec 29, 2022
Python interface for SmartRF Sniffer 2 Firmware

#TI SmartRF Packet Sniffer 2 Python Interface TI Makes available a nice packet sniffer firmware, which interfaces to Wireshark. You can see this proje

Colin O'Flynn 3 May 18, 2021
Selene is a Python library and command line interface for training deep neural networks from biological sequence data such as genomes.

Selene is a Python library and command line interface for training deep neural networks from biological sequence data such as genomes.

Troyanskaya Laboratory 323 Jan 1, 2023