Skip to main content

StateEstimation::FeatureVector

StateEstimation::FeatureVector

Container for multiple features with metadata. More…

#include <FeatureVector.hpp>

Public Functions

Name
FeatureVector() =default
Construct empty feature vector.
FeatureVector(std::size_t initial_capacity)
Construct with initial capacity.
std::size_t addFeature(std::string const & name, FeatureType type, Eigen::VectorXd const & values, bool has_derivatives =true)
Add a feature to the vector.
Eigen::VectorXd const & getVector() const
Get the complete feature vector.
Eigen::VectorXd & getVector()
Get mutable reference to feature vector.
Eigen::VectorXd getFeature(std::string const & name) const
Get feature values by name.
Eigen::VectorXd getFeature(std::size_t feature_index) const
Get feature values by index.
void setFeature(std::string const & name, Eigen::VectorXd const & values)
Set feature values by name.
void setFeature(std::size_t feature_index, Eigen::VectorXd const & values)
Set feature values by index.
FeatureDescriptor const * getFeatureDescriptor(std::string const & name) const
Get feature descriptor by name.
FeatureDescriptor const & getFeatureDescriptor(std::size_t feature_index) const
Get feature descriptor by index.
std::vector< FeatureDescriptor > const & getFeatureDescriptors() const
Get all feature descriptors.
std::size_t getFeatureCount() const
Get number of features.
std::size_t getDimension() const
Get total dimension of the feature vector.
bool hasFeature(std::string const & name) const
Check if a feature exists.
void clear()
Clear all features.
FeatureVector subset(std::vector< std::string > const & feature_names) const
Create a copy with only specified features.

Detailed Description

class StateEstimation::FeatureVector;

Container for multiple features with metadata.

Stores feature values as a single Eigen vector while maintaining metadata about individual features for proper handling during tracking and assignment operations.

Public Functions Documentation

function FeatureVector

FeatureVector() =default

Construct empty feature vector.

function FeatureVector

explicit FeatureVector(
    std::size_t initial_capacity
)

Construct with initial capacity.

function addFeature

std::size_t addFeature(
    std::string const & name,
    FeatureType type,
    Eigen::VectorXd const & values,
    bool has_derivatives =true
)

Add a feature to the vector.

Parameters:

  • name Feature name
  • type Feature type classification
  • values Feature values
  • has_derivatives Whether derivatives are meaningful for this feature

Return: Index of the added feature

function getVector

inline Eigen::VectorXd const & getVector() const

Get the complete feature vector.

function getVector

inline Eigen::VectorXd & getVector()

Get mutable reference to feature vector.

function getFeature

Eigen::VectorXd getFeature(
    std::string const & name
) const

Get feature values by name.

function getFeature

Eigen::VectorXd getFeature(
    std::size_t feature_index
) const

Get feature values by index.

function setFeature

void setFeature(
    std::string const & name,
    Eigen::VectorXd const & values
)

Set feature values by name.

function setFeature

void setFeature(
    std::size_t feature_index,
    Eigen::VectorXd const & values
)

Set feature values by index.

function getFeatureDescriptor

FeatureDescriptor const * getFeatureDescriptor(
    std::string const & name
) const

Get feature descriptor by name.

function getFeatureDescriptor

FeatureDescriptor const & getFeatureDescriptor(
    std::size_t feature_index
) const

Get feature descriptor by index.

function getFeatureDescriptors

inline std::vector< FeatureDescriptor > const & getFeatureDescriptors() const

Get all feature descriptors.

function getFeatureCount

inline std::size_t getFeatureCount() const

Get number of features.

function getDimension

inline std::size_t getDimension() const

Get total dimension of the feature vector.

function hasFeature

bool hasFeature(
    std::string const & name
) const

Check if a feature exists.

function clear

void clear()

Clear all features.

function subset

FeatureVector subset(
    std::vector< std::string > const & feature_names
) const

Create a copy with only specified features.


Updated on 2026-11-13 at 20:25:41 +0000