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.
- 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.
Install the latest version of go1pylib with pip:
pip install go1pylib
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/
Find more examples in the examples
directory for controlling the robot, collision avoidance, and LED control.
File Name | Status |
---|---|
avoid_obstacles.py |
❌ |
dance.py |
✅ |
get_state.py |
❌ |
led_control.py |
✅ |
move_forward.py |
✅ |
move_joints.py |
✅ |
square.py |
✅ |
- 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.
go1pylib/
├── examples/
│ ├── move_forward.py
│ ├── dance.py
│ └── avoid_obstacles.py
├── src/
│ └── go1pylib/
│ ├── go1.py
│ ├── mqtt/
│ ├── state.py
│ └── ...
├── tests/
└── README.md
Basic documentation can be found here. (Will be updated)
Contributions are welcome! Check out our contributing guidelines for more information.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to:
Thank you to all contributors who made this project possible!