Basically what's described by the title. We need to be able to run the cxx estimator code both in the full MATLAB sim as well as within @stewartaslan's breakout attitude simulation to verify it's correct.
To learn a little about MEX, a good place to look would be the mex files we have in psim already (MATLAB/environmental_models/helper_functions/*.cpp) and the MATLAB mex documentation online.
We'll probably need three functions similar to these:
function [state] = adcs_estimator_reset_mex(q, gyro_bias, cov)
function [state] = adcs_estimator_triad_reset_mex(t, r_ecef, b_body, s_body)
function [state, q_est, qyro_bias_est, cov_est] = adcs_estimator_update_mex(state,
t, r_ecef, b_body, s_body, w_body)
where state is a MATLAB struct that contains information that must persist across calls to the filter. Most notably, this is the attitude estimate quaternion, gyro bias estimate, and state covariance estimate.
The first function, adcs_estimator_reset_mex, doesn't need to incorporate any cxx code.
The second, adcs_estimator_triad_reset_mex, should call the following function once it's implemented:
Basically what's described by the title. We need to be able to run the cxx estimator code both in the full MATLAB sim as well as within @stewartaslan's breakout attitude simulation to verify it's correct.
To learn a little about MEX, a good place to look would be the mex files we have in psim already (
MATLAB/environmental_models/helper_functions/*.cpp
) and the MATLAB mex documentation online.We'll probably need three functions similar to these:
where
state
is a MATLAB struct that contains information that must persist across calls to the filter. Most notably, this is the attitude estimate quaternion, gyro bias estimate, and state covariance estimate.The first function,
adcs_estimator_reset_mex
, doesn't need to incorporate any cxx code.The second,
adcs_estimator_triad_reset_mex
, should call the following function once it's implemented:Lastly,
adcs_estimator_update_mex
will need to populate agnc::AttitudeEstimatorState
andgnc::AttitudeEstimatorData
struct to then call: