Base station
Overview
What is the base station? The Base Station is the ground control application used to monitor and ...
Getting Started
Prerequistites
MacOS installation steps were not tested, proceed at your own risk! Rust Install Rust via rustup ...
Cloning the Repository
Before cloning the repository, install the following tools on your machine. The repository contai...
Common Operations
Running in Development bun run tauri dev This command does the following in parallel: Starts the ...
Common Issues
Build fails with "No valid proto files found under components/" The proto submodule is not initia...
Backend — Application Entry Point & Build System
Location: src-tauri/src/ and src/
main.rs — Binary Entry Point
The binary entry point is intentionally minimal. It simply calls base_station_lib::run(), which l...
lib.rs — Application Bootstrap
lib.rs is where the entire Tauri application is configured and started. It does the following in ...
proto.rs — Protobuf Module
This file simply includes the generated Rust code for the packets protobuf module: rust pub mod p...
build.rs — Protobuf Compilation
The build script runs before the Rust compiler and is responsible for compiling all .proto files ...
tauri.conf.json — Application & Security Configuration
Window The app opens a single window titled base_station at 800×600. devtools is enabled, meaning...
Cargo.toml — Key Dependencies
CratePurposetauriDesktop app framework, with protocol-asset and devtools featurestokio (full)Asyn...
Backend — Commands
Location: src-tauri/src/commands/ Tauri commands are Rust functions exposed to the frontend via ...
rover_state.rs — Rover Mode State
The state described here MIGHT be subject to change Manages the three global boolean flags that t...
file_management.rs — Persistent File Storage
Handles all file I/O for the application. Files are stored inside Tauri's app_data_dir, which is ...
gstreamer.rs — Video Streaming
Receives H.264 video from the rover over UDP, decodes it, and serves it as MJPEG over HTTP so the...
network.rs — UDP & Dummy Simulator
This file is work in progress Exposes commands related to the UDP connection and the development ...
controller.rs — Gamepad Input
Runs a background listener for gamepad input using the gilrs library, translating button and axis...
checks.rs — Diagnostics
Two utility commands for diagnostics and maintenance. ping() Prints "PING FROM RUST" to the conso...
load_model.rs — 3D Model Loading
Handles loading of 3D model files bundled with the application. load_model(path) → Vec<u8> Reads ...
rover_commands.rs — Rover Science Commands
This file is work in progress These commands are called by the frontend to request measurements o...
map_commands.rs and map_processor.rs — 3D Map Rendering & Coordinate Transforms
map_processor.rs + map_commands.rs — 3D Map Rendering & Coordinate Transforms Converts 3D map fil...
Backend — Networking & Protocol
Location: src-tauri/src/network/ This module owns the UDP socket and all communication between t...
Overview
The socket is created once in service.rs, wrapped in an Arc, and shared between the listener and ...
service.rs — UDP Socket
UdpService is a thin wrapper that binds a UDP socket and holds it in an Arc<UdpSocket> so it can ...
listener.rs — Incoming Packet Handler
run_listener() is the main receive loop. It runs for the lifetime of the app as a spawned async t...
sender.rs — Outgoing Packet Sender
This file is work in progress send_envelope() is the single outgoing send function. It takes a Pb...
dummy.rs — Development Simulator
The simulator generates realistic fake rover data so the UI can be developed and tested without p...
Frontend — Basics
Location: src/ and src/routes/ The frontend is a SvelteKit TypeScript application. It uses Svelt...
routes/+layout.svelte — Navigation Bar
The layout wraps every page in the application. It renders the persistent navigation bar at the t...
routes/ — Pages
/ — Dashboard (Home) File: routes/+page.svelte The main operator screen. A CSS grid layout combin...
types.ts — Types
Shared TypeScript types used across the frontend. Sample — represents a single science sample col...
state.svelte.js — Global State
state.svelte.js is the single source of truth for shared reactive state that needs to be accessib...
Frontend — lib Structure
Location: src/lib/
Frontend — Components
Location: src/lib/components/ Components are reusable UI building blocks used across multiple ro...
video.svelte + double_video.svelte — Video Components
video.svelte TODO: still being developed, going to change The basic single-camera display compone...
model_scene.svelte + model_viewer.svelte + model_debug.ts — 3D Model Viewer
These three files together form the 3D model display system used on the dashboard. model_scene.sv...
task_completion.svelte — Task Completion
Displays the history of completed tasks read from the tasks/ app data directory. On mount it list...
map.svelte — Map
TODO: We still don't have the map format, function is subject to change Displays a static map tha...
costmap.svelte — Costmap
TODO: A placeholder component that renders a "Costmap" heading. Intended to display the rover's n...
imu.svelte — IMU
Displays live inertial measurement unit data received from the imu-update Tauri event. Data displ...
sampling_locations.svelte + SampleField.svelte — Sampling Locations
The main data collection interface for the Science task. Manages a list of Sample objects stored ...
interest_locations.svelte — Interest Locations
TODO: A placeholder component that renders a "Locations of Interest" heading. Intended to display...
navigation_plan.svelte — Navigation Plan
A drag-and-drop ordered list of navigation waypoints using svelte-dnd-action. Reads from and writ...
probes.svelte — Probes
Displays the list of probes from the probes store. Currently each probe renders as a basic card. ...
maintenance_tasks.svelte — Maintenance Panel
TODO: WIP
map.svelte + navigation_plan.svelte + interest_locations.svelte — Map & Navigation Components
map.svelte The core map display component. Loads a map file from <appDataDir>/maps/, renders it i...