ModelSpace
Documentation for ModelSpace models and classes.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cfspp::PointingVectorMeasurements< N > Class Template Reference

#include <PointingVectorMeasurements.hpp>

Inheritance diagram for cfspp::PointingVectorMeasurements< N >:

Public Member Functions

 PointingVectorMeasurements (uint32 state_quat_index, uint32 observer_pointing_index=0, uint32 observer_quat_index=3, uint32 meas_pointing_index=0)
 Constructor of the class. More...
 
void setNoiseStd (const std::array< floating_point, 3 > &new_std)
 Setter function for the measurement noise standard deviation. More...
 
int16 calculateMeasurements (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS > &expected_measurement) override
 Function to calculate a measurement from current state of system. More...
 
int16 calculateMeasurementsMatrix (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS *N > &measurement_Jacobian) override
 Function to calculate the measurement function Jacobian from current state of system. More...
 
int16 calculateMeasurementNoiseMappingMatrix (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS *POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS > &measurement_mapping) override
 Function to calculate the matrix that maps the noise configuration space to the measurement configuration space. More...
 
int16 calculateNoiseCovariance (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS *POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS > &measurement_covariance) override
 Function to calculate the covariance matrix of a given measurement with a specific noise profile. More...
 
- Public Member Functions inherited from cfspp::Measurements< N, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS, POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS >
virtual int16 calculateMeasurements (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, std::array< floating_point, M > &expected_measurement)
 Function to calculate a measurement from current state of system. More...
 
virtual int16 calculateMeasurementsMatrix (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, std::array< floating_point, M *N > &measurement_Jacobian)
 Function to calculate the measurement function Jacobian from current state of system. More...
 
virtual int16 calculateMeasurementNoiseMappingMatrix (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, std::array< floating_point, M *R > &measurement_mapping)
 Function to calculate the matrix that maps the noise configuration space to the measurement configuration space. More...
 
virtual int16 calculateNoiseCovariance (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, std::array< floating_point, R *R > &measurement_covariance)
 Function to calculate the covariance matrix of a given measurement with a specific noise profile. More...
 

Detailed Description

template<uint32 N>
class cfspp::PointingVectorMeasurements< N >

The pointing vector measurements class is a specific implementation of the Measurements.hpp class that is to be used in the update step of an EKF when a pointing vector is available to report the partial attitude of the body. This class is an implementation of the update step, generalized to any state vector of any size that must have at most one part that is the attitude of the body frame with respect to the reference frame provided as a quaternion. This reference frame does not need to be inertial and can be as simple or complex as ECI or a secondary body frame. For the functions implemented in this class, the following format is expected by the required inputs:

time: floating_point -> Value does not matter and is not used tar_state: std::array of size N >= 4 -> Elements state_quat_index:state_quat_index+3 - Attitude of the body frame with respect to the reference frame as provided as an attitude quaternion obs_state: std::array of size POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS = 7 -> Elements observer_pointing_index:observer_pointing_index+2 - Expected pointing vector experienced at sensor frame as provided in reference frame coordinates -> Elements observer_quat_index:observer_quat_index+3 - Attitude of the sensor frame with respect to the body frame as provided as an attitude quaternion

IMPORTANT: This class can be used for any sensor that reports a pointing vector of some sort. Some examples of this would be a magnetometer or a sun sensor.

NOTE FOR MAGNETOMETER USE: The expected magnetic field vector is passed in externally and can be computed through models such as WMM or IGRF. This can be computationally very expensive though. Another approach that is available is to compute the magnetic field vectors of a range of expected locations offline, and use a look-up table to crudely approximate the magnetic field.

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech

Constructor & Destructor Documentation

◆ PointingVectorMeasurements()

template<uint32 N>
cfspp::PointingVectorMeasurements< N >::PointingVectorMeasurements ( uint32  state_quat_index,
uint32  observer_pointing_index = 0,
uint32  observer_quat_index = 3,
uint32  meas_pointing_index = 0 
)
inline

Constructor of the class.

Parameters
state_quat_indexIndex in the state array that dictates when the quaternion part starts
observer_pointing_indexIndex in the observer array that dictates when the expected pointing vector part starts [defualts to 0]
observer_quat_indexIndex in the observer array that dictates when the quaternion part starts [defaults to 3]
meas_pointing_indexIndex in the measurement array that dictates when the pointing vector part starts [defaults to 0]

Member Function Documentation

◆ calculateMeasurementNoiseMappingMatrix()

template<uint32 N>
int16 cfspp::PointingVectorMeasurements< N >::calculateMeasurementNoiseMappingMatrix ( floating_point  time,
const std::array< floating_point, N > &  tar_state,
const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &  obs_state,
std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS *POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS > &  measurement_mapping 
)
override

Function to calculate the matrix that maps the noise configuration space to the measurement configuration space.

Parameters
[in]timeThe reference time
[in]tar_stateThe target reference state
[in]obs_stateThe observer reference state
[out]measurement_mappingImplicit return of the matrix (vectorized) that maps the noise space to the measurement space
Returns
Error return code, zero means no error

◆ calculateMeasurements()

template<uint32 N>
int16 cfspp::PointingVectorMeasurements< N >::calculateMeasurements ( floating_point  time,
const std::array< floating_point, N > &  tar_state,
const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &  obs_state,
std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS > &  expected_measurement 
)
override

Function to calculate a measurement from current state of system.

Parameters
[in]timeThe reference time
[in]tar_stateThe target reference state
[in]obs_stateThe observer reference state
[out]expected_measurementImplicit return of measurements based on time and state
Returns
Error return code, zero means no error

◆ calculateMeasurementsMatrix()

template<uint32 N>
int16 cfspp::PointingVectorMeasurements< N >::calculateMeasurementsMatrix ( floating_point  time,
const std::array< floating_point, N > &  tar_state,
const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &  obs_state,
std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS *N > &  measurement_Jacobian 
)
override

Function to calculate the measurement function Jacobian from current state of system.

Parameters
[in]timeThe reference time
[in]tar_stateThe target reference state
[in]obs_stateThe observer reference state
[out]measurement_JacobianImplicit return of the measurement Jacobian w.r.t. the state vector, NOTE: the matrix is vectorized
Returns
Error return code, zero means no error

◆ calculateNoiseCovariance()

template<uint32 N>
int16 cfspp::PointingVectorMeasurements< N >::calculateNoiseCovariance ( floating_point  time,
const std::array< floating_point, N > &  tar_state,
const std::array< floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &  obs_state,
std::array< floating_point, POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS *POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS > &  measurement_covariance 
)
override

Function to calculate the covariance matrix of a given measurement with a specific noise profile.

Parameters
[in]timeThe reference time
[in]tar_stateThe target reference state
[in]obs_stateThe observer reference state
[out]measurement_covarianceImplicit return of the measurement noise covariance (vectorized)
Returns
Error return code, zero means no error

◆ setNoiseStd()

template<uint32 N>
void cfspp::PointingVectorMeasurements< N >::setNoiseStd ( const std::array< floating_point, 3 > &  new_std)
inline

Setter function for the measurement noise standard deviation.


The documentation for this class was generated from the following file: