Commit 8b442812 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

log telemetry before updating coordinates

parent ce1c4016
......@@ -160,6 +160,11 @@ int mavsdk_start(const char * url, const char * log_file, int timeout,
// Set up callback to monitor altitude while the vehicle is in flight
publish_fn = publishCoordinates;
telemetry->subscribe_position([](Telemetry::Position position) {
std::ostringstream oss;
oss << drone_a << " m " << drone_at << " m "
<< drone_la << " " << drone_lo << " ";
log_telemetry(oss.str());
drone_la = position.latitude_deg;
drone_lo = position.longitude_deg;
drone_a = position.absolute_altitude_m;
......@@ -175,11 +180,6 @@ int mavsdk_start(const char * url, const char * log_file, int timeout,
xy_ratio = std::cos(initial_drone_la_rad);
initial_coords_set = true;
}
std::ostringstream oss;
oss << drone_a << " m " << drone_at << " m "
<< drone_la << " " << drone_lo << " ";
log_telemetry(oss.str());
});
log("MAVSDK started...");
mavsdk_started = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment