Skip to main content

Dexter Controller for the HARP Load Cells

Reason this release was yanked:

issue with namespace, not working

Project description

dexter-controller (Python)

This is a Python package for controlling the Dexter device. It provides an interface to interact with it using a mapping between the device's and the connected LoadCells for each finger.

Installation

You can install the package using uv:

uv add "harp.loadcells @ git+ssh://git@github.com/fchampalimaud/pyharp.loadcells.test.git"

Usage example

import time
from dexter_controller import Finger, DexterHandController

# The mapping dictionary should contain the serial port paths as keys and a list of Finger enums as values.
mapping = {
    "/dev/ttyUSB0": [Finger.THUMB, Finger.INDEX],   # "COMx" on Windows
    "/dev/ttyUSB1": [Finger.MIDDLE, Finger.RING],   # "COMy" on Windows
    "/dev/ttyUSB2": [Finger.PINKY],                 # "COMz on Windows
}

# When using the controller, you can access the raw data for each finger.
# Devices are connected on creation of the controller.
controller = DexterHandController(mapping)

try:
    print("Press Ctrl+C to exit.")
    while True:
        line = (
            f"Thumb: {controller.thumb.raw_data if controller.thumb else None} | "
            f"Index: {controller.index.raw_data if controller.index else None} | "
            f"Middle: {controller.middle.raw_data if controller.middle else None} | "
            f"Ring: {controller.ring.raw_data if controller.ring else None} | "
            f"Pinky: {controller.pinky.raw_data if controller.pinky else None}    "
        )
        print(line, end="\r", flush=True)
        # sleep for a short duration to avoid flooding the output (20 milliseconds)
        time.sleep(0.02)
except KeyboardInterrupt:
    print("Exiting...")
finally:
    controller.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dexter_controller-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dexter_controller-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dexter_controller-0.1.0.tar.gz.

File metadata

  • Download URL: dexter_controller-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for dexter_controller-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59c7d65bd532df260433ea858a0fad95eb4157809fd55d9008e17fcb34df7598
MD5 4f1c6f954d57c4291d862ccb82072c00
BLAKE2b-256 8e990e39de51e2c1c5525908677cb1e693144dcdbbecc373b63de430eaceb916

See more details on using hashes here.

File details

Details for the file dexter_controller-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dexter_controller-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 138d1c5403ffeeb300cc7e694f50813ceea7c67119962113d048fd84f4406275
MD5 35027a55706f3e9cdf39ee73e124367d
BLAKE2b-256 cdbc76afd5d3868f9e75b55ddd8e7a8088d129ae958a40734f71f82eb43b79f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page