Skip to content

aguptaaditya/fenrir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fenrir

fenrir

Fenrir is an autonomous mission intelligence system for deep space operations where Earth-based ground control cannot provide real-time guidance.

Named after the great wolf of Norse mythology — bound by the gods but destined to break free — Fenrir embodies unchained autonomous power beyond the reach of ground control. Mars is 20 minutes away at the speed of light. When a Starship is en route or on the surface, Fenrir breaks free from dependency on Earth and runs the entire mission autonomously: navigation, life support, abort decisions, resource allocation, communication scheduling, anomaly detection, and self-repair prioritization.

                    ┌──────────────────────────────────────────┐
                    │            fenrir command loop              │
                    │        sense → decide → act → log         │
                    └───────────────────┬──────────────────────┘
                                        │
          ┌─────────────────────────────┼─────────────────────────────┐
          │                             │                             │
┌─────────▼─────────┐   ┌──────────────▼──────────────┐   ┌─────────▼─────────┐
│    navigation     │   │         sentinel            │   │    lifesupport    │
│  trajectory       │   │  telemetry · anomaly        │   │  atmosphere       │
│  orbital mech     │   │  health scoring             │   │  resources        │
│  powered descent  │   │                             │   │  crew biometrics  │
└───────────────────┘   └─────────────────────────────┘   └───────────────────┘
          │                             │                             │
          └─────────────────────────────┼─────────────────────────────┘
                                        │
          ┌─────────────────────────────┼─────────────────────────────┐
          │                             │                             │
┌─────────▼─────────┐   ┌──────────────▼──────────────┐   ┌─────────▼─────────┐
│     autonomy      │   │          comms              │   │      swarm        │
│  PPO agent        │   │  delay-aware scheduling     │   │  fleet coord      │
│  reward shaping   │   │  message prioritization     │   │  consensus        │
│  curriculum       │   │  deep space protocol        │   │                   │
└───────────────────┘   └─────────────────────────────┘   └───────────────────┘
          │                             │                             │
          └─────────────────────────────┼─────────────────────────────┘
                                        │
                    ┌───────────────────▼──────────────────────┐
                    │         memory (SQLite + NetworkX)        │
                    │     mission log · dependency graph        │
                    └──────────────────────────────────────────┘

why autonomous?

The speed of light imposes a hard constraint on deep space operations. Earth-Mars communication delay ranges from 4 to 24 minutes depending on orbital positions. A round-trip command-response cycle can take up to 48 minutes. During powered descent, atmospheric entry, or any time-critical anomaly, the vehicle must make decisions without waiting for ground control.

Fenrir treats this as a reinforcement learning problem: the agent observes vehicle and mission state, selects actions under uncertainty, and optimizes for a multi-objective reward combining crew safety, mission efficiency, and science return.

modules

commander

The core sense-decide-act loop. Each tick ingests telemetry from all subsystems, evaluates mission priorities, runs the decision engine (abort / continue / reroute), and dispatches actions. The priority queue ensures safety-critical decisions always preempt lower-priority tasks.

navigation

Trajectory computation and correction using Keplerian propagation and Lambert solvers. Includes powered descent guidance based on convex optimization for fuel-optimal landing trajectories.

sentinel

Real-time telemetry ingestion with anomaly detection across all vehicle systems. Health scores track system degradation over time, enabling predictive maintenance decisions before failures cascade.

lifesupport

Atmospheric monitoring (O2, CO2, pressure, temperature), consumable resource budgeting (water, power, food), and crew health inference from biometric telemetry. Resource projections feed into abort decision logic.

comms

Delay-aware message scheduling that accounts for Earth-Mars light-time. Messages are prioritized during limited communication windows. The protocol handler manages packetization and acknowledgment across deep space links.

autonomy

PPO-based reinforcement learning agent for high-level mission decisions. The reward function shapes behavior across three objectives: safety (weighted 0.6), mission efficiency (0.3), and science return (0.1). A progressive curriculum trains the agent from simple orbital maneuvers to full autonomous operations.

swarm

Multi-vehicle coordination for fleet operations. Distributed consensus enables multiple vehicles to agree on shared plans without a central coordinator, using weighted voting based on each vehicle's confidence and sensor quality.

memory

SQLite-backed mission event log with a NetworkX dependency graph tracking relationships between events, decisions, and outcomes. Supports post-mission analysis and online replanning.

server

FastAPI endpoint exposing mission status, telemetry snapshots, and decision history for ground-based monitoring during communication windows.

configuration

Settings load from environment variables with the FENRIR_ prefix (see .env.example):

variable default description
FENRIR_MISSION_ID starship-mars-001 mission identifier
FENRIR_LOOP_INTERVAL_MS 1000 command loop tick interval (ms)
FENRIR_COMMS_DELAY_MS 1200000 earth-mars one-way delay (ms)
FENRIR_DB_PATH ./fenrir.db SQLite persistence path
FENRIR_RL_MODEL_PATH ./models/commander_v1.pt PPO policy checkpoint
FENRIR_REWARD_SAFETY_WEIGHT 0.6 safety objective weight
FENRIR_REWARD_EFFICIENCY_WEIGHT 0.3 efficiency objective weight
FENRIR_REWARD_SCIENCE_WEIGHT 0.1 science return objective weight

quick start

python -m venv .venv
source .venv/bin/activate   # Windows: .venv\\Scripts\\activate
pip install -e ".[dev]"

# run a single sense-decide-act cycle (simulated telemetry)
fenrir run --once

# start the command loop
fenrir run

# mission status API
fenrir serve --port 8090

development

pip install -e ".[dev]"
pytest -v
ruff check fenrir tests

Project layout:

fenrir/
├── commander/    # sense-decide-act loop, decision engine, priority queue
├── navigation/   # trajectory, orbital mechanics, powered descent
├── sentinel/     # telemetry, anomaly detection, health scoring
├── lifesupport/  # atmosphere, resources, crew biometrics
├── comms/        # delay-aware scheduling, message priority, protocol
├── autonomy/     # PPO agent, reward shaping, curriculum
├── swarm/        # fleet coordination, distributed consensus
├── memory/       # SQLite mission log, dependency graph
└── server/       # FastAPI mission status endpoint

status

Experimental research framework. Not flight software.

license

MIT — see LICENSE.

About

Autonomous mission intelligence system for deep space operations — navigation, life support, autonomy, and swarm coordination

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages