WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
warpos::PointingVectorMeasurements< N > Class Template Reference

#include <PointingVectorMeasurements.hpp>

Inheritance diagram for warpos::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.
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, floating_point expected_measurement[POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS]) override
 Function to calculate a measurement from current state of system.
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, floating_point measurement_Jacobian[N *POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS]) override
 Function to calculate the measurement function Jacobian from current state of system.
Public Member Functions inherited from warpos::Measurements< N, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS >
virtual int16 calculateMeasurements (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, floating_point expected_measurement[M])
 Function to calculate a measurement from current state of system.
virtual int16 calculateMeasurementsMatrix (floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, O > &obs_state, floating_point measurement_Jacobian[M *N])
 Function to calculate the measurement function Jacobian from current state of system.

Detailed Description

template<uint32 N>
class warpos::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>
warpos::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

◆ calculateMeasurements()

template<uint32 N>
int16 warpos::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,
floating_point expected_measurement[POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS] )
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 warpos::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,
floating_point measurement_Jacobian[N *POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS] )
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

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