receiverstatus_handler.cpp
Go to the documentation of this file.
1 //
3 // Copyright (c) 2020 NovAtel Inc.
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in all
13 // copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 // SOFTWARE.
22 //
25 #include <oem7_ros_publisher.hpp>
26 
27 #include <ros/ros.h>
28 
29 
30 #include <vector>
31 
32 
34 
35 #include "novatel_oem7_msgs/RXSTATUS.h"
36 
37 
38 namespace novatel_oem7_driver
39 {
40  typedef std::vector<std::string> str_vector_t;
41 
42 
43  /*** Oem7 Receiver errors strings - refer to Oem7 manual */
44  const str_vector_t RECEIVER_ERROR_STRS
45  {
46  "DRAM",
47  "Invalid FW",
48  "ROM",
49  "",
50  "ESN Access",
51  "AuthCode",
52  "",
53  "Supply Voltage",
54  "",
55  "Temperature",
56  "MINOS",
57  "PLL RF",
58  "",
59  "",
60  "",
61  "NVM",
62  "Software resource limit exceeded",
63  "Model invalid for this receiver",
64  "",
65  "",
66  "Remote loading has begun",
67  "Export restriction",
68  "Safe Mode",
69  "",
70  "",
71  "",
72  "",
73  "",
74  "",
75  "",
76  "",
77  "Component hardware failure"
78  };
79 
81  const str_vector_t RECEIVER_STATUS_STRS
82  {
83  "Receiver Error Flag",
84  "Temperature",
85  "Voltage Supply",
86  "Primary antenna not powered",
87  "LNA Failure",
88  "Primary antenna open circuit",
89  "Primary antenna short circuit",
90  "CPU overload",
91  "COM port tx buffer overrun",
92  "",
93  "",
94  "Link overrun",
95  "Input overrun",
96  "Aux transmit overrun",
97  "Antenna gain out of range",
98  "Jammer detected",
99  "INS reset",
100  "IMU communication failure",
101  "GPS almanac invalid",
102  "Position solution invalid",
103  "Position fixed",
104  "Clock steering disabled",
105  "Clock model invalid",
106  "External oscillator locked",
107  "Software resource warning",
108  "",
109  "Interpret Status/Error Bits as Oem7 format",
110  "Tracking mode: HDR",
111  "Digital filtering enabled",
112  "Aux3 event",
113  "Aux2 event",
114  "Aux1 event"
115  };
116 
118  const str_vector_t AUX1_STATUS_STRS
119  {
120  "Jammer detected on RF1",
121  "Jammer detected on RF2",
122  "Jammer detected on RF3",
123  "Position averaging On",
124  "Jammer detected on RF4",
125  "Jammer detected on RF5",
126  "Jammer detected on RF6",
127  "USB not connected",
128  "USB1 buffer overrun",
129  "USB2 buffer overrun",
130  "USB3 buffer overrun",
131  "",
132  "Profile Activation Error",
133  "Throttled Ethernet Reception",
134  "",
135  "",
136  "",
137  "",
138  "Ethernet not connected",
139  "ICOM1 buffer overrun",
140  "ICOM2 buffer overrun",
141  "ICOM3 buffer overrun",
142  "NCOM1 buffer overrun",
143  "NCOM2 buffer overrun",
144  "NCOM3 buffer overrun",
145  "",
146  "",
147  "",
148  "",
149  "",
150  "",
151  "IMU measurement outlier detected"
152  };
153 
155  const str_vector_t AUX2_STATUS_STRS
156  {
157  "SPI Communication Failure",
158  "I2C Communication Failure",
159  "COM4 buffer overrun",
160  "COM5 buffer overrun",
161  "",
162  "",
163  "",
164  "",
165  "",
166  "COM1 buffer overrun",
167  "COM2 buffer overrun",
168  "COM3 buffer overrun",
169  "PLL RF1 unlock",
170  "PLL RF2 unlock",
171  "PLL RF3 unlock",
172  "PLL RF4 unlock",
173  "PLL RF5 unlock",
174  "PLL RF6 unlock",
175  "CCOM1 buffer overrun",
176  "CCOM2 buffer overrun",
177  "CCOM3 buffer overrun",
178  "CCOM4 buffer overrun",
179  "CCOM5 buffer overrun",
180  "CCOM6 buffer overrun",
181  "ICOM4 buffer overrun",
182  "ICOM5 buffer overrun",
183  "ICOM6 buffer overrun",
184  "ICOM7 buffer overrun",
185  "Secondary antenna not powered",
186  "Secondary antenna open circuit",
187  "Secondary antenna short circuit",
188  "Reset loop detected",
189  };
190 
192  const str_vector_t AUX3_STATUS_STRS
193  {
194  "SCOM buffer overrun",
195  "WCOM1 buffer overrun",
196  "FILE buffer overrun",
197  "",
198  "",
199  "",
200  "",
201  "",
202  "",
203  "",
204  "",
205  "",
206  "",
207  "",
208  "",
209  "",
210  "",
211  "",
212  "",
213  "",
214  "",
215  "",
216  "",
217  "",
218  "",
219  "",
220  "",
221  "",
222  "",
223  "Web content is corrupt or does not exist",
224  "RF Calibration Data is present and in error",
225  "RF Calibration data exists and has no errors"
226  };
227 
228  const str_vector_t AUX4_STATUS_STRS
229  {
230  "<60% of available satellites are tracked well",
231  "<15% of available satellites are tracked well",
232  "",
233  "",
234  "",
235  "",
236  "",
237  "",
238  "",
239  "",
240  "",
241  "",
242  "Clock freewheeling due to bad position integrity",
243  "",
244  "Usable RTK Corrections: < 60%",
245  "Usable RTK Corrections: < 15%",
246  "Bad RTK Geometry",
247  "",
248  "",
249  "Long RTK Baseline",
250  "Poor RTK COM link",
251  "Poor ALIGN COM link",
252  "GLIDE Not Active",
253  "Bad PDP Geometry",
254  "No TerraStar Subscription",
255  "",
256  "",
257  "",
258  "Bad PPP Geometry",
259  "",
260  "No INS Alignment",
261  "INS not converged"
262  };
263 
264 
265  void
267  uint32_t bitmask,
268  const str_vector_t& str_map,
269  str_vector_t& str_list,
270  std::vector<uint8_t>& bit_list)
271  {
272  for(int bit = 0;
273  bit < (sizeof(bitmask) * 8);
274  bit++)
275  {
276  if(bitmask & (1 << bit))
277  {
278  bit_list.push_back(bit);
279  if(str_map[bit].length() > 0)
280  {
281  str_list.push_back(str_map[bit]);
282  }
283  }
284  }
285  }
286 
287 
288  /*** Handles RXSTATUS messages */
290  {
292 
293  std::string frame_id_;
294 
295  public:
297  {
298  static const size_t NUM_BITS = sizeof(uint32_t) * 8;
299  assert(RECEIVER_ERROR_STRS.size() == NUM_BITS);
300  assert(AUX1_STATUS_STRS.size() == NUM_BITS);
301  assert(AUX2_STATUS_STRS.size() == NUM_BITS);
302  assert(AUX3_STATUS_STRS.size() == NUM_BITS);
303  assert(AUX4_STATUS_STRS.size() == NUM_BITS);
304  }
305 
307  {
308  }
309 
311  {
312  RXSTATUS_pub_.setup<novatel_oem7_msgs::RXSTATUS>("RXSTATUS", nh);
313  }
314 
315  const std::vector<int>& getMessageIds()
316  {
317  static const std::vector<int> MSG_IDS({RXSTATUS_OEM7_MSGID});
318  return MSG_IDS;
319  }
320 
321  void handleMsg(Oem7RawMessageIf::ConstPtr msg)
322  {
324  MakeROSMessage(msg, rxstatus);
325 
326  // Populate status strings:
327  get_status_info(rxstatus->error, RECEIVER_ERROR_STRS, rxstatus->error_strs, rxstatus->error_bits);
328  get_status_info(rxstatus->rxstat, RECEIVER_STATUS_STRS, rxstatus->rxstat_strs, rxstatus->rxstat_bits);
329  get_status_info(rxstatus->aux1_stat, AUX1_STATUS_STRS, rxstatus->aux1_stat_strs, rxstatus->aux1_stat_bits);
330  get_status_info(rxstatus->aux2_stat, AUX2_STATUS_STRS, rxstatus->aux2_stat_strs, rxstatus->aux2_stat_bits);
331  get_status_info(rxstatus->aux3_stat, AUX3_STATUS_STRS, rxstatus->aux3_stat_strs, rxstatus->aux3_stat_bits);
332  get_status_info(rxstatus->aux4_stat, AUX4_STATUS_STRS, rxstatus->aux4_stat_strs, rxstatus->aux4_stat_bits);
333 
334  RXSTATUS_pub_.publish(rxstatus);
335  }
336  };
337 
338 
339 
340 }
341 
const int RXSTATUS_OEM7_MSGID
void handleMsg(Oem7RawMessageIf::ConstPtr msg)
const str_vector_t AUX2_STATUS_STRS
TF2SIMD_FORCE_INLINE tf2Scalar length(const Quaternion &q)
const str_vector_t AUX3_STATUS_STRS
void publish(boost::shared_ptr< M > &msg)
PLUGINLIB_EXPORT_CLASS(novatel_oem7_driver::Oem7ConfigNodelet, nodelet::Nodelet)
const str_vector_t RECEIVER_STATUS_STRS
void setup(const std::string &name, ros::NodeHandle &nh)
const str_vector_t RECEIVER_ERROR_STRS
const str_vector_t AUX1_STATUS_STRS
void MakeROSMessage(const Oem7RawMessageIf::ConstPtr &msg, boost::shared_ptr< T > &rosmsg)
std::vector< std::string > str_vector_t
const str_vector_t AUX4_STATUS_STRS
void get_status_info(uint32_t bitmask, const str_vector_t &str_map, str_vector_t &str_list, std::vector< uint8_t > &bit_list)


novatel_oem7_driver
Author(s):
autogenerated on Sun Mar 19 2023 02:17:37