Skip to main content

Overview

What is the base station?

The Base Station is the ground control application used to monitor and control the rover during operation. It runs on an operator's laptop and provides a unified interface for live video feeds, navigation, task management, rover arm control, and sensor readouts.

It is built with Tauri v2 (Rust backend) and SvelteKit (TypeScript frontend), bundled into a native desktop application. Communication with the rover happens over UDP using Protocol Buffers (protobuf) for message serialisation.

Tech Stack

Layer

Technology

Desktop framework

Tauri v2

Frontend

SvelteKit + TypeScript

Backend

Rust

Build tool

Bun + Vite

Video streaming

GStreamer (MJPEG)

Rover communication

UDP on port 9000

Serialisation

Protocol Buffers

3D model rendering

(see Model Viewer)

System Architecture

At a high level, the app has three layers:

┌─────────────────────────────────────────┐
│           SvelteKit Frontend            │
│  (routes, components, state.svelte.js)  │
└────────────────┬────────────────────────┘
                 │ Tauri Commands (invoke)
┌────────────────▼────────────────────────┐
│           Tauri / Rust Backend          │
│  commands/  │  network/  │  proto/      │
└────────────────┬────────────────────────┘
                 │ UDP port 9000 (protobuf)
┌────────────────▼────────────────────────┐
│                 Rover                   │
└─────────────────────────────────────────┘

The frontend communicates with the Rust backend exclusively through Tauri commands (called via invoke()). The backend owns the UDP socket and all rover communication — the frontend never talks to the rover directly.

On startup, the backend:

  1. Initialises rover state (drive/arm mode, pickup mode)
  2. Ensures local storage directories exist and clears stale cache
  3. Starts a GStreamer MJPEG streaming server to receive video feeds
  4. Binds a UDP socket on port 9000 and starts a listener for incoming rover data
  5. Starts a controller (gamepad) listener for hardware input

Rover Modes

The base station tracks three global modes managed by RoverState in the backend:

State

Type

Default

Description

drive_manual_mode

bool

true

Whether the rover driving is in manual control

arm_manual_mode

bool

true

Whether the arm is in manual control

pickup_mode

bool

false

Whether the rover is in driving or pickup mode

These are read and written from the frontend using the get_state / set_state Tauri commands.

Warning: You might be able to drive and move the arm at the same time

Project structure

ERC-SOFTWARE-BASESTATION/
├── src/                    # SvelteKit frontend
│   ├── lib/components/     # Reusable UI components
│   ├── routes/             # Page routes
│   ├── stores/             # Svelte stores
│   └── state.svelte.js     # Global reactive state
├── src-tauri/              # Tauri + Rust backend
│   ├── src/
│   │   ├── commands/       # Tauri command handlers
│   │   ├── network/        # UDP service + listener
│   │   └── proto/          # Protobuf definitions
│   └── models/             # Bundled 3D model files
├── fake_camera/            # Test video source (no hardware)
├── fake_camera_gstreamer/  # GStreamer-based test video source
└── static/                 # Static frontend assets