18#include <unordered_set>
68 [[nodiscard]] std::string
type()
const override;
71 [[nodiscard]]
static std::string
category();
78 [[nodiscard]]
json save()
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;
239 friend void to_json(
json& j,
const Combination& data);
247 friend void to_json(
json& j,
const Combination::Term& data);
251 friend void from_json(
const json& j, Combination::Term& data);
Common logging variables like time into run and local positions.
nlohmann::json json
json namespace
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.
static void pinAddCallback(Node *node)
Function to call to add a new pin.
bool initialize() override
Initialize the node.
static constexpr size_t OUTPUT_PORT_INDEX_DYN_DATA
Flow (DynamicData)
Combiner & operator=(Combiner &&)=delete
Move assignment operator.
gui::widgets::DynamicInputPins _dynamicInputPins
Dynamic input pins.
friend void from_json(const json &j, Combination &data)
Read info from 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.
Combiner(const Combiner &)=delete
Copy constructor.
static std::vector< std::string > _dataIdentifier
Possible data identifiers to connect.
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.
static void pinDeleteCallback(Node *node, size_t pinIdx)
Function to call to delete a pin.
void receiveData(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Data Function.
double _maxTimeStepMultiplierFrequency
Multiply frequency with this to get maximum allowed time step of incoming observations.
bool _noOutputIfTimeStepLarge
Wether to not output a term if the time step to interpolate in between is large.
size_t _refPinIdx
Reference pin.
static std::string category()
String representation of the Class Category.
Combiner(Combiner &&)=delete
Move constructor.
std::string type() const override
String representation of the Class Type.
std::map< InsTime, std::vector< SendRequest > > _sendRequests
Chronological list of send request.
static std::string typeStatic()
String representation of the Class Type.
std::vector< PinData > _pinData
Data per pin.
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.
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.
CommonLog(const CommonLog &)=delete
Copy constructor.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
The class is responsible for all time-related tasks.
static std::string type()
Returns the type of the data class.
Node(std::string name)
Constructor.
std::vector< InputPin > inputPins
List of input pins.
Polynomial Curve Fitting.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
Term of a combination equation.
double factor
Factor to multiply the term with.
ScrollingBuffer< std::shared_ptr< const NodeData > > rawData
Last raw data to add if we send.
std::string description(const Combiner *node, const std::vector< std::string > &descriptors) const
Get a string description of the combination.
size_t pinIndex
Pin Index.
std::variant< size_t, std::string > dataSelection
Data Index or Data identifier.
PolynomialRegressor< double > polyReg
Polynomial Regressor to interpolate data.
std::vector< Term > terms
List of terms making up the combination.
std::string description(const Combiner *node) const
Get a string description of the combination.
double minTimeStep
Min time between messages.
InsTime lastTime
Time of the last observation processed.
std::vector< std::string > dynDataDescriptors
Extra data descriptors for dynamic data.
Send request information.
double result
Calculation result.
std::unordered_set< size_t > termIndices
Term indices, which are already calculated.
bool termNullopt
True if one of the terms values returned std::nullopt.
std::vector< std::pair< std::string, std::shared_ptr< const NodeData > > > rawData
List of the raw data of all terms contributing to the result.
size_t combIndex
Combination Index.