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

Converts VectorNavBinaryOutput. More...

Public Types

enum class  OutputType : uint8_t {
  ImuObs ,
  ImuObsWDelta ,
  BaroPressObs ,
  PosVelAtt ,
  GnssObs ,
  COUNT
}
 Enum specifying the type of the output message. More...
 
- 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...
 

Public Member Functions

void guiConfig () override
 ImGui config window which is shown on double click.
 
VectorNavBinaryConverteroperator= (const VectorNavBinaryConverter &)=delete
 Copy assignment operator.
 
VectorNavBinaryConverteroperator= (VectorNavBinaryConverter &&)=delete
 Move 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.
 
 VectorNavBinaryConverter ()
 Default constructor.
 
 VectorNavBinaryConverter (const VectorNavBinaryConverter &)=delete
 Copy constructor.
 
 VectorNavBinaryConverter (VectorNavBinaryConverter &&)=delete
 Move constructor.
 
 ~VectorNavBinaryConverter () 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.
 
virtual void deinitialize ()
 Deinitialize the Node.
 
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  PosVelSource : uint8_t {
  PosVelSource_Best ,
  PosVelSource_Ins ,
  PosVelSource_Gnss1 ,
  PosVelSource_Gnss2
}
 Enum specifying the source for the PosVelAtt conversion. More...
 

Private Member Functions

std::shared_ptr< const BaroPressObsconvert2BaroPressObs (const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
 Converts the VectorNavBinaryOutput to a BaroPressObs observation.
 
std::shared_ptr< const ImuObsconvert2ImuObs (const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
 Converts the VectorNavBinaryOutput to a ImuObs observation.
 
std::shared_ptr< const ImuObsWDeltaconvert2ImuObsWDelta (const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
 Converts the VectorNavBinaryOutput to a ImuObsWDelta observation.
 
std::shared_ptr< const PosVelAttconvert2PosVelAtt (const std::shared_ptr< const VectorNavBinaryOutput > &vnObs)
 Converts the VectorNavBinaryOutput to a PosVelAtt observation.
 
bool initialize () override
 Initialize the node.
 
void receiveObs (InputPin::NodeDataQueue &queue, size_t pinIdx)
 Converts the VectorNavBinaryOutput observation to the selected message type.
 

Static Private Member Functions

static std::shared_ptr< const GnssObsconvert2GnssObs (const std::shared_ptr< const VectorNavBinaryOutput > &vnObs)
 Converts the VectorNavBinaryOutput to a GnssObs observation.
 

Private Attributes

bool _forceStatic
 GUI option. If checked forces position to a static value and velocity to 0.
 
OutputType _outputType
 The selected output type in the GUI.
 
std::shared_ptr< const PosVelAtt_posVelAtt__init
 Position, Velocity and Attitude at initialization (needed for static data)
 
PosVelSource _posVelSource
 The selected PosVel source in the GUI.
 
bool _useCompensatedData
 Whether to extract the compensated data or the uncompensated.
 

Static Private Attributes

static constexpr size_t INPUT_PORT_INDEX_VECTORNAV_BINARY_OUTPUT
 Flow (VectorNavBinaryOutput)
 
static constexpr size_t OUTPUT_PORT_INDEX_CONVERTED
 Flow.
 

Additional Inherited Members

- 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

Converts VectorNavBinaryOutput.

Definition at line 30 of file VectorNavBinaryConverter.hpp.

Member Enumeration Documentation

◆ OutputType

enum class NAV::VectorNavBinaryConverter::OutputType : uint8_t
strong

Enum specifying the type of the output message.

Enumerator
ImuObs 

Extract ImuObs data.

ImuObsWDelta 

Extract ImuObsWDelta data.

BaroPressObs 

Extract BaroPressObs data.

PosVelAtt 

Extract PosVelAtt data.

GnssObs 

Extract GnssObs data.

COUNT 

Number of items in the enum.

Definition at line 67 of file VectorNavBinaryConverter.hpp.

◆ PosVelSource

Enum specifying the source for the PosVelAtt conversion.

Enumerator
PosVelSource_Best 

INS > GNSS1 > GNSS2.

PosVelSource_Ins 

Take only INS values into account.

PosVelSource_Gnss1 

Take only GNSS1 values into account.

PosVelSource_Gnss2 

Take only GNSS2 values into account.

Definition at line 85 of file VectorNavBinaryConverter.hpp.

Constructor & Destructor Documentation

◆ VectorNavBinaryConverter() [1/3]

NAV::VectorNavBinaryConverter::VectorNavBinaryConverter ( )

Default constructor.

Definition at line 29 of file VectorNavBinaryConverter.cpp.

◆ ~VectorNavBinaryConverter()

NAV::VectorNavBinaryConverter::~VectorNavBinaryConverter ( )
override

Destructor.

Definition at line 41 of file VectorNavBinaryConverter.cpp.

◆ VectorNavBinaryConverter() [2/3]

NAV::VectorNavBinaryConverter::VectorNavBinaryConverter ( const VectorNavBinaryConverter & )
delete

Copy constructor.

◆ VectorNavBinaryConverter() [3/3]

NAV::VectorNavBinaryConverter::VectorNavBinaryConverter ( VectorNavBinaryConverter && )
delete

Move constructor.

Member Function Documentation

◆ category()

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

String representation of the Class Category.

Definition at line 56 of file VectorNavBinaryConverter.cpp.

◆ convert2BaroPressObs()

std::shared_ptr< const NAV::BaroPressObs > NAV::VectorNavBinaryConverter::convert2BaroPressObs ( const std::shared_ptr< const VectorNavBinaryOutput > & vnObs) const
private

Converts the VectorNavBinaryOutput to a BaroPressObs observation.

Parameters
[in]vnObsVectorNavBinaryOutput to process
Returns
The converted data

Definition at line 404 of file VectorNavBinaryConverter.cpp.

◆ convert2GnssObs()

std::shared_ptr< const NAV::GnssObs > NAV::VectorNavBinaryConverter::convert2GnssObs ( const std::shared_ptr< const VectorNavBinaryOutput > & vnObs)
staticprivate

Converts the VectorNavBinaryOutput to a GnssObs observation.

Parameters
[in]vnObsVectorNavBinaryOutput to process
Returns
The converted data

Definition at line 645 of file VectorNavBinaryConverter.cpp.

◆ convert2ImuObs()

std::shared_ptr< const NAV::ImuObs > NAV::VectorNavBinaryConverter::convert2ImuObs ( const std::shared_ptr< const VectorNavBinaryOutput > & vnObs) const
private

Converts the VectorNavBinaryOutput to a ImuObs observation.

Parameters
[in]vnObsVectorNavBinaryOutput to process
Returns
The converted data

Definition at line 326 of file VectorNavBinaryConverter.cpp.

◆ convert2ImuObsWDelta()

std::shared_ptr< const NAV::ImuObsWDelta > NAV::VectorNavBinaryConverter::convert2ImuObsWDelta ( const std::shared_ptr< const VectorNavBinaryOutput > & vnObs) const
private

Converts the VectorNavBinaryOutput to a ImuObsWDelta observation.

Parameters
[in]vnObsVectorNavBinaryOutput to process
Returns
The converted data

Definition at line 234 of file VectorNavBinaryConverter.cpp.

◆ convert2PosVelAtt()

std::shared_ptr< const NAV::PosVelAtt > NAV::VectorNavBinaryConverter::convert2PosVelAtt ( const std::shared_ptr< const VectorNavBinaryOutput > & vnObs)
private

Converts the VectorNavBinaryOutput to a PosVelAtt observation.

Parameters
[in]vnObsVectorNavBinaryOutput to process
Returns
The converted data

Definition at line 453 of file VectorNavBinaryConverter.cpp.

◆ guiConfig()

void NAV::VectorNavBinaryConverter::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 61 of file VectorNavBinaryConverter.cpp.

◆ initialize()

bool NAV::VectorNavBinaryConverter::initialize ( )
overrideprivatevirtual

Initialize the node.

Reimplemented from NAV::Node.

Definition at line 192 of file VectorNavBinaryConverter.cpp.

◆ operator=() [1/2]

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

Copy assignment operator.

◆ operator=() [2/2]

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

Move assignment operator.

◆ receiveObs()

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

Converts the VectorNavBinaryOutput observation to the selected message type.

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

Definition at line 201 of file VectorNavBinaryConverter.cpp.

◆ restore()

void NAV::VectorNavBinaryConverter::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 141 of file VectorNavBinaryConverter.cpp.

◆ save()

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

Saves the node into a json object.

Reimplemented from NAV::Node.

Definition at line 127 of file VectorNavBinaryConverter.cpp.

◆ type()

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

String representation of the Class Type.

Implements NAV::Node.

Definition at line 51 of file VectorNavBinaryConverter.cpp.

◆ typeStatic()

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

String representation of the Class Type.

Definition at line 46 of file VectorNavBinaryConverter.cpp.

Field Documentation

◆ _forceStatic

bool NAV::VectorNavBinaryConverter::_forceStatic
private

GUI option. If checked forces position to a static value and velocity to 0.

Definition at line 97 of file VectorNavBinaryConverter.hpp.

◆ _outputType

OutputType NAV::VectorNavBinaryConverter::_outputType
private

The selected output type in the GUI.

Definition at line 82 of file VectorNavBinaryConverter.hpp.

◆ _posVelAtt__init

std::shared_ptr<const PosVelAtt> NAV::VectorNavBinaryConverter::_posVelAtt__init
private

Position, Velocity and Attitude at initialization (needed for static data)

Definition at line 103 of file VectorNavBinaryConverter.hpp.

◆ _posVelSource

PosVelSource NAV::VectorNavBinaryConverter::_posVelSource
private

The selected PosVel source in the GUI.

Definition at line 94 of file VectorNavBinaryConverter.hpp.

◆ _useCompensatedData

bool NAV::VectorNavBinaryConverter::_useCompensatedData
private

Whether to extract the compensated data or the uncompensated.

Definition at line 100 of file VectorNavBinaryConverter.hpp.

◆ INPUT_PORT_INDEX_VECTORNAV_BINARY_OUTPUT

size_t NAV::VectorNavBinaryConverter::INPUT_PORT_INDEX_VECTORNAV_BINARY_OUTPUT
staticconstexprprivate

Flow (VectorNavBinaryOutput)

Definition at line 79 of file VectorNavBinaryConverter.hpp.

◆ OUTPUT_PORT_INDEX_CONVERTED

size_t NAV::VectorNavBinaryConverter::OUTPUT_PORT_INDEX_CONVERTED
staticconstexprprivate

Flow.

Definition at line 78 of file VectorNavBinaryConverter.hpp.


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