24 #include "core/MACoreTypes.hpp" 30 #define MA_ANALYZER_ADD_FEATURE_NAME(_name) \ 31 if (unlikely(!FeatureNamesReady)) \ 33 FeatureNames.push_back(#_name); \ 36 #define MA_ANALYZER_ADD_FEATURE_NAME_STR(_name) \ 37 if (unlikely(!FeatureNamesReady)) \ 39 FeatureNames.push_back(_name); \ 42 #define MA_ANALYZER_ADD_FEATURE_NAME_WITH_INDEX(_name, _index) \ 43 if (unlikely(!FeatureNamesReady)) \ 45 FeatureNames.push_back(std::string("\"")+#_name+MCToStr(_index)+'"'); \ 48 #define MA_ANALYZER_FEATURE_NAMES_COMMIT(_features) \ 49 if (unlikely(!FeatureNamesReady)) \ 51 FeatureNamesReady = true; \ 52 if (FeatureNames.size() != _features.size()) \ 54 MC_WARNING("Feature name and feature count are different (%d != %d)", \ 55 FeatureNames.size(), _features.size()); \ 96 virtual void Reset() = 0;
105 virtual bool IsValid()
const = 0;
131 const unsigned int window_size);
static MC::FloatTable CompactFeatureVectors(const MC::FloatTable &feature_vectors, const unsigned int window_size)
Compacting the feature vectors.
bool FeatureNamesReady
Whether the feature names are defined.
virtual bool IsValid() const =0
Check if enough samples were added to the analyzer.
virtual MC::FloatList GetFeatureVector()=0
Get a feature vector.
virtual void Reset()=0
Reset the analyzer and drop all samples.
MC::StringList FeatureNames
Feature names.
virtual void AddSamples(const MARobotState &robot_state)=0
Add new samples from the robot state.
const MC::StringList & GetFeatureNames() const
Get the feature names.