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" 
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 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 
00030 #ifndef UBLOX_SERIALIZATION_UBLOX_MSGS_H
00031 #define UBLOX_SERIALIZATION_UBLOX_MSGS_H
00032 
00033 #include <ros/console.h>
00034 #include <ublox/serialization.h>
00035 #include <ublox_msgs/ublox_msgs.h>
00036 
00042 
00043 namespace ublox {
00044 
00049 template <typename ContainerAllocator>
00050 struct Serializer<ublox_msgs::CfgDAT_<ContainerAllocator> > {
00051   typedef boost::call_traits<ublox_msgs::CfgDAT_<ContainerAllocator> > 
00052       CallTraits;
00053   static void read(const uint8_t *data, uint32_t count, 
00054                    typename CallTraits::reference m) {
00055     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00056     stream.next(m.datumNum);
00057     stream.next(m.datumName);
00058     stream.next(m.majA);
00059     stream.next(m.flat);
00060     stream.next(m.dX);
00061     stream.next(m.dY);
00062     stream.next(m.dZ);
00063     stream.next(m.rotX);
00064     stream.next(m.rotY);
00065     stream.next(m.rotZ);
00066     stream.next(m.scale);
00067   }
00068 
00069   static uint32_t serializedLength (typename CallTraits::param_type m) {
00070     // this is the size of CfgDAT set messages
00071     // serializedLength is only used for writes so this is ok
00072     return 44;
00073   }
00074 
00075   static void write(uint8_t *data, uint32_t size, 
00076                     typename CallTraits::param_type m) {
00077     ros::serialization::OStream stream(data, size);
00078     // ignores datumNum & datumName
00079     stream.next(m.majA);
00080     stream.next(m.flat);
00081     stream.next(m.dX);
00082     stream.next(m.dY);
00083     stream.next(m.dZ);
00084     stream.next(m.rotX);
00085     stream.next(m.rotY);
00086     stream.next(m.rotZ);
00087     stream.next(m.scale);
00088   }
00089 };
00090 
00094 template <typename ContainerAllocator>
00095 struct Serializer<ublox_msgs::CfgGNSS_<ContainerAllocator> > {
00096   typedef ublox_msgs::CfgGNSS_<ContainerAllocator> Msg;
00097   typedef boost::call_traits<Msg> CallTraits;
00098 
00099   static void read(const uint8_t *data, uint32_t count, 
00100                    typename CallTraits::reference m) {
00101     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00102     stream.next(m.msgVer);
00103     stream.next(m.numTrkChHw);
00104     stream.next(m.numTrkChUse);
00105     stream.next(m.numConfigBlocks);
00106     m.blocks.resize(m.numConfigBlocks);
00107     for(std::size_t i = 0; i < m.blocks.size(); ++i) 
00108       ros::serialization::deserialize(stream, m.blocks[i]);
00109   }
00110 
00111   static uint32_t serializedLength (typename CallTraits::param_type m) {
00112     return 4 + 8 * m.numConfigBlocks;
00113   }
00114 
00115   static void write(uint8_t *data, uint32_t size, 
00116                     typename CallTraits::param_type m) {
00117     if(m.blocks.size() != m.numConfigBlocks) {
00118       ROS_ERROR("CfgGNSS numConfigBlocks must equal blocks size");
00119     }
00120     ros::serialization::OStream stream(data, size);
00121     stream.next(m.msgVer);
00122     stream.next(m.numTrkChHw);
00123     stream.next(m.numTrkChUse);
00124     stream.next(
00125         static_cast<typename Msg::_numConfigBlocks_type>(m.blocks.size()));
00126     for(std::size_t i = 0; i < m.blocks.size(); ++i) 
00127       ros::serialization::serialize(stream, m.blocks[i]);
00128   }
00129 };
00130 
00134 template <typename ContainerAllocator>
00135 struct Serializer<ublox_msgs::CfgINF_<ContainerAllocator> > {
00136   typedef boost::call_traits<ublox_msgs::CfgINF_<ContainerAllocator> > 
00137       CallTraits;
00138 
00139   static void read(const uint8_t *data, uint32_t count,
00140                    typename CallTraits::reference m) {
00141     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00142     int num_blocks = count / 10;
00143     m.blocks.resize(num_blocks);
00144     for(std::size_t i = 0; i < num_blocks; ++i) 
00145       ros::serialization::deserialize(stream, m.blocks[i]);
00146   }
00147 
00148   static uint32_t serializedLength (typename CallTraits::param_type m) {
00149     return 10 * m.blocks.size();
00150   }
00151 
00152   static void write(uint8_t *data, uint32_t size, 
00153                     typename CallTraits::param_type m) {
00154     ros::serialization::OStream stream(data, size);
00155     for(std::size_t i = 0; i < m.blocks.size(); ++i) 
00156       ros::serialization::serialize(stream, m.blocks[i]);
00157   }
00158 };
00159 
00163 template <typename ContainerAllocator>
00164 struct Serializer<ublox_msgs::Inf_<ContainerAllocator> > {
00165   typedef boost::call_traits<ublox_msgs::Inf_<ContainerAllocator> > CallTraits;
00166   
00167   static void read(const uint8_t *data, uint32_t count, 
00168                    typename CallTraits::reference m) {
00169     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00170     m.str.resize(count);
00171     for (int i = 0; i < count; ++i)
00172       ros::serialization::deserialize(stream, m.str[i]);
00173   }
00174 
00175   static uint32_t serializedLength (typename CallTraits::param_type m) {
00176     return m.str.size();
00177   }
00178 
00179   static void write(uint8_t *data, uint32_t size, 
00180                     typename CallTraits::param_type m) {
00181     ros::serialization::OStream stream(data, size);
00182     for(std::size_t i = 0; i < m.str.size(); ++i) 
00183       ros::serialization::serialize(stream, m.str[i]);
00184   }
00185 };
00186 
00190 template <typename ContainerAllocator>
00191 struct Serializer<ublox_msgs::MonVER_<ContainerAllocator> > {
00192   typedef ublox_msgs::MonVER_<ContainerAllocator> Msg;
00193   typedef boost::call_traits<Msg> CallTraits;
00194 
00195   static void read(const uint8_t *data, uint32_t count, 
00196                    typename CallTraits::reference m) {
00197     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00198     stream.next(m.swVersion);
00199     stream.next(m.hwVersion);
00200 
00201     m.extension.clear();
00202     int N = (count - 40) / 30;
00203     m.extension.reserve(N);
00204     typename Msg::_extension_type::value_type ext;
00205     for (int i = 0; i < N; i++) {
00206       // Read each extension string
00207       stream.next(ext);
00208       m.extension.push_back(ext);
00209     }
00210   }
00211 
00212   static uint32_t serializedLength(typename CallTraits::param_type m) {
00213     return 40 + (30 * m.extension.size());
00214   }
00215 
00216   static void write(uint8_t *data, uint32_t size, 
00217                     typename CallTraits::param_type m) {
00218     ros::serialization::OStream stream(data, size);
00219     stream.next(m.swVersion);
00220     stream.next(m.hwVersion);
00221     for(std::size_t i = 0; i < m.extension.size(); ++i) 
00222       ros::serialization::serialize(stream, m.extension[i]);
00223   }
00224 };
00225 
00229 template <typename ContainerAllocator>
00230 struct Serializer<ublox_msgs::NavDGPS_<ContainerAllocator> > {
00231   typedef ublox_msgs::NavDGPS_<ContainerAllocator> Msg;
00232   typedef boost::call_traits<Msg> CallTraits;
00233 
00234   static void read(const uint8_t *data, uint32_t count, 
00235                    typename CallTraits::reference m) {
00236     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00237     stream.next(m.iTOW);
00238     stream.next(m.age);
00239     stream.next(m.baseId);
00240     stream.next(m.baseHealth);
00241     stream.next(m.numCh);
00242     stream.next(m.status);
00243     stream.next(m.reserved1);
00244     m.sv.resize(m.numCh);
00245     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00246       ros::serialization::deserialize(stream, m.sv[i]);
00247   }
00248 
00249   static uint32_t serializedLength (typename CallTraits::param_type m) {
00250     return 16 + 12 * m.numCh;
00251   }
00252 
00253   static void write(uint8_t *data, uint32_t size, 
00254                     typename CallTraits::param_type m) {
00255     if(m.sv.size() != m.numCh) {
00256       ROS_ERROR("NavDGPS numCh must equal sv size");
00257     }
00258     ros::serialization::OStream stream(data, size);
00259     stream.next(m.iTOW);
00260     stream.next(m.age);
00261     stream.next(m.baseId);
00262     stream.next(m.baseHealth);
00263     stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
00264     stream.next(m.status);
00265     stream.next(m.reserved1);
00266     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00267       ros::serialization::serialize(stream, m.sv[i]);
00268   }
00269 };
00270 
00271 
00275 template <typename ContainerAllocator>
00276 struct Serializer<ublox_msgs::NavSBAS_<ContainerAllocator> > {
00277   typedef ublox_msgs::NavSBAS_<ContainerAllocator> Msg;
00278   typedef boost::call_traits<Msg> CallTraits;
00279 
00280   static void read(const uint8_t *data, uint32_t count, 
00281                    typename CallTraits::reference m) {
00282     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00283     stream.next(m.iTOW);
00284     stream.next(m.geo);
00285     stream.next(m.mode);
00286     stream.next(m.sys);
00287     stream.next(m.service);
00288     stream.next(m.cnt);
00289     stream.next(m.reserved0);
00290     m.sv.resize(m.cnt);
00291     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00292       ros::serialization::deserialize(stream, m.sv[i]);
00293   }
00294 
00295   static uint32_t serializedLength (typename CallTraits::param_type m) {
00296     return 12 + 12 * m.cnt;
00297   }
00298 
00299   static void write(uint8_t *data, uint32_t size, 
00300                     typename CallTraits::param_type m) {
00301     if(m.sv.size() != m.cnt) {
00302       ROS_ERROR("NavSBAS cnt must equal sv size");
00303     }
00304     ros::serialization::OStream stream(data, size);
00305     stream.next(m.iTOW);
00306     stream.next(m.geo);
00307     stream.next(m.mode);
00308     stream.next(m.sys);
00309     stream.next(m.service);
00310     stream.next(static_cast<typename Msg::_cnt_type>(m.sv.size()));
00311     stream.next(m.reserved0);
00312     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00313       ros::serialization::serialize(stream, m.sv[i]);
00314   }
00315 };
00316 
00320 template <typename ContainerAllocator>
00321 struct Serializer<ublox_msgs::NavSAT_<ContainerAllocator> > {
00322   typedef ublox_msgs::NavSAT_<ContainerAllocator> Msg;
00323   typedef boost::call_traits<Msg> CallTraits;
00324 
00325   static void read(const uint8_t *data, uint32_t count, 
00326                    typename CallTraits::reference m) {
00327     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00328     stream.next(m.iTOW);
00329     stream.next(m.version);
00330     stream.next(m.numSvs);
00331     stream.next(m.reserved0);
00332     m.sv.resize(m.numSvs);
00333     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00334       ros::serialization::deserialize(stream, m.sv[i]);
00335   }
00336 
00337   static uint32_t serializedLength (typename CallTraits::param_type m) {
00338     return 8 + 12 * m.numSvs;
00339   }
00340 
00341   static void write(uint8_t *data, uint32_t size, 
00342                     typename CallTraits::param_type m) {
00343     if(m.sv.size() != m.numSvs) {
00344       ROS_ERROR("NavSAT numSvs must equal sv size");
00345     }
00346     ros::serialization::OStream stream(data, size);
00347     stream.next(m.iTOW);
00348     stream.next(m.version);
00349     stream.next(static_cast<typename Msg::_numSvs_type>(m.sv.size()));
00350     stream.next(m.reserved0);
00351     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00352       ros::serialization::serialize(stream, m.sv[i]);
00353   }
00354 };
00355 
00359 template <typename ContainerAllocator>
00360 struct Serializer<ublox_msgs::NavSVINFO_<ContainerAllocator> > {
00361   typedef ublox_msgs::NavSVINFO_<ContainerAllocator> Msg;
00362   typedef boost::call_traits<Msg> CallTraits;
00363 
00364   static void read(const uint8_t *data, uint32_t count, 
00365                    typename CallTraits::reference m) {
00366     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00367     stream.next(m.iTOW);
00368     stream.next(m.numCh);
00369     stream.next(m.globalFlags);
00370     stream.next(m.reserved2);
00371     m.sv.resize(m.numCh);
00372     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00373       ros::serialization::deserialize(stream, m.sv[i]);
00374   }
00375 
00376   static uint32_t serializedLength (typename CallTraits::param_type m) {
00377     return 8 + 12 * m.numCh;
00378   }
00379 
00380   static void write(uint8_t *data, uint32_t size, 
00381                     typename CallTraits::param_type m) {
00382     if(m.sv.size() != m.numCh) {
00383       ROS_ERROR("NavSVINFO numCh must equal sv size");
00384     }
00385     ros::serialization::OStream stream(data, size);
00386     stream.next(m.iTOW);
00387     stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
00388     stream.next(m.globalFlags);
00389     stream.next(m.reserved2);
00390     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00391       ros::serialization::serialize(stream, m.sv[i]);
00392   }
00393 };
00394 
00398 template <typename ContainerAllocator>
00399 struct Serializer<ublox_msgs::RxmRAW_<ContainerAllocator> > {
00400   typedef ublox_msgs::RxmRAW_<ContainerAllocator> Msg;
00401   typedef boost::call_traits<Msg> CallTraits;
00402 
00403   static void read(const uint8_t *data, uint32_t count, 
00404                    typename CallTraits::reference m) {
00405     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00406     stream.next(m.rcvTOW);
00407     stream.next(m.week);
00408     stream.next(m.numSV);
00409     stream.next(m.reserved1);
00410     m.sv.resize(m.numSV);
00411     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00412       ros::serialization::deserialize(stream, m.sv[i]);
00413   }
00414 
00415   static uint32_t serializedLength (typename CallTraits::param_type m) {
00416     return 8 + 24 * m.numSV;
00417   }
00418 
00419   static void write(uint8_t *data, uint32_t size, 
00420                     typename CallTraits::param_type m) {
00421     if(m.sv.size() != m.numSV) {
00422       ROS_ERROR("RxmRAW numSV must equal sv size");
00423     }
00424     ros::serialization::OStream stream(data, size);
00425     stream.next(m.rcvTOW);
00426     stream.next(m.week);
00427     stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
00428     stream.next(m.reserved1);
00429     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00430       ros::serialization::serialize(stream, m.sv[i]);
00431   }
00432 };
00433 
00437 template <typename ContainerAllocator>
00438 struct Serializer<ublox_msgs::RxmRAWX_<ContainerAllocator> > {
00439   typedef ublox_msgs::RxmRAWX_<ContainerAllocator> Msg;
00440   typedef boost::call_traits<Msg> CallTraits;
00441 
00442   static void read(const uint8_t *data, uint32_t count, 
00443                    typename CallTraits::reference m) {
00444     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00445     stream.next(m.rcvTOW);
00446     stream.next(m.week);
00447     stream.next(m.leapS);
00448     stream.next(m.numMeas);
00449     stream.next(m.recStat);
00450     stream.next(m.version);
00451     stream.next(m.reserved1);
00452     m.meas.resize(m.numMeas);
00453     for(std::size_t i = 0; i < m.meas.size(); ++i) 
00454       ros::serialization::deserialize(stream, m.meas[i]);
00455   }
00456 
00457   static uint32_t serializedLength (typename CallTraits::param_type m) {
00458     return 16 + 32 * m.numMeas;
00459   }
00460 
00461   static void write(uint8_t *data, uint32_t size, 
00462                     typename CallTraits::param_type m) {
00463     if(m.meas.size() != m.numMeas) {
00464       ROS_ERROR("RxmRAWX numMeas must equal meas size");
00465     }
00466     ros::serialization::OStream stream(data, size);
00467     stream.next(m.rcvTOW);
00468     stream.next(m.week);
00469     stream.next(m.leapS);
00470     stream.next(static_cast<typename Msg::_numMeas_type>(m.meas.size()));
00471     stream.next(m.recStat);
00472     stream.next(m.version);
00473     stream.next(m.reserved1);
00474     for(std::size_t i = 0; i < m.meas.size(); ++i) 
00475       ros::serialization::serialize(stream, m.meas[i]);
00476   }
00477 };
00478 
00482 template <typename ContainerAllocator>
00483 struct Serializer<ublox_msgs::RxmSFRBX_<ContainerAllocator> > {
00484   typedef ublox_msgs::RxmSFRBX_<ContainerAllocator> Msg;
00485   typedef boost::call_traits<Msg> CallTraits;
00486 
00487   static void read(const uint8_t *data, uint32_t count, 
00488                    typename CallTraits::reference m) {
00489     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00490     stream.next(m.gnssId);
00491     stream.next(m.svId);
00492     stream.next(m.reserved0);
00493     stream.next(m.freqId);
00494     stream.next(m.numWords);
00495     stream.next(m.chn);
00496     stream.next(m.version);
00497     stream.next(m.reserved1);
00498     m.dwrd.resize(m.numWords);
00499     for(std::size_t i = 0; i < m.dwrd.size(); ++i) 
00500       ros::serialization::deserialize(stream, m.dwrd[i]);
00501   }
00502 
00503   static uint32_t serializedLength (typename CallTraits::param_type m) {
00504     return 8 + 4 * m.numWords;
00505   }
00506 
00507   static void write(uint8_t *data, uint32_t size, 
00508                     typename CallTraits::param_type m) {
00509     if(m.dwrd.size() != m.numWords) {
00510       ROS_ERROR("RxmSFRBX numWords must equal dwrd size");
00511     }
00512     ros::serialization::OStream stream(data, size);
00513     stream.next(m.gnssId);
00514     stream.next(m.svId);
00515     stream.next(m.reserved0);
00516     stream.next(m.freqId);
00517     stream.next(static_cast<typename Msg::_numWords_type>(m.dwrd.size()));
00518     stream.next(m.chn);
00519     stream.next(m.version);
00520     stream.next(m.reserved1);
00521     for(std::size_t i = 0; i < m.dwrd.size(); ++i) 
00522       ros::serialization::serialize(stream, m.dwrd[i]);
00523   }
00524 };
00525 
00529 template <typename ContainerAllocator>
00530 struct Serializer<ublox_msgs::RxmSVSI_<ContainerAllocator> > {
00531   typedef ublox_msgs::RxmSVSI_<ContainerAllocator> Msg;
00532   typedef boost::call_traits<Msg> CallTraits;
00533 
00534   static void read(const uint8_t *data, uint32_t count, 
00535                    typename CallTraits::reference m) {
00536     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00537     stream.next(m.iTOW);
00538     stream.next(m.week);
00539     stream.next(m.numVis);
00540     stream.next(m.numSV);
00541     m.sv.resize(m.numSV);
00542     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00543       ros::serialization::deserialize(stream, m.sv[i]);
00544   }
00545 
00546   static uint32_t serializedLength (typename CallTraits::param_type m) {
00547     return 8 + 6 * m.numSV;
00548   }
00549 
00550   static void write(uint8_t *data, uint32_t size, 
00551                     typename CallTraits::param_type m) {
00552     if(m.sv.size() != m.numSV) {
00553       ROS_ERROR("RxmSVSI numSV must equal sv size");
00554     }
00555     ros::serialization::OStream stream(data, size);
00556     stream.next(m.iTOW);
00557     stream.next(m.week);
00558     stream.next(m.numVis);
00559     stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
00560     for(std::size_t i = 0; i < m.sv.size(); ++i) 
00561       ros::serialization::serialize(stream, m.sv[i]);
00562   }
00563 };
00564 
00568 template <typename ContainerAllocator>
00569 struct Serializer<ublox_msgs::RxmALM_<ContainerAllocator> > {
00570   typedef ublox_msgs::RxmALM_<ContainerAllocator> Msg;
00571   typedef boost::call_traits<Msg> CallTraits;
00572 
00573   static void read(const uint8_t *data, uint32_t count, 
00574                    typename CallTraits::reference m) {
00575     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00576     stream.next(m.svid);
00577     stream.next(m.week);
00578 
00579     m.dwrd.clear();
00580     if(count == 40) {
00581       typename Msg::_dwrd_type::value_type temp;
00582       m.dwrd.resize(8);
00583       for(std::size_t i = 0; i < 8; ++i) {
00584         stream.next(temp);
00585         m.dwrd.push_back(temp);
00586       }
00587     }
00588   }
00589 
00590   static uint32_t serializedLength (typename CallTraits::param_type m) {
00591     return 8 + (4 * m.dwrd.size());
00592   }
00593 
00594   static void write(uint8_t *data, uint32_t size, 
00595                     typename CallTraits::param_type m) {
00596     ros::serialization::OStream stream(data, size);
00597     stream.next(m.svid);
00598     stream.next(m.week);
00599     for(std::size_t i = 0; i < m.dwrd.size(); ++i) 
00600       ros::serialization::serialize(stream, m.dwrd[i]);
00601   }
00602 };
00603 
00607 template <typename ContainerAllocator>
00608 struct Serializer<ublox_msgs::RxmEPH_<ContainerAllocator> >
00609 {
00610   typedef ublox_msgs::RxmEPH_<ContainerAllocator> Msg;
00611   typedef boost::call_traits<Msg> CallTraits;
00612 
00613   static void read(const uint8_t *data, uint32_t count, 
00614                    typename CallTraits::reference m) {
00615     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00616     stream.next(m.svid);
00617     stream.next(m.how);
00618     m.sf1d.clear();
00619     m.sf2d.clear();
00620     m.sf3d.clear();
00621 
00622     if (count == 104) {
00623       typename Msg::_sf1d_type::value_type temp1;
00624       typename Msg::_sf2d_type::value_type temp2;
00625       typename Msg::_sf3d_type::value_type temp3;
00626 
00627       m.sf1d.resize(8);
00628       for(std::size_t i = 0; i < 8; ++i) {
00629         stream.next(temp1);
00630         m.sf1d.push_back(temp1);
00631       }
00632       m.sf2d.resize(8);
00633       for(std::size_t i = 0; i < 8; ++i) {
00634         stream.next(temp2);
00635         m.sf2d.push_back(temp2);
00636       }
00637       m.sf3d.resize(8);
00638       for(std::size_t i = 0; i < 8; ++i) {
00639         stream.next(temp3);
00640         m.sf3d.push_back(temp3);
00641       }
00642     }
00643   }
00644 
00645   static uint32_t serializedLength (typename CallTraits::param_type m) {
00646     return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
00647   }
00648 
00649   static void write(uint8_t *data, uint32_t size, 
00650                     typename CallTraits::param_type m) {
00651     ros::serialization::OStream stream(data, size);
00652     stream.next(m.svid);
00653     stream.next(m.how);
00654     for(std::size_t i = 0; i < m.sf1d.size(); ++i) 
00655       ros::serialization::serialize(stream, m.sf1d[i]);
00656     for(std::size_t i = 0; i < m.sf2d.size(); ++i) 
00657       ros::serialization::serialize(stream, m.sf2d[i]);
00658     for(std::size_t i = 0; i < m.sf3d.size(); ++i) 
00659       ros::serialization::serialize(stream, m.sf3d[i]);
00660   }
00661 };
00662 
00666 template <typename ContainerAllocator>
00667 struct Serializer<ublox_msgs::AidALM_<ContainerAllocator> > {
00668   typedef ublox_msgs::AidALM_<ContainerAllocator> Msg;
00669   typedef boost::call_traits<Msg> CallTraits;
00670 
00671   static void read(const uint8_t *data, uint32_t count, 
00672                    typename CallTraits::reference m) {
00673     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00674     stream.next(m.svid);
00675     stream.next(m.week);
00676 
00677     m.dwrd.clear();
00678     if (count == 40) {
00679       typename Msg::_dwrd_type::value_type temp;
00680       m.dwrd.resize(8);
00681       for(std::size_t i = 0; i < 8; ++i) {
00682         stream.next(temp);
00683         m.dwrd.push_back(temp);
00684       }
00685     } 
00686   }
00687 
00688   static uint32_t serializedLength (typename CallTraits::param_type m) {
00689     return 8 + (4 * m.dwrd.size());
00690   }
00691 
00692   static void write(uint8_t *data, uint32_t size, 
00693                     typename CallTraits::param_type m) {
00694     ros::serialization::OStream stream(data, size);
00695     stream.next(m.svid);
00696     stream.next(m.week);
00697     for(std::size_t i = 0; i < m.dwrd.size(); ++i) 
00698       ros::serialization::serialize(stream, m.dwrd[i]);
00699   }
00700 };
00701 
00705 template <typename ContainerAllocator>
00706 struct Serializer<ublox_msgs::AidEPH_<ContainerAllocator> >
00707 {
00708   typedef ublox_msgs::AidEPH_<ContainerAllocator> Msg;
00709   typedef boost::call_traits<Msg> CallTraits;
00710 
00711   static void read(const uint8_t *data, uint32_t count, 
00712                    typename CallTraits::reference m) {
00713     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00714     stream.next(m.svid);
00715     stream.next(m.how);
00716     m.sf1d.clear();
00717     m.sf2d.clear();
00718     m.sf3d.clear();
00719 
00720     if (count == 104) {
00721       typename Msg::_sf1d_type::value_type temp1;
00722       typename Msg::_sf2d_type::value_type temp2;
00723       typename Msg::_sf3d_type::value_type temp3;
00724       m.sf1d.resize(8);
00725       for(std::size_t i = 0; i < 8; ++i) {
00726         stream.next(temp1);
00727         m.sf1d.push_back(temp1);
00728       }
00729       m.sf2d.resize(8);
00730       for(std::size_t i = 0; i < 8; ++i) {
00731         stream.next(temp2);
00732         m.sf2d.push_back(temp2);
00733       }
00734       m.sf3d.resize(8);
00735       for(std::size_t i = 0; i < 8; ++i) {
00736         stream.next(temp3);
00737         m.sf3d.push_back(temp3);
00738       }
00739     }
00740   }
00741 
00742   static uint32_t serializedLength (typename CallTraits::param_type m) {
00743     return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
00744   }
00745 
00746   static void write(uint8_t *data, uint32_t size, 
00747                     typename CallTraits::param_type m) {
00748     ros::serialization::OStream stream(data, size);
00749     stream.next(m.svid);
00750     stream.next(m.how);
00751     for(std::size_t i = 0; i < m.sf1d.size(); ++i) 
00752       ros::serialization::serialize(stream, m.sf1d[i]);
00753     for(std::size_t i = 0; i < m.sf2d.size(); ++i) 
00754       ros::serialization::serialize(stream, m.sf2d[i]);
00755     for(std::size_t i = 0; i < m.sf3d.size(); ++i) 
00756       ros::serialization::serialize(stream, m.sf3d[i]);
00757   }
00758 };
00759 
00764 template <typename ContainerAllocator>
00765 struct Serializer<ublox_msgs::EsfMEAS_<ContainerAllocator> > {
00766   typedef boost::call_traits<ublox_msgs::EsfMEAS_<ContainerAllocator> > 
00767       CallTraits;
00768 
00769   static void read(const uint8_t *data, uint32_t count, 
00770                    typename CallTraits::reference m) {
00771     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00772     stream.next(m.timeTag);
00773     stream.next(m.flags);
00774     stream.next(m.id);
00775 
00776     bool calib_valid = m.flags & m.FLAGS_CALIB_T_TAG_VALID;
00777     int data_size = (count - (calib_valid ? 12 : 8)) / 4;
00778     // Repeating block
00779     m.data.resize(data_size);
00780     for(std::size_t i = 0; i < data_size; ++i) 
00781       ros::serialization::deserialize(stream, m.data[i]);
00782     // Optional block
00783     if(calib_valid) {
00784       m.calibTtag.resize(1);
00785       ros::serialization::deserialize(stream, m.calibTtag[0]);
00786     }
00787   }
00788 
00789   static uint32_t serializedLength (typename CallTraits::param_type m) {
00790     return 4 + 8 * m.data.size() + 4 * m.calibTtag.size();
00791   }
00792 
00793   static void write(uint8_t *data, uint32_t size, 
00794                     typename CallTraits::param_type m) {
00795     ros::serialization::OStream stream(data, size);
00796     stream.next(m.timeTag);
00797     stream.next(m.flags);
00798     stream.next(m.id);
00799     for(std::size_t i = 0; i < m.data.size(); ++i) 
00800       ros::serialization::serialize(stream, m.data[i]);
00801     for(std::size_t i = 0; i < m.calibTtag.size(); ++i) 
00802       ros::serialization::serialize(stream, m.calibTtag[i]);
00803   }
00804 };
00805 
00809 template <typename ContainerAllocator>
00810 struct Serializer<ublox_msgs::EsfRAW_<ContainerAllocator> > {
00811   typedef boost::call_traits<ublox_msgs::EsfRAW_<ContainerAllocator> > 
00812       CallTraits;
00813 
00814   static void read(const uint8_t *data, uint32_t count, 
00815                    typename CallTraits::reference m) {
00816     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00817     stream.next(m.reserved0);
00818     m.blocks.clear();
00819     int num_blocks = (count - 4) / 8;
00820     m.blocks.resize(num_blocks);
00821     for(std::size_t i = 0; i < num_blocks; ++i) 
00822       ros::serialization::deserialize(stream, m.blocks[i]);
00823   }
00824 
00825 
00826   static uint32_t serializedLength (typename CallTraits::param_type m) {
00827     return 4 + 8 * m.blocks.size();
00828   }
00829 
00830   static void write(uint8_t *data, uint32_t size, 
00831                     typename CallTraits::param_type m) {
00832     ros::serialization::OStream stream(data, size);
00833     stream.next(m.reserved0);
00834     for(std::size_t i = 0; i < m.blocks.size(); ++i) 
00835       ros::serialization::serialize(stream, m.blocks[i]);
00836   }
00837 };
00838 
00842 template <typename ContainerAllocator>
00843 struct Serializer<ublox_msgs::EsfSTATUS_<ContainerAllocator> > {
00844   typedef ublox_msgs::EsfSTATUS_<ContainerAllocator> Msg;
00845   typedef boost::call_traits<Msg> CallTraits;
00846 
00847   static void read(const uint8_t *data, uint32_t count, 
00848                    typename CallTraits::reference m) {
00849     ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
00850     stream.next(m.iTOW);
00851     stream.next(m.version);
00852     stream.next(m.fusionMode);
00853     stream.next(m.reserved2);
00854     stream.next(m.numSens);
00855     m.sens.resize(m.numSens);
00856     for(std::size_t i = 0; i < m.sens.size(); ++i) 
00857       ros::serialization::deserialize(stream, m.sens[i]);
00858   }
00859 
00860   static uint32_t serializedLength (typename CallTraits::param_type m) {
00861     return 16 + 4 * m.numSens;
00862   }
00863 
00864   static void write(uint8_t *data, uint32_t size, 
00865                     typename CallTraits::param_type m) {
00866     if(m.sens.size() != m.numSens) {
00867       ROS_ERROR("Writing EsfSTATUS message: numSens must equal size of sens");
00868     }
00869     ros::serialization::OStream stream(data, size);
00870     stream.next(m.iTOW);
00871     stream.next(m.version);
00872     stream.next(m.fusionMode);
00873     stream.next(m.reserved2);
00874     stream.next(static_cast<typename Msg::_numSens_type>(m.sens.size()));
00875     for(std::size_t i = 0; i < m.sens.size(); ++i) 
00876       ros::serialization::serialize(stream, m.sens[i]);
00877   }
00878 };
00879 
00880 
00881 } // namespace ublox
00882 
00883 #endif // UBLOX_SERIALIZATION_UBLOX_MSGS_H


ublox_msgs
Author(s): Johannes Meyer
autogenerated on Fri Aug 11 2017 02:31:04