Skip to main content

Sparky - Go2 Robot Control

Fast, simple robot control optimized for Vision Pro integration and real-time applications.

Perfect for Python beginners, researchers, and Vision Pro developers who need responsive robot control.

Sparky CLI Banner


Vision Pro Ready

from sparky import Robot

async def vision_pro_control():
    async with Robot() as robot:
        await robot.connect()
        await robot.hello()                    # Wave gesture
        await robot.move('forward', 0.3, 2.0)  # Move forward
        status = await robot.get_status()      # Real-time monitoring

Quick Start

Installation

# From project directory
pip install -e .

# Or with Poetry
poetry install

# For development (with all tools)
poetry install --extras dev
# or using Task
task install

Simple Demo

import asyncio
from sparky import Robot

async def demo():
    robot = Robot()
    await robot.connect()         # Auto-connects via robot WiFi
    await robot.hello()           # Wave hello
    await robot.sit()             # Sit down
    await robot.stand_up()        # Stand up
    await robot.disconnect()      # Clean disconnect

asyncio.run(demo())

Why Sparky?

  • ** Vision Pro Optimized** - Perfect for gesture-based control
  • ** Real-time Focus** - No verification overhead, maximum speed
  • ** Beginner Friendly** - Simple async/await patterns
  • ** Mobile Ready** - Lightweight, responsive API
  • ** Auto-connection** - Handles connection methods automatically

Examples

For Vision Pro Apps

For Beginners

Advanced Examples

🌐 Connection Methods

Sparky automatically tries connection methods in order:

  1. LocalAP (default) - Robot's WiFi hotspot
  2. Router - Shared network (if robot IP provided)
# Default (LocalAP)
await robot.connect()

# Specific method  
from sparky import ConnectionMethod
await robot.connect(ConnectionMethod.ROUTER, ip="192.168.1.100")

Available Commands

Basic Movements

await robot.move('forward', speed=0.3, duration=2.0)
await robot.move('backward', speed=0.3, duration=2.0) 
await robot.move('left', speed=0.3, duration=2.0)
await robot.move('right', speed=0.3, duration=2.0)
await robot.move('turn-left', speed=0.3, duration=2.0)
await robot.move('turn-right', speed=0.3, duration=2.0)

Gestures & Commands

await robot.hello()        # Wave hello
await robot.sit()          # Sit down  
await robot.stand_up()     # Stand up
await robot.dance(1)       # Dance routine

Advanced Patterns

await robot.walk_square(0.5)   # Walk in square
await robot.spin_360('right')  # Spin 360 degrees

Real-time Monitoring

# Basic status
status = await robot.get_status()
is_moving = await robot.is_moving()

# Data streaming
await robot.start_data_stream()
sensor_data = await robot.get_current_sensor_data()
await robot.stop_data_stream()

Firmware Compatibility

Current Go2 firmware operates in "mcf" mode only:

  • All basic movements work perfectly
  • Most gesture commands work (hello, sit, stand, dance)
  • Advanced commands unavailable (handstand, flips)
  • Motion mode switching disabled

🛠 Advanced Usage

For power users, the full API is available:

from sparky import Go2Connection, MotionController, DataCollector
from sparky.utils.constants import ConnectionMethod, MovementDirection

# Direct component access
connection = Go2Connection(ConnectionMethod.LOCALAP)
motion = MotionController(connection.conn)
data = DataCollector(connection.conn)

🤝 Need Help?

Getting Started

  1. New to robotics? → examples/simple_robot_control.py
  2. Building Vision Pro apps? → examples/vision_pro_example.py
  3. Need real-time data? → examples/basic/data_stream_basic_example.py

Common Issues

  • Connection fails? → Check robot is powered on and WiFi accessible
  • Commands don't work? → Run task test-robot or python examples/testing/motion_test.py
  • Import errors? → Ensure task install or pip install -e . was run successfully

Examples Structure

  • examples/ - All examples, organized by complexity and use case
    • Main examples - Vision Pro integration, beginner demos
    • basic/ - Getting started examples
    • data_streaming/ - Data collection & analytics
    • testing/ - Robot testing & diagnostics
    • advanced/ - Complex demonstrations
  • driver_examples/ - Hardware reference (audio, video, sensors)

🛠 Development & Testing

Task Automation

We use Task for streamlined development workflows:

# Development setup
task dev                 # Set up development environment
task install            # Install all dependencies

# Code quality
task format             # Format code with ruff
task check              # Run all quality checks
task ci                 # Run full CI checks locally

# Build & test
task build              # Build package
task clean              # Clean artifacts

# Robot testing
task run-examples       # List available examples
task test-robot         # Quick robot connectivity test
task run-example examples/simple_robot_control.py

GitHub CI/CD

Automated workflows ensure code quality and seamless publishing:

  • Quality Checks - Automatic testing on push/PR (ruff, mypy, pytest, safety)
  • Test Reports - Coverage reporting and test results in PRs
  • Auto Publishing - PyPI deployment on git tags

See all available tasks: task --list

🏗 Architecture

sparky/
├── Robot              #  Simple API (start here!)
├── ConnectionMethod   # 🌐 Connection types  
├── core/             #  Advanced components
│   ├── connection.py # WebRTC management
│   ├── motion.py     # Robot control  
│   ├── data_collector.py # Sensor streaming
│   └── analytics_engine.py # Real-time analysis
└── utils/            # 📦 Constants & exceptions

Perfect for: Vision Pro apps • Real-time control • Python beginners • Research • Mobile robotics

Built with: WebRTC • AsyncIO • Python 3.11+ • Poetry • Task • GitHub Actions

Metadata

Release files for go2-sparky 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for go2-sparky 0.0.2
File Size Uploaded Provenance
go2_sparky-0.0.2.tar.gz 54.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for go2-sparky 0.0.2
File Interpreter ABI Platform
go2_sparky-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 116.3 kB

Release files / go2_sparky-0.0.2.tar.gz

Download URL go2_sparky-0.0.2.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c33c4caf845680c1403ab5b73856a96fdaf9864fce41c0658560d6ce36bbede8
BLAKE2b-256 checksum
How to use checksums
efad5cf2668cc88f13b0d06a037c613a0c6b3c841c010508f7cd6e2ffd7d908c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

Release files / go2_sparky-0.0.2-py3-none-any.whl

Download URL go2_sparky-0.0.2-py3-none-any.whl
Size 62.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52fbd1c3c20e9aa41ccad08f4967766aeeae61b266c5e64d6339a6be6bc8d19e
BLAKE2b-256 checksum
How to use checksums
baa3d587087759226f710bd771f8718b8318626adeb92f4cb123d1b7c891ae29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.11.13 Linux/6.11.0-1018-azure

Security for go2-sparky 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page