17#ifndef GNCUTILS_EKF_POINTING_VECTOR_MEASUREMENTS_H
18#define GNCUTILS_EKF_POINTING_VECTOR_MEASUREMENTS_H
68 PointingVectorMeasurements(uint32 state_quat_index, uint32 observer_pointing_index = 0, uint32 observer_quat_index = 3, uint32 meas_pointing_index = 0) :
69 _quat_idx(state_quat_index),
70 _obs_pointing_idx(observer_pointing_index),
71 _obs_quat_idx(observer_quat_index),
72 _meas_pointing_idx(meas_pointing_index) {};
81 const std::array<floating_point, N> &tar_state,
82 const std::array<floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
92 const std::array<floating_point, N> &tar_state,
93 const std::array<floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
100 uint32 _obs_pointing_idx;
102 uint32 _obs_quat_idx;
104 uint32 _meas_pointing_idx;
126 const std::array<floating_point, N> &tar_state,
127 const std::array<floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
132 _mag__ref.setFromArray(&obs_state[_obs_pointing_idx]);
134 _dummy3 = _quat_body_ref*_mag__ref;
136 _dummy3.getAsArray(&expected_measurement[_meas_pointing_idx]);
149 const std::array<floating_point, N> &tar_state,
150 const std::array<floating_point, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
156 _quat_body_ref.setFromArray(&tar_state[_quat_idx]);
159 _mag__ref.setFromArray(&obs_state[_obs_pointing_idx]);
166 measurement_Jacobian[i] = 0.0;
168 for (uint32 i = 0; i < 3; ++i) {
169 for (uint32 j = 0; j < 4; ++j) {
170 measurement_Jacobian[i*N + j+_quat_idx] = dhdq.
get(i, j);
Standard vector class derived from Matrix.
Definition CartesianVector.hpp:39
Matrix math implementation.
Definition Matrix.hpp:55
int16 get(uint32 row, uint32 col, floating_point &result) const
Function to get a single value in the matrix.
Definition Matrix.hpp:394
void setFromArray(const floating_point *start_ptr, bool column_major=false)
Function to set the values of the matrix row-wise.
Definition Matrix.hpp:412
Quaternion class for attitude representation.
Definition Quaternion.h:68
Definition Measurements.hpp:41
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.
Definition PointingVectorMeasurements.hpp:125
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.
Definition PointingVectorMeasurements.hpp:148
PointingVectorMeasurements(uint32 state_quat_index, uint32 observer_pointing_index=0, uint32 observer_quat_index=3, uint32 meas_pointing_index=0)
Constructor of the class.
Definition PointingVectorMeasurements.hpp:68
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
#define ERROR_DIMENSIONS
Definition clockwerkerrors.h:41
Definition DeadReckon.cpp:20
const uint32 POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS(3)
const uint32 POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS(3)
const uint32 POINTING_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS(3)