Advanced Search
Search Results
45 total results found
rover_state.rs — Rover Mode State
The state described here MIGHT be subject to change Manages the three global boolean flags that track the rover's current operating mode. The state is held in a RoverState struct registered as Tauri managed state (initialised in lib.rs), so it persists for the...
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 platform-specific (e.g. %APPDATA%\base_station on Windows). Three subdirectories are used: DirectoryPurposetasks/Saved task plan filesimages/Snapshots captured fro...
gstreamer.rs — Video Streaming
Receives H.264 video from the rover over UDP, decodes it, and serves it as MJPEG over HTTP so the frontend can display it in <img> tags. Pipeline per camera udpsrc (UDP port) → rtpjitterbuffer → rtph264depay → avdec_h264 → videoconvert → jpegenc → appsink Each...
network.rs — UDP & Dummy Simulator
This file is work in progress Exposes commands related to the UDP connection and the development simulator. Commands send_ping_cmd(packet_type) Intended to send a ping packet to the rover over UDP. Currently logs to console — full implementation pending. start...
controller.rs — Gamepad Input
Runs a background listener for gamepad input using the gilrs library, translating button and axis events into UDP packets sent to the rover. All dispatching is gated on the current mode (drive vs. pickup) and whether the relevant manual mode is active. Modes T...
checks.rs — Diagnostics
Two utility commands for diagnostics and maintenance. ping() Prints "PING FROM RUST" to the console. Used to verify the Tauri bridge is working. clear_cache() Deletes all contents of the base_station/ folder inside the system cache directory. Exposed as a call...
load_model.rs — 3D Model Loading
Handles loading of 3D model files bundled with the application. load_model(path) → Vec<u8> Reads a model file by filename and returns its raw bytes to the frontend. In debug builds, models are loaded from src-tauri/models/. In release builds, they are loaded f...
rover_commands.rs — Rover Science Commands
This file is work in progress These commands are called by the frontend to request measurements or send data to the rover. All four are currently partially stubbed — they simulate a 1-second rover response delay and return dummy values, but the actual UDP disp...
Overview
The socket is created once in service.rs, wrapped in an Arc, and shared between the listener and the sender/dummy so they all use the same bound port. Graph subject to change as communication gets finalized
service.rs — UDP Socket
UdpService is a thin wrapper that binds a UDP socket and holds it in an Arc<UdpSocket> so it can be shared across async tasks. It is registered as Tauri managed state at startup so any command can access the socket via State<'_, UdpService>. Binds to address p...
listener.rs — Incoming Packet Handler
run_listener() is the main receive loop. It runs for the lifetime of the app as a spawned async task. On every received UDP datagram it: Decodes the raw bytes as a PbEnvelope using prostExtracts the inner payload variantChecks a per-payload throttle — events a...
sender.rs — Outgoing Packet Sender
This file is work in progress send_envelope() is the single outgoing send function. It takes a PbEnvelope, encodes it to bytes using prost, and sends it to the target address over UDP. A hex_dump() helper (currently commented out) can be re-enabled to log outg...
dummy.rs — Development Simulator
The simulator generates realistic fake rover data so the UI can be developed and tested without physical hardware. It is started via the start_dummy_streams or start_detection_sim commands from network.rs and stopped with stop_dummy_streams. Stream table Each ...
main.rs — Binary Entry Point
The binary entry point is intentionally minimal. It simply calls base_station_lib::run(), which lives in lib.rs. The only thing of note is the windows_subsystem = "windows" attribute on the first line — this suppresses the extra console window that would other...
lib.rs — Application Bootstrap
lib.rs is where the entire Tauri application is configured and started. It does the following in order: Managed state registration Three pieces of state are registered with Tauri's state manager so they can be injected into any command via State<'_>: RoverStat...
proto.rs — Protobuf Module
This file simply includes the generated Rust code for the packets protobuf module: rust pub mod packets { include!(concat!(env!("OUT_DIR"), "/packets.rs")); } The actual .proto source files live in src-tauri/proto/. They are compiled at build time by build...
build.rs — Protobuf Compilation
The build script runs before the Rust compiler and is responsible for compiling all .proto files into Rust code. It does this in several steps: 1. Collect proto files Recursively scans the src-tauri/proto/ directory for .proto files. Only files that are inside...
tauri.conf.json — Application & Security Configuration
Window The app opens a single window titled base_station at 800×600. devtools is enabled, meaning the browser DevTools can be opened in development builds. Content Security Policy The CSP is configured to be strict by default while allowing the specific localh...