Skip to content

go1pylib is a Python library designed to control the Go1 robot by Unitree Robotics. It provides an easy-to-use interface for robot movement, state management, collision avoidance, battery monitoring, and MQTT communication. Ideal for research and robotics development. https://pypi.org/project/go1pylib/

License

Notifications You must be signed in to change notification settings

chinmaynehate/go1pylib

Repository files navigation

go1pylib

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 in robotics.


🌟 Features

  • Robot Control: Control Go1's movements including forward, backward, turns, and pose adjustments.
  • Battery Monitoring: Real-time battery status with configurable LED indicators.
  • LED Control: Customizable LED color control based on robot state or custom feedback.
  • MQTT Communication: Reliable MQTT communication for Go1 state management and control.
  • Multiple Control Modes: Switch modes such as WALK, STAND for various scenarios.

🚀 Installation

Install the latest version of go1pylib with pip:

pip install go1pylib

💻 Usage

Here's an example to get started:

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())

It is recommended to try out the programs under examples/

📁 Examples

Find more examples in the examples directory for controlling the robot, collision avoidance, and LED control.

📁 Examples Progress

File Name Status
avoid_obstacles.py
dance.py
get_state.py
led_control.py
move_forward.py
move_joints.py
square.py

💡 Note

  • Files marked with ❌ are currently not operational and need debugging or additional implementation to function correctly.
  • All ✅ examples are fully functional and ready to use.

🗄️ Project Structure

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

📚 Documentation

Basic documentation can be found here. (Will be updated)

🤝 Contributing

Contributions are welcome! Check out our contributing guidelines for more information.

⚠️ License

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

💎 Acknowledgments

Special thanks to:

Thank you to all contributors who made this project possible!

About

go1pylib is a Python library designed to control the Go1 robot by Unitree Robotics. It provides an easy-to-use interface for robot movement, state management, collision avoidance, battery monitoring, and MQTT communication. Ideal for research and robotics development. https://pypi.org/project/go1pylib/

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages