Use updated map_projection_XXX functions in apps

This commit is contained in:
Anton Babushkin
2014-03-17 22:20:41 +04:00
parent 2284a7e985
commit 3d5f52678f
4 changed files with 14 additions and 11 deletions
+3 -2
View File
@@ -132,6 +132,7 @@ static orb_advert_t telemetry_status_pub = -1;
static int32_t lat0 = 0;
static int32_t lon0 = 0;
static double alt0 = 0;
struct map_projection_reference_s hil_ref;
static void
handle_message(mavlink_message_t *msg)
@@ -653,7 +654,7 @@ handle_message(mavlink_message_t *msg)
bool landed = hil_state.alt/1000.0f < (alt0 + 0.1); // XXX improve?
double lat = hil_state.lat*1e-7;
double lon = hil_state.lon*1e-7;
map_projection_project(lat, lon, &x, &y);
map_projection_project(&hil_ref, lat, lon, &x, &y);
hil_local_pos.timestamp = timestamp;
hil_local_pos.xy_valid = true;
hil_local_pos.z_valid = true;
@@ -679,7 +680,7 @@ handle_message(mavlink_message_t *msg)
lat0 = hil_state.lat;
lon0 = hil_state.lon;
alt0 = hil_state.alt / 1000.0f;
map_projection_init(hil_state.lat, hil_state.lon);
map_projection_init(&hil_ref, hil_state.lat, hil_state.lon);
}
/* Calculate Rotation Matrix */