Skip to content

EdgeFirstAI/samples

EdgeFirst Perception Middleware Samples

Build Status License EdgeFirst Studio

Ready-to-run examples for working with EdgeFirst Perception Middleware topics.

This repository provides sample applications demonstrating how to subscribe to and process topics from EdgeFirst Perception Middleware—a modular edge AI platform for vision, LiDAR, radar, and sensor fusion on embedded Linux devices.

Quick Links: Developer GuideLatest ReleaseContributing


Quick Start

Download Pre-Built Binaries

Download the ZIP file for your platform from the latest release:

Platform Download
Linux x86_64 edgefirst-samples-linux-x86_64.zip
Linux aarch64 edgefirst-samples-linux-aarch64.zip
macOS Intel edgefirst-samples-macos-x86_64.zip
macOS Apple Silicon edgefirst-samples-macos-aarch64.zip
Windows x86_64 edgefirst-samples-windows-x86_64.zip

Extract the archive and navigate to the directory:

unzip edgefirst-samples-linux-x86_64.zip
cd edgefirst-samples-linux-x86_64

Running the Samples

All samples support both local (on-device) and remote (over network) connections:

# Local mode - auto-discovers topics on EdgeFirst device
./list-topics

# Remote mode - connect to EdgeFirst device at specific IP
./list-topics --remote 192.168.1.100:7447

Note: When running remotely, ensure the Zenoh router (zenohd) is enabled on the EdgeFirst device with sudo systemctl enable --now zenohd.



What is EdgeFirst Perception?

The EdgeFirst Perception Middleware is a modular software stack for edge AI applications, built as a collection of services communicating over Zenoh—a high-performance pub/sub middleware. Each service focuses on a specific task:

  • Camera Service: Interfaces with cameras and ISPs, delivers raw frames, handles H.264/H.265/JPEG encoding
  • Vision Models: Runs ML inference for object detection, segmentation, and tracking
  • LiDAR/Radar Services: Processes point clouds, depth maps, and target tracking
  • Fusion Service: Combines data from multiple sensors (camera + LiDAR + radar) for 3D scene understanding
  • Recorder: Captures topics to MCAP files for EdgeFirst Studio or Foxglove playback

Services communicate using ROS2 CDR (Common Data Representation) serialization with Zenoh topics, ensuring interoperability with ROS2 tools while leveraging Zenoh's efficiency.

graph LR
    camera[Camera Service] --> model[Vision Model]
    camera --> fusion[Fusion Service]
    lidar[LiDAR Service] --> fusion
    radar[Radar Service] --> fusion
    model --> fusion
    imu[IMU] --> zenoh[Zenoh Topics]
    gps[GPS] --> zenoh
    camera --> zenoh
    model --> zenoh
    fusion --> zenoh
    lidar --> zenoh
    radar --> zenoh
    zenoh --> recorder[Recorder] --> mcap[MCAP Files]
    zenoh --> apps[Your Applications]
Loading

These samples demonstrate how to subscribe to EdgeFirst Perception topics, deserialize messages, and process sensor data in your own applications.


Sample Applications

🔍 1. List Topics - "Hello World" Example

Purpose: Discover and display all available topics on an EdgeFirst device.

Source Code: RustPython

This is the simplest starting point—it connects to the Zenoh network and lists all published topics under the rt/ namespace. Use this to verify connectivity and see what data sources are available.

Usage:

# Local discovery
./list-topics

# Remote connection
./list-topics --remote 192.168.1.100:7447

Topics Discovered:

  • rt/camera/image - Camera frames
  • rt/model/boxes2d - Object detection results
  • rt/lidar/points - LiDAR point clouds
  • rt/radar/targets - Radar detections
  • And many more...

🎥 2. Mega Sample - Complete Vision Pipeline Demo

Purpose: Demonstrates the core EdgeFirst Perception workflow—live camera feed with real-time object detection and segmentation.

Source Code: RustPython

This is the most comprehensive example, showcasing EdgeFirst's edge vision capabilities. It subscribes to multiple topics simultaneously:

  • Camera H.264 stream (rt/camera/h264) - Decodes and displays live video
  • Detection boxes (rt/model/boxes2d) - Overlays bounding boxes on detected objects
  • Segmentation masks (rt/model/mask) - Shows pixel-level classification
  • 3D fusion output (rt/fusion/boxes3d) - Multi-sensor 3D object tracking (optional)
  • GPS location (rt/gps) - Device location on map (optional)

Usage:

# Run with Rerun visualization (recommended)
./mega-sample

# Remote connection
./mega-sample --remote 192.168.1.100:7447

What You'll See:

  • Real-time video feed from the camera
  • Bounding boxes around detected objects (people, vehicles, etc.)
  • Segmentation overlay showing classified regions
  • 3D point cloud with fused sensor data (if LiDAR/radar enabled)
  • GPS map position (if GPS available)

This example shows the power of running vision models at the edge—low-latency ML inference with synchronized multi-sensor fusion, all processed on embedded hardware.


📷 3. Camera Examples - Image Acquisition

Purpose: Demonstrate different camera topic subscriptions and image handling methods.

Why Separate Examples? While mega-sample shows the complete pipeline, these focused examples help you understand camera-specific topics in isolation.

Camera DMA (Zero-Copy Buffers)

Source: RustPython
Topic: rt/camera/dma
Message: DmaBuf

Linux-only example showing high-performance zero-copy camera access using DMA buffers. This is the fastest way to access camera frames with minimal CPU overhead—ideal for real-time processing.

./camera-dma  # Must run on EdgeFirst device

Camera H.264 Stream

Source: RustPython
Topic: rt/camera/h264
Message: CompressedVideo

Decodes H.264-encoded camera streams. Works remotely and reduces network bandwidth.

./camera-h264 --remote 192.168.1.100:7447

Camera Info

Source: RustPython
Topic: rt/camera/info
Message: CameraInfo

Retrieves camera calibration and configuration (resolution, distortion parameters, frame rate).

./camera-info

🤖 4. Model Examples - ML Inference Results

Purpose: Subscribe to vision model outputs (object detection, segmentation, tracking).

These examples focus solely on processing ML inference results without the camera feed, making it easier to understand model output handling.

2D Bounding Boxes

Source: RustPython
Topic: rt/model/boxes2d
Message: BoundingBox2DArray

Displays detected objects with class labels, confidence scores, and bounding box coordinates.

./model-boxes

Tracked Objects

Source: RustPython
Topic: rt/model/boxes2d_tracked
Message: BoundingBox2DArray

Shows object tracking with persistent IDs across frames.

./model-boxes_tracked

Segmentation Masks

Source: RustPython
Topic: rt/model/mask
Message: Mask

Processes pixel-level semantic segmentation results.

./model-mask

Compressed Masks

Source: RustPython
Topic: rt/model/compressed_mask
Message: CompressedMask

Handles ZSTD-compressed segmentation masks for reduced bandwidth.

./model-compressed_mask

Model Info

Source: RustPython
Topic: rt/model/info
Message: ModelInfo

Retrieves model metadata (name, type, input/output dimensions, class labels).

./model-info

📡 5. Radar Examples - Target Tracking

Purpose: Process radar detections, clusters, and range-Doppler-azimuth data.

Radar Targets

Source: RustPython
Topic: rt/radar/targets
Message: PointCloud2

Displays detected radar targets as 3D points with velocity information.

./radar-targets

Radar Clusters

Source: RustPython
Topic: rt/radar/clusters
Message: PointCloud2

Shows clustered radar detections for object-level tracking.

./radar-clusters

Radar Cube

Source: RustPython
Topic: rt/radar/cube
Message: RadarCube

Processes raw range-Doppler-azimuth radar cube data.

./radar-cube

Radar Info

Source: RustPython
Topic: rt/radar/info
Message: RadarInfo

Retrieves radar configuration (range resolution, field of view, update rate).

./radar-info

🔍 6. LiDAR Examples - Point Cloud Processing

Purpose: Handle LiDAR point clouds, depth images, and clustering.

Point Clouds

Source: RustPython
Topic: rt/lidar/points
Message: PointCloud2

Visualizes 3D LiDAR point clouds.

./lidar-points

Depth Images

Source: RustPython
Topic: rt/lidar/depth
Message: Image

Converts LiDAR data to 2D depth map representation.

./lidar-depth

LiDAR Clusters

Source: RustPython
Topic: rt/lidar/clusters
Message: PointCloud2

Shows segmented point cloud clusters (e.g., individual objects or ground plane).

./lidar-clusters

Reflectivity

Source: RustPython
Topic: rt/lidar/reflect
Message: Image

Displays LiDAR intensity/reflectivity data as a 2D image.

./lidar-reflect

🔗 7. Fusion Examples - Multi-Sensor Integration

Purpose: Combine camera, LiDAR, and radar data for comprehensive scene understanding.

3D Bounding Boxes

Source: RustPython
Topic: rt/fusion/boxes3d
Message: BoundingBox3DArray

3D object detections fused from multiple sensors.

./fusion-boxes3d

Occupancy Grids

Source: RustPython
Topic: rt/fusion/occupancy
Message: OccupancyGrid

2D occupancy map for navigation and obstacle avoidance.

./fusion-occupancy

Fused Model Output

Source: RustPython
Topic: rt/fusion/model_output
Message: Detect

Combined detection results from vision models and sensor fusion.

./fusion-model-output

Fused Radar

Source: RustPython
Topic: rt/fusion/radar
Message: PointCloud2

Radar data transformed into camera coordinate frame.

./fusion-radar

Fused LiDAR

Source: RustPython
Topic: rt/fusion/lidar
Message: PointCloud2

LiDAR point cloud projected into camera perspective.

./fusion-lidar

🧭 8. Navigation Examples - IMU and GPS

Purpose: Access inertial measurement and positioning data.

IMU Data

Source: RustPython
Topic: rt/imu
Message: Imu

Reads accelerometer, gyroscope, and orientation data.

./imu

GPS Fix

Source: RustPython
Topic: rt/gps
Message: NavSatFix

Displays GPS latitude/longitude coordinates and fix quality.

./gps

Visualization

Most examples support visualization using the Rerun framework, providing:

  • On-device or remote visualization
  • Recording for later playback (.rrd files)
  • Time-series and spatial data views
  • Multi-sensor synchronized visualization

Enable Rerun with the --features rerun flag when building Rust examples.

Alternative integrations:

  • MCAP Recorder: Record topics to MCAP files → Documentation
  • Foxglove Studio: ROS2-compatible visualization → Guide
  • EdgeFirst Studio: Publish recordings for MLOps workflows → Platform
  • Maivin WebUI: JavaScript/HTML interface → GitHub

Building from Source

Prerequisites

Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Python:

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Clone and Build

git clone https://github.com/EdgeFirstAI/samples.git
cd samples

# Build all Rust examples (release mode)
cargo build --release --all-targets

# Build with Rerun visualization support
cargo build --release --all-targets --features rerun

# Run any example
cargo run --bin list-topics --release

# Python examples (no build required)
python python/list_topics.py

Building for Specific Targets

# Linux aarch64 cross-compilation
rustup target add aarch64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu

# macOS Apple Silicon
cargo build --release --target aarch64-apple-darwin

# Windows
cargo build --release --target x86_64-pc-windows-msvc

Documentation

Examples Overview

Category Rust Examples Python Examples Description
Discovery list-topics list_topics.py Topic discovery
Combined mega-sample combined/mega_sample.py Complete vision pipeline demo
Camera camera-dma, camera-h264, camera-info camera/dma.py, camera/h264.py, camera/camera_info.py Camera streams and calibration
ML Models model-boxes, model-mask, model-boxes_tracked, model-info model/boxes2d.py, model/mask.py, model/boxes2d_tracked.py Object detection, segmentation, tracking
Radar radar-targets, radar-clusters, radar-cube, radar-info radar/targets.py, radar/clusters.py, radar/cube.py Radar detections and processing
LiDAR lidar-points, lidar-depth, lidar-clusters, lidar-reflect lidar/points.py, lidar/depth.py, lidar/clusters.py Point clouds and depth imaging
Fusion fusion-boxes3d, fusion-occupancy, fusion-lidar, fusion-radar, fusion-model-output fusion/boxes3d.py, fusion/occupancy.py, fusion/lidar.py Multi-sensor integration
Navigation imu, gps imu.py, gps.py Inertial and positioning data

Support

Community Resources

EdgeFirst Ecosystem

  • EdgeFirst Studio: MLOps platform for edge AI model deployment
  • EdgeFirst Modules: Pre-built perception modules
  • Hardware Platforms:
    • Maivin: Edge AI development platform
    • Raivin: Automotive-grade edge AI platform

Commercial Support

Au-Zone Technologies offers commercial support services:

  • Training & Workshops: EdgeFirst development training
  • Custom Development: Tailored perception pipelines
  • Integration Services: Platform-specific integration
  • Enterprise Support: Priority support and SLAs

Contact: support@au-zone.com

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Development setup instructions
  • Code style guidelines
  • Pull request process
  • Testing requirements

All contributors must adhere to our Code of Conduct.

Security

For security vulnerability reports, please see our Security Policy.

Do not report security issues via public GitHub issues.

License

This project is licensed under the Apache License 2.0 - see LICENSE for details.

Copyright © 2025 Au-Zone Technologies. All Rights Reserved.

Third-party dependencies are listed in NOTICE with their respective licenses.

Acknowledgments

Built with:

  • Zenoh - High-performance pub/sub middleware
  • Rerun - Visualization framework
  • Rust - Systems programming language
  • The EdgeFirst team and open source contributors

EdgeFirst is a trademark of Au-Zone Technologies.
For more information, visit https://au-zone.com/

About

EdgeFirst Middleware Samples

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors