From ee4418f6e6aa84738f0de84dd2971a7b3b1794f0 Mon Sep 17 00:00:00 2001 From: Guillem Date: Mon, 23 Dec 2024 17:31:42 +0100 Subject: [PATCH] fixed init gnss recv. --- source/cpp/measurements/gnss_transmitter.cc | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source/cpp/measurements/gnss_transmitter.cc b/source/cpp/measurements/gnss_transmitter.cc index 1faf2a2b..acac7d8d 100644 --- a/source/cpp/measurements/gnss_transmitter.cc +++ b/source/cpp/measurements/gnss_transmitter.cc @@ -20,18 +20,19 @@ namespace lupnt { void GnssTransmitter::InitializeGnssTransmitter() { - if (gnss_type_ == "GPS") { - InitializeGPSTransmitter(); - } else if (gnss_type_ == "GLONASS") { - InitializeGLONASSTransmitter(); - } else if (gnss_type_ == "GALILEO") { - InitializeGALILEOTransmitter(); - } else if (gnss_type_ == "BEIDOU") { - InitializeBEIDOUTransmitter(); - } else { - std::runtime_error("Invalid GNSS type"); + if (gnss_type_.find("GPS") != std::string::npos) { + InitializeGPSTransmitter(); + } else if (gnss_type_.find("COSMOS") != std::string::npos) { + InitializeGLONASSTransmitter(); + } else if (gnss_type_.find("GSAT") != std::string::npos) { + InitializeGALILEOTransmitter(); + } else if (gnss_type_.find("BEIDOU") != std::string::npos) { + InitializeBEIDOUTransmitter(); + } else { + throw std::runtime_error("Invalid GNSS type"); + } } - } + /** * @brief Initialize the GPS transmitter