From 2ec2c58f675cff6779f2fccc393cb0f462131483 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 16 Feb 2013 20:15:57 +1100 Subject: [PATCH] SITL: added SIM_GPS_TYPE control for choosing what sort of GPS to simulate --- libraries/SITL/SITL.cpp | 1 + libraries/SITL/SITL.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/libraries/SITL/SITL.cpp b/libraries/SITL/SITL.cpp index 33e3ed7a1e..20ee1dba83 100644 --- a/libraries/SITL/SITL.cpp +++ b/libraries/SITL/SITL.cpp @@ -26,6 +26,7 @@ const AP_Param::GroupInfo SITL::var_info[] PROGMEM = { AP_GROUPINFO("WIND_SPD", 9, SITL, wind_speed, 5), AP_GROUPINFO("WIND_DIR", 10, SITL, wind_direction, 180), AP_GROUPINFO("WIND_TURB", 11, SITL, wind_turbulance, 0.2), + AP_GROUPINFO("GPS_TYPE", 12, SITL, gps_type, SITL::GPS_TYPE_UBLOX), AP_GROUPEND }; diff --git a/libraries/SITL/SITL.h b/libraries/SITL/SITL.h index 5c6cb17f21..a7d098096f 100644 --- a/libraries/SITL/SITL.h +++ b/libraries/SITL/SITL.h @@ -32,6 +32,13 @@ public: AP_Param::setup_object_defaults(this, var_info); } + enum GPSType { + GPS_TYPE_UBLOX = 0, + GPS_TYPE_MTK = 1, + GPS_TYPE_MTK16 = 2, + GPS_TYPE_MTK19 = 3 + }; + struct sitl_fdm state; static const struct AP_Param::GroupInfo var_info[]; @@ -48,6 +55,7 @@ public: AP_Float engine_mul; // engine multiplier AP_Int8 gps_disable; // disable simulated GPS AP_Int8 gps_delay; // delay in samples + AP_Int8 gps_type; // see enum GPSType // wind control AP_Float wind_speed;