From e3c719b27f052280eea00ed946c59a4b8f86f6d4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 2 Jan 2019 14:14:00 +1100 Subject: [PATCH] SITL: adjust for Location_Class and Location unification --- libraries/SITL/SIM_Aircraft.cpp | 2 +- libraries/SITL/SIM_CRRCSim.cpp | 1 - libraries/SITL/SITL.h | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index ca07ab7c8b..69c49454a0 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -125,7 +125,7 @@ bool Aircraft::parse_home(const char *home_str, Location &loc, float &yaw_degree return false; } - memset(&loc, 0, sizeof(loc)); + loc = {}; loc.lat = static_cast(strtod(lat_s, nullptr) * 1.0e7); loc.lng = static_cast(strtod(lon_s, nullptr) * 1.0e7); loc.alt = static_cast(strtod(alt_s, nullptr) * 1.0e2); diff --git a/libraries/SITL/SIM_CRRCSim.cpp b/libraries/SITL/SIM_CRRCSim.cpp index 22db2e9d75..43498b4117 100644 --- a/libraries/SITL/SIM_CRRCSim.cpp +++ b/libraries/SITL/SIM_CRRCSim.cpp @@ -122,7 +122,6 @@ void CRRCSim::recv_fdm(const struct sitl_input &input) Location loc1, loc2; loc2.lat = pkt.latitude * 1.0e7; loc2.lng = pkt.longitude * 1.0e7; - memset(&loc1, 0, sizeof(loc1)); Vector2f posdelta = location_diff(loc1, loc2); position.x = posdelta.x; position.y = posdelta.y; diff --git a/libraries/SITL/SITL.h b/libraries/SITL/SITL.h index ad2e148d7d..758ca8ba66 100644 --- a/libraries/SITL/SITL.h +++ b/libraries/SITL/SITL.h @@ -2,6 +2,7 @@ #include #include +#include #include "SIM_Sprayer.h" #include "SIM_Gripper_Servo.h"