ublox_msgs.h
Go to the documentation of this file.
00001 //=================================================================================================
00002 // Copyright (c) 2012, Johannes Meyer, TU Darmstadt
00003 // All rights reserved.
00004 
00005 // Redistribution and use in source and binary forms, with or without
00006 // modification, are permitted provided that the following conditions are met:
00007 //     * Redistributions of source code must retain the above copyright
00008 //       notice, this list of conditions and the following disclaimer.
00009 //     * Redistributions in binary form must reproduce the above copyright
00010 //       notice, this list of conditions and the following disclaimer in the
00011 //       documentation and/or other materials provided with the distribution.
00012 //     * Neither the name of the Flight Systems and Automatic Control group,
00013 //       TU Darmstadt, nor the names of its contributors may be used to
00014 //       endorse or promote products derived from this software without
00015 //       specific prior written permission.
00016 
00017 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00018 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00019 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00020 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 #ifndef UBLOX_SERIALIZATION_UBLOX_MSGS_H
00030 #define UBLOX_SERIALIZATION_UBLOX_MSGS_H
00031 
00032 #include <ublox/serialization.h>
00033 #include <ublox_msgs/ublox_msgs.h>
00034 
00035 namespace ublox {
00036 
00037 template <typename ContainerAllocator>
00038 struct Serializer<ublox_msgs::NavDGPS_<ContainerAllocator> >
00039 {
00040   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::NavDGPS_<ContainerAllocator> >::reference m)
00041   {
00042     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00043     stream.next(m.iTOW);
00044     stream.next(m.age);
00045     stream.next(m.baseId);
00046     stream.next(m.baseHealth);
00047     stream.next(m.numCh);
00048     stream.next(m.status);
00049     stream.next(m.reserved1);
00050     m.sv.resize(m.numCh);
00051     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::deserialize(stream, m.sv[i]);
00052   }
00053 
00054   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::NavDGPS_<ContainerAllocator> >::param_type m)
00055   {
00056     return 16 + 12 * m.numCh;
00057   }
00058 
00059   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::NavDGPS_<ContainerAllocator> >::param_type m)
00060   {
00061     ros::serialization::OStream stream(data, size);
00062     stream.next(m.iTOW);
00063     stream.next(m.age);
00064     stream.next(m.baseId);
00065     stream.next(m.baseHealth);
00066     stream.next(static_cast<typename ublox_msgs::NavDGPS_<ContainerAllocator>::_numCh_type>(m.sv.size()));
00067     stream.next(m.status);
00068     stream.next(m.reserved1);
00069     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::serialize(stream, m.sv[i]);
00070   }
00071 };
00072 
00073 template <typename ContainerAllocator>
00074 struct Serializer<ublox_msgs::NavSBAS_<ContainerAllocator> >
00075 {
00076   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::NavSBAS_<ContainerAllocator> >::reference m)
00077   {
00078     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00079     stream.next(m.iTOW);
00080     stream.next(m.geo);
00081     stream.next(m.mode);
00082     stream.next(m.sys);
00083     stream.next(m.service);
00084     stream.next(m.cnt);
00085     stream.next(m.reserved0);
00086     m.sv.resize(m.cnt);
00087     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::deserialize(stream, m.sv[i]);
00088   }
00089 
00090   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::NavSBAS_<ContainerAllocator> >::param_type m)
00091   {
00092     return 12 + 12 * m.cnt;
00093   }
00094 
00095   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::NavSBAS_<ContainerAllocator> >::param_type m)
00096   {
00097     ros::serialization::OStream stream(data, size);
00098     stream.next(m.iTOW);
00099     stream.next(m.geo);
00100     stream.next(m.mode);
00101     stream.next(m.sys);
00102     stream.next(m.service);
00103     stream.next(static_cast<typename ublox_msgs::NavSBAS_<ContainerAllocator>::_cnt_type>(m.sv.size()));
00104     stream.next(m.reserved0);
00105     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::serialize(stream, m.sv[i]);
00106   }
00107 };
00108 
00109 template <typename ContainerAllocator>
00110 struct Serializer<ublox_msgs::NavSVINFO_<ContainerAllocator> >
00111 {
00112   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::NavSVINFO_<ContainerAllocator> >::reference m)
00113   {
00114     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00115     stream.next(m.iTOW);
00116     stream.next(m.numCh);
00117     stream.next(m.globalFlags);
00118     stream.next(m.reserved2);
00119     m.sv.resize(m.numCh);
00120     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::deserialize(stream, m.sv[i]);
00121   }
00122 
00123   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::NavSVINFO_<ContainerAllocator> >::param_type m)
00124   {
00125     return 8 + 12 * m.numCh;
00126   }
00127 
00128   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::NavSVINFO_<ContainerAllocator> >::param_type m)
00129   {
00130     ros::serialization::OStream stream(data, size);
00131     stream.next(m.iTOW);
00132     stream.next(static_cast<typename ublox_msgs::NavSVINFO_<ContainerAllocator>::_numCh_type>(m.sv.size()));
00133     stream.next(m.globalFlags);
00134     stream.next(m.reserved2);
00135     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::serialize(stream, m.sv[i]);
00136   }
00137 };
00138 
00139 template <typename ContainerAllocator>
00140 struct Serializer<ublox_msgs::RxmRAW_<ContainerAllocator> >
00141 {
00142   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::RxmRAW_<ContainerAllocator> >::reference m)
00143   {
00144     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00145     stream.next(m.iTOW);
00146     stream.next(m.week);
00147     stream.next(m.numSV);
00148     stream.next(m.reserved1);
00149     m.sv.resize(m.numSV);
00150     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::deserialize(stream, m.sv[i]);
00151   }
00152 
00153   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::RxmRAW_<ContainerAllocator> >::param_type m)
00154   {
00155     return 8 + 24 * m.numSV;
00156   }
00157 
00158   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::RxmRAW_<ContainerAllocator> >::param_type m)
00159   {
00160     ros::serialization::OStream stream(data, size);
00161     stream.next(m.iTOW);
00162     stream.next(m.week);
00163     stream.next(static_cast<typename ublox_msgs::RxmRAW_<ContainerAllocator>::_numSV_type>(m.sv.size()));
00164     stream.next(m.reserved1);
00165     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::serialize(stream, m.sv[i]);
00166   }
00167 };
00168 
00169 template <typename ContainerAllocator>
00170 struct Serializer<ublox_msgs::RxmSVSI_<ContainerAllocator> >
00171 {
00172   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::RxmSVSI_<ContainerAllocator> >::reference m)
00173   {
00174     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00175     stream.next(m.iTOW);
00176     stream.next(m.week);
00177     stream.next(m.numVis);
00178     stream.next(m.numSV);
00179     m.sv.resize(m.numSV);
00180     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::deserialize(stream, m.sv[i]);
00181   }
00182 
00183   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::RxmSVSI_<ContainerAllocator> >::param_type m)
00184   {
00185     return 8 + 6 * m.numSV;
00186   }
00187 
00188   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::RxmSVSI_<ContainerAllocator> >::param_type m)
00189   {
00190     ros::serialization::OStream stream(data, size);
00191     stream.next(m.iTOW);
00192     stream.next(m.week);
00193     stream.next(m.numVis);
00194     stream.next(static_cast<typename ublox_msgs::RxmSVSI_<ContainerAllocator>::_numSV_type>(m.sv.size()));
00195     for(std::size_t i = 0; i < m.sv.size(); ++i) ros::serialization::serialize(stream, m.sv[i]);
00196   }
00197 };
00198 
00199 template <typename ContainerAllocator>
00200 struct Serializer<ublox_msgs::RxmALM_<ContainerAllocator> >
00201 {
00202   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::RxmALM_<ContainerAllocator> >::reference m)
00203   {
00204     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00205     stream.next(m.svid);
00206     stream.next(m.week);
00207 
00208     m.dwrd.clear();
00209     try {
00210       typename ublox_msgs::RxmALM_<ContainerAllocator>::_dwrd_type::value_type temp;
00211 
00212       for(std::size_t i = 0; i < 8; ++i) {
00213         stream.next(temp);
00214         m.dwrd.push_back(temp);
00215       }
00216     } catch(ros::serialization::StreamOverrunException& e) {
00217     }
00218   }
00219 
00220   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::RxmALM_<ContainerAllocator> >::param_type m)
00221   {
00222     return 8 + (4 * m.dwrd.size());
00223   }
00224 
00225   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::RxmALM_<ContainerAllocator> >::param_type m)
00226   {
00227     ros::serialization::OStream stream(data, size);
00228     stream.next(m.svid);
00229     stream.next(m.week);
00230     for(std::size_t i = 0; i < m.dwrd.size(); ++i) ros::serialization::serialize(stream, m.dwrd[i]);
00231   }
00232 };
00233 
00234 template <typename ContainerAllocator>
00235 struct Serializer<ublox_msgs::RxmEPH_<ContainerAllocator> >
00236 {
00237   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::RxmEPH_<ContainerAllocator> >::reference m)
00238   {
00239     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00240     stream.next(m.svid);
00241     stream.next(m.how);
00242     m.sf1d.clear();
00243     m.sf2d.clear();
00244     m.sf3d.clear();
00245 
00246     try {
00247       typename ublox_msgs::RxmEPH_<ContainerAllocator>::_sf1d_type::value_type temp1;
00248       typename ublox_msgs::RxmEPH_<ContainerAllocator>::_sf2d_type::value_type temp2;
00249       typename ublox_msgs::RxmEPH_<ContainerAllocator>::_sf3d_type::value_type temp3;
00250 
00251       for(std::size_t i = 0; i < 8; ++i) {
00252         stream.next(temp1);
00253         m.sf1d.push_back(temp1);
00254       }
00255       for(std::size_t i = 0; i < 8; ++i) {
00256         stream.next(temp2);
00257         m.sf2d.push_back(temp2);
00258       }
00259       for(std::size_t i = 0; i < 8; ++i) {
00260         stream.next(temp3);
00261         m.sf3d.push_back(temp3);
00262       }
00263     } catch(ros::serialization::StreamOverrunException& e) {
00264     }
00265   }
00266 
00267   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::RxmEPH_<ContainerAllocator> >::param_type m)
00268   {
00269     return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
00270   }
00271 
00272   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::RxmEPH_<ContainerAllocator> >::param_type m)
00273   {
00274     ros::serialization::OStream stream(data, size);
00275     stream.next(m.svid);
00276     stream.next(m.how);
00277     for(std::size_t i = 0; i < m.sf1d.size(); ++i) ros::serialization::serialize(stream, m.sf1d[i]);
00278     for(std::size_t i = 0; i < m.sf2d.size(); ++i) ros::serialization::serialize(stream, m.sf2d[i]);
00279     for(std::size_t i = 0; i < m.sf3d.size(); ++i) ros::serialization::serialize(stream, m.sf3d[i]);
00280   }
00281 };
00282 
00284 
00285 template <typename ContainerAllocator>
00286 struct Serializer<ublox_msgs::AidALM_<ContainerAllocator> >
00287 {
00288   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::AidALM_<ContainerAllocator> >::reference m)
00289   {
00290     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00291     stream.next(m.svid);
00292     stream.next(m.week);
00293 
00294     m.dwrd.clear();
00295     try {
00296       typename ublox_msgs::AidALM_<ContainerAllocator>::_dwrd_type::value_type temp;
00297 
00298       for(std::size_t i = 0; i < 8; ++i) {
00299         stream.next(temp);
00300         m.dwrd.push_back(temp);
00301       }
00302     } catch(ros::serialization::StreamOverrunException& e) {
00303     }
00304   }
00305 
00306   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::AidALM_<ContainerAllocator> >::param_type m)
00307   {
00308     return 8 + (4 * m.dwrd.size());
00309   }
00310 
00311   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::AidALM_<ContainerAllocator> >::param_type m)
00312   {
00313     ros::serialization::OStream stream(data, size);
00314     stream.next(m.svid);
00315     stream.next(m.week);
00316     for(std::size_t i = 0; i < m.dwrd.size(); ++i) ros::serialization::serialize(stream, m.dwrd[i]);
00317   }
00318 };
00319 
00320 template <typename ContainerAllocator>
00321 struct Serializer<ublox_msgs::AidEPH_<ContainerAllocator> >
00322 {
00323   static void read(const uint8_t *data, uint32_t count, typename boost::call_traits<ublox_msgs::AidEPH_<ContainerAllocator> >::reference m)
00324   {
00325     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00326     stream.next(m.svid);
00327     stream.next(m.how);
00328     m.sf1d.clear();
00329     m.sf2d.clear();
00330     m.sf3d.clear();
00331 
00332     try {
00333       typename ublox_msgs::AidEPH_<ContainerAllocator>::_sf1d_type::value_type temp1;
00334       typename ublox_msgs::AidEPH_<ContainerAllocator>::_sf2d_type::value_type temp2;
00335       typename ublox_msgs::AidEPH_<ContainerAllocator>::_sf3d_type::value_type temp3;
00336 
00337       for(std::size_t i = 0; i < 8; ++i) {
00338         stream.next(temp1);
00339         m.sf1d.push_back(temp1);
00340       }
00341       for(std::size_t i = 0; i < 8; ++i) {
00342         stream.next(temp2);
00343         m.sf2d.push_back(temp2);
00344       }
00345       for(std::size_t i = 0; i < 8; ++i) {
00346         stream.next(temp3);
00347         m.sf3d.push_back(temp3);
00348       }
00349     } catch(ros::serialization::StreamOverrunException& e) {
00350     }
00351   }
00352 
00353   static uint32_t serializedLength (typename boost::call_traits<ublox_msgs::AidEPH_<ContainerAllocator> >::param_type m)
00354   {
00355     return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
00356   }
00357 
00358   static void write(uint8_t *data, uint32_t size, typename boost::call_traits<ublox_msgs::AidEPH_<ContainerAllocator> >::param_type m)
00359   {
00360     ros::serialization::OStream stream(data, size);
00361     stream.next(m.svid);
00362     stream.next(m.how);
00363     for(std::size_t i = 0; i < m.sf1d.size(); ++i) ros::serialization::serialize(stream, m.sf1d[i]);
00364     for(std::size_t i = 0; i < m.sf2d.size(); ++i) ros::serialization::serialize(stream, m.sf2d[i]);
00365     for(std::size_t i = 0; i < m.sf3d.size(); ++i) ros::serialization::serialize(stream, m.sf3d[i]);
00366   }
00367 };
00368 
00369 } // namespace ublox
00370 
00371 #endif // UBLOX_SERIALIZATION_UBLOX_MSGS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


ublox_msgs
Author(s): Johannes Meyer
autogenerated on Mon Jul 15 2013 16:55:23