Skip to main content

Python control interface for the Durin robot

Project description

Durin control system

This repository contains Python code that interfaces with the robot Durin, built by the Neurocomputing Systems group at the KTH Royal Instititute of Technology. Please note that this is only the reference implementation for our interface. See below.

Installation

We require a working Python installation with access to pip. After that, installation is straight-forward:

pip install durin

Usage

The interface is meant to be used via Python. More examples can be found in the durin/examples folder.

from durin import *

# The ip address to Durin is 172.16.223.9X, where X is the number of the robot (1, 2, or 5).
durin_ip = "172.16.223.91"

# This connects to durin and displays a user interface (UI)
with DurinUI(durin_ip) as durin:

    while True:
        # Get observation
        (obs, dvs, cmd) = durin.read()

        # Do clever things...

        # Move durin 100 units left with 0 forward/backward motion and 0 rotation
        command = Move(100, 0, 0)

        # Send a command to Durin
        durin(command)

        # ... this loop continues forever!
        # You can exit it on your computer by pressing CTRL+C

Sensory data

The durin.read() method will give you access to

  1. An Observation from the robot sensors object containing
    • .tof Time of Flight sensors
    • .charge Battery charge
  2. A 640x480 DVS PyTorch tensor
    • This tensor has buffered/stacked events since the last .read() command.
    • Note that this is only available if the Durin has a DVS sensor installed
  3. Replies from the robot, following any Poll commands
    • This is specified in the protocol datasheet below - feel free to ignore

Commands

The most important command is Move(x, y, rotation). the x, y, rotation values should be in the interval between [-500, 500].

Custom implementation

You can interface to the microcontroller (sensor + wheel actuation) and DVS microcamera with TCP and UDP. A complete specification is available via Google Drive: https://docs.google.com/spreadsheets/d/11jD30J00-03ygZ6zJaVTnjJRQKfczT-wMIdBdpYMxD4/edit?usp=sharing

Each robot has two IP addresses - one for the microcontroller and one for the DVS controller. The robots are numbered 1, 2, or 5. Insert those numbers where X is written below:

  • 172.16.223.9X: Microcontroller for sensory data and motor commands
  • 172.16.223.10x: Raspberry Pi for streaming DVS data

Contact

Reach out to Juan or Jens if you need anything.

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

durin-0.0.68.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

durin-0.0.68-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file durin-0.0.68.tar.gz.

File metadata

  • Download URL: durin-0.0.68.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for durin-0.0.68.tar.gz
Algorithm Hash digest
SHA256 c5e760ae93c9bf1ff7ace258c88f913ed9ac954427562c96fb7ebb2ebe58af5a
MD5 5cc21858aa7ab28d6ceef5bdd8145424
BLAKE2b-256 a50036b8d25b43a8174043c41b8b0f481eb25cec2a0075fc7e2fef938d3ef002

See more details on using hashes here.

File details

Details for the file durin-0.0.68-py3-none-any.whl.

File metadata

  • Download URL: durin-0.0.68-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for durin-0.0.68-py3-none-any.whl
Algorithm Hash digest
SHA256 a6049e305a93d655deca238911666b77bf35951c163eab330dd09eba090881c1
MD5 da05f8a67b79f7aac6ce06c9f90565d8
BLAKE2b-256 7fd1053e60402b2bcece92bd2147688982f260158b6dbeebcff029fdf4d2fe03

See more details on using hashes here.

Supported by

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