Skip to main content

Python client for the Crawling Bot

PyPI

A small, dependency-light client for the robot's serial/TCP protocol. Use it as the reference implementation when you write your own client in another language.

  • Standard library only for TCP; pyserial is needed only for --serial.
  • Typed results (Snapshot, ImuFrame) instead of raw strings.
  • Turns "one reply per command" into ordinary Python calls, and skips the telemetry/calibration event lines for you.
  • Every call has a deadline, so a robot that stops answering raises RobotTimeout instead of hanging.

Install

pip install crawlingbot            # TCP only, no third-party dependencies
pip install "crawlingbot[serial]"  # adds pyserial for Robot.serial(...)

That is all you need — the scripts in this folder are optional extras:

python hello_robot.py --host 192.168.4.1
python hello_robot.py --serial /dev/cu.usbmodem1101 --list-ports

Five-minute tour

from crawlingbot import Robot

with Robot.tcp("192.168.4.1") as bot:
    print(bot.ping())            # uptime in ms
    print(bot.id_info())         # {'id': '1', 'ssid': 'ESP32-AP-1', ...}

    snap = bot.snapshot()        # one GET
    print(snap.roll, snap.pitch, snap.yaw)
    print(snap.calibrated, snap.down, snap.down_target)

    bot.act(120, 60)             # clamped targets come back

Streaming, with automatic cleanup:

with Robot.tcp() as bot:
    for frame in bot.frames(hz=50, count=500):
        print(frame.roll, frame.pitch, frame.yaw)

Calibration:

with Robot.tcp() as bot:
    ok = bot.calibrate("all", on_progress=print)

Scripts in this folder

Script What it does
hello_robot.py connect and print identity + one snapshot
walk_legs.py move the legs through a routine, waiting for each move
stream_telemetry.py log or print telemetry frames (--csv for a file)
calibrate.py run the guided calibration with live stage output

Tests

The tests run against a fake robot that emits the firmware's exact strings, so no hardware is needed:

cd examples/python
python -m unittest discover -s tests -v

tests/fake_robot.py is also useful on its own: it lets you develop a client in any language without a robot. Start it from Python and point your client at the printed port.

API summary

Method Protocol command Notes
ping() PING returns uptime in ms
id_info() ID raw key/value dict
robot_id ID property, int
set_id(n) SETID n validated 1–8
snapshot() GET returns Snapshot
stream(hz) STREAM hz 0 turns it off, max 50
frames(...) STREAM iterator over ImuFrame
act(down, up) ACT d u returns the clamped targets
stop() / park() STOP / PARK
calibrate(target, on_progress=) CAL [all|gyro|accel|mag] blocks; returns bool

Anything the client does not wrap is still reachable:

bot.command("GET")       # raw key/value dict, raises RobotError on ERR
bot.command("CAL gyro")

See docs/PROTOCOL.md for the wire format.

Metadata

Release files for crawlingbot 1.0.0

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

Source distribution (sdist)

Source distribution for crawlingbot 1.0.0
File Size Uploaded Provenance Actions
crawlingbot-1.0.0.tar.gz 16.3 kB Without provenance Details for crawlingbot-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crawlingbot 1.0.0
File Interpreter ABI Platform Actions
crawlingbot-1.0.0-py3-none-any.whl Python 3 none any Details for crawlingbot-1.0.0-py3-none-any.whl

Total release size: 29.2 kB

Release files / crawlingbot-1.0.0.tar.gz

Download URL crawlingbot-1.0.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
920a0b73d5c8385b826c72a32e9e015b54c9a4ef541bd35080dec110e0c6e911
BLAKE2b-256 checksum
How to use checksums
15f0a533057fd1f685bffa3043e99cad7b0e42765326918b62f95dab1f86eccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / crawlingbot-1.0.0-py3-none-any.whl

Download URL crawlingbot-1.0.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c789250bb4cb6bd9f166259a79892fffed2b0eee5a689cd64316d303377b1273
BLAKE2b-256 checksum
How to use checksums
ecd1ea140d68e8b243c0d144d3cb0693ca54d766ff16d6967911537404144257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for crawlingbot 1.0.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 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