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().
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_temp | f64 | Target temperature (°C) |
| actual_temp | f64 | Current measured temperature |
| compressor_throttle | f64 | 0–100% compressor output |
| co2_ppm | f64 | CO2 concentration (parts per million) |
| fault_code | u32 | 0 = OK, non-zero = fault identifier |
| thermal_mass | f64 | Zone thermal inertia constant |
| mode | u8 | OFF=0, COOL=1, HEAT=2 |
| fan_speed | f64 | Fan RPM (0–3000) |
| humidity | f64 | Relative humidity percentage |
| supply_air_temp | f64 | Temperature 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
// 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.