Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chinmaynehate/go1pylib
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/
https://github.com/chinmaynehate/go1pylib
auto mqtt python quadruped quadruped-robot robot-control robot-dogs robot-framework robotics robotics-library unitree unitree-go1
Last synced: about 1 month ago
JSON representation
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/
- Host: GitHub
- URL: https://github.com/chinmaynehate/go1pylib
- Owner: chinmaynehate
- License: mit
- Created: 2024-11-12T02:37:02.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-24T14:15:30.000Z (about 2 months ago)
- Last Synced: 2024-11-24T15:25:29.918Z (about 2 months ago)
- Topics: auto, mqtt, python, quadruped, quadruped-robot, robot-control, robot-dogs, robot-framework, robotics, robotics-library, unitree, unitree-go1
- Language: Python
- Homepage: https://chinmaynehate.github.io/go1pylib/
- Size: 9.5 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
![go1pylib](go1.gif)
# go1pylib: Python Library for Go1 Robot Control
[![PyPI version](https://badge.fury.io/py/go1pylib.svg)](https://pypi.org/project/go1pylib/)
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
![Python Versions](https://img.shields.io/pypi/pyversions/go1pylib)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.
---
## :star2: 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.## :rocket: Installation
Install the latest version of go1pylib with pip:
```bash
pip install go1pylib
```## :computer: Usage
Here's an example to get started:
```python
import asyncio
from go1pylib import Go1, Go1Modeasync 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/`## :file_folder: Examples
Find more examples in the `examples` directory for controlling the robot, collision avoidance, and LED control.
## :file_folder: Examples Progress
| **File Name** | **Status** |
|------------------------|------------|
| `avoid_obstacles.py` | ❌ |
| `dance.py` | ✅ |
| `get_state.py` | ❌ |
| `led_control.py` | ✅ |
| `move_forward.py` | ✅ |
| `move_joints.py` | ✅ |
| `square.py` | ✅ |### :bulb: 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.## :file_cabinet: Project Structure
```plaintext
go1pylib/
├── examples/
│ ├── move_forward.py
│ ├── dance.py
│ └── avoid_obstacles.py
├── src/
│ └── go1pylib/
│ ├── go1.py
│ ├── mqtt/
│ ├── state.py
│ └── ...
├── tests/
└── README.md
```## :books: Documentation
Basic documentation can be found [here](https://chinmaynehate.github.io/go1pylib/).
(Will be updated)## :handshake: Contributing
Contributions are welcome! Check out our [contributing guidelines](https://github.com/chinmaynehate/go1pylib/blob/main/CONTRIBUTING.md) for more information.
## :warning: License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/chinmaynehate/go1pylib/blob/main/LICENSE) file for details.
## :gem: Acknowledgments
Special thanks to:
- [go1-js by dbaldwin](https://github.com/dbaldwin/go1-js)
- [YushuTechUnitreeGo1 by MAVProxyUser](https://github.com/MAVProxyUser/YushuTechUnitreeGo1)
- [Unitree Go1 Educational Documentation](https://unitree-docs.readthedocs.io/en/latest/get_started/Go1_Edu.html)Thank you to all contributors who made this project possible!