PitchHut
Log in / Sign up
go1pylib
9 views
A Python library for seamless control of the Go1 robot.
Pitch

go1pylib is a versatile Python library tailored for the Go1 robot by Unitree Robotics. With features for movement control, collision avoidance, and MQTT communication, it simplifies development and research in robotics, allowing for efficient interaction with the robot through high-level APIs.

Description

go1pylib is a robust Python library specifically crafted to control the Go1 robot from Unitree Robotics. It simplifies the programming of robot movement, state management, collision avoidance, and MQTT communication, making it an excellent choice for both research and development in the field of robotics.

Key Features

  • Intuitive Robot Control: Easily command the Go1 robot to move in various directions—forward, backward, turn, and adjust poses—with straightforward functions.
  • Advanced Collision Avoidance: Ensure safe navigation with customizable thresholds for obstacle detection, enhancing your robot's operational safety.
  • Real-Time Battery Monitoring: Keep track of battery levels with built-in functionalities and get notifications through configurable LED indicators.
  • Customizable LED Control: Change LED colors based on the robot's state or use your criteria for feedback, adding a layer of interactivity.
  • Reliable MQTT Communication: Effectively manage the Go1's state and communication using MQTT protocols, making integration into larger systems seamless.
  • Multiple Control Modes: Easily switch between operational modes like WALK and STAND to suit different environments and tasks.

Quick Start Example

To illustrate go1pylib in action, here's a simple usage example:

import asyncio
from go1pylib import Go1, Go1Mode

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

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

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

    # Cease operation and disconnect
    robot.set_mode(Go1Mode.STAND_DOWN)
    robot.disconnect()

asyncio.run(main())

Project Structure

The project is organized as follows:

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

Documentation

For comprehensive guidance, the complete documentation is available here.

Contribution & Acknowledgments

Contributions are encouraged! Please refer to our contributing guidelines for more details. We especially thank the contributors from go1-js, YushuTechUnitreeGo1, and the Unitree Go1 Educational Documentation for their invaluable input.

With go1pylib, you can take your robotics projects to the next level with a streamlined and powerful interface for controlling the Go1 robot!