├── .circleci └── config.yml ├── .flake8 ├── .gitignore ├── .isort.cfg ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── digit_interface ├── __init__.py ├── digit.py └── digit_handler.py ├── docs └── digit-logo.svg ├── example ├── demo_digit.py └── demo_rgb_intensity.py ├── noxfile.py ├── requirements.txt ├── setup.py ├── tests └── test_import.py └── udev └── 50-DIGIT.rules /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | jobs: 4 | py37_linux: 5 | docker: 6 | - image: circleci/python:3.7 7 | steps: 8 | - checkout 9 | - run: 10 | name: "Preparing environment" 11 | command: | 12 | sudo pip install nox 13 | - run: 14 | name: "Testing digit-interface" 15 | command: | 16 | pip install nox 17 | nox 18 | 19 | workflows: 20 | version: 2 21 | build: 22 | jobs: 23 | - py37_linux 24 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = .git,.nox, __init__.py 3 | max-line-length = 119 4 | copyright-check = True 5 | select = E,F,W,C 6 | copyright-regexp=Copyright \(c\) Facebook, Inc. and its affiliates. All Rights Reserved 7 | ignore=W503,E203 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | *.swp 27 | *.yaml 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *,cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # IPython Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # dotenv 81 | .env 82 | 83 | # virtualenv 84 | venv/ 85 | ENV/ 86 | 87 | # Spyder project settings 88 | .spyderproject 89 | 90 | # Rope project settings 91 | .ropeproject 92 | 93 | # Pycharm 94 | .idea/ 95 | 96 | # DS Store 97 | .DS_Store 98 | 99 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | multi_line_output=3 3 | include_trailing_comma=True 4 | force_grid_wrap=0 5 | use_parentheses=True 6 | line_length=88 7 | ensure_newline_before_comments=True 8 | known_third_party=cv2 9 | known_first_party=digit_interface -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2021-04-27 [0.2.1] 4 | 5 | - Changed location of Digit defaults 6 | - Fixed error when printing device info when not connected 7 | 8 | ## 2021-04-27 [0.2] 9 | 10 | - Added suport for individual control of RGB LED's through firmware version 2.00 11 | 12 | ## 2020-06-22 [0.1.4] 13 | 14 | - Added PyPi support 15 | - Added PyPi CI support 16 | - Improved documentation -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct) so that you can understand what actions will and will not be tolerated. 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to digit-interface 2 | We welcome contributions from othe community, and want to make contributing to this project as easy and transparent as possible. 3 | 4 | ## Pull Requests 5 | We actively welcome your pull requests. 6 | 7 | 1. Fork the repo and create your branch from `master`. 8 | 2. If you haven't already, complete the Contributor License Agreement ("CLA"). 9 | 10 | ## Contributor License Agreement ("CLA") 11 | In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects. 12 | 13 | Complete your CLA here: 14 | 15 | ## Issues 16 | We use GitHub issues for general feature discussion, Q&A and tracking public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue or understand the problem. 17 | 18 | ## License 19 | By contributing to digit-interface, you agree that your contributions will be licensed under the [LICENSE file](LICENSE) in the root directory of this source tree. 20 | 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | Section 1 -- Definitions. 71 | 72 | a. Adapted Material means material subject to Copyright and Similar 73 | Rights that is derived from or based upon the Licensed Material 74 | and in which the Licensed Material is translated, altered, 75 | arranged, transformed, or otherwise modified in a manner requiring 76 | permission under the Copyright and Similar Rights held by the 77 | Licensor. For purposes of this Public License, where the Licensed 78 | Material is a musical work, performance, or sound recording, 79 | Adapted Material is always produced where the Licensed Material is 80 | synched in timed relation with a moving image. 81 | 82 | b. Adapter's License means the license You apply to Your Copyright 83 | and Similar Rights in Your contributions to Adapted Material in 84 | accordance with the terms and conditions of this Public License. 85 | 86 | c. Copyright and Similar Rights means copyright and/or similar rights 87 | closely related to copyright including, without limitation, 88 | performance, broadcast, sound recording, and Sui Generis Database 89 | Rights, without regard to how the rights are labeled or 90 | categorized. For purposes of this Public License, the rights 91 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 92 | Rights. 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. NonCommercial means not primarily intended for or directed towards 116 | commercial advantage or monetary compensation. For purposes of 117 | this Public License, the exchange of the Licensed Material for 118 | other material subject to Copyright and Similar Rights by digital 119 | file-sharing or similar means is NonCommercial provided there is 120 | no payment of monetary compensation in connection with the 121 | exchange. 122 | 123 | j. Share means to provide material to the public by any means or 124 | process that requires permission under the Licensed Rights, such 125 | as reproduction, public display, public performance, distribution, 126 | dissemination, communication, or importation, and to make material 127 | available to the public including in ways that members of the 128 | public may access the material from a place and at a time 129 | individually chosen by them. 130 | 131 | k. Sui Generis Database Rights means rights other than copyright 132 | resulting from Directive 96/9/EC of the European Parliament and of 133 | the Council of 11 March 1996 on the legal protection of databases, 134 | as amended and/or succeeded, as well as other essentially 135 | equivalent rights anywhere in the world. 136 | 137 | l. You means the individual or entity exercising the Licensed Rights 138 | under this Public License. Your has a corresponding meaning. 139 | 140 | Section 2 -- Scope. 141 | 142 | a. License grant. 143 | 144 | 1. Subject to the terms and conditions of this Public License, 145 | the Licensor hereby grants You a worldwide, royalty-free, 146 | non-sublicensable, non-exclusive, irrevocable license to 147 | exercise the Licensed Rights in the Licensed Material to: 148 | 149 | a. reproduce and Share the Licensed Material, in whole or 150 | in part, for NonCommercial purposes only; and 151 | 152 | b. produce, reproduce, and Share Adapted Material for 153 | NonCommercial purposes only. 154 | 155 | 2. Exceptions and Limitations. For the avoidance of doubt, where 156 | Exceptions and Limitations apply to Your use, this Public 157 | License does not apply, and You do not need to comply with 158 | its terms and conditions. 159 | 160 | 3. Term. The term of this Public License is specified in Section 161 | 6(a). 162 | 163 | 4. Media and formats; technical modifications allowed. The 164 | Licensor authorizes You to exercise the Licensed Rights in 165 | all media and formats whether now known or hereafter created, 166 | and to make technical modifications necessary to do so. The 167 | Licensor waives and/or agrees not to assert any right or 168 | authority to forbid You from making technical modifications 169 | necessary to exercise the Licensed Rights, including 170 | technical modifications necessary to circumvent Effective 171 | Technological Measures. For purposes of this Public License, 172 | simply making modifications authorized by this Section 2(a) 173 | (4) never produces Adapted Material. 174 | 175 | 5. Downstream recipients. 176 | 177 | a. Offer from the Licensor -- Licensed Material. Every 178 | recipient of the Licensed Material automatically 179 | receives an offer from the Licensor to exercise the 180 | Licensed Rights under the terms and conditions of this 181 | Public License. 182 | 183 | b. No downstream restrictions. You may not offer or impose 184 | any additional or different terms or conditions on, or 185 | apply any Effective Technological Measures to, the 186 | Licensed Material if doing so restricts exercise of the 187 | Licensed Rights by any recipient of the Licensed 188 | Material. 189 | 190 | 6. No endorsement. Nothing in this Public License constitutes or 191 | may be construed as permission to assert or imply that You 192 | are, or that Your use of the Licensed Material is, connected 193 | with, or sponsored, endorsed, or granted official status by, 194 | the Licensor or others designated to receive attribution as 195 | provided in Section 3(a)(1)(A)(i). 196 | 197 | b. Other rights. 198 | 199 | 1. Moral rights, such as the right of integrity, are not 200 | licensed under this Public License, nor are publicity, 201 | privacy, and/or other similar personality rights; however, to 202 | the extent possible, the Licensor waives and/or agrees not to 203 | assert any such rights held by the Licensor to the limited 204 | extent necessary to allow You to exercise the Licensed 205 | Rights, but not otherwise. 206 | 207 | 2. Patent and trademark rights are not licensed under this 208 | Public License. 209 | 210 | 3. To the extent possible, the Licensor waives any right to 211 | collect royalties from You for the exercise of the Licensed 212 | Rights, whether directly or through a collecting society 213 | under any voluntary or waivable statutory or compulsory 214 | licensing scheme. In all other cases the Licensor expressly 215 | reserves any right to collect such royalties, including when 216 | the Licensed Material is used other than for NonCommercial 217 | purposes. 218 | 219 | Section 3 -- License Conditions. 220 | 221 | Your exercise of the Licensed Rights is expressly made subject to the 222 | following conditions. 223 | 224 | a. Attribution. 225 | 226 | 1. If You Share the Licensed Material (including in modified 227 | form), You must: 228 | 229 | a. retain the following if it is supplied by the Licensor 230 | with the Licensed Material: 231 | 232 | i. identification of the creator(s) of the Licensed 233 | Material and any others designated to receive 234 | attribution, in any reasonable manner requested by 235 | the Licensor (including by pseudonym if 236 | designated); 237 | 238 | ii. a copyright notice; 239 | 240 | iii. a notice that refers to this Public License; 241 | 242 | iv. a notice that refers to the disclaimer of 243 | warranties; 244 | 245 | v. a URI or hyperlink to the Licensed Material to the 246 | extent reasonably practicable; 247 | 248 | b. indicate if You modified the Licensed Material and 249 | retain an indication of any previous modifications; and 250 | 251 | c. indicate the Licensed Material is licensed under this 252 | Public License, and include the text of, or the URI or 253 | hyperlink to, this Public License. 254 | 255 | 2. You may satisfy the conditions in Section 3(a)(1) in any 256 | reasonable manner based on the medium, means, and context in 257 | which You Share the Licensed Material. For example, it may be 258 | reasonable to satisfy the conditions by providing a URI or 259 | hyperlink to a resource that includes the required 260 | information. 261 | 262 | 3. If requested by the Licensor, You must remove any of the 263 | information required by Section 3(a)(1)(A) to the extent 264 | reasonably practicable. 265 | 266 | 4. If You Share Adapted Material You produce, the Adapter's 267 | License You apply must not prevent recipients of the Adapted 268 | Material from complying with this Public License. 269 | 270 | Section 4 -- Sui Generis Database Rights. 271 | 272 | Where the Licensed Rights include Sui Generis Database Rights that 273 | apply to Your use of the Licensed Material: 274 | 275 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 276 | to extract, reuse, reproduce, and Share all or a substantial 277 | portion of the contents of the database for NonCommercial purposes 278 | only; 279 | 280 | b. if You include all or a substantial portion of the database 281 | contents in a database in which You have Sui Generis Database 282 | Rights, then the database in which You have Sui Generis Database 283 | Rights (but not its individual contents) is Adapted Material; and 284 | 285 | c. You must comply with the conditions in Section 3(a) if You Share 286 | all or a substantial portion of the contents of the database. 287 | 288 | For the avoidance of doubt, this Section 4 supplements and does not 289 | replace Your obligations under this Public License where the Licensed 290 | Rights include other Copyright and Similar Rights. 291 | 292 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 293 | 294 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 295 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 296 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 297 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 298 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 299 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 300 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 301 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 302 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 303 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 304 | 305 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 306 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 307 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 308 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 309 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 310 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 311 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 312 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 313 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 314 | 315 | c. The disclaimer of warranties and limitation of liability provided 316 | above shall be interpreted in a manner that, to the extent 317 | possible, most closely approximates an absolute disclaimer and 318 | waiver of all liability. 319 | 320 | Section 6 -- Term and Termination. 321 | 322 | a. This Public License applies for the term of the Copyright and 323 | Similar Rights licensed here. However, if You fail to comply with 324 | this Public License, then Your rights under this Public License 325 | terminate automatically. 326 | 327 | b. Where Your right to use the Licensed Material has terminated under 328 | Section 6(a), it reinstates: 329 | 330 | 1. automatically as of the date the violation is cured, provided 331 | it is cured within 30 days of Your discovery of the 332 | violation; or 333 | 334 | 2. upon express reinstatement by the Licensor. 335 | 336 | For the avoidance of doubt, this Section 6(b) does not affect any 337 | right the Licensor may have to seek remedies for Your violations 338 | of this Public License. 339 | 340 | c. For the avoidance of doubt, the Licensor may also offer the 341 | Licensed Material under separate terms or conditions or stop 342 | distributing the Licensed Material at any time; however, doing so 343 | will not terminate this Public License. 344 | 345 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 346 | License. 347 | 348 | Section 7 -- Other Terms and Conditions. 349 | 350 | a. The Licensor shall not be bound by any additional or different 351 | terms or conditions communicated by You unless expressly agreed. 352 | 353 | b. Any arrangements, understandings, or agreements regarding the 354 | Licensed Material not stated herein are separate from and 355 | independent of the terms and conditions of this Public License. 356 | 357 | Section 8 -- Interpretation. 358 | 359 | a. For the avoidance of doubt, this Public License does not, and 360 | shall not be interpreted to, reduce, limit, restrict, or impose 361 | conditions on any use of the Licensed Material that could lawfully 362 | be made without permission under this Public License. 363 | 364 | b. To the extent possible, if any provision of this Public License is 365 | deemed unenforceable, it shall be automatically reformed to the 366 | minimum extent necessary to make it enforceable. If the provision 367 | cannot be reformed, it shall be severed from this Public License 368 | without affecting the enforceability of the remaining terms and 369 | conditions. 370 | 371 | c. No term or condition of this Public License will be waived and no 372 | failure to comply consented to unless expressly agreed to by the 373 | Licensor. 374 | 375 | d. Nothing in this Public License constitutes or may be interpreted 376 | as a limitation upon, or waiver of, any privileges and immunities 377 | that apply to the Licensor or You, including from the legal 378 | processes of any jurisdiction or authority. 379 | 380 | ======================================================================= 381 | 382 | Creative Commons is not a party to its public 383 | licenses. Notwithstanding, Creative Commons may elect to apply one of 384 | its public licenses to material it publishes and in those instances 385 | will be considered the “Licensor.” The text of the Creative Commons 386 | public licenses is dedicated to the public domain under the CC0 Public 387 | Domain Dedication. Except for the limited purpose of indicating that 388 | material is shared under a Creative Commons public license or as 389 | otherwise permitted by the Creative Commons policies published at 390 | creativecommons.org/policies, Creative Commons does not authorize the 391 | use of the trademark "Creative Commons" or any other trademark or logo 392 | of Creative Commons without its prior written consent including, 393 | without limitation, in connection with any unauthorized modifications 394 | to any of its public licenses or any other arrangements, 395 | understandings, or agreements concerning use of licensed material. For 396 | the avoidance of doubt, this paragraph does not form part of the 397 | public licenses. 398 | 399 | Creative Commons may be contacted at creativecommons.org. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DIGIT-INTERFACE 2 | 3 | [![License: CC BY-NC 4.0](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg)](LICENSE) 4 | [![PyPI](https://img.shields.io/pypi/v/digit-interface)](https://pypi.org/project/digit-interface/) 5 | 6 | DIGIT-logo 7 | 8 | 9 | Python interface for the [DIGIT tactile sensor](https://digit.ml). 10 | 11 | **For updates and discussions please join the #DIGIT channel at the [www.touch-sensing.org](https://www.touch-sensing.org/) community.** 12 | 13 | ## Installation 14 | 15 | The preferred way of installation is through PyPi: 16 | 17 | ```bash 18 | pip install digit-interface 19 | ``` 20 | 21 | Alternatively, you can manually clone the repository and install the package using: 22 | 23 | ```bash 24 | git clone https://github.com/facebookresearch/digit-interface.git 25 | cd digit-interface 26 | pip install -r requirements.txt 27 | python setup.py install 28 | ``` 29 | 30 | If you cannot access the device by serial number on your system follow [adding DIGIT udev Rule](#adding-digit-udev-rule) 31 | 32 | ## Usage 33 | The default connection method to the DIGIT tactile sensor is through the unique device serial number. The serial number 34 | is found on the back of each DIGIT. 35 | See [List all connected DIGIT's](#list-all-connected-digits) to find device serial numbers which are connected to the 36 | host. 37 | 38 | Once you have the device serial number, reading data from the sensor should be as easy as 39 | ```python 40 | from digit_interface import Digit 41 | 42 | d = Digit("D12345") # Unique serial number 43 | d.connect() 44 | d.show_view() 45 | d.disconnect() 46 | ``` 47 | 48 | Upon connection each DIGIT device initializes with a default stream resolution of ```VGA: 640x480``` at ```30fps``` 49 | 50 | #### Further Usage 51 | ##### List all connected DIGIT's: 52 | To list all connected DIGIT's and display sensor information: 53 | ```python 54 | from digit_interface import DigitHandler 55 | 56 | digits = DigitHandler.list_digits() 57 | ``` 58 | 59 | ##### Obtain a single frame: 60 | ```python 61 | from digit_interface import Digit 62 | 63 | d = Digit("D12345") # Unique serial number 64 | d.connect() 65 | frame = d.get_frame() 66 | ``` 67 | 68 | ##### List supported stream formats: 69 | Additional streams are supported, these streams vary in resolution and frames per second. 70 | 71 | To list the available stream formats: 72 | ```python 73 | from digit_interface import Digit 74 | 75 | print("Supported streams: \n {}".format(Digit.STREAMS)) 76 | ``` 77 | 78 | ##### Change resolution: 79 | ``` 80 | d.set_resolution(Digit.STREAMS["QVGA"]) 81 | ``` 82 | 83 | ##### Change FPS, 84 | Based on supported fps for each respective resolution. All streams support pre-defined resolutions which can 85 | be found in ```Digit.STREAMS``` 86 | ``` 87 | d.set_fps(Digit.STREAMS["QVGA"]["fps"]["15fps"]) 88 | ``` 89 | 90 | ### Adding DIGIT udev Rule 91 | Add your user to the ```plugdev``` group, 92 | 93 | ``` 94 | adduser username plugdev 95 | ``` 96 | 97 | Copy udev rule, 98 | 99 | ``` 100 | sudo cp ./udev/50-DIGIT.rules /lib/udev/rules.d/ 101 | ``` 102 | 103 | Reload rules, 104 | 105 | ``` 106 | sudo udevadm control --reload 107 | sudo udevadm trigger 108 | ``` 109 | 110 | Replug the DIGIT device into host. 111 | 112 | ## License 113 | This code is licensed under CC-by-NC, as found in the [LICENSE](LICENSE) file. 114 | 115 | ## Citing 116 | If you use this project in your research, please cite this [paper](https://arxiv.org/abs/2005.14679): 117 | 118 | ```BibTeX 119 | @Article{Lambeta2020DIGIT, 120 | 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}, 121 | title = {{DIGIT}: A Novel Design for a Low-Cost Compact High-Resolution Tactile Sensor with Application to In-Hand Manipulation}, 122 | journal = {IEEE Robotics and Automation Letters (RA-L)}, 123 | year = {2020}, 124 | volume = {5}, 125 | number = {3}, 126 | pages = {3838--3845}, 127 | doi = {10.1109/LRA.2020.2977257}, 128 | } 129 | ``` 130 | -------------------------------------------------------------------------------- /digit_interface/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | from .digit import Digit 6 | from .digit_handler import DigitHandler 7 | 8 | __author__ = "Mike Lambeta, Roberto Calandra" 9 | __contact__ = "lambetam@fb.com, rcalandra@fb.com" 10 | __version__ = "0.2.1" # Source of truth for digit_interfaces's version 11 | 12 | __all__ = ["__version__", "Digit"] 13 | -------------------------------------------------------------------------------- /digit_interface/digit.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | import logging 6 | import typing 7 | 8 | import cv2 9 | import numpy as np 10 | 11 | from digit_interface.digit_handler import DigitHandler 12 | 13 | logger = logging.getLogger(__name__) 14 | 15 | 16 | class DigitDefaults(object): 17 | STREAMS: typing.Dict = { 18 | # VGA resolution support 30 (default) and 15 fps 19 | "VGA": { 20 | "resolution": {"width": 640, "height": 480}, 21 | "fps": {"30fps": 30, "15fps": 15}, 22 | }, 23 | # QVGA resolution support 60 (default) and 30 fps 24 | "QVGA": { 25 | "resolution": {"width": 320, "height": 240}, 26 | "fps": {"60fps": 60, "30fps": 30}, 27 | }, 28 | } 29 | LIGHTING_MIN: int = 0 30 | LIGHTING_MAX: int = 15 31 | 32 | 33 | class Digit(DigitDefaults): 34 | __LIGHTING_SCALER = 17 35 | 36 | def __init__(self, serial: str = None, name: str = None) -> None: 37 | """ 38 | DIGIT Device class for a single DIGIT 39 | :param serial: DIGIT device serial 40 | :param name: Human friendly identifier name for the device 41 | """ 42 | self.serial: str = serial 43 | self.name: str = name 44 | 45 | self.__dev: typing.Optional[cv2.VideoCapture] = None 46 | 47 | self.dev_name: str = "" 48 | self.manufacturer: str = "" 49 | self.model: str = "" 50 | self.revision: int = "" 51 | 52 | self.resolution: typing.Dict = {} 53 | self.fps: int = 0 54 | self.intensity: int = 0 55 | 56 | if self.serial is not None: 57 | logger.debug(f"Digit object constructed with serial {self.serial}") 58 | self.populate(serial) 59 | 60 | def connect(self) -> None: 61 | logger.info(f"{self.serial}:Connecting to DIGIT") 62 | self.__dev = cv2.VideoCapture(self.dev_name) 63 | if not self.__dev.isOpened(): 64 | logger.error( 65 | f"Cannot open video capture device {self.serial} - {self.dev_name}" 66 | ) 67 | raise Exception(f"Error opening video stream: {self.dev_name}") 68 | # set stream defaults, QVGA at 60 fps 69 | logger.info( 70 | f"{self.serial}:Setting stream defaults to QVGA, 60fps, maximum LED intensity." 71 | ) 72 | logger.debug(f"Default stream to QVGA {self.STREAMS['QVGA']['resolution']}") 73 | self.set_resolution(self.STREAMS["QVGA"]) 74 | logger.debug(f"Default stream with {self.STREAMS['QVGA']['fps']['60fps']} fps") 75 | self.set_fps(self.STREAMS["QVGA"]["fps"]["60fps"]) 76 | logger.debug("Setting maximum LED illumination intensity") 77 | self.set_intensity(15) 78 | 79 | def set_resolution(self, resolution: typing.Dict) -> None: 80 | """ 81 | Sets stream resolution based on supported streams in Digit.STREAMS 82 | :param resolution: QVGA or VGA from Digit.STREAMS 83 | :return: None 84 | """ 85 | self.resolution = resolution["resolution"] 86 | width = self.resolution["width"] 87 | height = self.resolution["height"] 88 | logger.debug(f"{self.serial}:Stream resolution set to {height}w x {width}h") 89 | self.__dev.set(cv2.CAP_PROP_FRAME_WIDTH, width) 90 | self.__dev.set(cv2.CAP_PROP_FRAME_HEIGHT, height) 91 | 92 | def set_fps(self, fps: int) -> None: 93 | """ 94 | Sets the stream fps, only valid values from Digit.STREAMS are accepted. 95 | This should typically be called after the resolution is set as the stream fps defaults to the 96 | highest fps 97 | :param fps: Stream FPS 98 | :return: None 99 | """ 100 | self.fps = fps 101 | logger.debug(f"{self.serial}:Stream FPS set to {self.fps}") 102 | self.__dev.set(cv2.CAP_PROP_FPS, self.fps) 103 | 104 | def set_intensity(self, intensity: int) -> int: 105 | """ 106 | Sets all LEDs to specific intensity, this is a global control. 107 | :param intensity: Value between 0 and 15 where 0 is all LEDs off and 15 all 108 | LEDS full intensity 109 | :return: Returns the set intensity 110 | """ 111 | if self.revision < 200: 112 | # Deprecated version 1.01 (1b) is not supported 113 | intensity = int(intensity / self.__LIGHTING_SCALER) 114 | logger.warn( 115 | "You are using a previous version of the firmware " 116 | "which does not support independent RGB control, update your DIGIT firmware." 117 | ) 118 | self.intensity = self.set_intensity_rgb(intensity, intensity, intensity) 119 | return self.intensity 120 | 121 | def set_intensity_rgb( 122 | self, intensity_r: int, intensity_g: int, intensity_b: int 123 | ) -> int: 124 | """ 125 | Sets LEDs to specific intensity, per LED control 126 | Perimitted values are between 0 (off/dim) and 15 (full brightness) 127 | :param intensity_r: Red value 128 | :param intensity_g: Green value 129 | :param intensity_b: Blue value 130 | :return: Returns the set intensity 131 | """ 132 | if not all( 133 | [x in range(0, 16) for x in (intensity_r, intensity_g, intensity_b)] 134 | ): 135 | raise ValueError("RGB values must be between 0 and 15.") 136 | intensity = (intensity_r << 8) | (intensity_g << 4) | intensity_b 137 | logger.debug( 138 | f"{self.serial}:LED intensity set to {intensity} (R: {intensity_r} G: {intensity_g} B: {intensity_b}" 139 | ) 140 | self.intensity = intensity 141 | self.__dev.set(cv2.CAP_PROP_ZOOM, self.intensity) 142 | return self.intensity 143 | 144 | def get_frame(self, transpose: bool = False) -> np.ndarray: 145 | """ 146 | Returns a single image frame for the device 147 | :param transpose: Show direct output from the image sensor, WxH instead of HxW 148 | :return: Image frame array 149 | """ 150 | ret, frame = self.__dev.read() 151 | if not ret: 152 | logger.error( 153 | f"Cannot retrieve frame data from {self.serial}, is DIGIT device open?" 154 | ) 155 | raise Exception( 156 | f"Unable to grab frame from {self.serial} - {self.dev_name}!" 157 | ) 158 | if not transpose: 159 | frame = cv2.transpose(frame, frame) 160 | frame = cv2.flip(frame, 0) 161 | return frame 162 | 163 | def save_frame(self, path: str) -> np.ndarray: 164 | """ 165 | Saves a single image frame to host 166 | :param path: Path and file name where the frame shall be saved to 167 | :return: None 168 | """ 169 | frame = self.get_frame() 170 | logger.debug(f"Saving frame to {path}") 171 | cv2.imwrite(path, frame) 172 | return frame 173 | 174 | def get_diff(self, ref_frame: np.ndarray) -> np.ndarray: 175 | """ 176 | Returns the difference between two frames 177 | :param ref_frame: Original frame 178 | :return: Frame difference 179 | """ 180 | diff = self.get_frame() - ref_frame 181 | return diff 182 | 183 | def show_view(self, ref_frame: np.ndarray = None) -> None: 184 | """ 185 | Creates OpenCV named window with live view of DIGIT device, ESC to close window 186 | :param ref_frame: Specify reference frame to show image difference 187 | :return: None 188 | """ 189 | while True: 190 | frame = self.get_frame() 191 | if ref_frame is not None: 192 | frame = self.get_diff(ref_frame) 193 | cv2.imshow(f"Digit View {self.serial}", frame) 194 | if cv2.waitKey(1) == 27: 195 | break 196 | cv2.destroyAllWindows() 197 | 198 | def disconnect(self) -> None: 199 | logger.debug(f"{self.serial}:Closing DIGIT device") 200 | self.__dev.release() 201 | 202 | def info(self) -> str: 203 | """ 204 | Returns DIGIT device info 205 | :return: String representation of DIGIT device 206 | """ 207 | has_dev = self.__dev is not None 208 | is_connected = False 209 | if has_dev: 210 | is_connected = self.__dev.isOpened() 211 | info_string = ( 212 | f"Name: {self.name} {self.dev_name}" 213 | f"\n\t- Model: {self.model}" 214 | f"\n\t- Revision: {self.revision}" 215 | f"\n\t- Connected?: {is_connected}" 216 | ) 217 | if is_connected: 218 | info_string += ( 219 | f"\nStream Info:" 220 | f"\n\t- Resolution: {self.resolution['width']} x {self.resolution['height']}" 221 | f"\n\t- FPS: {self.fps}" 222 | f"\n\t- LED Intensity: {self.intensity}" 223 | ) 224 | return info_string 225 | 226 | def populate(self, serial: str) -> None: 227 | """ 228 | Find the connected DIGIT based on the serial number and populate device parameters into the class 229 | :param serial: DIGIT serial number 230 | :return: 231 | """ 232 | digit = DigitHandler.find_digit(serial) 233 | if digit is None: 234 | raise Exception(f"Cannot find DIGIT with serial {self.serial}") 235 | self.dev_name = digit["dev_name"] 236 | self.manufacturer = digit["manufacturer"] 237 | self.model = digit["model"] 238 | self.revision = int(digit["revision"]) 239 | self.serial = digit["serial"] 240 | 241 | def __repr__(self) -> str: 242 | return f"Digit(serial={self.serial}, name={self.name})" 243 | -------------------------------------------------------------------------------- /digit_interface/digit_handler.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | import logging 6 | from typing import Dict, List, Optional 7 | 8 | import pyudev 9 | 10 | logger = logging.getLogger(__name__) 11 | 12 | 13 | class DigitHandler: 14 | @staticmethod 15 | def _parse(digit_dev: Dict[str, str]) -> Dict[str, str]: 16 | digit_info = { 17 | "dev_name": digit_dev["DEVNAME"], 18 | "manufacturer": digit_dev["ID_VENDOR"], 19 | "model": digit_dev["ID_MODEL"], 20 | "revision": digit_dev["ID_REVISION"], 21 | "serial": digit_dev["ID_SERIAL_SHORT"], 22 | } 23 | return digit_info 24 | 25 | @staticmethod 26 | def list_digits() -> List[Dict[str, str]]: 27 | context = pyudev.Context() 28 | logger.debug("Finding udev devices with subsystem=video4linux, id_model=DIGIT") 29 | digits = context.list_devices(subsystem="video4linux", ID_MODEL="DIGIT") 30 | logger.debug("Following udev devices found: ") 31 | for device in digits: 32 | logger.debug(device) 33 | digits = [dict(DigitHandler._parse(_)) for _ in digits] 34 | if not digits: 35 | logger.debug("Could not find any udev devices matching parameters") 36 | return digits 37 | 38 | @staticmethod 39 | def find_digit(serial: str) -> Optional[Dict[str, str]]: 40 | digits = DigitHandler.list_digits() 41 | logger.debug(f"Searching for DIGIT with serial number {serial}") 42 | for digit in digits: 43 | if digit["serial"] == serial: 44 | return digit 45 | logger.error(f"No DIGIT with serial number {serial} found") 46 | return None 47 | -------------------------------------------------------------------------------- /docs/digit-logo.svg: -------------------------------------------------------------------------------- 1 | Asset 2 -------------------------------------------------------------------------------- /example/demo_digit.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | import logging 6 | import pprint 7 | import time 8 | 9 | import cv2 10 | 11 | from digit_interface.digit import Digit 12 | from digit_interface.digit_handler import DigitHandler 13 | 14 | logging.basicConfig(level=logging.DEBUG) 15 | 16 | # Print a list of connected DIGIT's 17 | digits = DigitHandler.list_digits() 18 | print("Connected DIGIT's to Host:") 19 | pprint.pprint(digits) 20 | 21 | # Connect to a Digit device with serial number with friendly name 22 | digit = Digit("D12345", "Left Gripper") 23 | digit.connect() 24 | 25 | # Print device info 26 | print(digit.info()) 27 | 28 | # Change LED illumination intensity 29 | digit.set_intensity(Digit.LIGHTING_MIN) 30 | time.sleep(1) 31 | digit.set_intensity(Digit.LIGHTING_MAX) 32 | 33 | # Change DIGIT resolution to QVGA 34 | qvga_res = Digit.STREAMS["QVGA"] 35 | digit.set_resolution(qvga_res) 36 | 37 | # Change DIGIT FPS to 15fps 38 | fps_30 = Digit.STREAMS["QVGA"]["fps"]["30fps"] 39 | digit.set_fps(fps_30) 40 | 41 | # Grab single frame from DIGIT 42 | frame = digit.get_frame() 43 | print(f"Frame WxH: {frame.shape[0]}{frame.shape[1]}") 44 | 45 | # Display stream obtained from DIGIT 46 | digit.show_view() 47 | 48 | # Disconnect DIGIT stream 49 | digit.disconnect() 50 | 51 | # Find a Digit by serial number and connect manually 52 | digit = DigitHandler.find_digit("D12345") 53 | pprint.pprint(digit) 54 | cap = cv2.VideoCapture(digit["dev_name"]) 55 | cap.release() 56 | -------------------------------------------------------------------------------- /example/demo_rgb_intensity.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | import logging 6 | import pprint 7 | import time 8 | 9 | from digit_interface.digit import Digit 10 | from digit_interface.digit_handler import DigitHandler 11 | 12 | logging.basicConfig(level=logging.DEBUG) 13 | 14 | # Print a list of connected DIGIT's 15 | digits = DigitHandler.list_digits() 16 | print("Connected DIGIT's to Host:") 17 | pprint.pprint(digits) 18 | 19 | # Connect to a Digit device with serial number with friendly name 20 | digit = Digit("D12345", "Left Gripper") 21 | digit.connect() 22 | 23 | # Maximum value for each channel is 15 24 | rgb_list = [(15, 0, 0), (0, 15, 0), (0, 0, 15)] 25 | 26 | # Cycle through colors R, G, B 27 | for rgb in rgb_list: 28 | digit.set_intensity_rgb(*rgb) 29 | time.sleep(1) 30 | 31 | # Set all LEDs to same intensity 32 | digit.set_intensity(15) 33 | 34 | digit.disconnect() 35 | -------------------------------------------------------------------------------- /noxfile.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | import os 3 | 4 | import nox 5 | 6 | BASE = os.path.abspath(os.path.dirname(__file__)) 7 | 8 | DEFAULT_PYTHON_VERSIONS = ["3.7"] 9 | 10 | LINT_SETUP_DEPS = ["black", "flake8", "flake8-copyright", "isort"] 11 | DEPLOY_SETUP_DEPS = ["twine"] 12 | 13 | VERBOSE = os.environ.get("VERBOSE", "0") 14 | SILENT = VERBOSE == "0" 15 | 16 | USING_CI = os.environ.get("USING_CI", False) 17 | PYPI_USERNAME = os.environ.get("PYPI_USERNAME", None) 18 | PYPI_PASSWORD = os.environ.get("PYPI_PASSWORD", None) 19 | 20 | 21 | def _base_install(session): 22 | session.install("--upgrade", "setuptools", "pip", silent=SILENT) 23 | 24 | 25 | def install_lint_deps(session): 26 | _base_install(session) 27 | session.install(*LINT_SETUP_DEPS, silent=SILENT) 28 | 29 | 30 | def install_deploy_deps(session): 31 | _base_install(session) 32 | session.install(*DEPLOY_SETUP_DEPS, silent=SILENT) 33 | 34 | 35 | def install_pytouch(session): 36 | session.chdir(BASE) 37 | session.run("pip", "install", "-e", ".") 38 | 39 | 40 | @nox.session(python=DEFAULT_PYTHON_VERSIONS) 41 | def lint(session): 42 | install_lint_deps(session) 43 | session.run("black", "--diff", "--check", ".", silent=SILENT) 44 | session.run( 45 | "isort", 46 | "--check", 47 | "--diff", 48 | ".", 49 | "--skip=.nox", 50 | silent=SILENT, 51 | ) 52 | session.run("flake8", "--config", ".flake8") 53 | 54 | 55 | @nox.session(python=DEFAULT_PYTHON_VERSIONS) 56 | def tests(session): 57 | _base_install(session) 58 | install_pytouch(session) 59 | session.install("pytest") 60 | session.run("pytest", "tests") 61 | 62 | 63 | @nox.session(python=DEFAULT_PYTHON_VERSIONS) 64 | def build(session): 65 | _base_install(session) 66 | session.run("rm", "-rf", "dist", external=True) 67 | session.run("python", "setup.py", "sdist") 68 | 69 | 70 | @nox.session(python=DEFAULT_PYTHON_VERSIONS) 71 | def deploy(session): 72 | if not USING_CI: 73 | session.skip("Skipping deployment to PyPi.") 74 | install_deploy_deps(session) 75 | session.run( 76 | "twine", 77 | "upload", 78 | "dist/*", 79 | env={"TWINE_USERNAME": PYPI_USERNAME, "TWINE_PASSWORD": PYPI_PASSWORD}, 80 | ) 81 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | black 2 | flake8 3 | flake8-copyright 4 | isort 5 | nox>=2019.11.9 6 | numpy >= 1.16 7 | opencv-python 8 | pyudev -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | 3 | # This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. 4 | 5 | import os 6 | import re 7 | 8 | from setuptools import find_packages, setup 9 | 10 | BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 11 | 12 | install_requires = ["numpy >= 1.16", "opencv-python", "pyudev"] 13 | 14 | dependency_links = [] 15 | 16 | 17 | def read(fname): 18 | return open(os.path.join(BASE_DIR, fname)).read() 19 | 20 | 21 | def find_version(*file_paths): 22 | version_file = read(*file_paths) 23 | version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) 24 | if version_match: 25 | return version_match.group(1) 26 | raise RuntimeError("Unable to find version string.") 27 | 28 | 29 | with open("README.md", "r") as fh: 30 | long_description = fh.read() 31 | 32 | setup( 33 | name="digit_interface", 34 | version=find_version("digit_interface/__init__.py"), 35 | description="Interface for the DIGIT tactile sensor.", 36 | url="https://github.com/facebookresearch/digit-interface", 37 | author="Mike Lambeta, Roberto Calandra", 38 | author_email="lambetam@fb.com, rcalandra@fb.com", 39 | keywords=["science"], 40 | long_description=long_description, 41 | long_description_content_type="text/markdown", 42 | license="LICENSE", 43 | packages=find_packages(), 44 | install_requires=install_requires, 45 | dependency_links=dependency_links, 46 | zip_safe=True, 47 | classifiers=[ 48 | "Programming Language :: Python :: 3", 49 | "Operating System :: POSIX :: Linux", 50 | ], 51 | python_requires=">=3.6", 52 | ) 53 | -------------------------------------------------------------------------------- /tests/test_import.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. 2 | import sys 3 | 4 | import digit_interface 5 | 6 | 7 | def test_main(): 8 | if "digit_interface" not in sys.modules: 9 | print(f"Found digit_interface {digit_interface.__version__}") 10 | assert True 11 | -------------------------------------------------------------------------------- /udev/50-DIGIT.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2833", ATTR{idProduct}=="0209", GROUP="plugdev", MODE="0666" --------------------------------------------------------------------------------