Skip to main content

bonicos

The Python SDK for BonicBot robots. Drive the base, move the arms, run navigation and mapping, and read live sensor telemetry — from your own laptop or from a program running on the robot itself, with the same code either way.

pip install bonicos
from bonicos import BonicBot

with BonicBot("192.168.1.50") as robot:
    robot.move_forward(speed=0.3, duration=2)
    robot.move_left_arm(shoulder=45, elbow=30)
    print(robot.get_battery(), "V")
# motors stopped and the connection closed, even on an exception

Requires Python 3.10+. Pure Python — the same wheel runs on a laptop, a Raspberry Pi, or a Jetson.


Connecting

bonicos talks to the robot over your local network. You need the robot's address:

robot = BonicBot("192.168.1.50")

If the environment already knows which robot you mean, a bare BonicBot() works. That's the case when your program runs on the robot, where BONICOS_HOST is set for you — so a script you developed on your laptop needs no edits to run on the robot. You can also set that variable yourself, or install bonicos[discovery] to find a robot by mDNS.

On a classroom LAN with several robots, robot_id is optional but useful: pin it and the connection only succeeds against that specific robot —

robot = BonicBot("192.168.1.50", robot_id="M1_001")

— and it doubles as the filter for bonicos[discovery] when you don't know the address either (BonicBot(robot_id="M1_001")). Leave it off for the common case of one robot, or a host you already trust.

Anyone on the same network can connect. There is no authentication yet — robot_id is a wrong-robot guard, not a password. Run robots on a network you trust.

No robot handy? BonicBot.simulated() connects to a fake one instead — driving, arms, and telemetry all behave for real, with no network and no hardware required.


What you can do

Area Examples
Motion move_forward, move_backward, turn_left, turn_right, stop, raw drive
Precise motion drive_distance, rotate_angle, drive_and_rotate, draw_square, queued routines
Navigation go_to(x, y), navigate_waypoints, cancel_goal, wait_for_goal, get_plan
Mapping enter_mapping_mode, start_mapping, save_map, list_maps, enter_navigation_mode
Arms & grippers move_left_arm, move_right_arm, set_servos, set_gripper, set_neck, get_servo_angles
Sensors get_position, get_battery, get_imu, get_servo_angles, wait_for_update
Camera get_camera_frame() → BGR numpy arrays (needs pip install bonicos[camera])
System speak, run_agent / stop_agent, health, session status and recovery

Full reference with every signature: API.md.

Movement calls block until the robot actually gets there — move_left_arm(...) returns when the joint has converged on its target, not when the command was merely acknowledged.

Not yet working on the robot

Some commands are accepted and silently do nothing on current robot firmware. Your code runs; that actuator just doesn't move. They are marked 🔌 stub in API.md:

  • Nav2 lifecycle — start_navigation, stop_navigation
  • servo_single

Head expression (set_expression, look) is live on A and S series, and every HeadMode expression is a real face on both. The LED-matrix display_* calls are A series only — the S display shows preset expressions and refuses them. All of it needs the base stack up, and a robot with no face display answers with an error rather than pretending.

Everything else in the table above is live. Vision pipelines (face/pose/object detection), autonomous exploration, and recorded sequences are not in this release.

On Lite robots (s1-lite, a2-lite) navigation and mapping are not stubs — they are absent, and raise CommandError rather than silently doing nothing. Motion, arms, display, speech, sensors and camera all work. The SDK does not check capability at runtime and the robot does not advertise it: API.md is the reference for what each model supports — every section carries an On Lite line.


Safety

  • Use the context-manager form (with BonicBot(...) as robot:) or call robot.close() in a finally. Both stop the robot on the way out.
  • The robot stops its own motors if it stops hearing from you (roughly 400 ms), so a crashed script or a dropped connection will not leave it driving. That backstop covers driving only — a navigation goal keeps running, so cancel it explicitly if you're bailing out.

Installing extras

pip install bonicos              # driving, arms, navigation, telemetry
pip install bonicos[camera]      # + camera frames (aiortc, numpy)
pip install bonicos[discovery]   # + find a robot by mDNS

Each extra reports what's missing if you use a feature without it, rather than failing with an import error.


Documentation

  • API.md — every class and method, with blocking behaviour and worked examples. Also the capability reference: each section's On Lite line says what that model supports.
  • PROTOCOL.md — the wire protocol, if you're writing your own client or working on the robot side.
  • examples/ — eleven runnable scripts, laptop or robot.
  • CHANGELOG.md — what changed between releases, including breaking changes and how to migrate.

License

MIT — see LICENSE. © Autobonics Pvt Ltd.

Metadata

Release files for bonicos 1.1.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 bonicos 1.1.2
File Size Uploaded Provenance Actions
bonicos-1.1.2.tar.gz 214.5 kB Without provenance Details for bonicos-1.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 329.7 kB

Release files / bonicos-1.1.2.tar.gz

Download URL bonicos-1.1.2.tar.gz
Size 214.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a50dff4832e4cad8f5ee36c151def1057c4981f24eb090b30dbb5e03c97ba44
BLAKE2b-256 checksum
How to use checksums
1e3e8f2e16ab31884820b4c43680a89ca3cc00787598a238f14f85d48c931ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / bonicos-1.1.2-py3-none-any.whl

Download URL bonicos-1.1.2-py3-none-any.whl
Size 115.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ea37085f416765719f1d1520a873bf50c485374b57e602f9ffa1587128e1e69
BLAKE2b-256 checksum
How to use checksums
6f6851a5b16e5a93ac5af5b1c613dae02fb9fb2035c3b057c13c376ff82d1a15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for bonicos 1.1.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.

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

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