Skip to main content

High-level Python library for Dynamixel servos with async support and comprehensive control table definitions

Project description

Dynamixel Async

A high-level Python library for controlling Dynamixel servos with async support and comprehensive control table definitions.

Features

  • Asynchronous API for better performance and control
  • Complete control table definitions for XM430 series servos
  • High-level abstractions for common operations
  • Type hints for better IDE support
  • Comprehensive error handling
  • Auto port detection

Installation

pip install dynamixel-async

Quick Start

import asyncio
from dynamixel_async import DynamixelController

async def main():
    # Create controller instance (auto-detects port)
    controller = DynamixelController(baudrate=57600)
    
    try:
        # Connect and scan for servos
        await controller.connect()
        print(f"Connected servos: {controller.get_connected_ids()}")
        
        # Get first servo
        servo = controller.get_servo(1)
        if not servo:
            print("No servo found with ID 1")
            return
            
        # Enable torque
        servo.enable_torque()
        
        # Move to different positions
        positions = [0, 90, 180, 90, 0]
        for pos in positions:
            print(f"Moving to {pos} degrees...")
            servo.set_position(pos)
            await controller.wait_for_servos()
            
            # Read current position
            current_pos = servo.get_position()
            print(f"Current position: {current_pos:.1f} degrees")
            await asyncio.sleep(1.0)
            
    finally:
        # Clean up
        if controller:
            await controller.disconnect()

if __name__ == "__main__":
    asyncio.run(main())

Supported Models

Currently supports:

  • XM430-W210
  • XM430-W350

More models can be easily added by defining their control tables.

Control Modes

Supports all XM430 control modes:

  • Position Control
  • Velocity Control
  • Current Control
  • Extended Position Control
  • PWM Control

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

dynamixel_async-0.2.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

dynamixel_async-0.2.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file dynamixel_async-0.2.0.tar.gz.

File metadata

  • Download URL: dynamixel_async-0.2.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for dynamixel_async-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d53cd3ad796e8b9d09b37588396762aaa1e567a6c85d20d0002ba4b85072463a
MD5 6ee4a84b94ac0c170cc752210a9fa22a
BLAKE2b-256 2d1731afee078e2b0dee0326456ef065ba55d8149e2e0741f2148d709311ab45

See more details on using hashes here.

File details

Details for the file dynamixel_async-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dynamixel_async-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c61c9533963a70133d0d8549133c67ed19545e09554c3d0ae87f56e930526dc8
MD5 3051749f9ca27d01fe63132e90674f16
BLAKE2b-256 44b3411e832f6312841840f7c49437c4eb289bd613c79132654a25ae1208f6d0

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