serialization/ublox_msgs.h
Go to the documentation of this file.
1 //==============================================================================
2 // Copyright (c) 2012, Johannes Meyer, TU Darmstadt
3 // All rights reserved.
4 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of the Flight Systems and Automatic Control group,
13 // TU Darmstadt, nor the names of its contributors may be used to
14 // endorse or promote products derived from this software without
15 // specific prior written permission.
16 
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //==============================================================================
28 
29 
30 #ifndef UBLOX_SERIALIZATION_UBLOX_MSGS_H
31 #define UBLOX_SERIALIZATION_UBLOX_MSGS_H
32 
33 #include <ros/console.h>
34 #include <ublox/serialization.h>
35 #include <ublox_msgs/ublox_msgs.h>
36 
42 
43 namespace ublox {
44 
49 template <typename ContainerAllocator>
50 struct Serializer<ublox_msgs::CfgDAT_<ContainerAllocator> > {
51  typedef boost::call_traits<ublox_msgs::CfgDAT_<ContainerAllocator> >
53  static void read(const uint8_t *data, uint32_t count,
54  typename CallTraits::reference m) {
55  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
56  stream.next(m.datumNum);
57  stream.next(m.datumName);
58  stream.next(m.majA);
59  stream.next(m.flat);
60  stream.next(m.dX);
61  stream.next(m.dY);
62  stream.next(m.dZ);
63  stream.next(m.rotX);
64  stream.next(m.rotY);
65  stream.next(m.rotZ);
66  stream.next(m.scale);
67  }
68 
69  static uint32_t serializedLength (typename CallTraits::param_type m) {
70  // this is the size of CfgDAT set messages
71  // serializedLength is only used for writes so this is ok
72  return 44;
73  }
74 
75  static void write(uint8_t *data, uint32_t size,
76  typename CallTraits::param_type m) {
77  ros::serialization::OStream stream(data, size);
78  // ignores datumNum & datumName
79  stream.next(m.majA);
80  stream.next(m.flat);
81  stream.next(m.dX);
82  stream.next(m.dY);
83  stream.next(m.dZ);
84  stream.next(m.rotX);
85  stream.next(m.rotY);
86  stream.next(m.rotZ);
87  stream.next(m.scale);
88  }
89 };
90 
94 template <typename ContainerAllocator>
95 struct Serializer<ublox_msgs::CfgGNSS_<ContainerAllocator> > {
96  typedef ublox_msgs::CfgGNSS_<ContainerAllocator> Msg;
97  typedef boost::call_traits<Msg> CallTraits;
98 
99  static void read(const uint8_t *data, uint32_t count,
100  typename CallTraits::reference m) {
101  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
102  stream.next(m.msgVer);
103  stream.next(m.numTrkChHw);
104  stream.next(m.numTrkChUse);
105  stream.next(m.numConfigBlocks);
106  m.blocks.resize(m.numConfigBlocks);
107  for(std::size_t i = 0; i < m.blocks.size(); ++i)
108  ros::serialization::deserialize(stream, m.blocks[i]);
109  }
110 
111  static uint32_t serializedLength (typename CallTraits::param_type m) {
112  return 4 + 8 * m.numConfigBlocks;
113  }
114 
115  static void write(uint8_t *data, uint32_t size,
116  typename CallTraits::param_type m) {
117  if(m.blocks.size() != m.numConfigBlocks) {
118  ROS_ERROR("CfgGNSS numConfigBlocks must equal blocks size");
119  }
120  ros::serialization::OStream stream(data, size);
121  stream.next(m.msgVer);
122  stream.next(m.numTrkChHw);
123  stream.next(m.numTrkChUse);
124  stream.next(
125  static_cast<typename Msg::_numConfigBlocks_type>(m.blocks.size()));
126  for(std::size_t i = 0; i < m.blocks.size(); ++i)
127  ros::serialization::serialize(stream, m.blocks[i]);
128  }
129 };
130 
134 template <typename ContainerAllocator>
135 struct Serializer<ublox_msgs::CfgINF_<ContainerAllocator> > {
136  typedef boost::call_traits<ublox_msgs::CfgINF_<ContainerAllocator> >
138 
139  static void read(const uint8_t *data, uint32_t count,
140  typename CallTraits::reference m) {
141  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
142  int num_blocks = count / 10;
143  m.blocks.resize(num_blocks);
144  for(std::size_t i = 0; i < num_blocks; ++i)
145  ros::serialization::deserialize(stream, m.blocks[i]);
146  }
147 
148  static uint32_t serializedLength (typename CallTraits::param_type m) {
149  return 10 * m.blocks.size();
150  }
151 
152  static void write(uint8_t *data, uint32_t size,
153  typename CallTraits::param_type m) {
154  ros::serialization::OStream stream(data, size);
155  for(std::size_t i = 0; i < m.blocks.size(); ++i)
156  ros::serialization::serialize(stream, m.blocks[i]);
157  }
158 };
159 
163 template <typename ContainerAllocator>
164 struct Serializer<ublox_msgs::Inf_<ContainerAllocator> > {
165  typedef boost::call_traits<ublox_msgs::Inf_<ContainerAllocator> > CallTraits;
166 
167  static void read(const uint8_t *data, uint32_t count,
168  typename CallTraits::reference m) {
169  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
170  m.str.resize(count);
171  for (int i = 0; i < count; ++i)
172  ros::serialization::deserialize(stream, m.str[i]);
173  }
174 
175  static uint32_t serializedLength (typename CallTraits::param_type m) {
176  return m.str.size();
177  }
178 
179  static void write(uint8_t *data, uint32_t size,
180  typename CallTraits::param_type m) {
181  ros::serialization::OStream stream(data, size);
182  for(std::size_t i = 0; i < m.str.size(); ++i)
183  ros::serialization::serialize(stream, m.str[i]);
184  }
185 };
186 
190 template <typename ContainerAllocator>
191 struct Serializer<ublox_msgs::MonVER_<ContainerAllocator> > {
192  typedef ublox_msgs::MonVER_<ContainerAllocator> Msg;
193  typedef boost::call_traits<Msg> CallTraits;
194 
195  static void read(const uint8_t *data, uint32_t count,
196  typename CallTraits::reference m) {
197  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
198  stream.next(m.swVersion);
199  stream.next(m.hwVersion);
200 
201  m.extension.clear();
202  int N = (count - 40) / 30;
203  m.extension.reserve(N);
204  typename Msg::_extension_type::value_type ext;
205  for (int i = 0; i < N; i++) {
206  // Read each extension string
207  stream.next(ext);
208  m.extension.push_back(ext);
209  }
210  }
211 
212  static uint32_t serializedLength(typename CallTraits::param_type m) {
213  return 40 + (30 * m.extension.size());
214  }
215 
216  static void write(uint8_t *data, uint32_t size,
217  typename CallTraits::param_type m) {
218  ros::serialization::OStream stream(data, size);
219  stream.next(m.swVersion);
220  stream.next(m.hwVersion);
221  for(std::size_t i = 0; i < m.extension.size(); ++i)
222  ros::serialization::serialize(stream, m.extension[i]);
223  }
224 };
225 
229 template <typename ContainerAllocator>
230 struct Serializer<ublox_msgs::NavDGPS_<ContainerAllocator> > {
231  typedef ublox_msgs::NavDGPS_<ContainerAllocator> Msg;
232  typedef boost::call_traits<Msg> CallTraits;
233 
234  static void read(const uint8_t *data, uint32_t count,
235  typename CallTraits::reference m) {
236  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
237  stream.next(m.iTOW);
238  stream.next(m.age);
239  stream.next(m.baseId);
240  stream.next(m.baseHealth);
241  stream.next(m.numCh);
242  stream.next(m.status);
243  stream.next(m.reserved1);
244  m.sv.resize(m.numCh);
245  for(std::size_t i = 0; i < m.sv.size(); ++i)
246  ros::serialization::deserialize(stream, m.sv[i]);
247  }
248 
249  static uint32_t serializedLength (typename CallTraits::param_type m) {
250  return 16 + 12 * m.numCh;
251  }
252 
253  static void write(uint8_t *data, uint32_t size,
254  typename CallTraits::param_type m) {
255  if(m.sv.size() != m.numCh) {
256  ROS_ERROR("NavDGPS numCh must equal sv size");
257  }
258  ros::serialization::OStream stream(data, size);
259  stream.next(m.iTOW);
260  stream.next(m.age);
261  stream.next(m.baseId);
262  stream.next(m.baseHealth);
263  stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
264  stream.next(m.status);
265  stream.next(m.reserved1);
266  for(std::size_t i = 0; i < m.sv.size(); ++i)
267  ros::serialization::serialize(stream, m.sv[i]);
268  }
269 };
270 
271 
275 template <typename ContainerAllocator>
276 struct Serializer<ublox_msgs::NavSBAS_<ContainerAllocator> > {
277  typedef ublox_msgs::NavSBAS_<ContainerAllocator> Msg;
278  typedef boost::call_traits<Msg> CallTraits;
279 
280  static void read(const uint8_t *data, uint32_t count,
281  typename CallTraits::reference m) {
282  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
283  stream.next(m.iTOW);
284  stream.next(m.geo);
285  stream.next(m.mode);
286  stream.next(m.sys);
287  stream.next(m.service);
288  stream.next(m.cnt);
289  stream.next(m.reserved0);
290  m.sv.resize(m.cnt);
291  for(std::size_t i = 0; i < m.sv.size(); ++i)
292  ros::serialization::deserialize(stream, m.sv[i]);
293  }
294 
295  static uint32_t serializedLength (typename CallTraits::param_type m) {
296  return 12 + 12 * m.cnt;
297  }
298 
299  static void write(uint8_t *data, uint32_t size,
300  typename CallTraits::param_type m) {
301  if(m.sv.size() != m.cnt) {
302  ROS_ERROR("NavSBAS cnt must equal sv size");
303  }
304  ros::serialization::OStream stream(data, size);
305  stream.next(m.iTOW);
306  stream.next(m.geo);
307  stream.next(m.mode);
308  stream.next(m.sys);
309  stream.next(m.service);
310  stream.next(static_cast<typename Msg::_cnt_type>(m.sv.size()));
311  stream.next(m.reserved0);
312  for(std::size_t i = 0; i < m.sv.size(); ++i)
313  ros::serialization::serialize(stream, m.sv[i]);
314  }
315 };
316 
320 template <typename ContainerAllocator>
321 struct Serializer<ublox_msgs::NavSAT_<ContainerAllocator> > {
322  typedef ublox_msgs::NavSAT_<ContainerAllocator> Msg;
323  typedef boost::call_traits<Msg> CallTraits;
324 
325  static void read(const uint8_t *data, uint32_t count,
326  typename CallTraits::reference m) {
327  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
328  stream.next(m.iTOW);
329  stream.next(m.version);
330  stream.next(m.numSvs);
331  stream.next(m.reserved0);
332  m.sv.resize(m.numSvs);
333  for(std::size_t i = 0; i < m.sv.size(); ++i)
334  ros::serialization::deserialize(stream, m.sv[i]);
335  }
336 
337  static uint32_t serializedLength (typename CallTraits::param_type m) {
338  return 8 + 12 * m.numSvs;
339  }
340 
341  static void write(uint8_t *data, uint32_t size,
342  typename CallTraits::param_type m) {
343  if(m.sv.size() != m.numSvs) {
344  ROS_ERROR("NavSAT numSvs must equal sv size");
345  }
346  ros::serialization::OStream stream(data, size);
347  stream.next(m.iTOW);
348  stream.next(m.version);
349  stream.next(static_cast<typename Msg::_numSvs_type>(m.sv.size()));
350  stream.next(m.reserved0);
351  for(std::size_t i = 0; i < m.sv.size(); ++i)
352  ros::serialization::serialize(stream, m.sv[i]);
353  }
354 };
355 
359 template <typename ContainerAllocator>
360 struct Serializer<ublox_msgs::NavSVINFO_<ContainerAllocator> > {
361  typedef ublox_msgs::NavSVINFO_<ContainerAllocator> Msg;
362  typedef boost::call_traits<Msg> CallTraits;
363 
364  static void read(const uint8_t *data, uint32_t count,
365  typename CallTraits::reference m) {
366  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
367  stream.next(m.iTOW);
368  stream.next(m.numCh);
369  stream.next(m.globalFlags);
370  stream.next(m.reserved2);
371  m.sv.resize(m.numCh);
372  for(std::size_t i = 0; i < m.sv.size(); ++i)
373  ros::serialization::deserialize(stream, m.sv[i]);
374  }
375 
376  static uint32_t serializedLength (typename CallTraits::param_type m) {
377  return 8 + 12 * m.numCh;
378  }
379 
380  static void write(uint8_t *data, uint32_t size,
381  typename CallTraits::param_type m) {
382  if(m.sv.size() != m.numCh) {
383  ROS_ERROR("NavSVINFO numCh must equal sv size");
384  }
385  ros::serialization::OStream stream(data, size);
386  stream.next(m.iTOW);
387  stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
388  stream.next(m.globalFlags);
389  stream.next(m.reserved2);
390  for(std::size_t i = 0; i < m.sv.size(); ++i)
391  ros::serialization::serialize(stream, m.sv[i]);
392  }
393 };
394 
398 template <typename ContainerAllocator>
399 struct Serializer<ublox_msgs::RxmRAW_<ContainerAllocator> > {
400  typedef ublox_msgs::RxmRAW_<ContainerAllocator> Msg;
401  typedef boost::call_traits<Msg> CallTraits;
402 
403  static void read(const uint8_t *data, uint32_t count,
404  typename CallTraits::reference m) {
405  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
406  stream.next(m.rcvTOW);
407  stream.next(m.week);
408  stream.next(m.numSV);
409  stream.next(m.reserved1);
410  m.sv.resize(m.numSV);
411  for(std::size_t i = 0; i < m.sv.size(); ++i)
412  ros::serialization::deserialize(stream, m.sv[i]);
413  }
414 
415  static uint32_t serializedLength (typename CallTraits::param_type m) {
416  return 8 + 24 * m.numSV;
417  }
418 
419  static void write(uint8_t *data, uint32_t size,
420  typename CallTraits::param_type m) {
421  if(m.sv.size() != m.numSV) {
422  ROS_ERROR("RxmRAW numSV must equal sv size");
423  }
424  ros::serialization::OStream stream(data, size);
425  stream.next(m.rcvTOW);
426  stream.next(m.week);
427  stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
428  stream.next(m.reserved1);
429  for(std::size_t i = 0; i < m.sv.size(); ++i)
430  ros::serialization::serialize(stream, m.sv[i]);
431  }
432 };
433 
437 template <typename ContainerAllocator>
438 struct Serializer<ublox_msgs::RxmRAWX_<ContainerAllocator> > {
439  typedef ublox_msgs::RxmRAWX_<ContainerAllocator> Msg;
440  typedef boost::call_traits<Msg> CallTraits;
441 
442  static void read(const uint8_t *data, uint32_t count,
443  typename CallTraits::reference m) {
444  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
445  stream.next(m.rcvTOW);
446  stream.next(m.week);
447  stream.next(m.leapS);
448  stream.next(m.numMeas);
449  stream.next(m.recStat);
450  stream.next(m.version);
451  stream.next(m.reserved1);
452  m.meas.resize(m.numMeas);
453  for(std::size_t i = 0; i < m.meas.size(); ++i)
454  ros::serialization::deserialize(stream, m.meas[i]);
455  }
456 
457  static uint32_t serializedLength (typename CallTraits::param_type m) {
458  return 16 + 32 * m.numMeas;
459  }
460 
461  static void write(uint8_t *data, uint32_t size,
462  typename CallTraits::param_type m) {
463  if(m.meas.size() != m.numMeas) {
464  ROS_ERROR("RxmRAWX numMeas must equal meas size");
465  }
466  ros::serialization::OStream stream(data, size);
467  stream.next(m.rcvTOW);
468  stream.next(m.week);
469  stream.next(m.leapS);
470  stream.next(static_cast<typename Msg::_numMeas_type>(m.meas.size()));
471  stream.next(m.recStat);
472  stream.next(m.version);
473  stream.next(m.reserved1);
474  for(std::size_t i = 0; i < m.meas.size(); ++i)
475  ros::serialization::serialize(stream, m.meas[i]);
476  }
477 };
478 
482 template <typename ContainerAllocator>
483 struct Serializer<ublox_msgs::RxmSFRBX_<ContainerAllocator> > {
484  typedef ublox_msgs::RxmSFRBX_<ContainerAllocator> Msg;
485  typedef boost::call_traits<Msg> CallTraits;
486 
487  static void read(const uint8_t *data, uint32_t count,
488  typename CallTraits::reference m) {
489  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
490  stream.next(m.gnssId);
491  stream.next(m.svId);
492  stream.next(m.reserved0);
493  stream.next(m.freqId);
494  stream.next(m.numWords);
495  stream.next(m.chn);
496  stream.next(m.version);
497  stream.next(m.reserved1);
498  m.dwrd.resize(m.numWords);
499  for(std::size_t i = 0; i < m.dwrd.size(); ++i)
500  ros::serialization::deserialize(stream, m.dwrd[i]);
501  }
502 
503  static uint32_t serializedLength (typename CallTraits::param_type m) {
504  return 8 + 4 * m.numWords;
505  }
506 
507  static void write(uint8_t *data, uint32_t size,
508  typename CallTraits::param_type m) {
509  if(m.dwrd.size() != m.numWords) {
510  ROS_ERROR("RxmSFRBX numWords must equal dwrd size");
511  }
512  ros::serialization::OStream stream(data, size);
513  stream.next(m.gnssId);
514  stream.next(m.svId);
515  stream.next(m.reserved0);
516  stream.next(m.freqId);
517  stream.next(static_cast<typename Msg::_numWords_type>(m.dwrd.size()));
518  stream.next(m.chn);
519  stream.next(m.version);
520  stream.next(m.reserved1);
521  for(std::size_t i = 0; i < m.dwrd.size(); ++i)
522  ros::serialization::serialize(stream, m.dwrd[i]);
523  }
524 };
525 
529 template <typename ContainerAllocator>
530 struct Serializer<ublox_msgs::RxmSVSI_<ContainerAllocator> > {
531  typedef ublox_msgs::RxmSVSI_<ContainerAllocator> Msg;
532  typedef boost::call_traits<Msg> CallTraits;
533 
534  static void read(const uint8_t *data, uint32_t count,
535  typename CallTraits::reference m) {
536  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
537  stream.next(m.iTOW);
538  stream.next(m.week);
539  stream.next(m.numVis);
540  stream.next(m.numSV);
541  m.sv.resize(m.numSV);
542  for(std::size_t i = 0; i < m.sv.size(); ++i)
543  ros::serialization::deserialize(stream, m.sv[i]);
544  }
545 
546  static uint32_t serializedLength (typename CallTraits::param_type m) {
547  return 8 + 6 * m.numSV;
548  }
549 
550  static void write(uint8_t *data, uint32_t size,
551  typename CallTraits::param_type m) {
552  if(m.sv.size() != m.numSV) {
553  ROS_ERROR("RxmSVSI numSV must equal sv size");
554  }
555  ros::serialization::OStream stream(data, size);
556  stream.next(m.iTOW);
557  stream.next(m.week);
558  stream.next(m.numVis);
559  stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
560  for(std::size_t i = 0; i < m.sv.size(); ++i)
561  ros::serialization::serialize(stream, m.sv[i]);
562  }
563 };
564 
568 template <typename ContainerAllocator>
569 struct Serializer<ublox_msgs::RxmALM_<ContainerAllocator> > {
570  typedef ublox_msgs::RxmALM_<ContainerAllocator> Msg;
571  typedef boost::call_traits<Msg> CallTraits;
572 
573  static void read(const uint8_t *data, uint32_t count,
574  typename CallTraits::reference m) {
575  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
576  stream.next(m.svid);
577  stream.next(m.week);
578 
579  m.dwrd.clear();
580  if(count == 40) {
581  typename Msg::_dwrd_type::value_type temp;
582  m.dwrd.resize(8);
583  for(std::size_t i = 0; i < 8; ++i) {
584  stream.next(temp);
585  m.dwrd.push_back(temp);
586  }
587  }
588  }
589 
590  static uint32_t serializedLength (typename CallTraits::param_type m) {
591  return 8 + (4 * m.dwrd.size());
592  }
593 
594  static void write(uint8_t *data, uint32_t size,
595  typename CallTraits::param_type m) {
596  ros::serialization::OStream stream(data, size);
597  stream.next(m.svid);
598  stream.next(m.week);
599  for(std::size_t i = 0; i < m.dwrd.size(); ++i)
600  ros::serialization::serialize(stream, m.dwrd[i]);
601  }
602 };
603 
607 template <typename ContainerAllocator>
608 struct Serializer<ublox_msgs::RxmEPH_<ContainerAllocator> >
609 {
610  typedef ublox_msgs::RxmEPH_<ContainerAllocator> Msg;
611  typedef boost::call_traits<Msg> CallTraits;
612 
613  static void read(const uint8_t *data, uint32_t count,
614  typename CallTraits::reference m) {
615  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
616  stream.next(m.svid);
617  stream.next(m.how);
618  m.sf1d.clear();
619  m.sf2d.clear();
620  m.sf3d.clear();
621 
622  if (count == 104) {
623  typename Msg::_sf1d_type::value_type temp1;
624  typename Msg::_sf2d_type::value_type temp2;
625  typename Msg::_sf3d_type::value_type temp3;
626 
627  m.sf1d.resize(8);
628  for(std::size_t i = 0; i < 8; ++i) {
629  stream.next(temp1);
630  m.sf1d.push_back(temp1);
631  }
632  m.sf2d.resize(8);
633  for(std::size_t i = 0; i < 8; ++i) {
634  stream.next(temp2);
635  m.sf2d.push_back(temp2);
636  }
637  m.sf3d.resize(8);
638  for(std::size_t i = 0; i < 8; ++i) {
639  stream.next(temp3);
640  m.sf3d.push_back(temp3);
641  }
642  }
643  }
644 
645  static uint32_t serializedLength (typename CallTraits::param_type m) {
646  return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
647  }
648 
649  static void write(uint8_t *data, uint32_t size,
650  typename CallTraits::param_type m) {
651  ros::serialization::OStream stream(data, size);
652  stream.next(m.svid);
653  stream.next(m.how);
654  for(std::size_t i = 0; i < m.sf1d.size(); ++i)
655  ros::serialization::serialize(stream, m.sf1d[i]);
656  for(std::size_t i = 0; i < m.sf2d.size(); ++i)
657  ros::serialization::serialize(stream, m.sf2d[i]);
658  for(std::size_t i = 0; i < m.sf3d.size(); ++i)
659  ros::serialization::serialize(stream, m.sf3d[i]);
660  }
661 };
662 
666 template <typename ContainerAllocator>
667 struct Serializer<ublox_msgs::AidALM_<ContainerAllocator> > {
668  typedef ublox_msgs::AidALM_<ContainerAllocator> Msg;
669  typedef boost::call_traits<Msg> CallTraits;
670 
671  static void read(const uint8_t *data, uint32_t count,
672  typename CallTraits::reference m) {
673  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
674  stream.next(m.svid);
675  stream.next(m.week);
676 
677  m.dwrd.clear();
678  if (count == 40) {
679  typename Msg::_dwrd_type::value_type temp;
680  m.dwrd.resize(8);
681  for(std::size_t i = 0; i < 8; ++i) {
682  stream.next(temp);
683  m.dwrd.push_back(temp);
684  }
685  }
686  }
687 
688  static uint32_t serializedLength (typename CallTraits::param_type m) {
689  return 8 + (4 * m.dwrd.size());
690  }
691 
692  static void write(uint8_t *data, uint32_t size,
693  typename CallTraits::param_type m) {
694  ros::serialization::OStream stream(data, size);
695  stream.next(m.svid);
696  stream.next(m.week);
697  for(std::size_t i = 0; i < m.dwrd.size(); ++i)
698  ros::serialization::serialize(stream, m.dwrd[i]);
699  }
700 };
701 
705 template <typename ContainerAllocator>
706 struct Serializer<ublox_msgs::AidEPH_<ContainerAllocator> >
707 {
708  typedef ublox_msgs::AidEPH_<ContainerAllocator> Msg;
709  typedef boost::call_traits<Msg> CallTraits;
710 
711  static void read(const uint8_t *data, uint32_t count,
712  typename CallTraits::reference m) {
713  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
714  stream.next(m.svid);
715  stream.next(m.how);
716  m.sf1d.clear();
717  m.sf2d.clear();
718  m.sf3d.clear();
719 
720  if (count == 104) {
721  typename Msg::_sf1d_type::value_type temp1;
722  typename Msg::_sf2d_type::value_type temp2;
723  typename Msg::_sf3d_type::value_type temp3;
724  m.sf1d.resize(8);
725  for(std::size_t i = 0; i < 8; ++i) {
726  stream.next(temp1);
727  m.sf1d.push_back(temp1);
728  }
729  m.sf2d.resize(8);
730  for(std::size_t i = 0; i < 8; ++i) {
731  stream.next(temp2);
732  m.sf2d.push_back(temp2);
733  }
734  m.sf3d.resize(8);
735  for(std::size_t i = 0; i < 8; ++i) {
736  stream.next(temp3);
737  m.sf3d.push_back(temp3);
738  }
739  }
740  }
741 
742  static uint32_t serializedLength (typename CallTraits::param_type m) {
743  return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
744  }
745 
746  static void write(uint8_t *data, uint32_t size,
747  typename CallTraits::param_type m) {
748  ros::serialization::OStream stream(data, size);
749  stream.next(m.svid);
750  stream.next(m.how);
751  for(std::size_t i = 0; i < m.sf1d.size(); ++i)
752  ros::serialization::serialize(stream, m.sf1d[i]);
753  for(std::size_t i = 0; i < m.sf2d.size(); ++i)
754  ros::serialization::serialize(stream, m.sf2d[i]);
755  for(std::size_t i = 0; i < m.sf3d.size(); ++i)
756  ros::serialization::serialize(stream, m.sf3d[i]);
757  }
758 };
759 
764 template <typename ContainerAllocator>
765 struct Serializer<ublox_msgs::EsfMEAS_<ContainerAllocator> > {
766  typedef boost::call_traits<ublox_msgs::EsfMEAS_<ContainerAllocator> >
768 
769  static void read(const uint8_t *data, uint32_t count,
770  typename CallTraits::reference m) {
771  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
772  stream.next(m.timeTag);
773  stream.next(m.flags);
774  stream.next(m.id);
775 
776  bool calib_valid = m.flags & m.FLAGS_CALIB_T_TAG_VALID;
777  int data_size = (count - (calib_valid ? 12 : 8)) / 4;
778  // Repeating block
779  m.data.resize(data_size);
780  for(std::size_t i = 0; i < data_size; ++i)
781  ros::serialization::deserialize(stream, m.data[i]);
782  // Optional block
783  if(calib_valid) {
784  m.calibTtag.resize(1);
785  ros::serialization::deserialize(stream, m.calibTtag[0]);
786  }
787  }
788 
789  static uint32_t serializedLength (typename CallTraits::param_type m) {
790  return 4 + 8 * m.data.size() + 4 * m.calibTtag.size();
791  }
792 
793  static void write(uint8_t *data, uint32_t size,
794  typename CallTraits::param_type m) {
795  ros::serialization::OStream stream(data, size);
796  stream.next(m.timeTag);
797  stream.next(m.flags);
798  stream.next(m.id);
799  for(std::size_t i = 0; i < m.data.size(); ++i)
800  ros::serialization::serialize(stream, m.data[i]);
801  for(std::size_t i = 0; i < m.calibTtag.size(); ++i)
802  ros::serialization::serialize(stream, m.calibTtag[i]);
803  }
804 };
805 
809 template <typename ContainerAllocator>
810 struct Serializer<ublox_msgs::EsfRAW_<ContainerAllocator> > {
811  typedef boost::call_traits<ublox_msgs::EsfRAW_<ContainerAllocator> >
813 
814  static void read(const uint8_t *data, uint32_t count,
815  typename CallTraits::reference m) {
816  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
817  stream.next(m.reserved0);
818  m.blocks.clear();
819  int num_blocks = (count - 4) / 8;
820  m.blocks.resize(num_blocks);
821  for(std::size_t i = 0; i < num_blocks; ++i)
822  ros::serialization::deserialize(stream, m.blocks[i]);
823  }
824 
825 
826  static uint32_t serializedLength (typename CallTraits::param_type m) {
827  return 4 + 8 * m.blocks.size();
828  }
829 
830  static void write(uint8_t *data, uint32_t size,
831  typename CallTraits::param_type m) {
832  ros::serialization::OStream stream(data, size);
833  stream.next(m.reserved0);
834  for(std::size_t i = 0; i < m.blocks.size(); ++i)
835  ros::serialization::serialize(stream, m.blocks[i]);
836  }
837 };
838 
842 template <typename ContainerAllocator>
843 struct Serializer<ublox_msgs::EsfSTATUS_<ContainerAllocator> > {
844  typedef ublox_msgs::EsfSTATUS_<ContainerAllocator> Msg;
845  typedef boost::call_traits<Msg> CallTraits;
846 
847  static void read(const uint8_t *data, uint32_t count,
848  typename CallTraits::reference m) {
849  ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
850  stream.next(m.iTOW);
851  stream.next(m.version);
852  stream.next(m.fusionMode);
853  stream.next(m.reserved2);
854  stream.next(m.numSens);
855  m.sens.resize(m.numSens);
856  for(std::size_t i = 0; i < m.sens.size(); ++i)
857  ros::serialization::deserialize(stream, m.sens[i]);
858  }
859 
860  static uint32_t serializedLength (typename CallTraits::param_type m) {
861  return 16 + 4 * m.numSens;
862  }
863 
864  static void write(uint8_t *data, uint32_t size,
865  typename CallTraits::param_type m) {
866  if(m.sens.size() != m.numSens) {
867  ROS_ERROR("Writing EsfSTATUS message: numSens must equal size of sens");
868  }
869  ros::serialization::OStream stream(data, size);
870  stream.next(m.iTOW);
871  stream.next(m.version);
872  stream.next(m.fusionMode);
873  stream.next(m.reserved2);
874  stream.next(static_cast<typename Msg::_numSens_type>(m.sens.size()));
875  for(std::size_t i = 0; i < m.sens.size(); ++i)
876  ros::serialization::serialize(stream, m.sens[i]);
877  }
878 };
879 
880 
881 } // namespace ublox
882 
883 #endif // UBLOX_SERIALIZATION_UBLOX_MSGS_H
boost::call_traits< ublox_msgs::CfgDAT_< ContainerAllocator > > CallTraits
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
ROS_FORCE_INLINE void next(T &t)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
boost::call_traits< ublox_msgs::EsfRAW_< ContainerAllocator > > CallTraits
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
void serialize(Stream &stream, const T &t)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
boost::call_traits< ublox_msgs::EsfMEAS_< ContainerAllocator > > CallTraits
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
ROS_FORCE_INLINE void next(const T &t)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
boost::call_traits< ublox_msgs::Inf_< ContainerAllocator > > CallTraits
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
void deserialize(Stream &stream, T &t)
#define ROS_ERROR(...)
static void read(const uint8_t *data, uint32_t count, typename CallTraits::reference m)
static void write(uint8_t *data, uint32_t size, typename CallTraits::param_type m)
static uint32_t serializedLength(typename CallTraits::param_type m)
boost::call_traits< ublox_msgs::CfgINF_< ContainerAllocator > > CallTraits


ublox_msgs
Author(s): Johannes Meyer
autogenerated on Thu Jan 28 2021 03:13:50