diff --git a/Examples/StandAloneSensors.hpp b/Examples/StandAloneSensors.hpp index 4791970be6..580ad575fd 100644 --- a/Examples/StandAloneSensors.hpp +++ b/Examples/StandAloneSensors.hpp @@ -88,11 +88,13 @@ class StandALoneSensors { output_stream << std::fixed; double last = Utils::getTimeSinceEpoch(); + bool which_alt = false; for(auto j = 0; j < 10; ++j) { for (auto i = 0; i < interations_20s; ++i) { const auto& output = baro.getOutput(); output_stream << Utils::getTimeSinceEpoch() << "\t"; - output_stream << output.pressure << "\t" << output.altitude << std::endl; + output_stream << output.pressure << "\t" << output.altitude << "\t" << + environment.getState().geo_point.altitude << std::endl; std::this_thread::sleep_for(std::chrono::duration(period - (Utils::getTimeSinceEpoch() - last))); @@ -103,7 +105,8 @@ class StandALoneSensors { baro.update(dt); } - environment.setPosition(Vector3r(0, 0, environment.getState().geo_point.altitude <= 1.0f ? 1.78f : 0)); + which_alt = !which_alt; + environment.setPosition(Vector3r(0, 0, which_alt ? -1.78f : 0)); } } diff --git a/Examples/main.cpp b/Examples/main.cpp index 865e2f8956..886ea50a18 100644 --- a/Examples/main.cpp +++ b/Examples/main.cpp @@ -26,6 +26,6 @@ int main(int argc, const char *argv[]) std::ofstream out_file(argv[1]); //StandALoneSensors::createStaticData(out_file, period, total_duration); //StandALoneSensors::generateBarometerStaticData(out_file, period, total_duration); - //StandALoneSensors::generateBarometerDynamicData(out_file, period, total_duration); - StandALoneSensors::generateMagnetometerDataLoc(out_file, period, total_duration); + StandALoneSensors::generateBarometerDynamicData(out_file, period, total_duration); + //StandALoneSensors::generateMagnetometerDataLoc(out_file, period, total_duration); } \ No newline at end of file