0.4.1
Loading...
Searching...
No Matches
NAV::BaroSimulator Class Reference

Convert RTKLib pos files into PosVel. More...

Public Member Functions

 BaroSimulator ()
 Default constructor.
 
 BaroSimulator (BaroSimulator &&)=delete
 Move constructor.
 
 BaroSimulator (const BaroSimulator &)=delete
 Copy constructor.
 
void guiConfig () override
 ImGui config window which is shown on double click.
 
BaroSimulatoroperator= (BaroSimulator &&)=delete
 Move assignment operator.
 
BaroSimulatoroperator= (const BaroSimulator &)=delete
 Copy assignment operator.
 
void restore (const json &j) override
 Restores the node from a json object.
 
json save () const override
 Saves the node into a json object.
 
std::string type () const override
 String representation of the Class Type.
 
 ~BaroSimulator () override
 Destructor.
 
- Public Member Functions inherited from NAV::Node
virtual void afterCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link was established.
 
virtual void afterDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link was deleted.
 
bool doDeinitialize (bool wait=false)
 Asks the node worker to deinitialize the node.
 
bool doDisable (bool wait=false)
 Asks the node worker to disable the node.
 
bool doEnable ()
 Enable the node.
 
bool doInitialize (bool wait=false)
 Asks the node worker to initialize the node.
 
bool doReinitialize (bool wait=false)
 Asks the node worker to reinitialize the node.
 
virtual void flush ()
 Function called by the flow executer after finishing to flush out remaining data.
 
template<typename T>
std::optional< InputPin::IncomingLink::ValueWrapper< T > > getInputValue (size_t portIndex) const
 Get Input Value connected on the pin. Only const data types.
 
Mode getMode () const
 Get the current mode of the node.
 
const ImVec2 & getSize () const
 Get the size of the node.
 
State getState () const
 Get the current state of the node.
 
bool hasInputPinWithSameTime (const InsTime &insTime) const
 Checks wether there is an input pin with the same time.
 
InputPininputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
 
size_t inputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
 
void invokeCallbacks (size_t portIndex, const std::shared_ptr< const NodeData > &data)
 Calls all registered callbacks on the specified output port.
 
bool isDisabled () const
 Checks if the node is disabled.
 
bool isInitialized () const
 Checks if the node is initialized.
 
bool isOnlyRealtime () const
 Checks if the node is only working in real time (sensors, network interfaces, ...)
 
bool isTransient () const
 Checks if the node is changing its state currently.
 
std::string nameId () const
 Node name and id.
 
 Node (const Node &)=delete
 Copy constructor.
 
 Node (Node &&)=delete
 Move constructor.
 
 Node (std::string name)
 Constructor.
 
void notifyOutputValueChanged (size_t pinIdx, const InsTime &insTime, const std::scoped_lock< std::mutex > &&guard)
 Notifies connected nodes about the change.
 
virtual bool onCreateLink (OutputPin &startPin, InputPin &endPin)
 Called when a new link is to be established.
 
virtual void onDeleteLink (OutputPin &startPin, InputPin &endPin)
 Called when a link is to be deleted.
 
Nodeoperator= (const Node &)=delete
 Copy assignment operator.
 
Nodeoperator= (Node &&)=delete
 Move assignment operator.
 
OutputPinoutputPinFromId (ax::NodeEditor::PinId pinId)
 Returns the pin with the given id.
 
size_t outputPinIndexFromId (ax::NodeEditor::PinId pinId) const
 Returns the index of the pin.
 
void releaseInputValue (size_t portIndex)
 Unblocks the connected node. Has to be called when the input value should be released and getInputValue was not called.
 
std::scoped_lock< std::mutex > requestOutputValueLock (size_t pinIdx)
 Blocks the thread till the output values was read by all connected nodes.
 
virtual bool resetNode ()
 Resets the node. It is guaranteed that the node is initialized when this is called.
 
virtual void restoreAtferLink (const json &j)
 Restores link related properties of the node from a json object.
 
void wakeWorker ()
 Wakes the worker thread.
 
virtual ~Node ()
 Destructor.
 

Static Public Member Functions

static std::string category ()
 String representation of the Class Category.
 
static std::string typeStatic ()
 String representation of the Class Type.
 
- Static Public Member Functions inherited from NAV::Node
static std::string toString (State state)
 Converts the state into a printable text.
 

Private Types

enum class  GravityInput : uint8_t {
  Manual ,
  Position ,
  COUNT
}
 Available options for gravity input. More...
 

Private Member Functions

void deinitialize () override
 Deinitialize the node.
 
bool initialize () override
 Initialize the node.
 
void receiveObs (InputPin::NodeDataQueue &queue, size_t pinIdx)
 Converts the RtklibPosObs into PosVel.
 

Private Attributes

double _exponent
 save computations, by storing g * M / R0 / L;
 
double _geoidhgt
 Geoid undulation in m.
 
double _gravity
 Gravity in m / s²
 
GravityInput _gravityInput
 Default gravity input type.
 
Eigen::Vector3d _initPos
 Initial position in LLA [deg, deg, m] for the calculation of the local gravity through EGM96.
 
double _lapserate
 Temperature lapse rate in K / m.
 
double _pressure0
 Pressure at Sea level in hPa.
 
double _pressurenoise
 pressure noise in hPa
 
RandomNumberGenerator _pressureRng
 Random number generator for the pressure noise.
 
double _temp0
 Temperature at Sea level in deg K.
 

Static Private Attributes

static constexpr size_t INPUT_PORT_INDEX_POS
 Flow.
 
static constexpr size_t OUTPUT_PORT_INDEX_BAROPRESSURE
 Flow.
 

Friends

constexpr const char * to_string (GravityInput value)
 Converts the enum to a string.
 

Additional Inherited Members

- Public Types inherited from NAV::Node
enum class  Mode : uint8_t {
  REAL_TIME ,
  POST_PROCESSING
}
 Different Modes the Node can work in. More...
 
enum class  State : uint8_t {
  Disabled ,
  Deinitialized ,
  DoInitialize ,
  Initializing ,
  Initialized ,
  DoDeinitialize ,
  Deinitializing ,
  DoShutdown ,
  Shutdown
}
 Possible states of the node. More...
 
- Data Fields inherited from NAV::Node
bool callbacksEnabled
 Enables the callbacks.
 
ax::NodeEditor::NodeId id
 Unique Id of the Node.
 
std::vector< InputPininputPins
 List of input pins.
 
Kind kind
 Kind of the Node.
 
std::string name
 Name of the Node.
 
std::vector< OutputPinoutputPins
 List of output pins.
 
std::multimap< InsTime, std::pair< OutputPin *, size_t > > pollEvents
 Map with callback events (sorted by time)
 
- Protected Attributes inherited from NAV::Node
ImVec2 _guiConfigDefaultWindowSize
 
bool _hasConfig
 Flag if the config window should be shown.
 
bool _lockConfigDuringRun
 Lock the config when executing post-processing.
 
bool _onlyRealTime
 Whether the node can run in post-processing or only real-time.
 

Detailed Description

Convert RTKLib pos files into PosVel.

Definition at line 25 of file BaroSimulator.hpp.

Member Enumeration Documentation

◆ GravityInput

enum class NAV::BaroSimulator::GravityInput : uint8_t
strongprivate

Available options for gravity input.

Enumerator
Manual 

Manual entry of the gravity's magnitude.

Position 

Entry of the position, gravity is then deducted from EGM96.

COUNT 

Number of items in the enum.

Definition at line 99 of file BaroSimulator.hpp.

Constructor & Destructor Documentation

◆ BaroSimulator() [1/3]

NAV::BaroSimulator::BaroSimulator ( )

Default constructor.

Definition at line 29 of file BaroSimulator.cpp.

◆ ~BaroSimulator()

NAV::BaroSimulator::~BaroSimulator ( )
override

Destructor.

Definition at line 45 of file BaroSimulator.cpp.

◆ BaroSimulator() [2/3]

NAV::BaroSimulator::BaroSimulator ( const BaroSimulator & )
delete

Copy constructor.

◆ BaroSimulator() [3/3]

NAV::BaroSimulator::BaroSimulator ( BaroSimulator && )
delete

Move constructor.

Member Function Documentation

◆ category()

std::string NAV::BaroSimulator::category ( )
staticnodiscard

String representation of the Class Category.

Definition at line 60 of file BaroSimulator.cpp.

◆ deinitialize()

void NAV::BaroSimulator::deinitialize ( )
overrideprivatevirtual

Deinitialize the node.

Reimplemented from NAV::Node.

Definition at line 158 of file BaroSimulator.cpp.

◆ guiConfig()

void NAV::BaroSimulator::guiConfig ( )
overridevirtual

ImGui config window which is shown on double click.

Attention
Don't forget to set _hasConfig to true in the constructor of the node

Reimplemented from NAV::Node.

Definition at line 65 of file BaroSimulator.cpp.

◆ initialize()

bool NAV::BaroSimulator::initialize ( )
overrideprivatevirtual

Initialize the node.

Reimplemented from NAV::Node.

Definition at line 145 of file BaroSimulator.cpp.

◆ operator=() [1/2]

BaroSimulator & NAV::BaroSimulator::operator= ( BaroSimulator && )
delete

Move assignment operator.

◆ operator=() [2/2]

BaroSimulator & NAV::BaroSimulator::operator= ( const BaroSimulator & )
delete

Copy assignment operator.

◆ receiveObs()

void NAV::BaroSimulator::receiveObs ( InputPin::NodeDataQueue & queue,
size_t pinIdx )
private

Converts the RtklibPosObs into PosVel.

Parameters
[in]queueQueue with all the received data messages
[in]pinIdxIndex of the pin the data is received on

Definition at line 223 of file BaroSimulator.cpp.

◆ restore()

void NAV::BaroSimulator::restore ( const json & j)
overridevirtual

Restores the node from a json object.

Parameters
[in]jJson object with the node state

Reimplemented from NAV::Node.

Definition at line 181 of file BaroSimulator.cpp.

◆ save()

json NAV::BaroSimulator::save ( ) const
nodiscardoverridevirtual

Saves the node into a json object.

Reimplemented from NAV::Node.

Definition at line 163 of file BaroSimulator.cpp.

◆ type()

std::string NAV::BaroSimulator::type ( ) const
nodiscardoverridevirtual

String representation of the Class Type.

Implements NAV::Node.

Definition at line 55 of file BaroSimulator.cpp.

◆ typeStatic()

std::string NAV::BaroSimulator::typeStatic ( )
staticnodiscard

String representation of the Class Type.

Definition at line 50 of file BaroSimulator.cpp.

Friends And Related Symbol Documentation

◆ to_string

const char * to_string ( GravityInput value)
friend

Converts the enum to a string.

Parameters
[in]valueEnum value to convert into text
Returns
String representation of the enum

Definition at line 118 of file BaroSimulator.hpp.

Field Documentation

◆ _exponent

double NAV::BaroSimulator::_exponent
private

save computations, by storing g * M / R0 / L;

Definition at line 93 of file BaroSimulator.hpp.

◆ _geoidhgt

double NAV::BaroSimulator::_geoidhgt
private

Geoid undulation in m.

Definition at line 83 of file BaroSimulator.hpp.

◆ _gravity

double NAV::BaroSimulator::_gravity
private

Gravity in m / s²

Definition at line 85 of file BaroSimulator.hpp.

◆ _gravityInput

GravityInput NAV::BaroSimulator::_gravityInput
private

Default gravity input type.

Definition at line 107 of file BaroSimulator.hpp.

◆ _initPos

Eigen::Vector3d NAV::BaroSimulator::_initPos
private

Initial position in LLA [deg, deg, m] for the calculation of the local gravity through EGM96.

Definition at line 96 of file BaroSimulator.hpp.

◆ _lapserate

double NAV::BaroSimulator::_lapserate
private

Temperature lapse rate in K / m.

Definition at line 81 of file BaroSimulator.hpp.

◆ _pressure0

double NAV::BaroSimulator::_pressure0
private

Pressure at Sea level in hPa.

Definition at line 79 of file BaroSimulator.hpp.

◆ _pressurenoise

double NAV::BaroSimulator::_pressurenoise
private

pressure noise in hPa

Definition at line 87 of file BaroSimulator.hpp.

◆ _pressureRng

RandomNumberGenerator NAV::BaroSimulator::_pressureRng
private

Random number generator for the pressure noise.

Definition at line 90 of file BaroSimulator.hpp.

◆ _temp0

double NAV::BaroSimulator::_temp0
private

Temperature at Sea level in deg K.

Definition at line 77 of file BaroSimulator.hpp.

◆ INPUT_PORT_INDEX_POS

size_t NAV::BaroSimulator::INPUT_PORT_INDEX_POS
staticconstexprprivate

Flow.

Definition at line 63 of file BaroSimulator.hpp.

◆ OUTPUT_PORT_INDEX_BAROPRESSURE

size_t NAV::BaroSimulator::OUTPUT_PORT_INDEX_BAROPRESSURE
staticconstexprprivate

Flow.

Definition at line 62 of file BaroSimulator.hpp.


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