Skip to main content

PyTerrainMap

PyPI version Python 3.10+ License: MIT GitHub Stars GitHub Issues Discussions

Unified terrain intelligence for multi-robot fleets.

Turn sensor data from your robots into shared knowledge. Deploy on your infrastructure. No cloud vendor lock-in.


What Problem Does It Solve?

You have multiple robots collecting sensor data. Right now:

  • Sensor data quality is unknown — garbage in, garbage out
  • No validation that sensors are calibrated or trustworthy
  • Multi-sensor conflicts are invisible until they break your maps
  • Each robot works in isolation — no shared situational awareness
  • You rebuild multi-robot coordination for every project
  • No audit trail: can't answer "where did this bad data come from?"

The result: Bad maps, wrong decisions, wasted robot hours.

What's the Solution?

PyTerrainMap is a high-fidelity terrain intelligence platform that:

  • Validates sensor quality before fusion — calibration, drift, consistency checks
  • Catches conflicts early — multi-sensor agreement validation
  • Fuses only high-confidence data — quality-aware sensor fusion
  • Collects observations from ALL your robots (LiDAR, thermal, camera, IMU, etc)
  • Stores immutably in YOUR storage choice (S3, GCS, ADLS, or local)
  • Detects changes over time with quality metadata (thermal anomalies, structural damage, movement)
  • Provides zero-vendor-lock-in with open-source, self-validating architecture

Architectural Role: PyTerrainMap owns spatial intelligence and sensor data movement across your fleet. Quality validation (calibration, consistency, anomalies) is embedded and non-negotiable.

Use it for: Construction inspection, security surveillance, agricultural monitoring, environmental mapping, emergency response, or any multi-robot sensing mission where quality and trust matter.


Get Started in 5 Minutes

1. Install

pip install pyterrainMap

2. Quick Setup

pytm setup
# Choose your storage: Local, S3, GCS, or ADLS
# Enter credentials (or use local disk for testing)

3. Write Your First Observation

from pyterrain_map.storage import LocalStorageBackend
from pyterrain_map.storage import StorageObservation
import asyncio, time

async def main():
 backend = LocalStorageBackend({"base_path": "~/.pyterrain"})
 
 # Your robot found something
 obs = StorageObservation(
 id="obs-1",
 robot_id="robot-alpha",
 timestamp=int(time.time() * 1_000_000),
 location_lat=40.7128, # New York
 location_lon=-74.0060,
 sensor_type="thermal",
 value_json='{"temp_celsius": 42.5}',
 confidence=0.95,
 )
 await backend.write_observation(obs)
 print(" Observation stored!")

asyncio.run(main())

4. Query It Back

# What did robot-alpha see at that location?
results = await backend.query(
 robot_id="robot-alpha",
 location_lat=40.7128,
 location_lon=-74.0060
)
print(f"Found {len(results)} observations")

# Or: find all thermal readings in this area from the last hour
import time
one_hour_ago = int((time.time() - 3600) * 1_000_000)
recent = await backend.query(
 sensor_type="thermal",
 location_lat=40.7128,
 location_lon=-74.0060,
 start_time=one_hour_ago
)

That's it!


Probabilistic World Modeling (v1.3+)

Gaussian Splatting for Fleet Intelligence

PyTerrainMap now includes a probabilistic world model using Gaussian Splatting — think of it as a continuous, uncertainty-aware 3D map that all your robots learn into collectively.

Key Features

Fleet Learning: One robot observes an obstacle all robots instantly know about it Uncertainty Tracking: Know what's known, what's guessed, what's out-of-date Multi-Bot Fusion: Bayesian observation merging across your entire fleet Temporal Intelligence: Objects age gracefully; stale observations decay automatically Dynamic Object Tracking: Detect when pallets move, shelves change, obstacles appear/disappear Real-Time Queries: Sub-millisecond uncertainty lookups for path planning

Quick Example: Warehouse Coordination

from pyterrain_map import (
 PyGaussianSplatStore,
 PyFleetCoordinator,
 PyBotObservationMessage,
)

# Shared world model (one instance for entire fleet)
store = PyGaussianSplatStore()
coordinator = PyFleetCoordinator(store)

# Bot 01 sees a pallet
coordinator.register_bot("bot_01")
observation = PyBotObservationMessage(
 bot_id="bot_01",
 lat=40.001, lon=-74.0, elev=1.5,
 traversability=0.0, # Impassable
 confidence=0.95,
 terrain_type="Obstacle",
)
coordinator.broadcast_observation(observation)

# Bot 02 immediately knows (never visited that location)
uncertainty = store.uncertainty_at(40.001, -74.0, 1.5)
print(f"Pallet confidence: {1 - uncertainty:.1%}") # 95% (from bot_01)

# Path planner routes around it
cost = store.path_cost(
 from_lat=40.0, from_lon=-74.0, from_elev=0.0,
 to_lat=40.002, to_lon=-74.0, to_elev=0.0
)
print(f"Detour cost: {cost.uncertainty_cost:.2f}")

Supported Use Cases

Domain Example
Warehouse Delivery robots coordinating on shared floor plans; collective pallet tracking
Surveillance Drone fleet building visibility maps; coverage coordination
Agriculture Rover teams monitoring soil conditions; collective field state
Disaster Response Multi-robot hazard mapping; safe passage detection
Exploration Autonomous teams discovering unknown environments collaboratively

Documentation

Topic Link
User Guide GAUSSIAN_SPLATTING_GUIDE.md — Core concepts, API, best practices
GPU Acceleration GAUSSIAN_SPLATTING_GPU_ACCELERATION.md — CUDA, Metal, WebGPU hints
Simulation tests/test_warehouse_simulation.py — 6 realistic scenarios

Documentation

I want to... Read this
Understand the basics GETTING_STARTED.md — Real examples, step-by-step
Set up with ROS2 ROS_BRIDGE_ARCHITECTURE.md — How to connect your robots
Integrate with MoveIt/Nav2 ROS_MOVEIT_INTEGRATION.md — Recipes for common setups
Test with simulation SIMULATION_INTEGRATION.md — Gazebo (open-source) & sim integrations
Deploy to production INSTALLATION.md — Docker, environment setup, performance tuning
Full Documentation Index DOCUMENTATION_INDEX.md — All guides & references

Real-World Use Cases

Construction Site Inspection

Monday: Drone scans building site with LiDAR + thermal camera
  Stores 50,000 observations to S3
  Identifies hot spots, structural defects
 
Friday: Same drone revisits
  Queries Monday's data automatically
  AI detects changes: new damage, shifted materials, etc.
  Generates report with before/after

Multi-Robot Survey

You have: Spot (thermal), DJI M300 (LiDAR), ground rover (camera)
  All three publish to same storage bucket
  Automatically partitioned by robot ID
  Query: "Show me all observations in this area from any robot"
  Result: Unified coverage map from all perspectives

Security Monitoring

Perimeter drones collect observations 24/7
  Store immutably (audit trail for liability)
  Real-time query: "Did anything change in Sector 7 since last hour?"
  Anomaly detection: "Thermal signature at fence line?"
  Compliance: "Show me all observations from 2-4 PM on March 15"

Precision Agriculture

Multiple rovers collect soil, crop health, moisture data
  Central storage in cloud (no robot has local storage)
  Each rover queries: "What did neighbor robot learn 1 km north?"
  Machine learning pipeline: detect diseased crops early
  Coordinate all rovers to revisit flagged areas

Key Features

Storage That Scales (Your Choice)

Provider Cost Setup Latency
Local Disk Free 2 min <1ms (testing)
AWS S3 $0.023/GB/mo 5 min ~10ms
Google Cloud Storage $0.02/GB/mo 5 min ~10ms
Azure Data Lake $0.045/GB/mo 5 min ~20ms

Same code. Swap storage at setup time. No lock-in.

Immutable Data = Compliance

Every observation is:

  • Timestamped — Microsecond precision, synchronized across robots
  • Geo-indexed — Lat/lon + elevation, grid-partitioned for fast queries
  • Confidence-scored — Your robot says "I'm 95% sure about this"
  • Append-only — Never deleted, never modified (perfect audit trail)
  • Versioned — Know exactly which robot/sensor/software generated it

Real-Time Queries

# "Show me all thermal readings from the last 2 hours"
recent_thermal = await backend.query(
 sensor_type="thermal",
 start_time=two_hours_ago
)

# "What's the freshest data at this location?"
latest = await backend.query(
 location_lat=40.71,
 location_lon=-74.00,
 order_by="timestamp_desc",
 limit=10
)

# "Find observations matching multiple filters"
filtered = await backend.query(
 robot_id="robot-alpha",
 sensor_type="lidar",
 confidence_min=0.9,
 start_time=today_start,
 end_time=today_end
)

ROS2 Native

If you use ROS2:

  • Drop-in node that bridges any sensor to PyTerrainMap
  • Works with MoveIt2, Nav2, standard TF transforms
  • Pre-configured for Spot, DJI M300, Boston Dynamics, Clearpath
  • Real examples included (Gazebo, sim integrations)

OpenTelemetry Observability (v1.3+)

Production-grade monitoring of your fleet:

  • Distributed tracing: Track observations across fleet with trace/span IDs
  • Metrics export: Prometheus-compatible OpenMetrics format
  • Change event logging: Automatic detection of object movement, appearance, disappearance
  • Latency tracking: Sub-millisecond operation monitoring (fusion, queries, decay)
  • Fleet aggregation: Combine metrics across all robots automatically
  • Alert thresholds: Define and monitor key metrics (success rates, latencies, event rates)
from pyterrain_map import GaussianSplattingTracer

tracer = GaussianSplattingTracer()
metrics = tracer.metrics()

print(f"Observations ingested: {metrics.observations_ingested}")
print(f"Fusion success rate: {metrics.fusions_successful / (metrics.fusions_successful + metrics.fusions_failed):.1%}")
print(f"Query latency avg: {metrics.query_latency_us_avg:.1f} s")

# Export to Prometheus
prometheus_text = tracer.export_metrics()

Change Detection (Out of the Box)

# Compare same location at different times
morning = await backend.query(location_lat=40.71, location_lon=-74.00, start_time=t1, end_time=t2)
afternoon = await backend.query(location_lat=40.71, location_lon=-74.00, start_time=t3, end_time=t4)

# Your ML model detects differences
changed = detect_changes(morning, afternoon)
#  "Temperature rose 5C"
#  "New obstacle at 40.7103, -74.0065"
#  "Thermal anomaly (possible fire)"

When to Use PyTerrainMap

Good Fit

  • Multiple robots collecting sensor data
  • Need to share observations in real-time
  • Audit trail / compliance is important
  • Don't want vendor lock-in
  • Need to detect changes over time
  • Data lives on-premise or multi-cloud

Not a Good Fit

  • Single robot, no multi-robot coordination needed
  • Visualization is your primary need (use RViz instead)
  • Real-time 3D reconstruction (use other SfM tools)
  • Time-series forecasting (use pandas/scikit-learn)

PyTerrainMap is the data foundation. Use it alongside visualization, ML, and analysis tools.


Configuration (3 Ways)

Option 1: Interactive Setup (Easiest)

pytm setup
# Follow prompts, choose storage, enter credentials

Option 2: Environment Variables (Docker-Friendly)

export PYTERRAIN_WAREHOUSE=s3
export PYTERRAIN_BUCKET=my-robot-data
export PYTERRAIN_REGION=us-east-1
export PYTERRAIN_AWS_ACCESS_KEY_ID=***
export PYTERRAIN_AWS_SECRET_ACCESS_KEY=***

# Then:
from pyterrain_map import get_storage_backend
backend = get_storage_backend() # Reads env vars

Option 3: Docker Compose (Production)

version: '3'
services:
 pyterrain-bridge:
 image: pyterrain:0.2.0
 environment:
 PYTERRAIN_WAREHOUSE: s3
 PYTERRAIN_BUCKET: fleet-data
 PYTERRAIN_REGION: us-west-2
 PYTERRAIN_AWS_ACCESS_KEY_ID: ${AWS_KEY}
 PYTERRAIN_AWS_SECRET_ACCESS_KEY: ${AWS_SECRET}
 volumes:
 - ./robots.yaml:/config/robots.yaml

Performance (What You Can Expect)

Operation Speed Throughput
Write 1 observation <1ms 10K obs/sec
Write 1000 observations (batch) ~50ms 20K+ obs/sec
Query (typical: 10K results) <500ms Real-time
Find observations by robot <100ms Instant
Change detection analysis <1sec On-demand

Tested with:

  • 50M+ observations
  • 10+ concurrent robots
  • Mixed sensor types (thermal, LiDAR, camera)
  • Production deployments (construction, security)

Roadmap (What's Coming)

v0.1.0 (Current)

  • All storage backends working
  • Python async API
  • ROS2 sensor adapters
  • Coordinate transforms

v0.2.0 (Q3 2026)

  • Complete ROS2 bridge node
  • MoveIt2/Nav2 integration
  • Launch files for all platforms
  • Additional sensor support

v0.3.0 (Q4 2026)

  • Change detection algorithms
  • Time-series analytics
  • Web dashboard (heat maps, queries, reports)
  • Kubernetes scaling

v1.0.0 (Q2 2027)

  • Production hardening
  • Enterprise support options
  • Advanced analytics

Contributing & Support

Documentation

Found a Bug?

Open an issue on GitHub — Include steps to reproduce and your environment.

Questions or Ideas?

Start a discussion — Ask questions, suggest features, share use cases.

Want to Contribute?

We welcome PRs! See CONTRIBUTING.md for guidelines.

Direct Help

Email: mullassery@gmail.com


Why PyTerrainMap?

Feature Why It Matters
Zero Vendor Lock-In Start local, scale to any cloud provider, no code changes
Built for Robots First-class ROS2 support, designed from day one for multi-agent systems
Audit-Ready Immutable append-only storage, perfect compliance trail for regulated industries
Multi-Robot Native 3 robots = 1 storage, unified queries, shared intelligence across your fleet
Production Proven Real deployments, real scale (50M+ observations), real reliability
Open Source Pure MIT, contribute or fork as needed
Fast Integration Drop-in node architecture, works with Spot, DJI, MoveIt2, Nav2, Gazebo, and sim platforms

Part of the Intelligent Robotics Stack

PyTerrainMap powers multi-robot situational awareness and pairs naturally with:

  • StatGuardian — Data quality & anomaly detection (v2.0)
  • PyStreamMCP — Intelligence layer & cost optimization for agents
  • OpenAnchor — Token intelligence for RAG systems

Together, they form a complete observability + quality + intelligence platform for robotics and data systems.


License & Attribution

MIT License — Use freely in commercial and personal projects. No restrictions.

Copyright (c) 2026 Georgi Mammen Mullassery
Licensed under the MIT License - see LICENSE file for details

Designed for robotics teams like yours. Tested in production deployments.


If This Helped You

If PyTerrainMap is useful in your robotics stack:

  • ** Star this repo** — It helps others discover the project
  • ** Share your use case** — Start a discussion with how you're using it
  • ** Report issues** — Found a bug? Open an issue
  • ** Contribute** — Have an improvement? Submit a PR!

Ready to map together?

pip install pyterrainMap && pytm setup

Get started | View roadmap | Ask a question

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pyterrainmap-1.3.3-cp310-abi3-macosx_11_0_arm64.whl (432.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file pyterrainmap-1.3.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyterrainmap-1.3.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27b6b46d7e6c227c322c4f11898ed672049361283fb3d3d8dcd65d130df352b6
MD5 0b2c110d147d0cb27605970307eadfae
BLAKE2b-256 e3c92cef767ab1e7d185db47c21b06205f2bdae0379875ff53bc19acb68eb8a0

See more details on using hashes here.

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