Skip to content

commandAGI/commandagi-example-byo-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommandAGI · Bring your own robot

A complete, hardware-free example of registering your own robot on CommandAGI: it streams a robot's camera into a CommandAGI session and applies the drive actions it receives. Anyone with the session link — a person in the web UI, an AI agent, or another developer's SDK client — can then watch the camera and drive the robot in real time.

This runs a virtual rover so you can try it with no hardware. Swap VirtualRobot for your real robot — a camera() that returns JPEG bytes and an on_action(action, payload) that moves it — and you've put a physical robot on the platform.

Run it

pip install -r requirements.txt
export COMMANDAGI_API_KEY=cagi_...        # create one in your CommandAGI dashboard (operator scope)
python virtual_robot.py

It prints a session URL — open it to watch your robot's camera and drive it (move / turn / stop / reset). Press Ctrl-C to take the robot offline.

How it works

from commandagi import CommandAGI

cagi = CommandAGI()                         # COMMANDAGI_API_KEY from the environment
bridge = cagi.register_robot("virtual-rover")   # registers a robot device, returns a bridge
print("watch + drive at:", bridge.session_url)

bridge.run(
    camera=robot.camera,                    # () -> JPEG/PNG bytes  (your robot's observation)
    on_action=robot.on_action,              # (action, payload) -> None  (drive your robot)
    fps=10,
)
  • register_robot() creates an agentless machine with a bring-your-own robot device and returns a RobotBridge.
  • bridge.run() connects to the session's realtime channel, publishes each camera() frame, and calls on_action() for every control message the platform routes to your robot.

The control vocabulary for a mobile robot: move {speed}, back {speed}, turn {dir, rate}, stop, reset.

Learn more

MIT licensed.

About

Register your own robot on CommandAGI — stream its camera and receive actions (hardware-free example).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages