Skip to content

Hardware

Hardware Communication

medulla connects your code to real hardware - cameras, depth sensors, and other devices - so you can capture and stream live data. Pick the group below that matches the hardware you're working with.

Cameras

Camera skills connect to a physical camera, capture color/depth frames or point clouds, and stream them live. The example below connects to a USB webcam and visualizes a captured frame in Rerun - the same pattern applies to other supported cameras (see all supported cameras).

Hardware required

You need a USB webcam connected to your machine. A built-in laptop camera works too - camera_id=0 selects the default camera.

Run the Capture from Webcam using Medulla

Save the script

Create a file called quickstart_webcam_example.py anywhere on your machine and paste the following

python
"""Telekinesis quickstart: capture a single frame from a USB webcam.

Connects to the default webcam, captures one color frame, and visualizes
it in a Rerun viewer.

Run as a script - python quickstart_webcam_example.py
"""

import rerun as rr
from loguru import logger

from telekinesis.medulla.cameras import webcam


def main() -> None:
    # Opens the Rerun viewer (spawn=True).
    rr.init("telekinesis_medulla_quickstart", spawn=True)
    
    # camera_id=0 is usually the default laptop camera or first USB webcam.
    camera = webcam.Webcam(name="my_webcam_camera", camera_id=0)

    try:
        camera.connect()
        # Skill call: Capture one color image as an HWC uint8 NumPy array.
        image = camera.capture_color_image()
        height, width = image.shape[:2]
        logger.success(f"Captured a {width}x{height} frame")
        
        # Log under entity path "webcam" so it appears in the spatial view.
        rr.log("webcam", rr.Image(image))
    except Exception as exc:
        logger.error(f"Failed to capture frame: {exc!r}")
    finally:
        camera.disconnect()


if __name__ == "__main__":
    main()

Run the script!

bash
python quickstart_webcam_example.py
Free Tier
Every new account starts on a free tier with credits to call the SDK — no billing details required.
Create API key →

Where to Go Next?

Ready to go deeper? Browse the Telekinesis Skill Examples repository for a runnable example covering every Skill.

Skill Examples

One runnable example per Skill, across vision, 3D, hardware, and robotics.

Explore →

Explore the Docs

Support