Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::Aeroutils Namespace Reference

Classes

struct  AerodynamicCoeff
 

Functions

float relAltitude (float pressure, float pressureRef=Constants::MSL_PRESSURE, float temperatureRef=Constants::MSL_TEMPERATURE)
 Returns the altitude given the pressure with respect to a reference pressure and temperature, using International Standard Atmosphere model.
 
float relPressure (float altitude, float pressureRef=Constants::MSL_PRESSURE, float temperatureRef=Constants::MSL_TEMPERATURE)
 Returns the pressure given the altitude with respect to a reference pressure and temperature, using International Standard Atmosphere model.
 
float relTemperature (float altitude, float temperatureRef=Constants::MSL_TEMPERATURE)
 Returns the temperature at the given altitude with respect to the reference temperature.
 
float relDensity (float pressure, float pressureRef=Constants::MSL_PRESSURE, float altitudeRef=0, float temperatureRef=Constants::MSL_TEMPERATURE)
 Returns the air density given the pressure with respect to a reference pressure, altitude and temperature, using the International Standard Atmosphere model.
 
float mslPressure (float pressureRef, float temperatureRef, float altitudeRef)
 Returns the expected pressure at mean sea level based on temperature and pressure at a reference altitude, using International Standard Atmosphere model.
 
float mslTemperature (float temperatureRef, float altitudeRef)
 Returns the expected temperature at mean sea level based on temperature at a reference altitude, using International Standard Atmosphere model.
 
float verticalSpeed (float p, float dpDt, float pRef, float tRef)
 
Vector2f geodetic2NED (const Vector2f &target, const Vector2f &origin)
 
float computeRho (float d, float t0)
 Computes the rho (air density) of air at the given altitude.
 
float computeSoundSpeed (float d, float t0)
 Computes the speed of sound at the given altitude.
 
float computeMach (float d, float vtot, float t0)
 Computes the mach relative to the speed at a certain altitude.
 
float computePitotMach (float pressureTotal, float pressureStatic)
 Computes the mach from total and static pressure measures from a pitot tube.
 
float computePitotAirspeed (float pressureTotal, float pressureStatic, float d, float t0)
 Computes air speed relative to the pitot tube.
 
float computeCd (const AerodynamicCoeff &coeff, float mach)
 Computes the CD from aerodynamic coefficients and mach.
 
Eigen::Vector2f geodetic2NED (const Eigen::Vector2f &target, const Eigen::Vector2f &origin)
 Converts decimal degrees of latitude and longitude into displacement in meters between two positions the with an ellipsoidal earth model.
 

Function Documentation

◆ computeCd()

float Boardcore::Aeroutils::computeCd ( const AerodynamicCoeff & coeff,
float mach )

Computes the CD from aerodynamic coefficients and mach.

Parameters
coeffAerodynamic coefficients.
machMach value.
Returns
The computed CD.

Definition at line 122 of file AeroUtils.cpp.

◆ computeMach()

float Boardcore::Aeroutils::computeMach ( float d,
float vtot,
float t0 )

Computes the mach relative to the speed at a certain altitude.

Parameters
dAltitude agl in NED frame [m].
vtotTotal speed [m/s].
t0Temperature at ground level [K].
Returns
The mach relative to the speed at a certain altitude.

Definition at line 101 of file AeroUtils.cpp.

◆ computePitotAirspeed()

float Boardcore::Aeroutils::computePitotAirspeed ( float pressureTotal,
float pressureStatic,
float d,
float t0 )

Computes air speed relative to the pitot tube.

Parameters
pressureTotalTotal pressure from the pitot tube [Pa].
pressureStaticStatic pressure from the pitot tube [Pa].
dAltitude agl in NED frame [m].
t0Temperature at ground level [K].
Returns
Calculated airspeed [m/s].

Definition at line 114 of file AeroUtils.cpp.

◆ computePitotMach()

float Boardcore::Aeroutils::computePitotMach ( float pressureTotal,
float pressureStatic )

Computes the mach from total and static pressure measures from a pitot tube.

Parameters
pressureTotalTotal pressure from the pitot tube [Pa].
pressureStaticStatic pressure from the pitot tube [Pa].
Returns
Calculated mach.

Definition at line 106 of file AeroUtils.cpp.

◆ computeRho()

float Boardcore::Aeroutils::computeRho ( float d,
float t0 )

Computes the rho (air density) of air at the given altitude.

Parameters
dAltitude agl in NED frame [m].
t0Temperature at ground level [K].
Returns
The air density at the given altitude [kg/m^3].

Definition at line 86 of file AeroUtils.cpp.

◆ computeSoundSpeed()

float Boardcore::Aeroutils::computeSoundSpeed ( float d,
float t0 )

Computes the speed of sound at the given altitude.

Parameters
dAltitude agl in NED frame [m].
t0Temperature at ground level [K].
Returns
The speed of sound at the given altitude [m/s].

Definition at line 94 of file AeroUtils.cpp.

◆ geodetic2NED() [1/2]

Eigen::Vector2f Boardcore::Aeroutils::geodetic2NED ( const Eigen::Vector2f & target,
const Eigen::Vector2f & origin )

Converts decimal degrees of latitude and longitude into displacement in meters between two positions the with an ellipsoidal earth model.

Parameters
targetCoordinates of target position [lat lon][deg]
originCoordinates of the Initial position used as the origin of the NED frame [lat lon][deg]
Returns
Target NED position with respect to the origin coordinates [n e][m]

◆ geodetic2NED() [2/2]

Vector2f Boardcore::Aeroutils::geodetic2NED ( const Vector2f & target,
const Vector2f & origin )

Definition at line 74 of file AeroUtils.cpp.

◆ mslPressure()

float Boardcore::Aeroutils::mslPressure ( float pressureRef,
float temperatureRef,
float altitudeRef )

Returns the expected pressure at mean sea level based on temperature and pressure at a reference altitude, using International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level
Parameters
pressureRefPressure at reference altitude [Pa]
temperatureRefTemperature at reference altitude. Must be > 0 [K]
altitudeRefReference altitude [m]
Returns
Pressure at mean sea level [Pa]

Definition at line 58 of file AeroUtils.cpp.

◆ mslTemperature()

float Boardcore::Aeroutils::mslTemperature ( float temperatureRef,
float altitudeRef )

Returns the expected temperature at mean sea level based on temperature at a reference altitude, using International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level.
Parameters
temperatureRefTemperature at reference altitude [K]
altitudeRefReference altitude [m]
Returns
Temperature at mean sea level [K]

Definition at line 64 of file AeroUtils.cpp.

◆ relAltitude()

float Boardcore::Aeroutils::relAltitude ( float pressure,
float pressureRef = Constants::MSL_PRESSURE,
float temperatureRef = Constants::MSL_TEMPERATURE )

Returns the altitude given the pressure with respect to a reference pressure and temperature, using International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level.
This function provides a relative altitude from the altitude where the reference pressure and temperature were measured. It does not provide altitude above mean sea level unless the reference is, in fact, the sea level.

This means that if the reference pressure and temperature are those at mean sea level, then the returned altitude is from mean sea level. Otherwise if the reference pressure and temperature are those form the launchpad, then the returned altitude is from above ground level.

Parameters
pressureCurrent absolute pressure [Pa]
pressureRefPressure at reference altitude (must be > 0) [Pa]
temperatureRefTemperature at reference altitude [K]
Returns
Current altitude with respect to the reference altitude [m]

Definition at line 36 of file AeroUtils.cpp.

◆ relDensity()

float Boardcore::Aeroutils::relDensity ( float pressure,
float pressureRef = Constants::MSL_PRESSURE,
float altitudeRef = 0,
float temperatureRef = Constants::MSL_TEMPERATURE )

Returns the air density given the pressure with respect to a reference pressure, altitude and temperature, using the International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level.
Parameters
pressureCurrent atmospheric pressure [Pa]
pressureRefPressure at reference altitude (must be > 0) [Pa]
altitudeRefReference altitude [m]
temperatureRefTemperature at reference altitude [K]
Returns
Current air density [Kg/m^3]

Definition at line 51 of file AeroUtils.cpp.

◆ relPressure()

float Boardcore::Aeroutils::relPressure ( float altitude,
float pressureRef = Constants::MSL_PRESSURE,
float temperatureRef = Constants::MSL_TEMPERATURE )

Returns the pressure given the altitude with respect to a reference pressure and temperature, using International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level.
This function provides a relative pressure at the given altitude relative to the altitude where the reference pressure and temperature were measured. It does not provide altitude above mean sea level unless the reference is, in fact, the sea level.

This means that if the reference pressure and temperature are those at mean sea level, then the returned pressure is from mean sea level. Otherwise if the reference pressure and temperature are those form the launchpad, then the returned pressure is from above ground level.

Parameters
altitudeCurrent relative altitude wrt the altitude of the reference pressure and temperature [m]
pressureRefPressure at reference altitude (must be > 0) [Pa]
temperatureRefTemperature at reference altitude [K]
Returns
Current pressure at the given altitude wrt the reference altitude [m]

Definition at line 41 of file AeroUtils.cpp.

◆ relTemperature()

float Boardcore::Aeroutils::relTemperature ( float altitude,
float temperatureRef = Constants::MSL_TEMPERATURE )

Returns the temperature at the given altitude with respect to the reference temperature.

Warning
This function is valid for altitudes below 11000 meters above sea level.
This function provides a relative temperature from the altitude where the reference temperature is measured. It does not provide temperature above mean sea level unless the reference is, in fact, measured at the sea level.

This means that if the reference temperature is that at mean sea level, then the returned temperature is that at the given altitude from mean sea level. Otherwise if the reference temperature is that form the launchpad, then the returned temperature is that at the given altitude from above ground level.

Parameters
altitudeCurrent relative altitude wrt the altitude of the reference pressure [m]
temperatureRefTemperature at reference altitude [K]
Returns
Current temperature at the given altitude wrt the reference altitude [m]

Definition at line 46 of file AeroUtils.cpp.

◆ verticalSpeed()

float Boardcore::Aeroutils::verticalSpeed ( float p,
float dpDt,
float pRef,
float tRef )

Returns the vertical speed (or rate of climb) of the rocket, assuming an International Standard Atmosphere model.

Warning
This function is valid for altitudes below 11000 meters above sea level
Parameters
pCurrent pressure (must be > 0) [Pa]
dpDtRate of change of pressure [Pa/s]
pRefReference pressure (must be > 0) [Pa]
tRefReference temperature [K]
Returns
Vertical speed, positive upwards [m/s]

Definition at line 69 of file AeroUtils.cpp.