![]() |
0.5.1
|
File reader for Multi-IMU data log files. More...
Public Member Functions | |
| void | guiConfig () override |
| ImGui config window which is shown on double click. | |
| const ImuPos & | imuPosition () const |
| Position and rotation information for conversion from platform to body frame. | |
| MultiImuFile () | |
| Default constructor. | |
| MultiImuFile (const MultiImuFile &)=delete | |
| Copy constructor. | |
| MultiImuFile (MultiImuFile &&)=delete | |
| Move constructor. | |
| MultiImuFile & | operator= (const MultiImuFile &)=delete |
| Copy assignment operator. | |
| MultiImuFile & | operator= (MultiImuFile &&)=delete |
| Move assignment operator. | |
| bool | resetNode () override |
| Resets the node. Moves the read cursor to the start. | |
| 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. | |
| ~MultiImuFile () 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. | |
| template<std::derived_from< Node > T> | |
| InputPin * | CreateInputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, void(T::*notifyFunc)(const InsTime &, size_t), int idx=-1) |
| Create an Input Pin object for data pins. The additional notify function gets called when the connected data was changed and the connected node calls NAV::Node::notifyOutputValueChanged. | |
| InputPin * | CreateInputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1) |
| Create an Input Pin object. | |
| template<std::derived_from< Node > T> | |
| InputPin * | CreateInputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, void(T::*callback)(InputPin::NodeDataQueue &, size_t)=nullptr, InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1) |
| Create an Input Pin object. | |
| OutputPin * | CreateOutputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1) |
| Create an Output Pin object. | |
| template<std::derived_from< Node > T> | |
| OutputPin * | CreateOutputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*peekPollDataFunc)(size_t, bool)=nullptr, int idx=-1) |
| Create an Output Pin object for Flow Pins. | |
| template<std::derived_from< Node > T> | |
| OutputPin * | CreateOutputPin (const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, std::shared_ptr< const NAV::NodeData >(T::*pollDataFunc)()=nullptr, int idx=-1) |
| Create an Output Pin object for Flow Pins. | |
| bool | DeleteInputPin (size_t pinIndex) |
| Deletes the input pin. Invalidates the pin reference given. | |
| bool | DeleteOutputPin (size_t pinIndex) |
| Deletes the output pin. Invalidates the pin reference given. | |
| 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. | |
| InputPin & | inputPinFromId (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. | |
| Node & | operator= (const Node &)=delete |
| Copy assignment operator. | |
| Node & | operator= (Node &&)=delete |
| Move assignment operator. | |
| OutputPin & | outputPinFromId (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 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. | |
| Public Member Functions inherited from NAV::FileReader | |
| FileReader (const FileReader &)=delete | |
| Copy constructor. | |
| FileReader (FileReader &&)=delete | |
| Move constructor. | |
| FileReader & | operator= (const FileReader &)=delete |
| Copy assignment operator. | |
| FileReader & | operator= (FileReader &&)=delete |
| Move assignment operator. | |
| virtual | ~FileReader ()=default |
| 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. | |
Protected Attributes | |
| ImuPos | _imuPos |
| Position and rotation information for conversion from platform to body frame. | |
| 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. | |
| Protected Attributes inherited from NAV::FileReader | |
| FileType | _fileType |
| File Type. | |
| std::vector< std::string > | _headerColumns |
| Header Columns of a CSV file. | |
| std::string | _path |
| Path to the file. | |
Private Types | |
| enum class | NmeaType : uint8_t { GPGGA , GPZDA , COUNT } |
| Types of NMEA messages available. More... | |
Private Member Functions | |
| void | deinitialize () override |
| Deinitialize the node. | |
| NAV::FileReader::FileType | determineFileType () override |
| Function to determine the File Type. | |
| bool | initialize () override |
| Initialize the node. | |
| std::shared_ptr< const NodeData > | pollData (size_t pinIdx, bool peek) |
| Polls data from the file. | |
| void | readHeader () override |
| Function to read the Header of a file. | |
| void | updateNumberOfOutputPins () |
| Adds/Deletes Output Pins depending on the variable _nOutputPins. | |
Private Attributes | |
| std::vector< std::string > | _columns |
| Container of column names. | |
| char | _delim |
| Delimiter: ',' for GPZDA and ' ' for GPGGA messages (NMEA) | |
| bool | _gpggaFound |
| Flag that indicates whether a 'GPGGA' message was found in the Multi-IMU-Logs header. | |
| double | _gpsRate |
| GPS data rate [Hz]. | |
| bool | _gpzdaFound |
| Flag that indicates whether a 'GPZDA' message was found in the Multi-IMU-Logs header. | |
| std::vector< std::string > | _headerColumns |
| Container of header column names. | |
| std::vector< ImuPos > | _imuPosAll |
| Container for individual sensor orientations of a Multi-IMU. | |
| InsTime | _lastFiltObs |
| Previous observation (for timestamp) | |
| size_t | _lineCounter |
| Counter for lines. | |
| std::vector< size_t > | _messageCnt |
| Counter for messages. | |
| std::vector< std::map< InsTime, std::shared_ptr< ImuObs > > > | _messages |
| Read messages. Vector idx: Sensor Id,. | |
| NmeaType | _nmeaType |
| Selected NMEA type in the GUI. | |
| size_t | _nSensors |
| Number of connected sensors. | |
| InsTime | _startTime |
| Absolute start time. | |
| gui::widgets::TimeEditFormat | _startTimeEditFormat |
| Time Format to input the init time with. | |
| double | _startupGpsSecond |
| First 'gpsSecond', s.t. measurements start at time = 0. | |
Static Private Attributes | |
| static constexpr size_t | OUTPUT_PORT_INDEX_IMU_OBS |
| Flow (ImuObs) | |
Friends | |
| constexpr const char * | to_string (NmeaType 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... | |
| Public Types inherited from NAV::FileReader | |
| enum | FileType : uint8_t { NONE , BINARY , ASCII } |
| File Type Enumeration. More... | |
| enum | GuiResult : uint8_t { PATH_UNCHANGED , PATH_CHANGED , PATH_CHANGED_INVALID } |
| Results enum for the gui config. More... | |
| Data Fields inherited from NAV::Node | |
| bool | callbacksEnabled |
| Enables the callbacks. | |
| ax::NodeEditor::NodeId | id |
| Unique Id of the Node. | |
| std::vector< InputPin > | inputPins |
| List of input pins. | |
| Kind | kind |
| Kind of the Node. | |
| std::string | name |
| Name of the Node. | |
| std::vector< OutputPin > | outputPins |
| List of output pins. | |
| std::multimap< InsTime, std::pair< OutputPin *, size_t > > | pollEvents |
| Map with callback events (sorted by time) | |
| Protected Member Functions inherited from NAV::FileReader | |
| void | deinitialize () |
| Deinitialize the file reader. | |
| auto | eof () const |
| Check whether the end of file is reached. | |
| FileReader ()=default | |
| Default constructor. | |
| size_t | getCurrentLineNumber () const |
| Get the current line number. | |
| std::filesystem::path | getFilepath () |
| Returns the path of the file. | |
| auto & | getline (std::string &str) |
| Reads a line from the filestream. | |
| bool | good () const |
| Fast error checking. | |
| GuiResult | guiConfig (const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId) |
| ImGui config. | |
| auto & | ignore (std::streamsize count, int delim) |
| Extracts and discards characters from the input stream until and including delim. | |
| bool | initialize () |
| Initialize the file reader. | |
| auto | peek () |
| Looking ahead in the stream. | |
| auto & | read (char *__s, std::streamsize __n) |
| Extraction without delimiters. | |
| auto | readsome (char *s, std::streamsize count) |
| Extracts up to count immediately available characters from the input stream. The extracted characters are stored into the character array pointed to by s. | |
| void | resetReader () |
| Moves the read cursor to the start. | |
| void | restore (const json &j) |
| Restores the node from a json object. | |
| json | save () const |
| Saves the node into a json object. | |
| auto & | seekg (std::streamoff pos, std::ios_base::seekdir dir) |
| Changing the current read position. | |
| std::streampos | tellg () |
| Getting the current read position. | |
File reader for Multi-IMU data log files.
Definition at line 26 of file MultiImuFile.hpp.
|
strongprivate |
Types of NMEA messages available.
| Enumerator | |
|---|---|
| GPGGA | NMEA message type. |
| GPZDA | NMEA message type. |
| COUNT | Number of items in the enum. |
Definition at line 145 of file MultiImuFile.hpp.
| NAV::MultiImuFile::MultiImuFile | ( | ) |
Default constructor.
Definition at line 21 of file MultiImuFile.cpp.
|
override |
Destructor.
Definition at line 32 of file MultiImuFile.cpp.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
staticnodiscard |
String representation of the Class Category.
Definition at line 47 of file MultiImuFile.cpp.
|
overrideprivatevirtual |
Deinitialize the node.
Reimplemented from NAV::Node.
Definition at line 172 of file MultiImuFile.cpp.
|
overrideprivatevirtual |
Function to determine the File Type.
Reimplemented from NAV::FileReader.
Definition at line 210 of file MultiImuFile.cpp.
|
overridevirtual |
ImGui config window which is shown on double click.
Reimplemented from NAV::Node.
Definition at line 52 of file MultiImuFile.cpp.
|
inlinenodiscard |
Position and rotation information for conversion from platform to body frame.
Definition at line 66 of file MultiImuFile.hpp.
|
overrideprivatevirtual |
|
delete |
Copy assignment operator.
|
delete |
Move assignment operator.
|
nodiscardprivate |
Polls data from the file.
| [in] | pinIdx | Index of the pin the data is requested on |
| [in] | peek | Specifies if the data should be peeked (without moving the read cursor) or read |
Definition at line 329 of file MultiImuFile.cpp.
|
overrideprivatevirtual |
Function to read the Header of a file.
Reimplemented from NAV::FileReader.
Definition at line 223 of file MultiImuFile.cpp.
|
overridevirtual |
Resets the node. Moves the read cursor to the start.
Reimplemented from NAV::Node.
Definition at line 179 of file MultiImuFile.cpp.
|
overridevirtual |
Restores the node from a json object.
| [in] | j | Json object with the node state |
Reimplemented from NAV::Node.
Definition at line 139 of file MultiImuFile.cpp.
|
nodiscardoverridevirtual |
Saves the node into a json object.
Reimplemented from NAV::Node.
Definition at line 124 of file MultiImuFile.cpp.
|
nodiscardoverridevirtual |
String representation of the Class Type.
Implements NAV::Node.
Definition at line 42 of file MultiImuFile.cpp.
|
staticnodiscard |
String representation of the Class Type.
Definition at line 37 of file MultiImuFile.cpp.
|
private |
Adds/Deletes Output Pins depending on the variable _nOutputPins.
Definition at line 198 of file MultiImuFile.cpp.
|
friend |
Converts the enum to a string.
| [in] | value | Enum value to convert into text |
Definition at line 163 of file MultiImuFile.hpp.
|
private |
Container of column names.
Definition at line 128 of file MultiImuFile.hpp.
|
private |
Delimiter: ',' for GPZDA and ' ' for GPGGA messages (NMEA)
Definition at line 116 of file MultiImuFile.hpp.
|
private |
Flag that indicates whether a 'GPGGA' message was found in the Multi-IMU-Logs header.
Definition at line 142 of file MultiImuFile.hpp.
|
private |
GPS data rate [Hz].
Definition at line 101 of file MultiImuFile.hpp.
|
private |
Flag that indicates whether a 'GPZDA' message was found in the Multi-IMU-Logs header.
Definition at line 140 of file MultiImuFile.hpp.
|
private |
Container of header column names.
Definition at line 131 of file MultiImuFile.hpp.
|
protected |
Position and rotation information for conversion from platform to body frame.
Definition at line 70 of file MultiImuFile.hpp.
|
private |
Container for individual sensor orientations of a Multi-IMU.
Definition at line 134 of file MultiImuFile.hpp.
|
private |
Previous observation (for timestamp)
Definition at line 137 of file MultiImuFile.hpp.
|
private |
Counter for lines.
Definition at line 110 of file MultiImuFile.hpp.
|
private |
Counter for messages.
Definition at line 113 of file MultiImuFile.hpp.
Read messages. Vector idx: Sensor Id,.
Definition at line 107 of file MultiImuFile.hpp.
|
private |
Selected NMEA type in the GUI.
Definition at line 157 of file MultiImuFile.hpp.
|
private |
Number of connected sensors.
Definition at line 98 of file MultiImuFile.hpp.
|
private |
Absolute start time.
Definition at line 125 of file MultiImuFile.hpp.
|
private |
Time Format to input the init time with.
Definition at line 122 of file MultiImuFile.hpp.
|
private |
First 'gpsSecond', s.t. measurements start at time = 0.
Definition at line 119 of file MultiImuFile.hpp.
|
staticconstexprprivate |
Flow (ImuObs)
Definition at line 73 of file MultiImuFile.hpp.