mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mars::PressureConversion Class Reference

#include </home/runner/work/mars_lib/mars_lib/source/mars/include/mars/sensors/pressure/pressure_conversion.h>

+ Collaboration diagram for mars::PressureConversion:

Public Types

typedef Eigen::Matrix< double, 1, 1 > Matrix1d
 

Public Member Functions

 PressureConversion ()=default
 Default constructor for creating a PressureConversion object. More...
 
 PressureConversion (Pressure pressure)
 Detailed constructor to set also the pressure reference. More...
 
 PressureConversion (Pressure pressure, MediumPressureOptions gas_options)
 Detailed constructor to set the pressure reference and medium options. More...
 
void set_pressure_reference (Pressure pressure)
 Setter function to set the reference pressure after construction of object. More...
 
Matrix1d get_height (Pressure pressure)
 Converts the given pressure measurement to a height (distance) value. More...
 

Private Member Functions

double get_height_liquid (const Pressure &pressure)
 Converts the given pressure measurement to a height based. More...
 
double get_height_gas (const Pressure &pressure)
 Converts the given pressure measurement to a height based. More...
 

Private Attributes

Pressure reference_
 reference pressure for h=0 More...
 
MediumPressureOptions medium_options_
 pressure medium (gas or liquid) options to use More...
 
bool reference_is_set_ { false }
 flag to determine if the reference_ has been set More...
 

Member Typedef Documentation

◆ Matrix1d

typedef Eigen::Matrix<double, 1, 1> mars::PressureConversion::Matrix1d

Constructor & Destructor Documentation

◆ PressureConversion() [1/3]

mars::PressureConversion::PressureConversion ( )
default

Default constructor for creating a PressureConversion object.

The medium_options_ are initialized to their default values.

See also
MediumPressureOptions

◆ PressureConversion() [2/3]

mars::PressureConversion::PressureConversion ( Pressure  pressure)
inline

Detailed constructor to set also the pressure reference.

Parameters
pressurePressure to set as reference for height = 0.

The medium_options_ are initialized to their default values.

See also
MediumPressureOptions
214 : PressureConversion(pressure, MediumPressureOptions()){};
PressureConversion()=default
Default constructor for creating a PressureConversion object.

◆ PressureConversion() [3/3]

mars::PressureConversion::PressureConversion ( Pressure  pressure,
MediumPressureOptions  gas_options 
)

Detailed constructor to set the pressure reference and medium options.

Parameters
pressurePressure to set as reference for height = 0.
gas_optionsMediumPressureOptions to use

Use this constructor if your medium is different than either air (gas) or water (liquid).

Member Function Documentation

◆ set_pressure_reference()

void mars::PressureConversion::set_pressure_reference ( Pressure  pressure)

Setter function to set the reference pressure after construction of object.

Parameters
pressurePressure reference to set
+ Here is the caller graph for this function:

◆ get_height()

Matrix1d mars::PressureConversion::get_height ( Pressure  pressure)

Converts the given pressure measurement to a height (distance) value.

Parameters
pressurePressure to convert to height
Returns
Matrix1d
+ Here is the caller graph for this function:

◆ get_height_liquid()

double mars::PressureConversion::get_height_liquid ( const Pressure pressure)
private

Converts the given pressure measurement to a height based.

Parameters
pressurePressure of type Pressure::Type::LIQUID to convert to height.
Returns
double the height of the measurement

The measurement is converted assuming that the height is directly proportional to the pressure, .i.e,

h = \frac{P}{\rho g},

with P being the measured pressure, \rho the liquid's density, g the gravity at the surface of the liquid, and h the calculated height.

See also
https://en.wikipedia.org/wiki/Pressure#Liquid_pressure

◆ get_height_gas()

double mars::PressureConversion::get_height_gas ( const Pressure pressure)
private

Converts the given pressure measurement to a height based.

Parameters
pressurePressure of type Pressure::Type::GAS to convert to height.
Returns
double the height of the measurement

The measurement is converted assuming that the height is directly proportional to the pressure, .i.e,

h_start = ((log(P_0) - log(P_sl))*T_0 ) * (R)/(M*g),

h_now = ((log(P) - log(P_sl))*T ) * (R)/(M*g),

h = h_now-h_start,

with P being the measured pressure, P_0 the measured initial pressure (for h=0), P_sl the medium's pressure at sealevel, T the measured temperature, T_0 the measured initial temperature, R the universal gas constant, M the molar mass of the medium, g the gravity at sealevel, and h the calculated height.

See also
https://en.wikipedia.org/wiki/Barometric_formula#Pressure_equations

Member Data Documentation

◆ reference_

Pressure mars::PressureConversion::reference_
private

reference pressure for h=0

◆ medium_options_

MediumPressureOptions mars::PressureConversion::medium_options_
private

pressure medium (gas or liquid) options to use

◆ reference_is_set_

bool mars::PressureConversion::reference_is_set_ { false }
private

flag to determine if the reference_ has been set


The documentation for this class was generated from the following file: