18#include <unordered_set>
68 [[nodiscard]] std::string
type()
const override;
119 [[nodiscard]] std::string
description(
const Combiner* node,
const std::vector<std::string>& descriptors)
const
123 return fmt::format(
"{} {} ({})",
factor == 1.0 ?
"+" : (
factor == -1.0 ?
"-" : fmt::format(
"{:.2f}",
factor)),
128 return fmt::format(
"{} {} ({})",
factor == 1.0 ?
"+" : (
factor == -1.0 ?
"-" : fmt::format(
"{:.2f}",
factor)),
136 std::vector<Term>
terms{
Term{ .factor = +1.0, .pinIndex = 0 },
137 Term{ .factor = -1.0, .pinIndex = 1 } };
144 for (
const auto& term :
terms)
147 auto termDescription = term.description(node, descriptors);
151 if (termDescription.starts_with(
"+ ") || termDescription.starts_with(
"- "))
160 desc += termDescription;
203 std::vector<std::pair<std::string, std::shared_ptr<const NodeData>>>
rawData;
Common logging variables like time into run and local positions.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
GNSS measurement combinations.
GNSS Observation messages.
Data storage class for simulated IMU observations.
Data storage class for one VectorNavImu observation.
Parent Class for all IMU Observations.
Loosely-coupled Kalman Filter INS/GNSS errors.
Tightly-coupled Kalman Filter INS/GNSS errors.
The class is responsible for all time-related tasks.
Data storage class for one KVH Imu observation.
Polynomial curve fitting.
Position, Velocity and Attitude Storage Class.
RTKLIB Pos Observation Class.
Binary Outputs from VectorNav Sensors.
bool initialize() override
Initialize the node.
static constexpr size_t OUTPUT_PORT_INDEX_DYN_DATA
Flow (DynamicData)
Definition Combiner.hpp:85
Combiner & operator=(Combiner &&)=delete
Move assignment operator.
static void pinAddCallback(Node *node)
Function to call to add a new pin.
friend void from_json(const json &j, Combination::Term &data)
Read info from a json object.
gui::widgets::DynamicInputPins _dynamicInputPins
Dynamic input pins.
Definition Combiner.hpp:219
friend void to_json(json &j, const Combination::Term &data)
Write info to a json object.
std::vector< std::string > getDataDescriptors(size_t pinIndex) const
Returns a list of descriptors for the pin.
double _maxTimeDiffMultiplierFrequency
Multiply frequency with this to get maximum allowed time difference to interpolate to.
Definition Combiner.hpp:191
Combiner(const Combiner &)=delete
Copy constructor.
static void pinDeleteCallback(Node *node, size_t pinIdx)
Function to call to delete a pin.
static std::vector< std::string > _dataIdentifier
Possible data identifiers to connect.
Definition Combiner.hpp:88
void guiConfig() override
ImGui config window which is shown on double click.
void deinitialize() override
Deinitialize the node.
bool _outputMissingAsNaN
Output missing combinations with NaN instead of removing.
Definition Combiner.hpp:188
void receiveData(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Data Function.
static std::string typeStatic()
String representation of the Class Type.
double _maxTimeStepMultiplierFrequency
Multiply frequency with this to get maximum allowed time step of incoming observations.
Definition Combiner.hpp:194
bool _noOutputIfTimeStepLarge
Wether to not output a term if the time step to interpolate in between is large.
Definition Combiner.hpp:193
friend void from_json(const json &j, Combination &data)
Read info from a json object.
size_t _refPinIdx
Reference pin.
Definition Combiner.hpp:185
Combiner(Combiner &&)=delete
Move constructor.
static std::string category()
String representation of the Class Category.
std::string type() const override
String representation of the Class Type.
std::map< InsTime, std::vector< SendRequest > > _sendRequests
Chronological list of send request.
Definition Combiner.hpp:207
std::vector< PinData > _pinData
Data per pin.
Definition Combiner.hpp:182
Combiner()
Default constructor.
void restore(const json &j) override
Restores the node from a json object.
bool _noOutputIfTimeDiffLarge
Wether to not output a term if the interpolation time point is too far away.
Definition Combiner.hpp:190
friend void to_json(json &j, const Combination &data)
Write info to a json object.
~Combiner() override
Destructor.
Combiner & operator=(const Combiner &)=delete
Copy assignment operator.
json save() const override
Saves the node into a json object.
std::vector< Combination > _combinations
Combinations to calculate.
Definition Combiner.hpp:168
CommonLog(const CommonLog &)=delete
Copy constructor.
static std::string type()
Returns the type of the data class.
Definition GnssCombination.hpp:32
static std::string type()
Returns the type of the data class.
Definition GnssObs.hpp:150
static std::string type()
Returns the type of the data class.
Definition ImuObsSimulated.hpp:31
static std::string type()
Returns the type of the data class.
Definition ImuObsWDelta.hpp:32
static std::string type()
Returns the type of the data class.
Definition ImuObs.hpp:33
static std::string type()
Returns the type of the data class.
Definition InsGnssLCKFSolution.hpp:30
static std::string type()
Returns the type of the data class.
Definition InsGnssTCKFSolution.hpp:26
The class is responsible for all time-related tasks.
Definition InsTime.hpp:710
static std::string type()
Returns the type of the data class.
Definition KvhObs.hpp:39
Node(std::string name)
Constructor.
std::vector< InputPin > inputPins
List of input pins.
Definition Node.hpp:390
Polynomial Curve Fitting.
Definition PolynomialRegressor.hpp:39
static std::string type()
Returns the type of the data class.
Definition PosVelAtt.hpp:29
static std::string type()
Returns the type of the data class.
Definition PosVel.hpp:27
static std::string type()
Returns the type of the data class.
Definition Pos.hpp:36
static std::string type()
Returns the type of the data class.
Definition RtklibPosObs.hpp:139
static std::string type()
Returns the type of the data class.
Definition SppSolution.hpp:41
static std::string type()
Returns the type of the data class.
Definition VectorNavBinaryOutput.hpp:48
Term of a combination equation.
Definition Combiner.hpp:108
double factor
Factor to multiply the term with.
Definition Combiner.hpp:109
ScrollingBuffer< std::shared_ptr< const NodeData > > rawData
Last raw data to add if we send.
Definition Combiner.hpp:114
std::string description(const Combiner *node, const std::vector< std::string > &descriptors) const
Get a string description of the combination.
Definition Combiner.hpp:119
size_t pinIndex
Pin Index.
Definition Combiner.hpp:110
std::variant< size_t, std::string > dataSelection
Data Index or Data identifier.
Definition Combiner.hpp:111
PolynomialRegressor< double > polyReg
Polynomial Regressor to interpolate data.
Definition Combiner.hpp:113
Combination of data.
Definition Combiner.hpp:105
std::vector< Term > terms
List of terms making up the combination.
Definition Combiner.hpp:136
std::string description(const Combiner *node) const
Get a string description of the combination.
Definition Combiner.hpp:141
Pin data.
Definition Combiner.hpp:172
double minTimeStep
Min time between messages.
Definition Combiner.hpp:176
InsTime lastTime
Time of the last observation processed.
Definition Combiner.hpp:174
std::vector< std::string > dynDataDescriptors
Extra data descriptors for dynamic data.
Definition Combiner.hpp:178
Send request information.
Definition Combiner.hpp:198
double result
Calculation result.
Definition Combiner.hpp:201
std::unordered_set< size_t > termIndices
Term indices, which are already calculated.
Definition Combiner.hpp:200
bool termNullopt
True if one of the terms values returned std::nullopt.
Definition Combiner.hpp:202
std::vector< std::pair< std::string, std::shared_ptr< const NodeData > > > rawData
List of the raw data of all terms contributing to the result.
Definition Combiner.hpp:203
size_t combIndex
Combination Index.
Definition Combiner.hpp:199