Namespace mim_estimation::io_tools¶
-
namespace io_tools
-
class DataCollector
- #include <data_collector.hpp>
Subclassed by mim_estimation::io_tools::NonRtDataCollector
Public Functions
-
inline DataCollector()
-
inline virtual ~DataCollector()
-
virtual void addVariable(const double *data, const std::string &name, const std::string &units) = 0
virtual functions to add variables to data collection for different types
-
virtual void addVariable(const float *data, const std::string &name, const std::string &units) = 0
-
virtual void addVariable(const int *data, const std::string &name, const std::string &units) = 0
-
virtual void updateDataCollection() = 0
virtual function to update the collection with the recently added variables
-
virtual void stopDataCollection() = 0
-
virtual void startDataCollection() = 0
-
virtual bool isDataCollectionDone() = 0
virtual function to check whether data collection has completed:
-
void addVector(const Eigen::Ref<const Eigen::VectorXd> &data, const std::vector<std::string> &name, const std::vector<std::string> &units)
helper functions to unroll eigen vectors into simpler types that can be handled by the addVariable functions
arbitrary Eigen Vectors
-
void addVector(const Eigen::Ref<const Eigen::VectorXd> &data, const std::string &name, const std::vector<std::string> &extension, const std::vector<std::string> &units)
extension contains the list of strings to be appended to name for each elem of data
-
void addVector(const Eigen::Ref<const Eigen::VectorXd> &data, const std::string &name, const std::string &unit)
will just add 0,1,2..etc as extension to name
-
void addVector3d(const Eigen::Ref<const Eigen::Vector3d> &data, const std::string &name, const std::string &units)
the actual recorded names will be name_x, name_y, name_z
-
void addVector3d(const Eigen::Ref<const Eigen::Vector3d> &data, const std::string &name, const std::string &units, const std::string &extension)
the actual recorded names will be name_x, name_y, name_z plus extension
-
void addQuaternion(const Eigen::Ref<const Eigen::Vector4d> &data, const std::string &name)
the actual recorded names will be name_q0, name_q1, name_q2, name_q3 with units “-”
-
void addQuaternion(const Eigen::Quaterniond &data, const std::string &name)
the actual recorded names will be name_q0, name_q1, name_q2, name_q3 with units “-”
-
void addVector6d(const Eigen::Ref<const Eigen::Matrix<double, 6, 1>> &data, const std::string &name, const std::string &units)
the actual recorded names will have extension x,y,z,a,b,g
-
void addMatrix(const Eigen::Ref<const Eigen::MatrixXd> &data, const std::string &name, const std::string &unit)
arbitrary Eigen matrices (will just add matrix indes as extension to name, eg 11, 12, 21, 22
-
inline DataCollector()
-
class DataReader
- #include <data_reader.hpp>
Public Functions
-
inline DataReader()
-
inline ~DataReader()
-
void read(const std::string &fname)
read, reads a clmcplot file and fills the internal data structure.
- Parameters:
fname – name of the d-file to read.
-
int getIndex(const std::string &stream_name)
findIndex, find the column index corresponding to the field name.
- Parameters:
name – name of the field.
- Returns:
the column index corresponding to the field name.
-
void getIndexes(const std::vector<std::string> &stream_names, std::vector<int> &indexes)
getIndexes:, find stream column indexes corresponding to the names.
- Parameters:
names – list of the stream name.
indexes – the output list of indexes.
-
void fillPose(int row, const std::vector<int> &indexes, Eigen::Vector3d &pose, Eigen::Quaterniond &orientation)
fillPose, fill an existing pose object with the data.
- Parameters:
row – row index homogenous to time/sampling_period.
indexes – the indexes of the data streams to copy in order: [x, y, z, qw, qx, qy, qz].
pose – the object to fill.
-
void fillVector(int row, const std::vector<int> &indexes, Eigen::Ref<Eigen::VectorXd> vec)
fillVector, fill an existing vector from the data
- Parameters:
row – row index homogenous to time/sampling_period.
indexes – the indexes of the data streams to copy.
vec – the vector with the correct dimension that is filled
-
inline int getNbRows()
getNbRows, get the number of rows equivalent to the number of time step saved in the d-file
- Returns:
the number of time step saved
-
inline double getValue(int row, int index)
getValue, get the value of a specific stream at a specific time
- Parameters:
row – row index homogenous to time/sampling_period.
index – the index of the data streams to copy from.
- Returns:
the value
-
inline double getFrequency()
getFrequence, get the getFrequence of the read data
- Returns:
the frequence
-
inline DataReader()
-
class NonRtDataCollector : public mim_estimation::io_tools::DataCollector
- #include <non_rt_data_collector.hpp>
Public Functions
-
inline NonRtDataCollector()
-
inline virtual ~NonRtDataCollector()
-
virtual void addVariable(const double *data, const std::string &name, const std::string &units)
virtual functions to add variables to data collection for different types
-
virtual void addVariable(const float *data, const std::string &name, const std::string &units)
-
virtual void addVariable(const int *data, const std::string &name, const std::string &units)
-
virtual void addVariable(const bool *data, const std::string &name, const std::string &units)
-
virtual void updateDataCollection()
virtual function to update the collection with the recently added variables
-
virtual void stopDataCollection()
-
virtual void startDataCollection()
-
virtual bool isDataCollectionDone()
virtual function to check whether data collection has completed:
-
float reverseFloat(const float inFloat)
convertion big endian and little endian
-
void dump(std::string path)
dump the data in SL format the
-
inline NonRtDataCollector()
-
class DataCollector