This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
miniROS-rs is a lightweight, high-performance ROS2-compatible middleware written in Rust with Python bindings, following the "Mini" Philosophy: Maximum robotics performance, minimum complexity.
# Setup and installation
bash scripts/setup.sh # Complete setup
bash scripts/setup.sh build # Build CLIs only
bash scripts/setup.sh test # Test installation
# Build and test
cargo build # Build Rust components
cargo test # Run comprehensive unit tests
cd python && pip install -e . # Install Python bindings
cd python && pytest # Test Python bindings
# Run examples (progressive learning from basic to advanced)
cargo run --example 01_basic_pubsub # Basic pub/sub
cargo run --example 02_simple_service # Services
cargo run --example 20_production_system # Full production system
# CLI usage
cargo run --bin mini_ros -- launch <package> <launch_file>
cargo run --bin mini_ros -- pkg list
cargo run --bin mini_ros -- run <package> <executable>
mini_ros_py examples run <name> # Python examples
# Documentation
cd docs && mdbook serve # Serve documentation locallycargo test # Rust unit tests
cd python && pytest # Python tests with asyncio support
cargo run --example <example_name> # Test specific examples- src/core/: Node, Message, Context - fundamental building blocks
- src/communication/: Publisher/Subscriber, Services, Actions with async support
- src/transport/: Multiple transport layers (TCP default, DDS, Zenoh, UDP)
- src/system/: Discovery, Launch, Packages, Parameters, ROS2 Bridge, Plugin System
- src/types.rs: Complete ROS2-compatible message types with validation
- packages/: Built-in message packages (std_msgs, geometry_msgs, nav_msgs, sensor_msgs, etc.)
- python/: PyO3 bindings for Python integration
- TCP Transport: Default reliable transport
- DDS Transport: ROS2 compatibility layer (custom implementation)
- Zenoh Transport: High-performance alternative
- UDP Transport: Low-latency multicast option
- Auto-discovery of common robotics topics (
/cmd_vel,/odom,/scan) - Automatic message conversion between ROS2 and miniROS formats
- QoS profile mapping (reliability, durability, history)
- Bidirectional communication with existing ROS2 systems
- Specialized turtlebot integration
Extensible architecture with Plugin trait:
- CustomTransportPlugin: Transport implementations
- MonitoringPlugin: Metrics and health monitoring
- Lifecycle management (initialize, start, stop)
All messages include:
- Validation: Range checks, safety limits, covariance validation
- Serialization: Efficient binary format with bincode
- Schema: Runtime type checking and metadata
- ROS2 Compatibility: Drop-in replacement for ROS2 message types
YAML-based package manifests with:
- Dependencies and version management
- Python support flags
- Executable definitions with feature flags
- Launch file specifications
- Core Functionality Focus: Essential robotics primitives only
- Zero-Copy Optimizations: High-performance message passing
- Async-First: Full Tokio integration for concurrency
- Type Safety: Rust's type system prevents runtime errors
- ROS2 Compatibility: Seamless integration capability
- Minimal Dependencies: Lean dependency tree
- Actor Model: Nodes as independent actors with message passing
- Event-Driven: Async callbacks and reactive patterns
- Schema-Driven: Runtime type checking and validation
- Transport Abstraction: Common interface across transport layers
- Follow existing patterns in src/ directory structure
- Use async/await for all I/O operations
- Implement comprehensive error handling with custom Error types
- Add validation to all message types
- Maintain ROS2 compatibility in message structures
- Unit tests for all core functionality
- Integration tests for communication patterns
- Example-based testing for user-facing features
- Performance benchmarks for critical paths
- Default features:
["tcp-transport", "visualization"] - Optional features:
python,dds-transport, benchmarks - Core dependencies: tokio, serde, uuid, tracing, dashmap, bincode
- Python bindings: PyO3 with asyncio support
- Sub-millisecond message latency target
-
1000-10000 msgs/sec throughput depending on message type
- Zero-copy optimizations for large sensor data
- Efficient handling of 720-point LaserScans and image data