17#ifndef GNCUTILS_EKF_GPS_MEASUREMENTS_HPP
18#define GNCUTILS_EKF_GPS_MEASUREMENTS_HPP
78 GPSMeasurements(uint32 state_pos_index, uint32 observer_quat_index = 0, uint32 meas_pos_index = 0) :
79 _pos_idx(state_pos_index),
80 _obs_quat_idx(observer_quat_index),
81 _meas_pos_idx(meas_pos_index) {};
90 const std::array<floating_point, N> &tar_state,
91 const std::array<floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
101 const std::array<floating_point, N> &tar_state,
102 const std::array<floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
109 uint32 _obs_quat_idx;
111 uint32 _meas_pos_idx;
123 const std::array<floating_point, N> &tar_state,
124 const std::array<floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
127 expected_measurement[_meas_pos_idx] = tar_state[_pos_idx];
128 expected_measurement[_meas_pos_idx+1] = tar_state[_pos_idx+1];
129 expected_measurement[_meas_pos_idx+2] = tar_state[_pos_idx+2];
142 const std::array<floating_point, N> &tar_state,
143 const std::array<floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS> &obs_state,
150 measurement_Jacobian[i] = 0.0;
152 for (uint32 i = 0; i < 3; ++i) {
153 for (uint32 j = 0; j < 3; ++j) {
154 measurement_Jacobian[i*N + j+_pos_idx] =
IDENTITY_3_3.get(i, j);
int16 calculateMeasurementsMatrix(floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, floating_point measurement_Jacobian[N *GPS_MEASUREMENT_VECTOR_ELEMENTS]) override
Function to calculate the measurement function Jacobian from current state of system.
Definition GPSMeasurements.hpp:141
int16 calculateMeasurements(floating_point time, const std::array< floating_point, N > &tar_state, const std::array< floating_point, GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > &obs_state, floating_point expected_measurement[GPS_MEASUREMENT_VECTOR_ELEMENTS]) override
Function to calculate a measurement from current state of system.
Definition GPSMeasurements.hpp:122
GPSMeasurements(uint32 state_pos_index, uint32 observer_quat_index=0, uint32 meas_pos_index=0)
Constructor of the class.
Definition GPSMeasurements.hpp:78
Definition Measurements.hpp:41
#define NO_ERROR
Error code in the case where matrix math executed successfully.
Definition clockwerkerrors.h:34
#define ERROR_DIMENSIONS
Definition clockwerkerrors.h:41
const clockwerk::Matrix< 3, 3 > IDENTITY_3_3({ {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} })
Definition DeadReckon.cpp:20
const uint32 GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS(4)
const uint32 GPS_MEASUREMENT_MEASUREMENT_NOISE_ELEMENTS(3)
const uint32 GPS_MEASUREMENT_VECTOR_ELEMENTS(3)