callback_handlers.cpp
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // © Copyright 2020, Septentrio NV/SA.
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // 1. Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // 2. Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // 3. Neither the name of the copyright holder nor the names of its
14 // contributors may be used to endorse or promote products derived
15 // from this software without 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 OR CONTRIBUTORS BE
21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 // POSSIBILITY OF SUCH DAMAGE.
28 //
29 // *****************************************************************************
30 
32 
39 std::pair<std::string, uint32_t> gpsfix_pairs[] = {
40  std::make_pair("4013", 0), std::make_pair("4027", 1), std::make_pair("4001", 2),
41  std::make_pair("4007", 3), std::make_pair("5906", 4), std::make_pair("5908", 5),
42  std::make_pair("5938", 6), std::make_pair("5939", 7), std::make_pair("4226", 8)};
43 
44 std::pair<std::string, uint32_t> navsatfix_pairs[] = {
45  std::make_pair("4007", 0), std::make_pair("5906", 1), std::make_pair("4226", 2)};
46 
47 std::pair<std::string, uint32_t> pose_pairs[] = {
48  std::make_pair("4007", 0), std::make_pair("5906", 1), std::make_pair("5938", 2),
49  std::make_pair("5939", 3), std::make_pair("4226", 4)};
50 
51 std::pair<std::string, uint32_t> diagnosticarray_pairs[] = {
52  std::make_pair("4014", 0), std::make_pair("4082", 1)};
53 
54 std::pair<std::string, uint32_t> imu_pairs[] = {std::make_pair("4226", 0),
55  std::make_pair("4050", 1)};
56 
57 std::pair<std::string, uint32_t> localization_pairs[] = {std::make_pair("4226", 0)};
58 
59 namespace io_comm_rx {
61 
63  gpsfix_pairs + 9);
72 
75  localization_pairs + 1);
76 
77  std::string CallbackHandlers::do_gpsfix_ = "4007";
78  std::string CallbackHandlers::do_navsatfix_ = "4007";
79  std::string CallbackHandlers::do_pose_ = "4007";
80  std::string CallbackHandlers::do_diagnostics_ = "4014";
81 
82  std::string CallbackHandlers::do_insgpsfix_ = "4226";
83  std::string CallbackHandlers::do_insnavsatfix_ = "4226";
84  std::string CallbackHandlers::do_inspose_ = "4226";
85  std::string CallbackHandlers::do_imu_ = "4226";
86  std::string CallbackHandlers::do_inslocalization_ = "4226";
87 
91  {
92  // Find the ROS message callback handler for the equivalent Rx message
93  // (SBF/NMEA) at hand & call it
94  boost::mutex::scoped_lock lock(callback_mutex_);
95  CallbackMap::key_type key = rx_message_.messageID();
96  std::string ID_temp = rx_message_.messageID();
97  if (!(ID_temp == "4013" || ID_temp == "4001" || ID_temp == "4014" ||
98  ID_temp == "4082"))
99  // We only want to handle ChannelStatus, MeasEpoch, DOP, ReceiverStatus,
100  // QualityInd blocks in case GPSFix and DiagnosticArray
101  // messages are to be published, respectively, see few lines below.
102  {
103  for (CallbackMap::iterator callback = callbackmap_.lower_bound(key);
104  callback != callbackmap_.upper_bound(key); ++callback)
105  {
106  try
107  {
108  callback->second->handle(rx_message_, callback->first);
109  } catch (std::runtime_error& e)
110  {
111  throw std::runtime_error(e.what());
112  }
113  }
114  }
115 
116  // Call NavSatFix callback function if it was added for GNSS
117  if (settings_->septentrio_receiver_type == "gnss")
118  {
120  {
121  CallbackMap::key_type key = "NavSatFix";
122  std::string ID_temp = rx_message_.messageID();
123  if (ID_temp == do_navsatfix_)
124  // The last incoming block PVTGeodetic triggers
125  // the publishing of NavSatFix.
126  {
127  for (CallbackMap::iterator callback =
128  callbackmap_.lower_bound(key);
129  callback != callbackmap_.upper_bound(key); ++callback)
130  {
131  try
132  {
133  callback->second->handle(rx_message_, callback->first);
134  } catch (std::runtime_error& e)
135  {
136  throw std::runtime_error(e.what());
137  }
138  }
139  do_navsatfix_ = std::string();
140  }
141  }
142  }
143  // Call NavSatFix callback function if it was added for INS
144  if (settings_->septentrio_receiver_type == "ins")
145  {
147  {
148  CallbackMap::key_type key = "INSNavSatFix";
149  std::string ID_temp = rx_message_.messageID();
150  if (ID_temp == do_insnavsatfix_)
151  // The last incoming block INSNavGeod triggers
152  // the publishing of NavSatFix.
153  {
154  for (CallbackMap::iterator callback =
155  callbackmap_.lower_bound(key);
156  callback != callbackmap_.upper_bound(key); ++callback)
157  {
158  try
159  {
160  callback->second->handle(rx_message_, callback->first);
161  } catch (std::runtime_error& e)
162  {
163  throw std::runtime_error(e.what());
164  }
165  }
166  do_insnavsatfix_ = std::string();
167  }
168  }
169  }
170  // Call PoseWithCovarianceStampedMsg callback function if it was
171  // added for GNSS
172  if (settings_->septentrio_receiver_type == "gnss")
173  {
174  if (settings_->publish_pose)
175  {
176  CallbackMap::key_type key = "PoseWithCovarianceStamped";
177  std::string ID_temp = rx_message_.messageID();
178  if (ID_temp == do_pose_)
179  // The last incoming block among PVTGeodetic, PosCovGeodetic,
180  // AttEuler and AttCovEuler triggers the publishing of
181  // PoseWithCovarianceStamped.
182  {
183  for (CallbackMap::iterator callback =
184  callbackmap_.lower_bound(key);
185  callback != callbackmap_.upper_bound(key); ++callback)
186  {
187  try
188  {
189  callback->second->handle(rx_message_, callback->first);
190  } catch (std::runtime_error& e)
191  {
192  throw std::runtime_error(e.what());
193  }
194  }
195  do_pose_ = std::string();
196  }
197  }
198  }
199  // Call PoseWithCovarianceStampedMsg callback function if it was
200  // added for INS
201  if (settings_->septentrio_receiver_type == "ins")
202  {
203  if (settings_->publish_pose)
204  {
205  CallbackMap::key_type key = "INSPoseWithCovarianceStamped";
206  std::string ID_temp = rx_message_.messageID();
207  if (ID_temp == do_inspose_)
208  // The last incoming block INSNavGeod triggers the publishing of
209  // PoseWithCovarianceStamped.
210  {
211  for (CallbackMap::iterator callback =
212  callbackmap_.lower_bound(key);
213  callback != callbackmap_.upper_bound(key); ++callback)
214  {
215  try
216  {
217  callback->second->handle(rx_message_, callback->first);
218  } catch (std::runtime_error& e)
219  {
220  throw std::runtime_error(e.what());
221  }
222  }
223  do_inspose_ = std::string();
224  }
225  }
226  }
227  // Call DiagnosticArrayMsg callback function if it was added
228  // for the both type of receivers
230  {
231  CallbackMap::key_type key1 = rx_message_.messageID();
232  std::string ID_temp = rx_message_.messageID();
233  if (ID_temp == "4014" || ID_temp == "4082" || ID_temp == "5902")
234  {
235  for (CallbackMap::iterator callback = callbackmap_.lower_bound(key1);
236  callback != callbackmap_.upper_bound(key1); ++callback)
237  {
238  try
239  {
240  callback->second->handle(rx_message_, callback->first);
241  } catch (std::runtime_error& e)
242  {
243  throw std::runtime_error(e.what());
244  }
245  }
246  }
247  CallbackMap::key_type key2 = "DiagnosticArray";
248  if (ID_temp == do_diagnostics_)
249  // The last incoming block among ReceiverStatus, QualityInd and
250  // ReceiverSetup triggers the publishing of DiagnosticArray.
251  {
252  for (CallbackMap::iterator callback = callbackmap_.lower_bound(key2);
253  callback != callbackmap_.upper_bound(key2); ++callback)
254  {
255  try
256  {
257  callback->second->handle(rx_message_, callback->first);
258  } catch (std::runtime_error& e)
259  {
260  throw std::runtime_error(e.what());
261  }
262  }
263  do_diagnostics_ = std::string();
264  }
265  }
266  // Call ImuMsg callback function if it was
267  // added for INS
268  if (settings_->septentrio_receiver_type == "ins")
269  {
270  if (settings_->publish_imu)
271  {
272  CallbackMap::key_type key = "Imu";
273  std::string ID_temp = rx_message_.messageID();
274  if (ID_temp == do_imu_)
275  // The last incoming block INSNavGeod triggers the publishing of
276  // PoseWithCovarianceStamped.
277  {
278  for (CallbackMap::iterator callback =
279  callbackmap_.lower_bound(key);
280  callback != callbackmap_.upper_bound(key); ++callback)
281  {
282  try
283  {
284  callback->second->handle(rx_message_, callback->first);
285  } catch (std::runtime_error& e)
286  {
287  throw std::runtime_error(e.what());
288  }
289  }
290  do_imu_ = std::string();
291  }
292  }
293  }
294  // Call LocalizationMsg callback function if it was
295  // added for INS
296  if (settings_->septentrio_receiver_type == "ins")
297  {
299  {
300  CallbackMap::key_type key = "Localization";
301  std::string ID_temp = rx_message_.messageID();
302  if (ID_temp == do_inslocalization_)
303  // The last incoming block INSNavGeod triggers the publishing of
304  // PoseWithCovarianceStamped.
305  {
306  for (CallbackMap::iterator callback =
307  callbackmap_.lower_bound(key);
308  callback != callbackmap_.upper_bound(key); ++callback)
309  {
310  try
311  {
312  callback->second->handle(rx_message_, callback->first);
313  } catch (std::runtime_error& e)
314  {
315  throw std::runtime_error(e.what());
316  }
317  }
318  do_inslocalization_ = std::string();
319  }
320  }
321  }
322  // Call TimeReferenceMsg (with GPST) callback function if it was
323  // added
324  if (settings_->septentrio_receiver_type == "gnss")
325  {
326  if (settings_->publish_gpst)
327  {
328  CallbackMap::key_type key1 = "GPST";
329  std::string ID_temp = rx_message_.messageID();
330  // If no new PVTGeodetic block is coming in, there is no need to
331  // publish TimeReferenceMsg (with GPST) anew.
332  if (ID_temp == "4007")
333  {
334  for (CallbackMap::iterator callback =
335  callbackmap_.lower_bound(key1);
336  callback != callbackmap_.upper_bound(key1); ++callback)
337  {
338  try
339  {
340  callback->second->handle(rx_message_, callback->first);
341  } catch (std::runtime_error& e)
342  {
343  throw std::runtime_error(e.what());
344  }
345  }
346  }
347  }
348  }
349  if (settings_->septentrio_receiver_type == "ins")
350  {
351  if (settings_->publish_gpst)
352  {
353  CallbackMap::key_type key1 = "GPST";
354  std::string ID_temp = rx_message_.messageID();
355  // If no new INSNavGeod block is coming in, there is no need to
356  // publish TimeReferenceMsg (with GPST) anew.
357  if (ID_temp == "4226")
358  {
359  for (CallbackMap::iterator callback =
360  callbackmap_.lower_bound(key1);
361  callback != callbackmap_.upper_bound(key1); ++callback)
362  {
363  try
364  {
365  callback->second->handle(rx_message_, callback->first);
366  } catch (std::runtime_error& e)
367  {
368  throw std::runtime_error(e.what());
369  }
370  }
371  }
372  }
373  }
374  // Call GPSFix callback function if it was added for GNSS
375  if (settings_->septentrio_receiver_type == "gnss")
376  {
378  {
379  std::string ID_temp = rx_message_.messageID();
380  CallbackMap::key_type key1 = rx_message_.messageID();
381  if (ID_temp == "4013" || ID_temp == "4001")
382  // Even though we are not interested in publishing ChannelStatus
383  // (4013) and DOP (4001) ROS messages, we have to save some contents
384  // of these incoming blocks in order to publish the GPSFix message.
385  {
386  for (CallbackMap::iterator callback =
387  callbackmap_.lower_bound(key1);
388  callback != callbackmap_.upper_bound(key1); ++callback)
389  {
390  try
391  {
392  callback->second->handle(rx_message_, callback->first);
393  } catch (std::runtime_error& e)
394  {
395  throw std::runtime_error(e.what());
396  }
397  }
398  }
399  CallbackMap::key_type key2 = "GPSFix";
400  if (ID_temp == do_gpsfix_)
401  // The last incoming block among ChannelStatus (4013), MeasEpoch
402  // (4027), and DOP (4001) triggers the publishing of GPSFix.
403  {
404  for (CallbackMap::iterator callback =
405  callbackmap_.lower_bound(key2);
406  callback != callbackmap_.upper_bound(key2); ++callback)
407  {
408  try
409  {
410  callback->second->handle(rx_message_, callback->first);
411  } catch (std::runtime_error& e)
412  {
413  throw std::runtime_error(e.what());
414  }
415  }
416  do_gpsfix_ = std::string();
417  }
418  }
419  }
420  // Call GPSFix callback function if it was added for INS
421  if (settings_->septentrio_receiver_type == "ins")
422  {
424  {
425  std::string ID_temp = rx_message_.messageID();
426  CallbackMap::key_type key1 = rx_message_.messageID();
427  if (ID_temp == "4013" || ID_temp == "4001")
428  // Even though we are not interested in publishing ChannelStatus
429  // (4013) and DOP (4001) ROS messages, we have to save some contents
430  // of these incoming blocks in order to publish the GPSFix message.
431  {
432  for (CallbackMap::iterator callback =
433  callbackmap_.lower_bound(key1);
434  callback != callbackmap_.upper_bound(key1); ++callback)
435  {
436  try
437  {
438  callback->second->handle(rx_message_, callback->first);
439  } catch (std::runtime_error& e)
440  {
441  throw std::runtime_error(e.what());
442  }
443  }
444  }
445  CallbackMap::key_type key2 = "INSGPSFix";
446  if (ID_temp == do_insgpsfix_)
447  // The last incoming block among ChannelStatus (4013), MeasEpoch
448  // (4027) and DOP (4001) triggers the publishing of INSGPSFix.
449  {
450  for (CallbackMap::iterator callback =
451  callbackmap_.lower_bound(key2);
452  callback != callbackmap_.upper_bound(key2); ++callback)
453  {
454  try
455  {
456  callback->second->handle(rx_message_, callback->first);
457  } catch (std::runtime_error& e)
458  {
459  throw std::runtime_error(e.what());
460  }
461  }
462  do_insgpsfix_ = std::string();
463  }
464  }
465  }
466  }
467 
468  void CallbackHandlers::readCallback(Timestamp recvTimestamp, const uint8_t* data,
469  std::size_t& size)
470  {
471  rx_message_.newData(recvTimestamp, data, size);
472  // Read !all! (there might be many) messages in the buffer
473  while (rx_message_.search() != rx_message_.getEndBuffer() &&
474  rx_message_.found())
475  {
476  // Print the found message (if NMEA) or just show messageID (if SBF)..
477  if (rx_message_.isSBF())
478  {
479  std::size_t sbf_block_length;
480  std::string ID_temp = rx_message_.messageID();
481  sbf_block_length =
482  static_cast<std::size_t>(rx_message_.getBlockLength());
484  "ROSaic reading SBF block " + ID_temp + " made up of " +
485  std::to_string(sbf_block_length) + " bytes...");
486  // If full message did not yet arrive, throw an error message.
487  if (sbf_block_length > rx_message_.getCount())
488  {
489  node_->log(
491  "Not a valid SBF block, parts of the SBF block are yet to be received. Ignore..");
492  throw(
493  static_cast<std::size_t>(rx_message_.getPosBuffer() - data));
494  }
495  if (settings_->septentrio_receiver_type == "gnss")
496  {
497  if (settings_->publish_gpsfix == true &&
498  (ID_temp == "4013" || ID_temp == "4027" ||
499  ID_temp == "4001" || ID_temp == "4007" ||
500  ID_temp == "5906" || ID_temp == "5908" ||
501  ID_temp == "5938" || ID_temp == "5939"))
502  {
504  {
505  do_gpsfix_ = ID_temp;
506  }
507  }
508  }
509  if (settings_->septentrio_receiver_type == "ins")
510  {
511  if (settings_->publish_gpsfix == true &&
512  (ID_temp == "4013" || ID_temp == "4027" ||
513  ID_temp == "4001" || ID_temp == "4226"))
514  {
516  {
517  do_insgpsfix_ = ID_temp;
518  }
519  }
520  }
521  if (settings_->septentrio_receiver_type == "gnss")
522  {
523  if (settings_->publish_navsatfix == true &&
524  (ID_temp == "4007" || ID_temp == "5906"))
525  {
527  navsatfix_map[ID_temp]))
528  {
529  do_navsatfix_ = ID_temp;
530  }
531  }
532  }
533  if (settings_->septentrio_receiver_type == "ins")
534  {
535  if (settings_->publish_navsatfix == true && (ID_temp == "4226"))
536  {
538  navsatfix_map[ID_temp]))
539  {
540  do_insnavsatfix_ = ID_temp;
541  }
542  }
543  }
544  if (settings_->septentrio_receiver_type == "gnss")
545  {
546  if (settings_->publish_pose == true &&
547  (ID_temp == "4007" || ID_temp == "5906" ||
548  ID_temp == "5938" || ID_temp == "5939"))
549  {
551  {
552  do_pose_ = ID_temp;
553  }
554  }
555  }
556  if (settings_->septentrio_receiver_type == "ins")
557  {
558  if (settings_->publish_pose == true && (ID_temp == "4226"))
559  {
560  if (rx_message_.ins_pose_complete(pose_map[ID_temp]))
561  {
562  do_inspose_ = ID_temp;
563  }
564  }
565  }
566  if (settings_->publish_diagnostics == true &&
567  (ID_temp == "4014" || ID_temp == "4082"))
568  {
570  diagnosticarray_map[ID_temp]))
571  {
572  do_diagnostics_ = ID_temp;
573  }
574  }
576  (ID_temp == "4226"))
577  {
579  localization_map[ID_temp]))
580  {
581  do_inslocalization_ = ID_temp;
582  }
583  }
584  }
585  if (rx_message_.isNMEA())
586  {
587  boost::char_separator<char> sep("\r"); // Carriage Return (CR)
588  typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
589  std::size_t nmea_size = rx_message_.messageSize();
590  // Syntax: new_string_name (const char* s, size_t n); size_t is
591  // either 2 or 8 bytes, depending on your system
592  std::string block_in_string(
593  reinterpret_cast<const char*>(rx_message_.getPosBuffer()),
594  nmea_size);
595  tokenizer tokens(block_in_string, sep);
597  "The NMEA message contains " + std::to_string(nmea_size) +
598  " bytes and is ready to be parsed. It reads: " +
599  *tokens.begin());
600  }
601  if (rx_message_.isResponse()) // If the response is not sent at once,
602  // only first part is ROS_DEBUG-printed
603  {
604  std::size_t response_size = rx_message_.messageSize();
605  std::string block_in_string(
606  reinterpret_cast<const char*>(rx_message_.getPosBuffer()),
607  response_size);
608  node_->log(LogLevel::DEBUG, "The Rx's response contains " +
609  std::to_string(response_size) +
610  " bytes and reads:\n " +
611  block_in_string);
612  {
613  boost::mutex::scoped_lock lock(g_response_mutex);
614  g_response_received = true;
615  lock.unlock();
616  g_response_condition.notify_one();
617  }
619  {
620  node_->log(
622  "Invalid command just sent to the Rx! The Rx's response contains " +
623  std::to_string(response_size) + " bytes and reads:\n " +
624  block_in_string);
625  }
626  continue;
627  }
629  {
630  std::string cd(
631  reinterpret_cast<const char*>(rx_message_.getPosBuffer()), 4);
632  g_rx_tcp_port = cd;
633  if (g_cd_count == 0)
634  {
635  node_->log(
637  "The connection descriptor for the TCP connection is " + cd);
638  }
639  if (g_cd_count < 3)
640  ++g_cd_count;
641  if (g_cd_count == 2)
642  {
643  boost::mutex::scoped_lock lock(g_cd_mutex);
644  g_cd_received = true;
645  lock.unlock();
646  g_cd_condition.notify_one();
647  }
648  continue;
649  }
650  try
651  {
652  handle();
653  } catch (std::runtime_error& e)
654  {
656  "Incomplete message: " + std::string(e.what()));
657  throw(static_cast<std::size_t>(rx_message_.getPosBuffer() - data));
658  }
659  }
660  }
661 } // namespace io_comm_rx
Settings::publish_pose
bool publish_pose
Whether or not to publish the PoseWithCovarianceStampedMsg message.
Definition: settings.h:241
g_rx_tcp_port
std::string g_rx_tcp_port
Rx TCP port, e.g. IP10 or IP11, to which ROSaic is connected to.
Definition: communication_core.cpp:117
Timestamp
uint64_t Timestamp
Definition: typedefs.hpp:88
io_comm_rx::RxMessage::isNMEA
bool isNMEA()
Determines whether data_ currently points to an NMEA message.
Definition: rx_message.cpp:1706
io_comm_rx::CallbackHandlers::LocalizationMap
std::unordered_map< std::string, uint32_t > LocalizationMap
Definition: callback_handlers.hpp:344
Settings::publish_localization
bool publish_localization
Whether or not to publish the LocalizationMsg message.
Definition: settings.h:247
io_comm_rx::RxMessage::messageSize
std::size_t messageSize()
Definition: rx_message.cpp:1617
io_comm_rx::CallbackHandlers::navsatfix_map
static NavSatFixMap navsatfix_map
Definition: callback_handlers.hpp:316
io_comm_rx::CallbackHandlers::readCallback
void readCallback(Timestamp recvTimestamp, const uint8_t *data, std::size_t &size)
Searches for Rx messages that could potentially be decoded/parsed/published.
Definition: callback_handlers.cpp:468
io_comm_rx::CallbackHandlers::ImuMap
std::unordered_map< std::string, uint32_t > ImuMap
Definition: callback_handlers.hpp:336
gpsfix_pairs
std::pair< std::string, uint32_t > gpsfix_pairs[]
Definition: callback_handlers.cpp:39
io_comm_rx::CallbackHandlers::diagnosticarray_map
static DiagnosticArrayMap diagnosticarray_map
Definition: callback_handlers.hpp:332
Settings::publish_imu
bool publish_imu
Whether or not to publish the ImuMsg message.
Definition: settings.h:245
io_comm_rx::RxMessage::getBlockLength
uint16_t getBlockLength()
Gets the length of the SBF block.
Definition: rx_message.cpp:1801
io_comm_rx::RxMessage::found
bool found()
Has an NMEA message, SBF block or command reply been found in the buffer?
Definition: rx_message.cpp:1582
io_comm_rx::CallbackHandlers::GPSFixMap
std::unordered_map< std::string, uint32_t > GPSFixMap
Definition: callback_handlers.hpp:304
io_comm_rx::CallbackHandlers::DiagnosticArrayMap
std::unordered_map< std::string, uint32_t > DiagnosticArrayMap
Definition: callback_handlers.hpp:328
ERROR
@ ERROR
Definition: typedefs.hpp:166
io_comm_rx::RxMessage::gnss_pose_complete
bool gnss_pose_complete(uint32_t id)
Wether all blocks from GNSS have arrived for Pose Message.
Definition: rx_message.cpp:3101
Settings::publish_gpst
bool publish_gpst
Whether or not to publish the TimeReferenceMsg message with GPST.
Definition: settings.h:235
io_comm_rx::CallbackHandlers::do_inspose_
static std::string do_inspose_
Definition: callback_handlers.hpp:285
callback_handlers.hpp
Handles callbacks when reading NMEA/SBF messages.
pose_pairs
std::pair< std::string, uint32_t > pose_pairs[]
Definition: callback_handlers.cpp:47
io_comm_rx::RxMessage::getCount
std::size_t getCount()
Returns the count_ variable.
Definition: rx_message.hpp:327
io_comm_rx::CallbackHandlers::callback_mutex_
static boost::mutex callback_mutex_
Definition: callback_handlers.hpp:258
io_comm_rx::RxMessage::gnss_gpsfix_complete
bool gnss_gpsfix_complete(uint32_t id)
Wether all blocks from GNSS have arrived for GpsFix Message.
Definition: rx_message.cpp:3067
g_cd_condition
boost::condition_variable g_cd_condition
Condition variable complementing "g_cd_mutex".
Definition: communication_core.cpp:112
io_comm_rx::CallbackHandlers::localization_map
static LocalizationMap localization_map
Definition: callback_handlers.hpp:348
g_cd_received
bool g_cd_received
Determines whether the connection descriptor was received from the Rx.
Definition: communication_core.cpp:110
io_comm_rx::RxMessage::isConnectionDescriptor
bool isConnectionDescriptor()
Definition: rx_message.cpp:1741
INFO
@ INFO
Definition: typedefs.hpp:164
io_comm_rx::RxMessage::ins_navsatfix_complete
bool ins_navsatfix_complete(uint32_t id)
Wether all blocks from INS have arrived for NavSatFix Message.
Definition: rx_message.cpp:3095
io_comm_rx::CallbackHandlers::do_diagnostics_
static std::string do_diagnostics_
Definition: callback_handlers.hpp:290
io_comm_rx
Definition: async_manager.hpp:84
Settings::publish_gpsfix
bool publish_gpsfix
Whether or not to publish the GPSFixMsg message.
Definition: settings.h:239
io_comm_rx::CallbackHandlers::do_imu_
static std::string do_imu_
Definition: callback_handlers.hpp:295
io_comm_rx::CallbackHandlers::gpsfix_map
static GPSFixMap gpsfix_map
Definition: callback_handlers.hpp:308
io_comm_rx::RxMessage::search
const uint8_t * search()
Searches the buffer for the beginning of the next message (NMEA or SBF)
Definition: rx_message.cpp:1598
io_comm_rx::CallbackHandlers::settings_
Settings * settings_
Settings.
Definition: callback_handlers.hpp:251
io_comm_rx::CallbackHandlers::do_insgpsfix_
static std::string do_insgpsfix_
Definition: callback_handlers.hpp:266
callback
void callback(const sensor_msgs::NavSatFixConstPtr &fix)
io_comm_rx::CallbackHandlers::do_pose_
static std::string do_pose_
Definition: callback_handlers.hpp:280
io_comm_rx::CallbackHandlers::handle
void handle()
Called every time rx_message is found to contain some potentially useful message.
Definition: callback_handlers.cpp:90
io_comm_rx::RxMessage::getPosBuffer
const uint8_t * getPosBuffer()
Gets the current position in the read buffer.
Definition: rx_message.cpp:1797
io_comm_rx::RxMessage::diagnostics_complete
bool diagnostics_complete(uint32_t id)
Wether all blocks have arrived for Diagnostics Message.
Definition: rx_message.cpp:3115
io_comm_rx::RxMessage::ins_gpsfix_complete
bool ins_gpsfix_complete(uint32_t id)
Wether all blocks from INS have arrived for GpsFix Message.
Definition: rx_message.cpp:3080
DEBUG
@ DEBUG
Definition: typedefs.hpp:163
Settings::publish_diagnostics
bool publish_diagnostics
Whether or not to publish the DiagnosticArrayMsg message.
Definition: settings.h:243
io_comm_rx::RxMessage::newData
void newData(Timestamp recvTimestamp, const uint8_t *data, std::size_t &size)
Put new data.
Definition: rx_message.hpp:289
io_comm_rx::CallbackHandlers::do_navsatfix_
static std::string do_navsatfix_
Definition: callback_handlers.hpp:271
io_comm_rx::RxMessage::gnss_navsatfix_complete
bool gnss_navsatfix_complete(uint32_t id)
Wether all blocks from GNSS have arrived for NavSatFix Message.
Definition: rx_message.cpp:3088
io_comm_rx::CallbackHandlers::rx_message_
RxMessage rx_message_
RxMessage parser.
Definition: callback_handlers.hpp:248
io_comm_rx::RxMessage::isSBF
bool isSBF()
Determines whether data_ currently points to an SBF block.
Definition: rx_message.cpp:1689
io_comm_rx::RxMessage::isErrorMessage
bool isErrorMessage()
Definition: rx_message.cpp:1759
io_comm_rx::CallbackHandlers::PoseWithCovarianceStampedMap
std::unordered_map< std::string, uint32_t > PoseWithCovarianceStampedMap
Definition: callback_handlers.hpp:320
localization_pairs
std::pair< std::string, uint32_t > localization_pairs[]
Definition: callback_handlers.cpp:57
navsatfix_pairs
std::pair< std::string, uint32_t > navsatfix_pairs[]
Definition: callback_handlers.cpp:44
io_comm_rx::CallbackHandlers::imu_map
static ImuMap imu_map
Definition: callback_handlers.hpp:340
g_response_received
bool g_response_received
Determines whether a command reply was received from the Rx.
Definition: communication_core.cpp:104
io_comm_rx::CallbackHandlers::do_insnavsatfix_
static std::string do_insnavsatfix_
Definition: callback_handlers.hpp:275
io_comm_rx::CallbackHandlers::pose_map
static PoseWithCovarianceStampedMap pose_map
Definition: callback_handlers.hpp:324
io_comm_rx::RxMessage::isResponse
bool isResponse()
Determines whether data_ currently points to an NMEA message.
Definition: rx_message.cpp:1724
ROSaicNodeBase::log
void log(LogLevel logLevel, const std::string &s)
Log function to provide abstraction of ROS loggers.
Definition: typedefs.hpp:231
io_comm_rx::CallbackHandlers::do_gpsfix_
static std::string do_gpsfix_
Definition: callback_handlers.hpp:262
io_comm_rx::RxMessage::ins_pose_complete
bool ins_pose_complete(uint32_t id)
Wether all blocks from INS have arrived for Pose Message.
Definition: rx_message.cpp:3109
io_comm_rx::CallbackHandlers::NavSatFixMap
std::unordered_map< std::string, uint32_t > NavSatFixMap
Definition: callback_handlers.hpp:312
g_cd_mutex
boost::mutex g_cd_mutex
Mutex to control changes of global variable "g_cd_received".
Definition: communication_core.cpp:108
Settings::publish_navsatfix
bool publish_navsatfix
Whether or not to publish the NavSatFixMsg message.
Definition: settings.h:237
Settings::publish_tf
bool publish_tf
Whether or not to publish the tf of the localization.
Definition: settings.h:251
io_comm_rx::RxMessage::messageID
std::string messageID()
Definition: rx_message.cpp:1777
g_cd_count
uint32_t g_cd_count
Definition: communication_core.cpp:120
io_comm_rx::CallbackHandlers::do_inslocalization_
static std::string do_inslocalization_
Definition: callback_handlers.hpp:300
diagnosticarray_pairs
std::pair< std::string, uint32_t > diagnosticarray_pairs[]
Definition: callback_handlers.cpp:51
io_comm_rx::RxMessage::getEndBuffer
const uint8_t * getEndBuffer()
Gets the end position in the read buffer.
Definition: rx_message.cpp:1799
io_comm_rx::RxMessage::ins_localization_complete
bool ins_localization_complete(uint32_t id)
Wether all blocks have arrived for Localization Message.
Definition: rx_message.cpp:3122
g_response_condition
boost::condition_variable g_response_condition
Condition variable complementing "g_response_mutex".
Definition: communication_core.cpp:106
g_response_mutex
boost::mutex g_response_mutex
Mutex to control changes of global variable "g_response_received".
Definition: communication_core.cpp:102
Settings::septentrio_receiver_type
std::string septentrio_receiver_type
Septentrio receiver type, either "gnss" or "ins".
Definition: settings.h:257
imu_pairs
std::pair< std::string, uint32_t > imu_pairs[]
Definition: callback_handlers.cpp:54
io_comm_rx::CallbackHandlers::node_
ROSaicNodeBase * node_
Pointer to Node.
Definition: callback_handlers.hpp:245
io_comm_rx::CallbackHandlers::callbackmap_
CallbackMap callbackmap_
Definition: callback_handlers.hpp:241


septentrio_gnss_driver
Author(s): Tibor Dome
autogenerated on Fri Mar 10 2023 04:02:30