WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
PressureSensor.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, INC.
15******************************************************************************/
16/*
17Pressure Sensor model header file
18
19Author: James Tabony
20*/
21/*
22Metadata for MS GUI:
23imdata = {"exclude" : True}
24*/
25
26#ifndef MODELS_SENSORS_PRESSURE_SENSOR_H
27#define MODELS_SENSORS_PRESSURE_SENSOR_H
28
29#include "simulation/Model.h"
32#include "utils/LatencyUtil.hpp"
33
34namespace warptwin {
35
74
79 // Default constuctor (should populate with model defualt outputs)
82 // Custom constructor
85 };
86
87 MODEL(PressureSensor)
88 public:
89 // Model params
90 // NAME TYPE DEFAULT VALUE
93 SIGNAL(min_pressure, double, 0.0)
95 SIGNAL(max_pressure, double, 0.0) // TODO: change max default to Float Max in warptwin
99 SIGNAL(resolution, double, 0.0)
102 SIGNAL(rate_hz, int, 0)
104 SIGNAL(seed_value, int, 0)
108 SIGNAL(latency, int, 0)
111 SIGNAL(operational_power_draw, double, 0.0)
113 SIGNAL(mass, double, 0.0)
115
116 // Model inputs
117 // NAME TYPE DEFAULT VALUE
120 SIGNAL(perfect_pressure, double, 0.0)
123 SIGNAL(bias, double, 0.0)
127 SIGNAL(gaussian_noise_std, double, 0.0)
129 SIGNAL(scale_factor_std, double, 0.0)
131
132 // Model outputs
133 // NAME TYPE DEFAULT VALUE
138 SIGNAL(output_time, clockwerk::Time, clockwerk::Time(0, 0))
143 SIGNAL(meas_pressure, double, 0.0)
148 SIGNAL(meas_pressure_mbar, double, 0.0)
151 SIGNAL(is_valid, bool, false)
154 SIGNAL(current_power_draw, double, 0.0)
156
159 warptwin::MarkovUncertaintyModel* getNoiseModel() {return &_sensor_noise_model;}
160
163 warptwin::RateMonitor* rateMonitor() {return &_rate_monitor;}
164
165 int16 activate() override;
166 int16 deactivate() override;
167
168 protected:
169 int16 start() override;
170 int16 execute() override;
171
173 void _configureInternal();
174
176 MarkovUncertaintyModel _sensor_noise_model;
177
179 RateMonitor _rate_monitor;
180
184
187
190
191 };
192
193}
194
195#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
Latency model.
Definition LatencyUtil.hpp:41
Definition CircularBuffer.hpp:28
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
MarkovUncertaintyModel _sensor_noise_model
The bias and noise model for sensor output.
Definition Accelerometer.h:240
double _meas_pres
Temporary variable to hold the measured pressure before bound checks and reolution quantinization.
Definition PressureSensor.h:183
void _configureInternal()
Function to configure sensor – runs in all constructors.
warptwin::RateMonitor * rateMonitor()
Accessor for the internal rate monitor model.
Definition Accelerometer.h:224
int16 activate() override
_accel_output_struct _last_output
Temporary variable for the latest recorded output added to latency model and dummy output for steppin...
Definition Accelerometer.h:264
MODEL(Servo) public int16 deactivate() override
Model to simulate a servo's motion.
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
LatencyUtil< double > _latency_model
The latency model for servo angle output.
Definition Servo.h:116
MODEL(Accelerometer) public warptwin::MarkovUncertaintyModel * getNoiseModel()
Accessor for the internal noise model.
Definition Accelerometer.h:220
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
RateMonitor _rate_monitor
Rate monitor to control the rate at which the sensor runs.
Definition Accelerometer.h:243
double _latency_return
Temporary value for the return of the latency value.
Definition Servo.h:122
Pressure Sensor Model.
Definition PressureSensor.h:76
_pressure_output_struct()
Definition PressureSensor.h:80
bool is_valid
Definition PressureSensor.h:78
double meas_pressure
Definition PressureSensor.h:77
_pressure_output_struct(double meas_pressure, bool is_valid)
Definition PressureSensor.h:83