parsing_utils.h
Go to the documentation of this file.
00001 // *****************************************************************************
00002 //
00003 // Copyright (c) 2017, Southwest Research Institute® (SwRI®)
00004 // All rights reserved.
00005 //
00006 // Redistribution and use in source and binary forms, with or without
00007 // modification, are permitted provided that the following conditions are met:
00008 //     * Redistributions of source code must retain the above copyright
00009 //       notice, this list of conditions and the following disclaimer.
00010 //     * Redistributions in binary form must reproduce the above copyright
00011 //       notice, this list of conditions and the following disclaimer in the
00012 //       documentation and/or other materials provided with the distribution.
00013 //     * Neither the name of Southwest Research Institute® (SwRI®) nor the
00014 //       names of its contributors may be used to endorse or promote products
00015 //       derived from this software without specific prior written permission.
00016 //
00017 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020 // ARE DISCLAIMED. IN NO EVENT SHALL SOUTHWEST RESEARCH INSTITUTE BE LIABLE FOR ANY
00021 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00022 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00023 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00026 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027 //
00028 // *****************************************************************************
00029 
00030 #ifndef NOVATEL_GPS_DRIVER_BASE_PARSER_H
00031 #define NOVATEL_GPS_DRIVER_BASE_PARSER_H
00032 
00033 #include <novatel_gps_msgs/NovatelMessageHeader.h>
00034 
00035 #include <novatel_gps_msgs/NovatelExtendedSolutionStatus.h>
00036 
00037 #include <novatel_gps_msgs/NovatelSignalMask.h>
00038 
00039 #include <stdint.h>
00040 
00045 namespace novatel_gps_driver
00046 {
00047   const size_t NOVATEL_MESSAGE_HEADER_LENGTH = 10;
00048 
00049   const size_t MAX_SOLUTION_STATUS = 22;
00050   const std::string SOLUTION_STATUSES[] = {
00051       "SOL_COMPUTED", "INSUFFICIENT_OBS", "NO_CONVERGENCE", "SINGULARITY", "COV_TRACE",
00052       "TEST_DIST", "COLD_START", "V_H_LIMIT", "VARIANCE", "RESIDUALS",
00053       "RESERVED", "RESERVED", "RESERVED", "INTEGRITY_WARNING", "RESERVED",
00054       "RESERVED", "RESERVED", "RESERVED", "PENDING", "INVALID_FIX",
00055       "UNAUTHORIZED", "RESERVED", "INVALID_RATE"};
00056   const size_t MAX_POSITION_TYPE = 80;
00057   const std::string POSITION_TYPES[] = {
00058       "NONE", "FIXEDPOS", "FIXEDHEIGHT", "RESERVED", "FLOATCONV",
00059       "WIDELANE", "NARROWLANE", "RESERVED", "DOPPLER_VELOCITY", "RESERVED",
00060       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00061       "RESERVED", "SINGLE", "PSRDIFF", "WAAS", "PROPOGATED",
00062       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00063       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00064       "RESERVED", "RESERVED", "L1_FLOAT", "IONOFREE_FLOAT", "NARROW_FLOAT",
00065       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00066       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00067       "RESERVED", "RESERVED", "RESERVED", "L1_INT", "WIDE_INT",
00068       "NARROW_INT", "RTK_DIRECT_INS", "INS_SBAS", "INS_PSRSP", "INS_PSRDIFF",
00069       "INS_RTKFLOAT", "INS_RTKFIXED", "RESERVED", "RESERVED", "RESERVED",
00070       "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED",
00071       "RESERVED", "RESERVED", "RESERVED", "PPP_CONVERGING", "PPP",
00072       "OPERATIONAL", "WARNING", "OUT_OF_BOUNDS", "INS_PPP_CONVERGING", "INS_PPP",
00073       "UNKNOWN", "UNKNOWN", "PPP_BASIC_CONVERGING", "PPP_BASIC", "INS_PPP_BASIC",
00074       "INS_PPP_BASIC_CONVERGING"};
00075   const size_t MAX_DATUM = 86;
00076   const std::string DATUMS[] = {
00077       "BLANK",
00078       "ADIND", "ARC50", "ARC60", "AGD66", "AGD84", "BUKIT", "ASTRO", "CHATM", "CARTH", "CAPE",
00079       "DJAKA", "EGYPT", "ED50", "ED79", "GUNSG", "GEO49", "GRB36", "GUAM", "HAWAII", "KAUAI",
00080       "MAUI", "OAHU", "HERAT", "HJORS", "HONGK", "HUTZU", "INDIA", "IRE65", "KERTA", "KANDA",
00081       "LIBER", "LUZON", "MINDA", "MERCH", "NAHR", "NAD83", "CANADA", "ALASKA", "NAD27", "CARIBB",
00082       "MEXICO", "CAMER", "MINNA", "OMAN", "PUERTO", "QORNO", "ROME", "CHUA", "SAM56", "SAM69",
00083       "CAMPO", "SACOR", "YACAR", "TANAN", "TIMBA", "TOKYO", "TRIST", "VITI", "WAK60", "WGS72",
00084       "WGS84", "ZANDE", "USER", "CSRS", "ADIM", "ARSM", "ENW", "HTN", "INDB", "INDI",
00085       "IRL", "LUZA", "LUZB", "NAHC", "NASP", "OGBM", "OHAA", "OHAB", "OHAC", "OHAD",
00086       "OHIA", "OHIB", "OHIC", "OHID", "TIL", "TOYM"};
00087   const std::string PORT_IDENTIFIERS[] = {
00088       "NO_PORTS", "COM1_ALL", "COM2_ALL", "COM3_ALL", "UNUSED", "UNUSED", "THISPORT_ALL", "FILE_ALL", "ALL_PORTS",
00089       "XCOM1_ALL", "XCOM2_ALL", "UNUSED", "UNUSED", "USB1_ALL", "USB2_ALL", "USB3_ALL", "AUX_ALL", "XCOM3_ALL",
00090       "UNUSED", "COM4_ALL", "ETH1_ALL", "IMU_ALL", "UNUSED", "ICOM1_ALL", "ICOM2_ALL", "ICOM3_ALL", "NCOM1_ALL",
00091       "NCOM2_ALL", "NCOM3_ALL", "ICOM4_ALL", "WCOM1_ALL", "UNUSED", "COM1", "COM1_1", "COM1_2", "COM1_3", "COM1_4",
00092       "COM1_5", "COM1_6", "COM1_7", "COM1_8", "COM1_9", "COM1_10", "COM1_11", "COM1_12", "COM1_13", "COM1_14",
00093       "COM1_15", "COM1_16", "COM1_17", "COM1_18", "COM1_19", "COM1_20", "COM1_21", "COM1_22", "COM1_23", "COM1_24",
00094       "COM1_25", "COM1_26", "COM1_27", "COM1_28", "COM1_29", "COM1_30", "COM1_31", "COM2", "COM2_1", "COM2_2", "COM2_3",
00095       "COM2_4", "COM2_5", "COM2_6", "COM2_7", "COM2_8", "COM2_9", "COM2_10", "COM2_11", "COM2_12", "COM2_13", "COM2_14",
00096       "COM2_15", "COM2_16", "COM2_17", "COM2_18", "COM2_19", "COM2_20", "COM2_21", "COM2_22", "COM2_23", "COM2_24",
00097       "COM2_25", "COM2_26", "COM2_27", "COM2_28", "COM2_29", "COM2_30", "COM2_31", "COM3", "COM3_1", "COM3_2", "COM3_3",
00098       "COM3_4", "COM3_5", "COM3_6", "COM3_7", "COM3_8", "COM3_9", "COM3_10", "COM3_11", "COM3_12", "COM3_13", "COM3_14",
00099       "COM3_15", "COM3_16", "COM3_17", "COM3_18", "COM3_19", "COM3_20", "COM3_21", "COM3_22", "COM3_23", "COM3_24",
00100       "COM3_25", "COM3_26", "COM3_27", "COM3_28", "COM3_29", "COM3_30", "COM3_31", "UNUSED", "UNUSED", "UNUSED",
00101       "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED",
00102       "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED",
00103       "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "SPECIAL", "SPECIAL_1", "SPECIAL_2",
00104       "SPECIAL_3", "SPECIAL_4", "SPECIAL_5", "SPECIAL_6", "SPECIAL_7", "SPECIAL_8", "SPECIAL_9", "SPECIAL_10",
00105       "SPECIAL_11", "SPECIAL_12", "SPECIAL_13", "SPECIAL_14", "SPECIAL_15", "SPECIAL_16", "SPECIAL_17", "SPECIAL_18",
00106       "SPECIAL_19", "SPECIAL_20", "SPECIAL_21", "SPECIAL_22", "SPECIAL_23", "SPECIAL_24", "SPECIAL_25", "SPECIAL_26",
00107       "SPECIAL_27", "SPECIAL_28", "SPECIAL_29", "SPECIAL_30", "SPECIAL_31", "THISPORT", "THISPORT_1", "THISPORT_2",
00108       "THISPORT_3", "THISPORT_4", "THISPORT_5", "THISPORT_6", "THISPORT_7", "THISPORT_8", "THISPORT_9", "THISPORT_10",
00109       "THISPORT_11", "THISPORT_12", "THISPORT_13", "THISPORT_14", "THISPORT_15", "THISPORT_16", "THISPORT_17",
00110       "THISPORT_18", "THISPORT_19", "THISPORT_20", "THISPORT_21", "THISPORT_22", "THISPORT_23", "THISPORT_24",
00111       "THISPORT_25", "THISPORT_26", "THISPORT_27", "THISPORT_28", "THISPORT_29", "THISPORT_30", "THISPORT_31", "FILE",
00112       "FILE_1", "FILE_2", "FILE_3", "FILE_4", "FILE_5", "FILE_6", "FILE_7", "FILE_8", "FILE_9", "FILE_10", "FILE_11",
00113       "FILE_12", "FILE_13", "FILE_14", "FILE_15", "FILE_16", "FILE_17", "FILE_18", "FILE_19", "FILE_20", "FILE_21",
00114       "FILE_22", "FILE_23", "FILE_24", "FILE_25", "FILE_26", "FILE_27", "FILE_28", "FILE_29", "FILE_30", "FILE_31"};
00115 
00116   double ConvertDmsToDegrees(double dms);
00117 
00118   void GetExtendedSolutionStatusMessage(
00119       uint32_t status,
00120       novatel_gps_msgs::NovatelExtendedSolutionStatus& msg);
00121 
00122 
00123   void GetNovatelReceiverStatusMessage(
00124       uint32_t status,
00125       novatel_gps_msgs::NovatelReceiverStatus& receiver_status_msg);
00126 
00127   void GetSignalsUsed(
00128       uint32_t mask,
00129       novatel_gps_msgs::NovatelSignalMask& msg);
00130 
00140   double ParseDouble(const uint8_t* buffer);
00141 
00149   bool ParseDouble(const std::string& string, double& value);
00150 
00160   float ParseFloat(const uint8_t* buffer);
00161 
00169   bool ParseFloat(const std::string& string, float& value);
00170 
00180   int16_t ParseInt16(const uint8_t* buffer);
00181 
00190   bool ParseInt16(const std::string& string, int16_t& value, int32_t base = 10);
00191 
00201   int32_t ParseInt32(const uint8_t* buffer);
00202 
00211   bool ParseInt32(const std::string& string, int32_t& value, int32_t base = 10);
00212 
00221   bool ParseUInt8(const std::string& string, uint8_t& value, int32_t base = 10);
00222 
00232   uint16_t ParseUInt16(const uint8_t* buffer);
00233 
00242   bool ParseUInt16(const std::string& string, uint16_t& value, int32_t base = 10);
00243 
00253   uint32_t ParseUInt32(const uint8_t* buffer);
00254 
00263   bool ParseUInt32(const std::string& string, uint32_t& value, int32_t base = 10);
00264 
00265   double UtcFloatToSeconds(double utc_float);
00266 }
00267 
00268 #endif //NOVATEL_GPS_DRIVER_BASE_PARSER_H


novatel_gps_driver
Author(s):
autogenerated on Wed Jul 3 2019 19:40:37