Skip to content

louisgevers/pyhaptic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyhaptic

Unofficial Python bindings for Force Dimension Haptic SDK.

Installation

Clone the repository and its submodules:

$ git clone --recurse-submodules

Download the Force Dimension SDK. To install pyhaptic with the SDK, you have two options:

(a) Environment variable

Point the FORCE_DIMENSION_SDK variable to the SDK's path:

$ export FORCE_DIMENSION_SDK=/path/to/sdk

(b) Move the SDK

Move the SDK folder under src/dhd/include (and rename the folder to force-dimension-sdk). The structure should look as follows:

- src
    - dhd
        - include
            - force-dimension-sdk
                - bin
                - doc
                - examples
                - ...

Once you have done either (a) or (b), install pyhaptic in your environment of choice, this will create the bindings and interface under the pyhaptic module (and raw bindings under pyhaptic.dhd).

$ pip install .

Basic usage

After connecting a haptic device, use the Device class of pyhaptic to establish a connection and interact with the device. Each Device will attempt to open the connection on creation and throw a ConnectionError if this fails. For multiple devices, just create multiple Device objects.

import pyhaptic

# Connect with the device
device = pyhaptic.Device()

# Read its position
px, py, pz = device.get_position()

# Close the connection
device.close()

See examples/springmodel.py for an easy implementation to test your installation.

About

Python bindings for Force Dimension Haptic SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors