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

#include <GPSMeasurements.hpp>

Inheritance diagram for warpos::GPSMeasurements< N >:

Public Member Functions

 GPSMeasurements (uint32 state_pos_index, uint32 observer_quat_index=0, uint32 meas_pos_index=0)
 Constructor of the class.
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.
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.
Public Member Functions inherited from warpos::Measurements< N, GPS_MEASUREMENT_VECTOR_ELEMENTS, GPS_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::GPSMeasurements< N >

The GPS position measurement class is a specific implementation of the Measurements.hpp class that is to be used in the update step of an EKF when a GPS receiver is available to report the position of the vehicle in a known reference frame (e.g., ECEF, ECI). This class is an implementation of the EKF measurement update step, generalized to any state vector of any size that contains a position component and optionally an attitude component. The reference frame in which the GPS reports its position does not need to be inertial and can be any well-defined global frame suitable for navigation.

This update step incorporates the GPS-derived position into the EKF state by comparing the measured position (after necessary frame transformations) with the predicted position from the current state estimate. The transformation accounts for the location of the GPS antenna relative to the body frame and the orientation between the GPS reporting frame and the EKF’s state reference frame.

For the functions implemented in this class, the following format is expected for the required inputs:

time: floating_point -> Value does not matter and is not used tar_state: std::array of size N >= 3 -> Elements state_pos_idx:state_pos_idx+2 - Position of the body frame with respect to some state frame resolved in the state frame obs_state: std::array of size GPS_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS = 4 -> Elements observer_quat_index:observer_quat_index+3 - The attitude of the frame the state is resolved in with respect to the attitude of the frame the GPS sensor reports in

NOTE: The position measurement pass in generally not be the position directly recieved from the GPS, some transformations are necessary: pos_B_F__F = quat_F_REF*pos_GPS_I__REF - pos_F_I__F - quat_F_B*pos_GPS_B__B where: B - body frame F - state relative frame I - Inertial frame GPS - GPS frame REF - frame that the GPS sensor reports in (e.g. ECEF, ECI) NOTE: pos_GPS_I__REF is the direct GPS sensor output

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

Constructor & Destructor Documentation

◆ GPSMeasurements()

template<uint32 N>
warpos::GPSMeasurements< N >::GPSMeasurements ( uint32 state_pos_index,
uint32 observer_quat_index = 0,
uint32 meas_pos_index = 0 )
inline

Constructor of the class.

Parameters
state_pos_indexIndex in the state array that dictates when the position part starts
observer_quat_indexIndex in the observer array that dictates when the quaternion part starts [defaults to 0]
meas_pos_indexIndex in the measurement array that dictates when the position part starts [defaults to 0]

Member Function Documentation

◆ calculateMeasurements()

template<uint32 N>
int16 warpos::GPSMeasurements< N >::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.

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::GPSMeasurements< N >::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.

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: