Project Info
Crater: Play-Do Prize; Cal Hacks: Best Hardware Hack
Hardware Context Protocol (MCP for Hardware)
Model Context Protocol (MCP) revolutionized the capabilities of LLMs by offering a radically new way of creating software for our everyday lives. Missing from this was meaningful capability to interact with the real world beyond a screen, and inspired us to develop our Hardware Context Protocol (HCP). It enables LLMs to control hardware components via well-defined exposed interfaces, allowing AI to interact with the world through reading sensor data, commanding actuators, and bringing them all together with context. The problem that inspired us was household serving (or rather, the lack of an intelligent machine to do so) - think making salads, finding snacks. We proved that our HCP SDK is a fast and iterable way to bring intelligence into the homes of everyday individuals by integrating its functionality into a robot arm.
What it does
We created an SDK that allows the user to create a minimal JSON-based definition of a certain hardware node and what actions it exposes to the LLM. This then bootstraps a custom TCP networking layer deployable on the hardware node compliant with our novel HCP interaction layer. The LLM goes through an initial discovery period where any HCP-bootstrapped TCP nodes are able to subscribe to it and pass relevant context in the HCP-defined schema. Sensors, like a camera, can detect the locations of objects and items of interest within their sensing frame, exposing them to the model; these can then be used to inform control actions orchestrated by the HCP.
Challenges we ran into
Architecting HCP to be a scalable architecture that would cleanly integrate a fully in-software LLM to real-life hardware. Exposing generic hardware interfaces on actuator interfaces (such as the demo'd SOARM101) to be controllable by the LLM, developing inverse kinematics and smooth path planning for safe operation of the robot arm as well.
Accomplishments we're proud of
Creating a fully-fledged SDK that we were able to use to bootstrap demo hardware nodes at near-zero ramp-up or integration cost. Creating a fully custom TCP networking stack under a publish/subscribe model that was HCP-compatible and allowed seamless multi-node orchestration. Creating a seamless agentic loop between pure-software LLMs and distributed hardware nodes, both for sensing and environment manipulation.
What we learned
Building HCP taught us that bridging the digital reasoning power of LLMs with the physical world requires both a solid networking backbone and a thoughtful interface abstraction. We learned how critical it is to design schemas that balance simplicity with extensibility. This enables both small embedded devices and complex robotic systems to integrate seamlessly. We also realized that context management is the heart of intelligent automation: giving LLMs structured, real-time situational awareness unlocks emergent problem-solving behaviours that feel almost human. The goal of the SOARM-101 integration is to provide an actuation platform that can be controlled by the HCP SDK. While the HCP SDK provides an authoritative interface for exposing a hardware node's capabilities, integrating a robotic arm required significant effort. The robotic arm provides control functionality to move to a desired position and grab and move objects. LLM interprets the user’s prompt about what they want to eat and moves the arm to pick up the desired ingredients to make a suitable dish. 3DOF End-Effector Commanding In robotic manipulation challenges, the goal is typically to track an end-effector position in the world. However, the SOARM-100 only exposed an API to command joint angles, requiring us to develop our own single-link-chain inverse kinematics model. The solver can solve for multiple manipulator configurations (elbow up/down). The advantage of this approach is that it generalizes the HCP's interaction with the arm (fully in world-frame space), thereby enhancing the control system's generalizability. The development of the model required implementing a custom simulator to validate that null-space solutions are rejected, as well as to provide a sanity check that the forward and inverse kinematics models yield sane results. A figure of the simulator is shown below and has proved to be helpful in debugging and iterating off-target. Camera and Vision Detection A camera was used to identify the locations of each object for the robot to interact with, using AprilTags and OpenCV. It exposes each object's type and position to the HCP layer so the LLM can guide the robot to interact with them. This approach of publishing generic data can be easily expanded to any type of sensor in the future, to help the model gain a better understanding of its environment.
What's next
for Hardware Context Protocol Our next step is to expand the HCP SDK into a fully modular ecosystem that supports standardized drivers, cloud-based orchestration, and real-time safety supervision layers. We hope to release open-source tools, including the ones developed at this very hackathon, for rapidly bootstrapping HCP-compatible nodes across a variety of microcontrollers. In the long term, we envision HCP serving as the foundation for a universal hardware abstraction layer for AI agents, enabling LLMs to intuitively control everything from IoT devices to full-scale industrial robotics, bringing physical intelligence to any environment.
Hardware Context Protocol (calhacks2025)
Setup
- Create a virtual environment (
python3 -m venv .venv) - Activate the virtual environment (
source .venv/bin/activateon MacOS/Linux,.venv\Scripts\activateon Windows) - Install system dependencies (
sudo apt-get install cmake build-essential pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev pkg-config) - Install Python dependencies (
pip install -r requirements.txt)
Good resources
Analysis
View
Metric
- 53
- 25
- 10
- 7
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- FastAPIIn code
- Hugging FaceIn code
- PythonIn code
- PyTorchIn code
- FlaskClaimed
4 of 5 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
119 KB
Source files
33
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
danielzyy/calhacks2025
43 files · 353 KB · @ f7cf006
Structure
Interface
1 file · 2%Screens, components and styles rendered to the user.
Application logic
32 files · 74%Domain rules, services and shared utilities.
+5 more
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python95%
- Markdown4%
- Shell0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 217- absl-py
- accelerate
- aiohappyeyeballs
- aiohttp
- aiosignal
- annotated-doc
- annotated-types
- anyio
- asttokens
- attrs
- av
- certifi
- cffi
- cfgv
- charset-normalizer
- click
- cloudpickle
- cmake
- +199 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
Camera-based object detection using AprilTags and OpenCVVerified
A camera identifies object locations using AprilTags and OpenCV, exposing type/position to the HCP layer
Claimed on Devposthigh confidencevision/tag_detections.py:138— Uses cv.aruco with DICT_APRILTAG_36h11 dictionary to detect AprilTags, computes tag centers/positions, and maps them to named Item objects (pepsi_cup, cookies_cup, lettuce_cup, base)vision/main.py:19— vision/main.py wires tag_detections into an HCPClient so a 'get_tags' HCP action returns getItemPositions() to the LLM layer
Custom TCP publish/subscribe networking stack for multi-node orchestrationVerified
Fully custom TCP networking stack under a pub/sub model enabling multi-node orchestration
Claimed on Devposthigh confidencehcp_client/main.py:214— start_server() runs a TCP socket server, accepts multiple client connections, tracks them in a dict, and has broadcast/send_to helpershcp_client/hcp_executor.py:89— execute_action sends action commands over the registered device's TCP connection
HCP SDK JSON-to-code generator for hardware nodesVerified
SDK lets user create a minimal JSON definition of a hardware node's actions, which bootstraps a TCP-networked client
Claimed on Devposthigh confidencehcp_sdk/hcp_sdk_gen.py:36— generate_device_code() reads a JSON spec (validated against hcp_sdk_schema.json) and emits a TCP HCPClient class for the devicehcp_sdk/hcp_sdk_schema.json:1— JSON schema defining device metadata and available_commands used to validate SDK input
LLM discovery/registration of hardware nodes and command execution via HCP schemaVerified
LLM goes through an initial discovery period where HCP nodes subscribe and pass context/schema; LLM can then call actions
Claimed on Devposthigh confidencehcp_client/main.py:342— CONNECTING state requests HCP_DATA from newly connected nodes and registers device metadata/commands with hcp_executorhcp_client/main.py:253— AI replies are parsed for a JSON action block (target_hardware/toolname/command_body) and dispatched via hcp.execute_action
LLM integration via ASI:One (Fetch.ai) APIVerified
asi:one used as the LLM backend for the agentic loop
Claimed on Devposthigh confidencehcp_client/asi1client.py:21— ASI1Client wraps https://api.asi1.ai/v1 chat completions, used in hcp_client/main.py for the chat loop
Setup instructions to install and run the project (venv, system deps, requirements.txt, LeRobot)Verified
README setup steps for creating a venv, installing system deps, and pip installing requirements, referencing LeRobot installation
Claimed on readmehigh confidencerequirements.txt:1— requirements.txt exists at repo root matching the README's pip install -r requirements.txt instruction
SOARM101/SOARM100 actuator hardware integration (joint angle commanding, teleop, autonomous mode)Verified
Integrated a robot arm (SOARM101 demo) to be controllable by the HCP SDK, with full teleop and autonomous modes
Claimed on Devposthigh confidenceactuator/actuator_layer.py:21— Mode enum (FULL_TELEOP, ELBOW_CONTROL_ONLY_TELEOP, AUTONOMOUS) and ActuatorLayer class connect to SO101Follower/SO101Leader (lerobot) and send joint position actionsexamples/teleop_learms.py:1— Example script using lerobot SO101 leader/follower teleop config, corroborating hardware integration
Voice-activated controlVerified
voice-activated autonomous chef robot
Claimed on Devpostmedium confidencehcp_client/chat_loop_voice.py:47— listen_to_speech uses SpeechRecognition/keyboard for push-to-talk voice input feeding into ASI1Client chathcp_client/main.py:41— main.py also supports --voice flag wiring listen_to_speech into the same command loop that drives hardware actions
Web-based visualizer/dashboard for HCP devices and requestsVerified
implied by 'context management' and general system dashboarding; not explicitly a top-line Devpost claim but part of demoed tooling
Claimed on readmemedium confidenceui/hcp_ui.py:1— Flask + SocketIO app rendering a device list, node canvas, and request log, with /api/log_request, /api/register_device, /api/log_response endpoints called from hcp_client/main.py
3DOF inverse kinematics solver with elbow up/down configurationsCode-supported
Custom single-link-chain IK model that solves for multiple manipulator configurations (elbow up/down), generalized in world-frame space
Claimed on Devpostmedium confidenceactuator/kinematics/arm_kinematics.py:13— compute_inverse_kinematics_elbow_desired_pos implements 2-link IK with an arctan2 formula that has two mathematical solutions, but the code comment says 'we take the elbow-up one (todo, mayb not?)' and only one branch (elbow-down sign) is actually returned, not a selectable elbow up/down configurationactuator/kinematics/arm_kinematics.py:39— compute_inverse_kinematics_at_desired_wrist_position adds wrist-angle handling on top of the 2-link IK for full end-effector position/orientation commanding
Custom simulator validating IK/FK and rejecting null-space solutionsCode-supported
A custom simulator was built to validate that null-space solutions are rejected and that forward/inverse kinematics yield sane results, with a figure of the simulator
Claimed on Devpostlow confidenceactuator/visualizer.py:1— A Visualizer class exists and is used by actuator_layer.py to plot joint angles, matching the 'figure of the simulator' claimactuator/kinematics/test_actuator.py:4— Only a single round-trip mech<->DH angle conversion test exists; no test or code explicitly validating null-space rejection or FK/IK sanity was found
Robot arm control for household serving tasks (making salads, grabbing snacks/ingredients)Code-supported
LLM interprets user's prompt about food and moves the arm to pick up ingredients to make a suitable dish
Claimed on Devpostmedium confidenceactuator/actuator_layer.py:163— run_autonomous() computes IK for a requested x/y/z target and issues joint commands to the SO101 follower arm, and vision/tag_detections.py labels detected items as food-related (pepsi_cup, cookies_cup, lettuce_cup)actuator/gen/SOARM100_ROBOT_ARM_hcp_support.py:1— Auto-generated HCP support file exposes robot arm commands over TCP, but no end-to-end code ties a specific LLM 'make a salad' prompt to a sequence of pick-and-place actions; this composition is only inferable, not directly demonstrated
Generic sensor abstraction easily expandable to other sensor typesClaimed only
The approach of publishing generic data can be easily expanded to any type of sensor in the future
Claimed on Devpostmedium confidenceModular ecosystem, standardized drivers, cloud orchestration, safety supervision (future roadmap)Claimed only
Next steps: expand HCP SDK into a modular ecosystem with standardized drivers, cloud-based orchestration, and real-time safety supervision layers
Claimed on Devposthigh confidence
An AI agent derived these features from the project’s Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.