Skip to main content

Real-time safety guard pipeline for robot arms — clamp, reject, or fallback on unsafe actions.

Project description

DAM — Detachable Action Monitor

See where your policy breaks — before your hardware does.

PyPI Python 3.11+ Rust 1.80+ License: MPL 2.0 Discussions

Install · Quick Start · Isaac Sim · Architecture · Docs

https://github.com/user-attachments/assets/a10711ea-a419-4aee-ba06-de1e2d437d49

Install

pip install robot-dam            # includes torch, lerobot, mcap, dam-rs (Rust extension)
pip install robot-dam[isaac]     # + Isaac Sim 6.0 adapter
pip install robot-dam[full]      # + ROS2, REST API, QP solver, everything

Or from source:

git clone https://github.com/ez945y/DAM.git && cd DAM
make setup

What It Does

ML policies always output the next action — they have no idea when something is unsafe. DAM intercepts every action and evaluates it through a layered guard pipeline before it reaches hardware. Each action is either passed, clamped (adjusted to stay safe), or rejected.

The goal isn't to hide failures. It's to make them visible and easier to understand.

System Architecture

Important: DAM is experimental research software, not a certified safety system.


Quick Start

git clone https://github.com/ez945y/DAM.git
cd DAM
make setup    # Python venv + Rust extension + npm install (~3 min)
make run      # Backend :8080 + Console :3000

Open http://localhost:3000 — the demo Stackfile replays a dataset through the full guard pipeline without hardware.

CLI

.venv/bin/dam doctor                                # check environment
.venv/bin/dam callbacks                             # list 18 built-in safety checks
.venv/bin/dam validate examples/stackfiles/*.yaml   # schema-check Stackfiles
.venv/bin/dam run examples/stackfiles/demo.yaml --cycles 200 --task demo

Make Targets

Command What it does
make setup First-time install (venv + Rust + npm)
make run Backend + pre-built frontend
make dev Backend + frontend with hot-reload
make test Full test suite (688+ Python tests + 109 frontend tests)
make record Safe IL recording with DAM guards
make callbacks List all 18 built-in safety checks
make validate Validate example Stackfiles

Safe Recording for Imitation Learning

During data collection, DAM smooths motions and catches bad data before it enters your dataset. Integrates with LeRobot — one file configures hardware, safety boundaries, and recording.

make record                                # reads examples/stackfiles/safety.yaml
make record ARGS="--dataset.num_episodes=20"   # CLI args override YAML

Python API (3 levels)

import dam

# Level 1: one-liner (notebooks)
safe_action = dam.safe(action, obs, stackfile="safety.yaml")

# Level 2: stateful guard (recording loops + Isaac Sim)
guard = dam.SafetyGuard("safety.yaml", task="record")
safe_action = guard(action, obs)  # dict → dict, ndarray → ndarray, Tensor → Tensor

# Level 3: lerobot pipeline (one line addition)
from dam import SafetyProcessorStep
robot_action_processor.steps.insert(0, SafetyProcessorStep("safety.yaml"))
Runtime Workflow

The recorded dataset contains only safe actions — your policy trains on data that already respects physical constraints. See Safe Recording Guide for full details.


Isaac Sim Integration

DAM works as a drop-in safety filter for Isaac Sim 6.0+ control loops. Accepts and returns torch.Tensor on any device — no CPU↔GPU copies needed.

import dam
from dam.adapter.isaac import IsaacSafetyFilter

# Single env — SafetyGuard accepts torch.Tensor directly
guard = dam.SafetyGuard("franka_safety.yaml", task="manipulation")
safe_action = guard(action_tensor, obs_tensor)  # same device/dtype

# Multi-env (Isaac Lab) — vectorized filter
filt = IsaacSafetyFilter("franka_safety.yaml", task="manipulation", num_envs=4096)
safe_actions = filt(actions_batch, obs_batch)    # (N, J) → (N, J)

# Auto-detect from ArticulationView
filt = IsaacSafetyFilter.from_articulation(franka_view, "franka_safety.yaml")

Bundled presets: so101_follower, franka_emika_panda. See examples/isaac_franka_demo.py for the full demo.


Architecture

Guard Layers

Layer What it checks Example checks
L0 OOD Detection Is the observation in-distribution? Real-NVP / Memory Bank anomaly scoring
L1 Physical Kinematics Can this move physically happen? Joint limits, workspace bounds, velocity caps
L2 Task Execution Does this make sense for the task? Gripper sequence, progress enforcement
L3 Hardware Monitoring Is the hardware healthy? Temperature, current, voltage, heartbeat

L0 and L1 run in parallel. The final decision is the most restrictive outcome across all active layers.

Stackfile Configuration

Everything is configured in a YAML Stackfile:

boundaries:
  joint_position_limits:
    layer: L1
    type: single
    nodes:
      - callback: joint_position_limits
        params:
          upper: [1.8243, 1.7691, 1.8326, 1.8067, 3.0741, 1.7453]
          lower: [-1.8243, -1.7691, -1.8326, -1.8067, -3.0741, 0.0]

Start from examples/stackfiles/minimal.yaml or see the Stackfile Walkthrough.

18 Built-in Safety Checks

Run dam callbacks to list them all:

  • L0: OOD detector (Real-NVP, Memory Bank, Welford)
  • L1: Joint position/velocity limits, workspace bounds, keep-out zones, orientation, geofence, Cartesian velocity, smoothness
  • L2: Task gripper sequence enforcement
  • L3: Temperature, current, voltage, force/torque, hardware watchdog, host health

Documentation

Goal Start here
Learn DAM step by step Learn DAM
Read a Stackfile Stackfile Walkthrough
Common config edits Common Stackfile Edits
Understand the console Console Walkthrough
Prepare for hardware Hardware Readiness
Troubleshooting Troubleshooting

Contributing

See Contributing. We welcome safety testing, hardware adapters, performance optimization, and example Stackfiles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robot_dam-0.6.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robot_dam-0.6.0-py3-none-any.whl (326.7 kB view details)

Uploaded Python 3

File details

Details for the file robot_dam-0.6.0.tar.gz.

File metadata

  • Download URL: robot_dam-0.6.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for robot_dam-0.6.0.tar.gz
Algorithm Hash digest
SHA256 98b0d5acf2b7d1c8c62f289247cbe8c2d3a5ff278fa6600c32e0a1aed985dc9b
MD5 2b15eadd1b1372706a7af65bb758a687
BLAKE2b-256 706535567d9fb054160ccdb63961397589cdc16bb26c9585779f7e93dc3986b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for robot_dam-0.6.0.tar.gz:

Publisher: release.yml on ez945y/DAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file robot_dam-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: robot_dam-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 326.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for robot_dam-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7cb0bc74b0584c8aa8e9171c65db1141d5db33d46d9029fe17ca37318aab179
MD5 cdcc019c2f6879cdb6c82f66ead3ec40
BLAKE2b-256 7cb3889bd06e9c7408ec240cc7f5499101820d784624513f21e1823704fcc728

See more details on using hashes here.

Provenance

The following attestation bundles were made for robot_dam-0.6.0-py3-none-any.whl:

Publisher: release.yml on ez945y/DAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page