Domain Simulators

Tetrapus ships with domain-specific simulators for development and testing. Each simulator generates realistic telemetry and implements command handling so operators can practice control workflows without live hardware.

SimRegistry

The SimRegistry manages multi-domain simulator registration. Each simulator implements the Simulator trait with tick() and handle_command().

Rust
pub trait Simulator: Send + Sync {
    fn tick(&mut self, dt: f64);
    fn handle_command(&mut self, cmd: &IssuedCommand) -> CommandStatus;
    fn snapshot(&self) -> Vec<FieldValue>;
}

HVAC Simulator

Building management system simulation with thermal dynamics. Modes: OFF=0, COOL=1, HEAT=2.

Field Type Description
setpoint_tempf64Target temperature (°C)
actual_tempf64Current measured temperature
compressor_throttlef640–100% compressor output
co2_ppmf64CO2 concentration (parts per million)
fault_codeu320 = OK, non-zero = fault identifier
thermal_massf64Zone thermal inertia constant
modeu8OFF=0, COOL=1, HEAT=2
fan_speedf64Fan RPM (0–3000)
humidityf64Relative humidity percentage
supply_air_tempf64Temperature of air leaving the unit

Aviation Simulator

Generates flight entities with great-circle routing and altitude profiles. Each flight follows a waypoint path with realistic climb/cruise/descent phases.

  • Great-circle — Haversine-based position interpolation between waypoints
  • Altitude profiles — departure climb, cruise at FL350–FL410, approach descent
  • Speed — Mach-relative ground speed with wind vector adjustment
  • Commands — divert to alternate airport, adjust altitude, change squawk code

Rally Simulator

Car dynamics simulation for motorsport telemetry. Models tyre degradation, fuel consumption, and stage timing.

  • Dynamics — throttle, brake, steering angle, lateral G, longitudinal G
  • Tyres — temperature per corner, wear percentage, grip coefficient
  • Engine — RPM, oil temp, water temp, turbo boost pressure
  • Commands — pit stop request, tyre compound selection, fuel map adjustment

Command Handling

Rust
// Each simulator handles commands via the trait method:
fn handle_command(&mut self, cmd: &IssuedCommand) -> CommandStatus {
    for assignment in &cmd.fields {
        match assignment.field.as_str() {
            "setpoint_temp" => self.setpoint = assignment.value,
            "mode"          => self.mode = assignment.value as u8,
            unknown         => return CommandStatus::Failed,
        }
    }
    CommandStatus::Acked
}

Questions?

Reach out for help with integration, deployment, or custom domain codecs.