Barometer

This sensor follows the International Standard Atmosphere (ISA) model [Cav00] .

File: barometer.py
Author: Marcelo Jacinto (marcelo.jacinto@tecnico.ulisboa.pt)
License: BSD-3-Clause. Copyright (c) 2023, Marcelo Jacinto. All rights reserved.
Description: Simulates a barometer. Based on the implementation provided in PX4 stil_gazebo (https://github.com/PX4/PX4-SITL_gazebo) by Elia Tarasov.
References: Both the original implementation provided in the gazebo based simulation and this one are based on the following article - ‘A brief summary of atmospheric modeling’, Cavcar, M., http://fisicaatmo.at.fcen.uba.ar/practicas/ISAweb.pdf

Classes:

Barometer

The class that implements a barometer sensor.

class pegasus.simulator.logic.sensors.barometer.Barometer

Bases: Sensor

The class that implements a barometer sensor. This class inherits the base class Sensor.

Methods:

__init__([config])

Initialize the Barometer class

update(state, dt)

Method that should be implemented by the class that inherits Sensor.

Attributes:

state

(dict) The 'state' of the sensor, i.e. the data produced by the sensor at any given point in time.

__init__(config={})

Initialize the Barometer class

Parameters:

config (dict) – A Dictionary that contains all the parameters for configuring the Barometer - it can be empty or only have some of the parameters used by the Barometer.

Examples

The dictionary default parameters are

>>> {"temperature_msl": 288.15,           # temperature at MSL [K] (15 [C])
>>>  "pressure_msl": 101325.0,            # pressure at MSL [Pa]
>>>  "lapse_rate": 0.0065,                # reduction in temperature with altitude for troposphere [K/m]
>>>  "air_density_msl": 1.225,            # air density at MSL [kg/m^3]
>>>  "absolute_zero": -273.15,            # [C]
>>>  "drift_pa_per_sec": 0.0,             # Pa
>>>  "update_rate": 250.0}                # Hz
update(state, dt)

Method that should be implemented by the class that inherits Sensor. This is where the actual implementation of the sensor should be performed.

Parameters:
  • state (State) – The current state of the vehicle.

  • dt (float) – The time elapsed between the previous and current function calls (s).

Returns:

(dict) A dictionary containing the current state of the sensor (the data produced by the sensor)

property state

(dict) The ‘state’ of the sensor, i.e. the data produced by the sensor at any given point in time