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.3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: go1pylib-0.1.3.tar.gz
  • Upload date:
  • Size: 14.4 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.3.tar.gz
Algorithm Hash digest
SHA256 9f36c5827a037bd03833be5b021f740d1a52f139f172c1ce43588795b03a9129
MD5 809df697b41a12b850a19c50ac7c5bdb
BLAKE2b-256 a4a119fdf224e57471c8a53209d6790b35a0de0630ee00a03fc1758a8ce86be5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: go1pylib-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e31a6b074a456fc420efe90fb217759cd81dda4309c6ffb90afea6b43683d6f
MD5 fb11e4e1dd081446b87842b129f389b9
BLAKE2b-256 c03326aa8dfd20540738e1745c392fb201e129ccaee475ca94427e2a0d7acc1d

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