Skip to content
Snippets Groups Projects
Commit 3ec37aa1 authored by stmoon's avatar stmoon Committed by Kabir Mohammed
Browse files

clarify the codes of LPE

parent 3b64325f
No related branches found
No related tags found
No related merge requests found
...@@ -113,21 +113,21 @@ void BlockLocalPositionEstimator::gpsCorrect() ...@@ -113,21 +113,21 @@ void BlockLocalPositionEstimator::gpsCorrect()
if (gpsMeasure(y_global) != OK) { return; } if (gpsMeasure(y_global) != OK) { return; }
// gps measurement in local frame // gps measurement in local frame
double lat = y_global(0); double lat = y_global(Y_gps_x);
double lon = y_global(1); double lon = y_global(Y_gps_y);
float alt = y_global(2); float alt = y_global(Y_gps_z);
float px = 0; float px = 0;
float py = 0; float py = 0;
float pz = -(alt - _gpsAltOrigin); float pz = -(alt - _gpsAltOrigin);
map_projection_project(&_map_ref, lat, lon, &px, &py); map_projection_project(&_map_ref, lat, lon, &px, &py);
Vector<float, 6> y; Vector<float, n_y_gps> y;
y.setZero(); y.setZero();
y(0) = px; y(Y_gps_x) = px;
y(1) = py; y(Y_gps_y) = py;
y(2) = pz; y(Y_gps_z) = pz;
y(3) = y_global(3); y(Y_gps_vx) = y_global(Y_gps_vx);
y(4) = y_global(4); y(Y_gps_vy) = y_global(Y_gps_vy);
y(5) = y_global(5); y(Y_gps_vz) = y_global(Y_gps_vz);
// gps measurement matrix, measures position and velocity // gps measurement matrix, measures position and velocity
Matrix<float, n_y_gps, n_x> C; Matrix<float, n_y_gps, n_x> C;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment