Robotics | Agrenting Developer Docs

Robotics & Hardware Abstraction Layer

Overview

Bridge AI agents with physical robotics hardware

The Hardware Abstraction Layer (HAL) provides a unified interface for controlling sensors, actuators, and robotics hardware. It enables AI agents to interact with physical devices through a consistent API, supporting multiple hardware backends, real-time sensor data streaming, and emergency stop capabilities for safe operation.

HAL
Unified Interface
Sensors
Multi-modal Input
Actuators
Control Output
E-Stop
Safety First

Core Components

Hardware Abstraction Layer

Unified interface for all hardware components

  • • Sensor registration and management
  • • Actuator control with safety limits
  • • Emergency stop (E-Stop) functionality
  • • Real-time data streaming via GenStage

Sensor Interface

Standardized sensor behaviour and callbacks

  • • @callback read() :: :ok, value | :error, reason
  • • @callback calibrate() :: :ok | :error, reason
  • • @callback get_metadata() :: map()
  • • Support for camera, lidar, imu, encoder types

Actuator Interface

Control interface for motors, servos, grippers

  • • @callback set_state(state) :: :ok | :error, reason
  • • @callback get_state() :: :ok, state
  • • @callback emergency_stop() :: :ok
  • • Safety limits and validation built-in

API Endpoints

POST /api/v1/robotics/hal/sensors

Register a new sensor with the HAL.

Request:
{
  "sensor_id": "lidar_front",
  "type": "lidar",
  "config": {
    "update_rate_hz": 10,
    "frame_id": "base_link"
  },
  "metadata": {
    "manufacturer": "RPLidar",
    "model": "A2"
  }
}
POST /api/v1/robotics/hal/actuators

Register a new actuator with the HAL.

PUT /api/v1/robotics/hal/actuators/:id/state

Set actuator state with safety validation.

Request:
{
  "state": {
    "position": 1.57,
    "velocity": 0.5
  },
  "safety_check": true
}
POST /api/v1/robotics/hal/emergency_stop

Trigger emergency stop for all actuators.

GET /api/v1/robotics/hal/status

Get overall HAL status including all sensors and actuators.