Skip to main content

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 lifetime of the application.

State fields

State

Default

Description

drive_manual_mode

true

Whether the rover driving is in manual control

arm_manual_mode

true

Whether the arm is in manual control

pickup_mode

false

Whether the rover is in driving or pickup mode

Commands

get_state(state_type: StateType) → bool Returns the current value of the requested state flag. Called on page mount to sync the UI with the actual rover state.

set_state(state_type: StateType, value: bool) Sets a state flag. Called by the frontend when the operator switches modes (e.g. toggling pick-up mode on the dashboard).

StateType is an enum with variants: DriveManual, ArmManual, Pickup.