How xdei-group/aerialclaw works
1. Overall shape
AerialClaw is a drone autonomy stack centered on an LLM-driven decision loop. The architecture is split into a control plane in Python, a web monitoring/operator UI in React, and a hardware/simulation adapter layer that lets the same agent run against mock, PX4/Gazebo, or AirSim backends.
2. Primary entry points
server.py is the main service entry point and exposes the system over REST plus WebSocket. The web UI connects to that service for live telemetry, commands, mode switching, and status updates. config.py and .env hold runtime configuration such as LLM provider choice and simulation settings.
3. Cognitive core
The brain/ package is the autonomous reasoning layer. agent_loop.py runs the closed-loop perceive → plan → act cycle, planner_agent.py builds task plans using LLM + memory context, and chat_mode.py supports conversational interaction when the operator is not running fully autonomous tasks.
4. Skill execution layer
The skills/ package is the action substrate. It is organized as a two-layer skill model: hard skills for atomic actions, and soft skills for higher-level strategies. Hard skills cover flight control, perception, status queries, and general-purpose utilities; soft skills live as Markdown strategy documents and are loaded/composed at runtime via the registry/loader/dynamic generation path.
5. Perception pipeline
perception/ provides both passive and active sensing. The passive side continuously fuses camera/LiDAR/sensor data into ongoing situational summaries, while vlm_analyzer.py performs on-demand visual analysis through an external VLM/LLM. gz_camera.py bridges simulation camera feeds, and prompts.py contains the prompt templates that shape semantic perception output.
6. Memory and identity
memory/ is a multi-layer persistence subsystem: episodic memory for task history, skill memory for execution stats, world model for environment knowledge, vector store for semantic retrieval, and shared memory for cross-device reuse. reflection_engine.py and skill_evolution.py support post-task learning and skill refinement. The robot_profile/ Markdown files (SOUL, BODY, MEMORY, SKILLS, WORLD_MAP) are the agent’s persistent identity/state documents and are read/written as part of long-term adaptation.
7. Hardware abstraction boundary
adapters/ isolates the autonomy stack from the physical or simulated vehicle. sim_adapter.py defines the common interface, while adapter_manager.py selects the concrete backend: mock_adapter.py for no-hardware runs, px4_adapter.py for PX4 SITL, airsim_adapter.py/airsim_physics.py/airsim_rpc.py for AirSim, and mavsdk_adapter.py for MAVSDK-based control. This is the key boundary that makes the same brain/skills layer portable across environments.
8. Data flow from task to actuation
A user task enters through the server/UI, is interpreted by the planner agent, enriched with memory and current perception, then decomposed into skills. Skills call the selected adapter, which sends commands to either the simulator or the real vehicle. Sensor data and execution results flow back through the adapter into perception, memory, and the UI, closing the loop.
9. Safety and execution constraints
The system is designed around a safety envelope rather than raw command execution. The readme describes command filtering, sandboxed computation, approval boundaries, and flight envelope checks, especially for utilities like Python execution, HTTP access, and file I/O. This makes the boundary between “LLM decides” and “vehicle executes” explicit.
10. Web monitoring/operator console
The ui/ app is a separate React/Vite frontend for observability and control. It renders live camera views, LiDAR, robot/sensor panels, logs, skill state, map view, and AI panels, and supports switching between manual and autonomous modes. The UI is therefore not just a dashboard; it is the human override and supervision layer.
11. Configuration and deployment
config/ contains simulation and safety parameters plus camera placement definitions. scripts/ automates PX4 setup and simulation startup. The repository also includes Gazebo world/model assets under sim/, which are the environment side of the hardware abstraction boundary.
12. External services and runtimes
The stack depends on Python 3.10+ for the agent/service runtime and Node.js for the UI build. Runtime behavior depends materially on external LLM/VLM providers such as OpenAI-compatible APIs, and on simulator ecosystems such as PX4, Gazebo, and AirSim. Those services are not peripheral: they are part of the main execution path for planning, perception, and vehicle control.
13. Diagramming takeaway
If you draw the architecture, the central box should be the Python autonomy service with four major internal subsystems: brain, skills, perception, and memory. Around it sit the adapter layer to PX4/AirSim/mock backends, the React UI as the operator console, and the robot-profile Markdown documents as persistent identity/state artifacts. The key flow is bidirectional: operator/task input in, perception/memory/context into the LLM, skill execution out to the adapter, and telemetry/reflection back into memory and UI.
Main entry points: memory_manager.py Memory · adapter_manager.py Adapter manager · passive_perception.py Perception · App.jsx UI app
Components 29
Python autonomy
Core service, cognition, perception, memory, skills, and runtime orchestration.
- Server · Main Python service exposing REST and WebSocket interfaces.
server.py - Agent loop · Runs the perceive-plan-act cycle for autonomous operation.
brain/agent_loop.py - Planner · Builds task plans using LLM context plus memory and perception.
brain/planner_agent.py - Chat mode · Supports conversational interaction outside fully autonomous tasks.
brain/chat_mode.py - Skills · Skill registry and execution layer for atomic actions and strategies.
skills/registry.py - Motor skills · Flight and actuation-oriented skills such as takeoff, land, hover, and navigation.
skills/motor_skills.py - Perception skills · Skills that query sensors, fuse observations, and update situational context.
skills/perception_skills.py - Cognitive skills · Higher-level operator interaction, reporting, and reasoning utilities.
skills/cognitive_skills.py - Soft docs · Markdown strategy documents loaded and composed at runtime.
skills/soft_docs - Skill loader · Loads, registers, and dynamically generates skills and documents.
skills/skill_loader.py - Perception · Passive and active sensing pipeline for situational understanding.
perception/passive_perception.py - VLM analyzer · Uses external VLM/LLM services for visual analysis tasks.
perception/vlm_analyzer.py - Memory · Manages episodic, skill, shared, vector, and world-model state.
memory/memory_manager.py - Reflection · Post-task reflection and adaptation for future behavior.
memory/reflection_engine.py - Skill evolution · Refines skills based on execution history and feedback.
memory/skill_evolution.py - Runtime · Execution wrapper that coordinates agent lifecycle and task execution.
runtime/agent_runtime.py
Vehicle adapters
Hardware and simulator boundary layer for mock, PX4, MAVSDK, and AirSim.
- Adapter manager · Chooses the concrete vehicle backend for a run.
adapters/adapter_manager.py - Sim adapter · Common interface for vehicle control and telemetry across backends.
adapters/sim_adapter.py - Mock adapter · No-hardware backend for local or development runs.
adapters/mock_adapter.py - PX4 adapter · PX4 SITL backend for simulated flight control.
adapters/px4_adapter.py - AirSim adapter · AirSim control backend for simulation and telemetry.
adapters/airsim_adapter.py - MAVSDK adapter · MAVSDK-based control path for vehicle command execution.
adapters/mavsdk_adapter.py
Operator UI
React frontend for monitoring, control, and supervision.
- UI app · Operator console for telemetry, mode switching, logs, and maps.
ui/src/App.jsx - UI panels · Camera, sensor, robot, skill, map, and AI monitoring panels.
ui/src/components - Socket hook · WebSocket client hook for live server updates.
ui/src/hooks/useSocket.js
Persistent state
Markdown profiles and long-term memory artifacts used across runs.
- Robot profile · Persistent markdown documents for soul, body, memory, skills, and world map.
robot_profile
Simulation assets
Gazebo worlds, models, and launch/config assets for simulated runs.
- Sim worlds · Gazebo models and worlds used by the simulation backends.
sim/worlds/urban_rescue.sdf - Sim models · Vehicle and environment models for the simulated drone platform.
sim/models/x500_lidar_2d_cam/model.sdf - Sim config · Simulation and camera placement configuration assets.
config/sim_config.yaml
Connections 36
- Server → Agent loop: starts · Server invokes the autonomous control loop.
- Server → UI app: serves · Backend exposes data and control endpoints consumed by the UI.
- UI app → Socket hook: connects · Frontend subscribes to live telemetry and status updates.
- Agent loop → Planner: plans · Loop asks the planner for next actions and task decomposition.
- Agent loop → Perception: reads · Closed loop consumes current situational state.
- Agent loop → Skills: executes · Loop dispatches planned actions into the skill layer.
- Planner → Memory: retrieves · Planner uses memory context and task history.
- Planner → Perception: contexts · Planning is conditioned on current perception state.
- Chat mode → Memory: references · Conversational mode can use stored context and identity state.
- Skills → Skill loader: loads · Skill registry resolves hard and soft skills at runtime.
- Skill loader → Soft docs: composes · Loader builds soft skills from markdown strategy documents.
- Skills → Motor skills: dispatches · Core skill execution can route to flight and actuation commands.
- Skills → Perception skills: dispatches · Skills can trigger sensing, observation, and map updates.
- Skills → Cognitive skills: dispatches · Core skill execution includes reporting and operator interaction.
- Motor skills → Adapter manager: commands · Motor skills rely on the selected vehicle backend.
- Perception skills → Perception: queries · Perception-oriented skills consume sensor fusion results.
- Perception → VLM analyzer: spawns · Active perception can request on-demand visual analysis.
- Perception → Memory: stores · Perception writes summaries and state into persistence.
- Reflection → Memory: updates · Reflection converts task outcomes into longer-term memory.
- Skill evolution → Memory: learns from · Skill refinement uses execution stats and history.
- Runtime → Agent loop: orchestrates · Runtime manages agent lifecycle and execution flow.
- Runtime → Adapter manager: binds · Runtime binds the current run to a backend implementation.
- Adapter manager → Sim adapter: abstracts · Manager selects through a common simulation/control interface.
- Adapter manager → Mock adapter: selects · Development or no-hardware backend.
- Adapter manager → PX4 adapter: selects · PX4 SITL backend.
- Adapter manager → AirSim adapter: selects · AirSim backend.
- Adapter manager → MAVSDK adapter: selects · MAVSDK-based backend.
- UI app → Server: controls · Operator UI sends commands, mode changes, and requests.
- UI panels → UI app: renders · Panels compose the main monitoring and control surface.
- Server → Memory: persists · Service records task history and system state.
- Memory → Robot profile: syncs · Long-term identity and state are mirrored into profile documents.
- Sim adapter → Sim worlds: runs on · Backends operate within Gazebo world assets.
- Sim adapter → Sim models: uses · Backends rely on drone and environment models.
- Sim adapter → Sim config: configures · Simulation behavior is governed by config assets.
- Perception → UI app: publishes · Telemetry and situational summaries are surfaced to the operator UI.
- Memory → UI app: feeds · UI can display logs, state, and skill evolution data.