Skip to main content

Python Library for Go1 Robot Control

Project description

go1pylib: Python Library for Go1 Robot Control

PyPI version License: MIT Python Versions

go1pylib is a Python library designed for controlling the Go1 robot, providing high-level methods for robot movement, state management, and collision avoidance. With built-in functionality for MQTT communication and control modes, go1pylib is ideal for both development and research use in robotics applications.

Features

  • Robot Control: Seamlessly control Go1's movements, including forward, backward, turns, and various pose adjustments.
  • Collision Avoidance: Built-in methods for safe navigation with customizable thresholds for obstacle detection.
  • Battery Monitoring: Real-time battery status feedback with configurable LED indicators based on battery levels.
  • LED Control: Control LED colors for custom feedback based on robot state or user-defined actions.
  • MQTT Communication: Reliable MQTT communication interface for Go1 state management and control.
  • Multiple Control Modes: Switch between modes such as WALK and STAND for different application scenarios.

Installation

Install the latest version of go1pylib using pip:

pip install go1pylib

Usage

Here's a quick example demonstrating basic usage:

import asyncio
from go1pylib import Go1, Go1Mode

async def main():
    robot = Go1()
    robot.init()  # Connect to the robot

    # Set to WALK mode and move forward
    robot.set_mode(Go1Mode.WALK)
    await robot.go_forward(speed=0.3, duration_ms=1000)

    # Check battery status
    battery_level = robot.get_battery_level()
    print(f"Battery Level: {battery_level}%")

    # Stop and disconnect
    robot.set_mode(Go1Mode.STAND_DOWN)
    robot.disconnect()

asyncio.run(main())

Examples

Examples for controlling the robot, collision avoidance, and LED control can be found in the examples directory.

Project Structure

go1pylib/
├── examples/
│   ├── move_forward.py
│   ├── dance.py
│   └── avoid_obstacles.py
├── src/
│   └── go1pylib/
│       ├── go1.py
│       ├── mqtt/
│       ├── state.py
│       └── ...
├── tests/
└── README.md

Documentation

Complete documentation can be found here.

Contributing

Contributions are welcome! Please see our contributing guidelines for more information.

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

go1pylib-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

go1pylib-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: go1pylib-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for go1pylib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8fdd067bc5ca088f3ca7877b4c63bc72275abc8f5ccdcb630951e47cdc67cad
MD5 f9896850932d832d09821b8c388ef6a7
BLAKE2b-256 974106e84d85481beee28c1265b0c045268fdadefca4a9b27284667259239f36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: go1pylib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for go1pylib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcf954009d071fb86e7bf365985ebcdac231ce205fd5f4a142a052ef52d2d60e
MD5 5733cc8cd6ddd1ceb26f0caa1061b86f
BLAKE2b-256 ba742c79adc30ef7ef859dad3e5699509e4a2e639344539b0211d3732d0f96df

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