# forcedimension-python
![license](https://img.shields.io/github/v/release/EmDash00/forcedimension-python?display_name=tag)
Written and Mantained Ember Chow. Looking for the documentation? You can find it here:
https://forcedimension-python-documentation.readthedocs.io/en/latest/
## About
### What is ForceDimensionSDK?
ForceDimensionSDK is a set of C/C++ functions and drivers created by [Force Dimension](https://www.forcedimension.com/company/about) for working with haptic devices, used by many companies and researchers around the world.
### Why Python?
Up until this point, the drivers have been exclusively in C/C++ with Java bindings; however, a lot of research is conducted using Python and its various scientific computing libraries (numpy, scipy, sympy, pandas, matplotlib, etc).
This was also the case for Prof. Roth's lab at IU: Bloomington. Our lab group is primarily focused on researching human-robot, many times through the use of haptic devices.
The ForceDimensionSDK is a very well written interface that solves the problem of making applications that use haptic devices.
## Installation
#### Note: Available for Windows and Linux only.
### PyPI Package (recommended)
```
pip install forcedimension
```
`numpy` is an optional dependency. If you want to install that as well:
```
pip install forcedimension\[numpy\]
```
#### Install the [ForceDimensionSDK](https://www.forcedimension.com/software/sdk) for your computer.
By default, the bindings will search in the following system-wide install locations.
* System-wide install locations (Linux):
- `/usr/local/lib`
- `/usr/lib`
* System-wide install location (Windows):
- `C:\Program Files\ForceDimension\sdk-X.X.X\lib`
##### Non-system-wide Installs
If you do not wish to make a system-wide installation set the FORCEDIM_SDK environment variable to the root folder of the ForceDimensionSDK installation (the `lib` folder should be one level under the root installation folder)
##### System-wide install for Linux
This requires extra steps since the Makefile for the ForceDimensionSDK does not offer a `make install` target for a system-wide install.
1. Copy all files from `lib/release/lin-*-gcc` to `/usr/local/lib`
2. Copy all files from `include` to `/usr/local/include`
3. MAKE SURE the libraries have `755` level access using `chmod`. If they don't applications cannot link or load them.
4. Make a symbolic link to libdhd and libdrd that drop the version so they end in `.so`, so that the file names are `libdhd.so` and `libdrd.so`
These steps can be automated by adding these targets to the Makefile.
```makefile
install:
cp include/* /usr/local/include
cp lib/release/lin-*-gcc/* /usr/local/lib
chmod 755 /usr/local/lib/libdhd.so.X.X.X
chmod 755 /usr/local/lib/libdrd.so.X.X.X
chmod 755 /usr/local/lib/libdhd.a
chmod 755 /usr/local/lib/libdrd.a
ln -s /usr/local/lib/libdhd.so /usr/local/lib/libdhd.so.X.X.X
ln -s /usr/local/lib/libdrd.so /usr/local/lib/libdrd.so.X.X.X
```
```makefile
uninstall:
rm /usr/local/include/dhdc.h
rm /usr/local/include/drdc.h
rm /usr/local/lib/libdhd.a
rm /usr/local/lib/libdhd.so.3.9.1
rm /usr/local/lib/libdhd.so
rm /usr/local/lib/libdrd.a
rm /usr/local/lib/libdrd.so.3.9.1
rm /usr/local/lib/libdrd.so
```
#### Additional Setup
##### Windows
Device Manager is a Windows tool that can be used to see connected devices, their statuses, driver information, and driver installation.
The easiest way to bring it up is to use the windows search bar on Windows 10 and search “Device Manager”. Regardless of the method used, you will need administrator level privileges to launch the Device Manager.
Find your haptics device and right-click on it and open `Properities`. Do `Update driver>Browse my computer for driver software` and specify the drivers listed under the `drivers\usb` in the root install directory. Try restarting if drivers are not detected or changes do not take place.
Your device should now be listed under `USB Haptic Devices`
##### Linux
Add a udev rule under `/etc/udev/rules.d` for your device. Here's an explaination from the [Arch Linux Wiki](https://wiki.archlinux.org/index.php/Udev#Waking_from_suspend_with_USB_device) about what they are and here's a good udev file for the [Novint Falcon](https://github.com/libnifalcon/libnifalcon/blob/master/linux/40-novint-falcon-udev.rules).
A good way to find the USB bus of the device is by unplugging the device, doing `ls -l /dev/bus/usb/00*`, replugging, the device and then performing it again.
MAKE SURE you unplug the USB and not just the power because the unpowering the device does not unpower the USB communications (which get power through the computer).
Then perform `lsusb` and note the ID of your device, which is in the format `idVendor:idPorduct`
Raw data
{
"_id": null,
"home_page": "https://github.com/EmDash00/forcedimension-python",
"name": "forcedimension",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<3.12",
"maintainer_email": "",
"keywords": "forcedimension,haptics,wrappers",
"author": "Ember Chow",
"author_email": "emberchow.business@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/97/b0/b766a3f5cd6463f1a8b81871084c62d094eb39cdecc53e3ac30f796180fe/forcedimension-0.1.7.tar.gz",
"platform": null,
"description": "# forcedimension-python\n\n![license](https://img.shields.io/github/v/release/EmDash00/forcedimension-python?display_name=tag)\n\nWritten and Mantained Ember Chow. Looking for the documentation? You can find it here:\n\nhttps://forcedimension-python-documentation.readthedocs.io/en/latest/\n\n## About\n\n### What is ForceDimensionSDK?\n\nForceDimensionSDK is a set of C/C++ functions and drivers created by [Force Dimension](https://www.forcedimension.com/company/about) for working with haptic devices, used by many companies and researchers around the world.\n\n### Why Python?\n\nUp until this point, the drivers have been exclusively in C/C++ with Java bindings; however, a lot of research is conducted using Python and its various scientific computing libraries (numpy, scipy, sympy, pandas, matplotlib, etc).\n\nThis was also the case for Prof. Roth's lab at IU: Bloomington. Our lab group is primarily focused on researching human-robot, many times through the use of haptic devices.\n\nThe ForceDimensionSDK is a very well written interface that solves the problem of making applications that use haptic devices.\n\n## Installation\n\n#### Note: Available for Windows and Linux only.\n\n### PyPI Package (recommended)\n\n```\npip install forcedimension\n```\n\n`numpy` is an optional dependency. If you want to install that as well:\n\n```\npip install forcedimension\\[numpy\\]\n```\n\n\n\n#### Install the [ForceDimensionSDK](https://www.forcedimension.com/software/sdk) for your computer. \nBy default, the bindings will search in the following system-wide install locations.\n\n* System-wide install locations (Linux):\n - `/usr/local/lib`\n - `/usr/lib`\n* System-wide install location (Windows):\n - `C:\\Program Files\\ForceDimension\\sdk-X.X.X\\lib`\n\n##### Non-system-wide Installs\n\nIf you do not wish to make a system-wide installation set the FORCEDIM_SDK environment variable to the root folder of the ForceDimensionSDK installation (the `lib` folder should be one level under the root installation folder)\n\n##### System-wide install for Linux\n\nThis requires extra steps since the Makefile for the ForceDimensionSDK does not offer a `make install` target for a system-wide install.\n\n1. Copy all files from `lib/release/lin-*-gcc` to `/usr/local/lib` \n\n2. Copy all files from `include` to `/usr/local/include` \n\n3. MAKE SURE the libraries have `755` level access using `chmod`. If they don't applications cannot link or load them.\n\n4. Make a symbolic link to libdhd and libdrd that drop the version so they end in `.so`, so that the file names are `libdhd.so` and `libdrd.so`\n\nThese steps can be automated by adding these targets to the Makefile.\n\n```makefile\ninstall:\n\tcp include/* /usr/local/include\n\tcp lib/release/lin-*-gcc/* /usr/local/lib\n\tchmod 755 /usr/local/lib/libdhd.so.X.X.X\n\tchmod 755 /usr/local/lib/libdrd.so.X.X.X\n\tchmod 755 /usr/local/lib/libdhd.a\n\tchmod 755 /usr/local/lib/libdrd.a\n\tln -s /usr/local/lib/libdhd.so /usr/local/lib/libdhd.so.X.X.X\n\tln -s /usr/local/lib/libdrd.so /usr/local/lib/libdrd.so.X.X.X\n```\n\n```makefile\nuninstall:\n\trm /usr/local/include/dhdc.h\n\trm /usr/local/include/drdc.h\n\trm /usr/local/lib/libdhd.a\n\trm /usr/local/lib/libdhd.so.3.9.1\n\trm /usr/local/lib/libdhd.so\n\trm /usr/local/lib/libdrd.a\n\trm /usr/local/lib/libdrd.so.3.9.1\n\trm /usr/local/lib/libdrd.so\n```\n#### Additional Setup\n\n##### Windows\n\nDevice Manager is a Windows tool that can be used to see connected devices, their statuses, driver information, and driver installation.\n\nThe easiest way to bring it up is to use the windows search bar on Windows 10 and search \u201cDevice Manager\u201d. Regardless of the method used, you will need administrator level privileges to launch the Device Manager.\n\nFind your haptics device and right-click on it and open `Properities`. Do `Update driver>Browse my computer for driver software` and specify the drivers listed under the `drivers\\usb` in the root install directory. Try restarting if drivers are not detected or changes do not take place. \n\nYour device should now be listed under `USB Haptic Devices`\n\n##### Linux\n\nAdd a udev rule under `/etc/udev/rules.d` for your device. Here's an explaination from the [Arch Linux Wiki](https://wiki.archlinux.org/index.php/Udev#Waking_from_suspend_with_USB_device) about what they are and here's a good udev file for the [Novint Falcon](https://github.com/libnifalcon/libnifalcon/blob/master/linux/40-novint-falcon-udev.rules).\n\nA good way to find the USB bus of the device is by unplugging the device, doing `ls -l /dev/bus/usb/00*`, replugging, the device and then performing it again. \n\nMAKE SURE you unplug the USB and not just the power because the unpowering the device does not unpower the USB communications (which get power through the computer).\n\nThen perform `lsusb` and note the ID of your device, which is in the format `idVendor:idPorduct`\n\n",
"bugtrack_url": null,
"license": "LGPL-3.0",
"summary": "Unofficial, Experimental, High-Level Python Wrappers for the Force Dimension SDK",
"version": "0.1.7",
"project_urls": {
"Documentation": "https://forcedimension-python-documentation.readthedocs.io/en/latest/",
"Homepage": "https://github.com/EmDash00/forcedimension-python",
"Repository": "https://github.com/EmDash00/forcedimension-python"
},
"split_keywords": [
"forcedimension",
"haptics",
"wrappers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6dc608764e80b47d131d6d0e182966a8773a5e490675d623222942eb70c2aa2c",
"md5": "ce4f5012f483b46d260fc7588f27f87d",
"sha256": "9faed154688f422ecd52c3715d01a8b6dd0faacbf1359f9ac9834a307e4e41fd"
},
"downloads": -1,
"filename": "forcedimension-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ce4f5012f483b46d260fc7588f27f87d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<3.12",
"size": 51609,
"upload_time": "2023-11-07T22:11:19",
"upload_time_iso_8601": "2023-11-07T22:11:19.480771Z",
"url": "https://files.pythonhosted.org/packages/6d/c6/08764e80b47d131d6d0e182966a8773a5e490675d623222942eb70c2aa2c/forcedimension-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97b0b766a3f5cd6463f1a8b81871084c62d094eb39cdecc53e3ac30f796180fe",
"md5": "56e4cce38cf7ed42603176910cee77e5",
"sha256": "0d88986065bfa16d24783ba62225362a7ba910ece9152d972ca134c5e6bb0e7d"
},
"downloads": -1,
"filename": "forcedimension-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "56e4cce38cf7ed42603176910cee77e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<3.12",
"size": 49568,
"upload_time": "2023-11-07T22:11:20",
"upload_time_iso_8601": "2023-11-07T22:11:20.984964Z",
"url": "https://files.pythonhosted.org/packages/97/b0/b766a3f5cd6463f1a8b81871084c62d094eb39cdecc53e3ac30f796180fe/forcedimension-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-07 22:11:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EmDash00",
"github_project": "forcedimension-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "forcedimension"
}