ISDisplay.cpp
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2021 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #include <stdio.h>
14 #include <iostream>
15 #include <sstream>
16 #include <iomanip>
17 #include <math.h>
18 
19 #include "ISConstants.h"
20 #include "ISUtilities.h"
21 #include "ISDisplay.h"
22 #include "ISPose.h"
23 #include "ISDataMappings.h"
24 
25 #if PLATFORM_IS_WINDOWS
26 
27 #include <conio.h>
28 
29 #endif
30 
31 #if PLATFORM_IS_LINUX || PLATFORM_IS_APPLE
32 
33 #include <unistd.h>
34 #include <sys/time.h>
35 #include <termios.h>
36 
37 #endif
38 
39 #define PRINTV3_P1 "%8.1f,%8.1f,%8.1f\n"
40 #define PRINTV3_P2 " %8.2f,%8.2f,%8.2f\n"
41 #define PRINTV3_P3 " %8.3f,%8.3f,%8.3f\n"
42 #define PRINTV4_P1 "%8.1f,%8.1f,%8.1f,%8.1f\n"
43 #define PRINTV4_P2 " %8.2f,%8.2f,%8.2f,%8.2f\n"
44 #define PRINTV4_P3 " %8.3f,%8.3f,%8.3f,%8.3f\n"
45 #define PRINTV3_LLA "%13.7f,%13.7f,%7.1f ellipsoid\n"
46 #define PRINTV3_LLA_MSL "%13.7f,%13.7f,%7.1f MSL\n"
47 #define BUF_SIZE 8192
48 
49 #define DISPLAY_DELTA_TIME 0 // show delta time instead of time
50 
52 
53 #if PLATFORM_IS_WINDOWS
54 
55 static bool ctrlHandler(DWORD fdwCtrlType)
56 {
57  switch (fdwCtrlType)
58  {
59  case CTRL_C_EVENT:
60  case CTRL_CLOSE_EVENT:
61  case CTRL_BREAK_EVENT:
62  case CTRL_LOGOFF_EVENT:
63  case CTRL_SHUTDOWN_EVENT:
64  s_controlCWasPressed = true;
65  return true;
66  default:
67  return false;
68  }
69 }
70 
71 #else
72 
73 #include <signal.h>
74 
75 static void signalFunction(int sig)
76 {
77  (void)sig;
78  s_controlCWasPressed = true;
79 }
80 
81 #endif
82 
84 {
85  cout << endl << Hello() << endl;
86 
88 
89 #if PLATFORM_IS_WINDOWS
90 
91  // Hide cursor
92  ShowCursor(false);
93 
94  if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE)ctrlHandler, true))
95  {
96  std::cout << "Failed to set console ctrl handler!" << std::endl;
97  }
98 
99 #else
100 
101  signal(SIGINT, signalFunction);
102 
103 #endif
104 
105 }
106 
107 
109 {
110 
111 #if PLATFORM_IS_WINDOWS
112 
113 // m_windowsConsoleIn = GetStdHandle(STD_INPUT_HANDLE);
114  m_windowsConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
115  CONSOLE_CURSOR_INFO cursorInfo;
116  GetConsoleCursorInfo(m_windowsConsoleOut, &cursorInfo);
117  cursorInfo.bVisible = visible;
118  SetConsoleCursorInfo(m_windowsConsoleOut, &cursorInfo);
119 
120 #endif
121 
122 }
123 
124 
126 {
127  ShowCursor(true);
128 // cout << "Shutting down..." << endl;
129 }
130 
131 
133 {
134 
135 #if PLATFORM_IS_WINDOWS
136 
137  COORD topLeft = { 0, 0 };
138  HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
139  CONSOLE_SCREEN_BUFFER_INFO screen;
140  DWORD written;
141  GetConsoleScreenBufferInfo(console, &screen);
142  FillConsoleOutputCharacterA(console, ' ', screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
143  FillConsoleOutputAttribute(console, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE, screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
144  SetConsoleCursorPosition(console, topLeft);
145 
146 #else
147 
148  printf( "\x1B[2J" ); // VT100 terminal command
149 
150 #endif
151 
152 }
153 
155 {
156 
157 #if PLATFORM_IS_WINDOWS
158 
159  COORD topLeft = { 0, 0 };
160  SetConsoleCursorPosition(m_windowsConsoleOut, topLeft);
161 
162 #else
163 
164  printf( "\x1B[H" ); // VT100 terminal command
165 
166 #endif
167 
168 }
169 
171 {
172 
173 #if PLATFORM_IS_WINDOWS
174 
175  COORD pos = { 0, (int16_t)y };
176  SetConsoleCursorPosition(m_windowsConsoleOut, pos);
177 
178 #else
179 
180  printf("\x1B[%dH", y); // VT100 terminal command
181 
182 #endif
183 
184 }
185 
187 {
188 
189 #if PLATFORM_IS_WINDOWS
190 
191  COORD pos = { (int16_t)x, (int16_t)y };
192  SetConsoleCursorPosition(m_windowsConsoleOut, pos);
193 
194 #else
195 
196  printf("\x1B[%d;%df", y, x); // VT100 terminal command
197 
198 #endif
199 
200 }
201 
203 {
204  return "$ Inertial Sense. Press CTRL-C to terminate.\n";
205 }
206 
208 {
209  return string("$ Inertial Sense. Connected. Press CTRL-C to terminate. Rx ") + std::to_string(m_rxCount) + "\n";
210 }
211 
212 string cInertialSenseDisplay::Replay(double speed)
213 {
214  char buf[BUF_SIZE];
215 
216  SNPRINTF(buf, BUF_SIZE, "$ Inertial Sense. Replay mode at %.1lfx speed. Press CTRL-C to terminate.\n", speed);
217 
218  return buf;
219 }
220 
222 {
223  return "\nThanks for using Inertial Sense!\n";
224 }
225 
227 {
228 
229 #if PLATFORM_IS_WINDOWS
230 
231 #if 0
232  // This isn't working
233  INPUT_RECORD ip;
234  DWORD numRead = 0;
235  PeekConsoleInputA(m_windowsConsoleIn, &ip, 1, &numRead);
236  if (numRead == 1)
237  {
238  ReadConsoleInputA(m_windowsConsoleIn, &ip, 1, &numRead);
239  if (numRead == 1 && ip.EventType == KEY_EVENT && ip.Event.KeyEvent.bKeyDown)
240  {
241  return ip.Event.KeyEvent.uChar.AsciiChar;
242  }
243  }
244 #else
245  if (_kbhit())
246  {
247  return _getch();
248  }
249 #endif
250 
251 #else
252 
253  struct timeval tv;
254  fd_set fds;
255  tv.tv_sec = 0;
256  tv.tv_usec = 0;
257  FD_ZERO(&fds);
258  FD_SET(STDIN_FILENO, &fds);
259  select(STDIN_FILENO + 1, &fds, NULL, NULL, &tv);
260  if (FD_ISSET(0, &fds))
261  {
262  struct termios oldt;
263  struct termios newt;
264  tcgetattr(STDIN_FILENO, &oldt); /* store old settings*/
265  newt = oldt; /* copy old settings to new settings */
266  newt.c_lflag &= ~(ICANON); /* change settings */
267  tcsetattr(STDIN_FILENO, TCSANOW, &newt); /*apply the new settings immediatly */
268  int ch = getchar(); /* standard getchar call */
269  tcsetattr(STDIN_FILENO, TCSANOW, &oldt); /* reapply the old settings */
270  return ch; /* return received char */
271  }
272 
273 #endif
274 
275  return -1;
276 }
277 
279 {
280  return s_controlCWasPressed;
281 }
282 
283 void cInertialSenseDisplay::ProcessData(p_data_t *data, bool enableReplay, double replaySpeedX)
284 {
285  if (m_displayMode == DMODE_QUIET)
286  {
287  return;
288  }
289 
290  int curTimeMs = current_timeMs();
291  m_rxCount++;
292 
293  if (enableReplay)
294  {
295  static bool isTowMode = false;
296  static int gpsTowMsOffset = 0;
297  static int msgTimeMsOffset = 0;
298  int msgTimeMs = 0;
299 
300  // Copy only new data
301  uDatasets d = {};
302  copyDataPToStructP(&d, data, sizeof(uDatasets));
303 
304  // Record message time. In either ToW or time since boot.
305  switch (data->hdr.id)
306  {
307  // Time of week - double
308  case DID_INS_1:
309  case DID_INS_2:
310  msgTimeMs = (int)(1000.0*d.ins1.timeOfWeek);
311  isTowMode = true;
312  break;
313 
314  // Time of week - uint32 ms
315  case DID_SYS_PARAMS:
316  msgTimeMs = d.gpsPos.timeOfWeekMs;
317  isTowMode = true;
318  break;
319 
320  case DID_GPS1_POS:
321  case DID_GPS1_RTK_POS:
322  msgTimeMs = d.gpsPos.timeOfWeekMs;
323  gpsTowMsOffset = (int)(1000.0*d.gpsPos.towOffset);
324  isTowMode = true;
325  break;
326 
328  msgTimeMs = d.gpsRtkRel.timeOfWeekMs;
329  isTowMode = true;
330  break;
331 
333  msgTimeMs = d.gpsPos.timeOfWeekMs;
334  gpsTowMsOffset = (int)(1000.0*d.gpsPos.towOffset);
335  isTowMode = false;
336  break;
337 
338  // Time since boot - double
339  case DID_MAGNETOMETER_1:
340  case DID_BAROMETER:
341  case DID_SYS_SENSORS:
343  case DID_DUAL_IMU:
344  case DID_INL2_STATES:
345  case DID_GPS_BASE_RAW:
346  if( isTowMode )
347  msgTimeMs = (int)(1000.0*d.imu.time) + gpsTowMsOffset;
348  else
349  msgTimeMs = (int)(1000.0*d.imu.time);
350  break;
351 
352  // Unidentified data type
353 // default: printf("Unknown DID %d\t", data->hdr.id); return;
354  }
355 
356 
357  // Control replay rate
358  if (msgTimeMs != 0 && replaySpeedX>0.0)
359  {
360  for (;;)
361  {
362  curTimeMs = current_timeMs();
363 
364  // Replay speed
365  int replayTimeMs = (int)(long)(((double)curTimeMs)*replaySpeedX);
366 
367  // Reinitialize message offset
368  if (abs(msgTimeMs + msgTimeMsOffset - replayTimeMs) > 1500)
369  msgTimeMsOffset = replayTimeMs - msgTimeMs;
370 
371  // Proceed if we're caught up
372  if (replayTimeMs >= msgTimeMs + msgTimeMsOffset)
373  break;
374 
375  // Add delay
376 // SLEEP_US(1000);
377  SLEEP_MS(10);
378  }
379  }
380  }
381 
382 
383  static int timeSinceRefreshMs = 0;
384  static int timeSinceClearMs = 0;
385  static char idHist[DID_COUNT] = { 0 };
387  {
388  // Clear display every 2 seconds or if we start seeing new messages.
389  if (curTimeMs - timeSinceClearMs > 2000 || curTimeMs < timeSinceClearMs || idHist[data->hdr.id] == 0)
390  {
391  Clear();
392  idHist[data->hdr.id] = 1;
393  timeSinceClearMs = curTimeMs;
394  }
395  }
396 
397 
398  // Display Data
399  switch (m_displayMode)
400  {
401  default:
403  // fall through
404  case DMODE_PRETTY:
405 
406  // Data stays at fixed location (no scroll history)
407  DataToVector(data);
408 
409  // Limit printData display updates to 20Hz (50 ms)
410  if (curTimeMs - timeSinceRefreshMs > 50 || curTimeMs < timeSinceRefreshMs)
411  {
412  Home();
413  if (enableReplay)
414  cout << Replay(replaySpeedX) << endl;
415  else
416  cout << Connected() << endl;
417 
418  cout << VectortoString();
419 
420  timeSinceRefreshMs = curTimeMs;
421  }
422  break;
423 
424  case DMODE_STATS:
425  // Limit printData display updates to 20Hz (50 ms)
426  if (curTimeMs - timeSinceRefreshMs > 50 || curTimeMs < timeSinceRefreshMs)
427  {
428  Home();
429  cout << Connected() << endl;
430  DataToStats(data);
431 
432  timeSinceRefreshMs = curTimeMs;
433  }
434  break;
435 
436 
437  case DMODE_SCROLL: // Scroll display
438  cout << DataToString(data) << endl;
439  break;
440  }
441 
442 
443 
444 }
445 
447 {
448  stringstream ss;
449 
450  for (size_t i = 0; i < m_didMsgs.size(); i++)
451  {
452  if (m_didMsgs[i].size())
453  {
454  ss << m_didMsgs[i];
455  }
456  }
457 
458  return ss.str();
459 }
460 
462 {
463  size_t id = data->hdr.id;
464  if (m_didMsgs.size() <= id)
465  { // Resize vector if necessary
466  m_didMsgs.resize(id + 1);
467  }
468  // Add string to vector
469  m_didMsgs[id] = DataToString(data);
470 }
471 
473 {
474  size_t id = data->hdr.id;
475  if (m_didStats.size() <= id)
476  { // Resize vector if necessary
477  m_didStats.resize(id + 1);
478  }
479 
480  // Update stats
481  int curTimeMs = current_timeMs();
482  sDidStats &s = m_didStats[id];
483  s.count++;
484  if(s.lastTimeMs)
485  s.dtMs = curTimeMs - s.lastTimeMs;
486  s.lastTimeMs = curTimeMs;
487 
488  // Display stats
489  printf(" Name DID Count dt\n");
490  for (int i = 0; i < (int)m_didStats.size(); i++)
491  {
492  s = m_didStats[i];
493  if (s.count)
494  {
495  printf("%20s %4d %9d %9.3lf\n", cISDataMappings::GetDataSetName(i), i, s.count, s.dtMs*0.001);
496  }
497  }
498 }
499 
501 {
502  uDatasets d = {};
503 
504  // Copy only new data
505  copyDataPToStructP(&d, data, sizeof(uDatasets));
506 
507  string str;
508  switch (data->hdr.id)
509  {
510  case DID_DEV_INFO: str = DataToStringDevInfo(d.devInfo, data->hdr); break;
511  case DID_DUAL_IMU: str = DataToStringDualIMU(d.dualImu, data->hdr); break;
512  case DID_PREINTEGRATED_IMU: str = DataToStringPreintegratedImu(d.pImu, data->hdr); break;
513  case DID_INS_1: str = DataToStringINS1(d.ins1, data->hdr); break;
514  case DID_INS_2: str = DataToStringINS2(d.ins2, data->hdr); break;
515  case DID_INS_3: str = DataToStringINS3(d.ins3, data->hdr); break;
516  case DID_INS_4: str = DataToStringINS4(d.ins4, data->hdr); break;
517  case DID_MAGNETOMETER_1:
518  case DID_MAGNETOMETER_2: str = DataToStringMag(d.mag, data->hdr); break;
519  case DID_MAG_CAL: str = DataToStringMagCal(d.magCal, data->hdr); break;
520  case DID_BAROMETER: str = DataToStringBaro(d.baro, data->hdr); break;
521  case DID_GPS1_POS: str = DataToStringGpsPos(d.gpsPos, data->hdr, "DID_GPS1_POS"); break;
522  case DID_GPS2_POS: str = DataToStringGpsPos(d.gpsPos, data->hdr, "DID_GPS2_POS"); break;
523  case DID_GPS1_RTK_POS: str = DataToStringGpsPos(d.gpsPos, data->hdr, "DID_GPS1_RTK_POS"); break;
524  case DID_GPS1_RTK_POS_REL: str = DataToStringRtkRel(d.gpsRtkRel, data->hdr, "DID_GPS1_RTK_POS_REL"); break;
525  case DID_GPS1_RTK_POS_MISC: str = DataToStringRtkMisc(d.gpsRtkMisc, data->hdr, "RTK_POS_MISC"); break;
526  case DID_GPS2_RTK_CMP_REL: str = DataToStringRtkRel(d.gpsRtkRel, data->hdr, "DID_GPS2_RTK_CMP_REL"); break;
527  case DID_GPS2_RTK_CMP_MISC: str = DataToStringRtkMisc(d.gpsRtkMisc, data->hdr, "RTK_CMP_MISC"); break;
528  case DID_GPS1_RAW:
529  case DID_GPS2_RAW:
530  case DID_GPS_BASE_RAW: str = DataToStringRawGPS(d.gpsRaw, data->hdr); break;
531  case DID_SURVEY_IN: str = DataToStringSurveyIn(d.surveyIn, data->hdr); break;
532  case DID_SYS_PARAMS: str = DataToStringSysParams(d.sysParams, data->hdr); break;
533  case DID_SYS_SENSORS: str = DataToStringSysSensors(d.sysSensors, data->hdr); break;
534  case DID_RTOS_INFO: str = DataToStringRTOS(d.rtosInfo, data->hdr); break;
535  case DID_SENSORS_ADC: str = DataToStringSensorsADC(d.sensorsAdc, data->hdr); break;
536  case DID_WHEEL_ENCODER: str = DataToStringWheelEncoder(d.wheelEncoder, data->hdr); break;
537  default:
538 #if 0 // List all DIDs
539  char buf[128];
540  SNPRINTF(buf, 128, "DID: %d\n", data->hdr.id);
541  str = buf;
542 #endif
543  break;
544  }
545 
546  return str;
547 }
548 
549 char* cInertialSenseDisplay::StatusToString(char* ptr, char* ptrEnd, const uint32_t insStatus, const uint32_t hdwStatus)
550 {
551  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tSTATUS\n");
552  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t\tSatellite Rx %d Aiding: Mag %d, GPS (Hdg %d, Pos %d)\n",
553  (hdwStatus & HDW_STATUS_GPS_SATELLITE_RX) != 0,
554  (insStatus & INS_STATUS_MAG_AIDING_HEADING) != 0,
555  (insStatus & INS_STATUS_GPS_AIDING_HEADING) != 0,
556  (insStatus & INS_STATUS_GPS_AIDING_POS_VEL) != 0);
557  if (insStatus & INS_STATUS_NAV_MODE)
558  {
559  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t\tMode: NAV ");
560  }
561  else
562  {
563  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t\tMode: AHRS");
564  }
565  switch (INS_STATUS_SOLUTION(insStatus))
566  {
567  default:
568  case INS_STATUS_SOLUTION_OFF: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: OFF\n"); break;
569  case INS_STATUS_SOLUTION_ALIGNING: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: ALIGNING\n"); break;
570  case INS_STATUS_SOLUTION_ALIGNMENT_COMPLETE: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: ALIGNMENT COMPLETE\n"); break;
571  case INS_STATUS_SOLUTION_NAV: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: NAV\n"); break;
572  case INS_STATUS_SOLUTION_NAV_HIGH_VARIANCE: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: NAV HIGH VARIANCE\n"); break;
573  case INS_STATUS_SOLUTION_AHRS: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: AHRS\n"); break;
574  case INS_STATUS_SOLUTION_AHRS_HIGH_VARIANCE: ptr += SNPRINTF(ptr, ptrEnd - ptr, " Solution: AHRS HIGH VARIANCE\n"); break;
575  }
576 // ptr += SNPRINTF(ptr, ptrEnd - ptr, " Align Good: Att %d, Vel %d, Pos %d\n",
577 // (insStatus & INS_STATUS_ATT_ALIGN_GOOD) != 0,
578 // (insStatus & INS_STATUS_VEL_ALIGN_GOOD) != 0,
579 // (insStatus & INS_STATUS_POS_ALIGN_GOOD) != 0);
580  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t\tErrors Rx parse %d, temperature %d, self-test %d\n",
582  (hdwStatus & HDW_STATUS_ERR_TEMPERATURE) != 0,
583  (hdwStatus & HDW_STATUS_BIT_FAULT) != 0);
584 
585  return ptr;
586 }
587 
588 char* cInertialSenseDisplay::InsStatusToSolStatusString(char* ptr, char* ptrEnd, const uint32_t insStatus)
589 {
590  switch (INS_STATUS_SOLUTION(insStatus))
591  {
592  default:
593  case INS_STATUS_SOLUTION_OFF: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", OFF "); break;
594  case INS_STATUS_SOLUTION_ALIGNING: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", ALIGNING "); break;
595  case INS_STATUS_SOLUTION_ALIGNMENT_COMPLETE: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", COMPLETE "); break;
596  case INS_STATUS_SOLUTION_NAV: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", NAV "); break;
597  case INS_STATUS_SOLUTION_NAV_HIGH_VARIANCE: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", NAV VARIA"); break;
598  case INS_STATUS_SOLUTION_AHRS: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", AHRS "); break;
599  case INS_STATUS_SOLUTION_AHRS_HIGH_VARIANCE: ptr += SNPRINTF(ptr, ptrEnd - ptr, ", AHRS VARI"); break;
600  }
601 
602  return ptr;
603 }
604 
606 {
607  (void)hdr;
608  char buf[BUF_SIZE];
609  char* ptr = buf;
610  char* ptrEnd = buf + BUF_SIZE;
611  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_INS_1:");
612 
613 #if DISPLAY_DELTA_TIME==1
614  static double lastTime = 0;
615  double dtMs = 1000.0*(ins1.timeOfWeek - lastTime);
616  lastTime = ins1.timeOfWeek;
617  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
618 #else
619  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", ins1.timeOfWeek);
620 #endif
621 
623  { // Single line format
624  ptr = InsStatusToSolStatusString(ptr, ptrEnd, ins1.insStatus);
625  ptr += SNPRINTF(ptr, ptrEnd - ptr, " theta[%6.2f,%6.2f,%7.2f], uvw[%6.2f,%6.2f,%6.2f], lla[%12.7f,%12.7f,%7.1f], ned[%6.3f,%6.3f,%6.3f]",
626  ins1.theta[0] * C_RAD2DEG_F,
627  ins1.theta[1] * C_RAD2DEG_F,
628  ins1.theta[2] * C_RAD2DEG_F,
629  ins1.uvw[0], ins1.uvw[1], ins1.uvw[2],
630  ins1.lla[0], ins1.lla[1], ins1.lla[2],
631  ins1.ned[0], ins1.ned[1], ins1.ned[2]);
632  }
633  else
634  { // Spacious format
635  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tEuler\t");
636  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P2,
637  ins1.theta[0] * C_RAD2DEG_F, // Roll
638  ins1.theta[1] * C_RAD2DEG_F, // Pitch
639  ins1.theta[2] * C_RAD2DEG_F); // Yaw
640  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tUWV\t");
641  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P1,
642  ins1.uvw[0], // U body velocity
643  ins1.uvw[1], // V body velocity
644  ins1.uvw[2]); // W body velocity
645  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tLLA\t");
646  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_LLA,
647  ins1.lla[0], // INS Latitude
648  ins1.lla[1], // INS Longitude
649  ins1.lla[2]); // INS Ellipsoid altitude (meters)
650  ptr = StatusToString(ptr, ptrEnd, ins1.insStatus, ins1.hdwStatus);
651  }
652 
653  return buf;
654 }
655 
657 {
658  (void)hdr;
659  char buf[BUF_SIZE];
660  char* ptr = buf;
661  char* ptrEnd = buf + BUF_SIZE;
662  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_INS_2:");
663 
664 #if DISPLAY_DELTA_TIME==1
665  static double lastTime = 0;
666  double dtMs = 1000.0*(ins2.timeOfWeek - lastTime);
667  lastTime = ins2.timeOfWeek;
668  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
669 #else
670  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", ins2.timeOfWeek);
671 #endif
672 
674  { // Single line format
675  ptr = InsStatusToSolStatusString(ptr, ptrEnd, ins2.insStatus);
676  ptr += SNPRINTF(ptr, ptrEnd - ptr, " qn2b[%6.3f,%6.3f,%6.3f,%6.3f], uvw[%6.2f,%6.2f,%6.2f], lla[%12.7f,%12.7f,%7.1f]",
677  ins2.qn2b[0], ins2.qn2b[1], ins2.qn2b[2], ins2.qn2b[3],
678  ins2.uvw[0], ins2.uvw[1], ins2.uvw[2],
679  ins2.lla[0], ins2.lla[1], ins2.lla[2]);
680  }
681  else
682  { // Spacious format
683  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tQn2b\t");
684  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV4_P3, // Quaternion attitude rotation
685  ins2.qn2b[0], // W
686  ins2.qn2b[1], // X
687  ins2.qn2b[2], // Y
688  ins2.qn2b[3]); // Z
689  float theta[3];
690  quat2euler(ins2.qn2b, theta);
691  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t(Euler)\t");
692  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P2, // Convert quaternion to euler rotation
693  theta[0] * C_RAD2DEG_F, // Roll
694  theta[1] * C_RAD2DEG_F, // Pitch
695  theta[2] * C_RAD2DEG_F); // Yaw
696  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tUWV\t");
697  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P1,
698  ins2.uvw[0], // U body velocity
699  ins2.uvw[1], // V body velocity
700  ins2.uvw[2]); // W body velocity
701  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tLLA\t");
702  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_LLA,
703  ins2.lla[0], // INS Latitude
704  ins2.lla[1], // INS Longitude
705  ins2.lla[2]); // INS Ellipsoid altitude (meters)
706  ptr = StatusToString(ptr, ptrEnd, ins2.insStatus, ins2.hdwStatus);
707  }
708 
709  return buf;
710 }
711 
713 {
714  (void)hdr;
715  char buf[BUF_SIZE];
716  char* ptr = buf;
717  char* ptrEnd = buf + BUF_SIZE;
718  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_INS_3:");
719 
720 #if DISPLAY_DELTA_TIME==1
721  static double lastTime = 0;
722  double dtMs = 1000.0*(ins3.timeOfWeek - lastTime);
723  lastTime = ins3.timeOfWeek;
724  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
725 #else
726  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", ins3.timeOfWeek);
727 #endif
728 
730  { // Single line format
731  ptr = InsStatusToSolStatusString(ptr, ptrEnd, ins3.insStatus);
732  ptr += SNPRINTF(ptr, ptrEnd - ptr, " qn2b[%6.3f,%6.3f,%6.3f,%6.3f], uvw[%6.2f,%6.2f,%6.2f], lla[%12.7f,%12.7f,%7.1f]",
733  ins3.qn2b[0], ins3.qn2b[1], ins3.qn2b[2], ins3.qn2b[3],
734  ins3.uvw[0], ins3.uvw[1], ins3.uvw[2],
735  ins3.lla[0], ins3.lla[1], ins3.lla[2]);
736  }
737  else
738  { // Spacious format
739  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tQn2b\t");
740  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV4_P3, // Quaternion attitude rotation
741  ins3.qn2b[0], // W
742  ins3.qn2b[1], // X
743  ins3.qn2b[2], // Y
744  ins3.qn2b[3]); // Z
745  float theta[3];
746  quat2euler(ins3.qn2b, theta);
747  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t(Euler)\t");
748  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P2, // Convert quaternion to euler rotation
749  theta[0] * C_RAD2DEG_F, // Roll
750  theta[1] * C_RAD2DEG_F, // Pitch
751  theta[2] * C_RAD2DEG_F); // Yaw
752  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tUWV\t");
753  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P1,
754  ins3.uvw[0], // U body velocity
755  ins3.uvw[1], // V body velocity
756  ins3.uvw[2]); // W body velocity
757  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tLLA\t");
758  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_LLA_MSL,
759  ins3.lla[0], // INS Latitude
760  ins3.lla[1], // INS Longitude
761  ins3.lla[2]); // INS Ellipsoid altitude (meters)
762  ptr = StatusToString(ptr, ptrEnd, ins3.insStatus, ins3.hdwStatus);
763  }
764 
765  return buf;
766 }
767 
769 {
770  (void)hdr;
771  char buf[BUF_SIZE];
772  char* ptr = buf;
773  char* ptrEnd = buf + BUF_SIZE;
774  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_INS_4:");
775 
776 #if DISPLAY_DELTA_TIME==1
777  static double lastTime = 0;
778  double dtMs = 1000.0*(ins4.timeOfWeek - lastTime);
779  lastTime = ins4.timeOfWeek;
780  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
781 #else
782  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", ins4.timeOfWeek);
783 #endif
784 
786  { // Single line format
787  ptr = InsStatusToSolStatusString(ptr, ptrEnd, ins4.insStatus);
788  ptr += SNPRINTF(ptr, ptrEnd - ptr, " qe2b[%6.3f,%6.3f,%6.3f,%6.3f], ve[%6.2f,%6.2f,%6.2f], ecef[%12.7f,%12.7f,%7.1f]",
789  ins4.qe2b[0], ins4.qe2b[1], ins4.qe2b[2], ins4.qe2b[3],
790  ins4.ve[0], ins4.ve[1], ins4.ve[2],
791  ins4.ecef[0], ins4.ecef[1], ins4.ecef[2]);
792  }
793  else
794  { // Spacious format
795  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tQe2b\t");
796  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV4_P3, // Quaternion attitude rotation
797  ins4.qe2b[0], // W
798  ins4.qe2b[1], // X
799  ins4.qe2b[2], // Y
800  ins4.qe2b[3]); // Z
801  float theta[3];
802  qe2b2EulerNedEcef(theta, (float*)ins4.qe2b, (double*)ins4.ecef);
803  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\t(Euler)\t");
804  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P2, // Convert quaternion to euler rotation
805  theta[0] * C_RAD2DEG_F, // Roll
806  theta[1] * C_RAD2DEG_F, // Pitch
807  theta[2] * C_RAD2DEG_F); // Yaw
808  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tVE\t");
809  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
810  ins4.ve[0], // X ECEF velocity
811  ins4.ve[1], // Y ECEF velocity
812  ins4.ve[2]); // Z ECEF velocity
813  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tECEF\t");
814  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
815  ins4.ecef[0], // X ECEF position
816  ins4.ecef[1], // Y ECEF position
817  ins4.ecef[2]); // Z ECEF position
818  ptr = StatusToString(ptr, ptrEnd, ins4.insStatus, ins4.hdwStatus);
819  }
820 
821  return buf;
822 }
823 
825 {
826  (void)hdr;
827  char buf[BUF_SIZE];
828  char* ptr = buf;
829  char* ptrEnd = buf + BUF_SIZE;
830  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_DUAL_IMU:");
831 
832 #if DISPLAY_DELTA_TIME==1
833  static double lastTime = 0;
834  double dtMs = 1000.0*(imu.time - lastTime);
835  lastTime = imu.time;
836  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
837 #else
838  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", imu.time);
839 #endif
840 
842  { // Single line format
843  for (int i = 0; i < 2; i++)
844  {
845  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", pqr[%5.1f,%5.1f,%5.1f]",
846  imu.I[i].pqr[0] * C_RAD2DEG_F,
847  imu.I[i].pqr[1] * C_RAD2DEG_F,
848  imu.I[i].pqr[2] * C_RAD2DEG_F);
849  }
850  for (int i = 0; i < 2; i++)
851  {
852  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", acc[%5.1f,%5.1f,%5.1f]",
853  imu.I[i].acc[0], imu.I[i].acc[1], imu.I[i].acc[2]);
854  }
855  }
856  else
857  { // Spacious format
858  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
859  for (int i = 0; i < 2; i++)
860  {
861  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tPQR\t");
862  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P1,
863  imu.I[i].pqr[0] * C_RAD2DEG_F, // P angular rate
864  imu.I[i].pqr[1] * C_RAD2DEG_F, // Q angular rate
865  imu.I[i].pqr[2] * C_RAD2DEG_F); // R angular rate
866  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tAcc\t");
867  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P1,
868  imu.I[i].acc[0], // X acceleration
869  imu.I[i].acc[1], // Y acceleration
870  imu.I[i].acc[2]); // Z acceleration
871  }
872  }
873 
874  return buf;
875 }
876 
878 {
879  (void)hdr;
880  char buf[BUF_SIZE];
881  char* ptr = buf;
882  char* ptrEnd = buf + BUF_SIZE;
883  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_PREINTEGRATED_IMU:");
884 
885 #if DISPLAY_DELTA_TIME==1
886  static double lastTime = 0;
887  double dtMs = 1000.0*(imu.time - lastTime);
888  lastTime = imu.time;
889  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
890 #else
891  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs, dt:%6.3f", imu.time, imu.dt);
892 #endif
893 
895  { // Single line format
896  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", theta1[%6.3f,%6.3f,%6.3f], vel1[%6.3f,%6.3f,%6.3f]",
897  imu.theta1[0] * C_RAD2DEG_F,
898  imu.theta1[1] * C_RAD2DEG_F,
899  imu.theta1[2] * C_RAD2DEG_F,
900  imu.vel1[0], imu.vel1[1], imu.vel1[2]);
901  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", theta2[%6.3f,%6.3f,%6.3f], vel2[%6.3f,%6.3f,%6.3f]",
902  imu.theta2[0] * C_RAD2DEG_F,
903  imu.theta2[1] * C_RAD2DEG_F,
904  imu.theta2[2] * C_RAD2DEG_F,
905  imu.vel2[0], imu.vel2[1], imu.vel2[2]);
906  }
907  else
908  { // Spacious format
909  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tIMU1 theta1\t");
910  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
911  imu.theta1[0] * C_RAD2DEG_F, // IMU1 P angular rate
912  imu.theta1[1] * C_RAD2DEG_F, // IMU1 Q angular rate
913  imu.theta1[2] * C_RAD2DEG_F); // IMU1 R angular rate
914  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tIMU2 theta2\t");
915  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
916  imu.theta2[0] * C_RAD2DEG_F, // IMU2 P angular rate
917  imu.theta2[1] * C_RAD2DEG_F, // IMU2 Q angular rate
918  imu.theta2[2] * C_RAD2DEG_F); // IMU2 R angular rate
919  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tIMU1 vel1\t");
920  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
921  imu.vel1[0], // IMU1 X acceleration
922  imu.vel1[1], // IMU1 Y acceleration
923  imu.vel1[2]); // IMU1 Z acceleration
924  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tIMU2 vel2\t");
925  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
926  imu.vel2[0], // IMU2 X acceleration
927  imu.vel2[1], // IMU2 Y acceleration
928  imu.vel2[2]); // IMU2 Z acceleration
929  }
930 
931  return buf;
932 }
933 
935 {
936  (void)hdr;
937  char buf[BUF_SIZE];
938  char* ptr = buf;
939  char* ptrEnd = buf + BUF_SIZE;
940  int i = 0;
941  if (hdr.id == DID_MAGNETOMETER_2) i = 1;
942  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_MAGNETOMETER_%d:", i + 1);
943 
944 #if DISPLAY_DELTA_TIME==1
945  static double lastTime[2] = { 0 };
946  double dtMs = 1000.0*(mag.time - lastTime[i]);
947  lastTime[i] = mag.time;
948  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
949 #else
950  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", mag.time);
951 #endif
952 
954  { // Single line format
955  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", mag[%6.2f,%6.2f,%6.2f]",
956  mag.mag[0], // X magnetometer
957  mag.mag[1], // Y magnetometer
958  mag.mag[2]); // Z magnetometer
959  }
960  else
961  { // Spacious format
962  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tmag\t");
963  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P2,
964  mag.mag[0], // X magnetometer
965  mag.mag[1], // Y magnetometer
966  mag.mag[2]); // Z magnetometer
967  }
968 
969  return buf;
970 }
971 
973 {
974  (void)hdr;
975  char buf[BUF_SIZE];
976  char* ptr = buf;
977  char* ptrEnd = buf + BUF_SIZE;
978  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_MAG_CAL:");
979 
980  switch (mag.recalCmd)
981  {
982  default: ptr += SNPRINTF(ptr, ptrEnd - ptr, " recalCmd %3d, ", mag.recalCmd); break;
983  case MAG_RECAL_CMD_MULTI_AXIS: ptr += SNPRINTF(ptr, ptrEnd - ptr, " recalCmd %3d (MULTI-AXIS ), ", mag.recalCmd); break;
984  case MAG_RECAL_CMD_SINGLE_AXIS: ptr += SNPRINTF(ptr, ptrEnd - ptr, " recalCmd %3d (SINGLE-AXIS), ", mag.recalCmd); break;
985  case MAG_RECAL_CMD_ABORT: ptr += SNPRINTF(ptr, ptrEnd - ptr, " recalCmd %3d (ABORT ), ", mag.recalCmd); break;
986  }
987 
988  { // Single line format
989  ptr += SNPRINTF(ptr, ptrEnd - ptr, " progress: %3.0f %%, declination: %4.1f",
990  mag.progress,
991  mag.declination * C_RAD2DEG_F);
992  }
993 
995  {
996  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
997  }
998 
999  return buf;
1000 }
1001 
1003 {
1004  (void)hdr;
1005  char buf[BUF_SIZE];
1006  char* ptr = buf;
1007  char* ptrEnd = buf + BUF_SIZE;
1008  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_BAROMETER:");
1009 
1010 #if DISPLAY_DELTA_TIME==1
1011  static double lastTime = 0;
1012  double dtMs = 1000.0*(baro.time - lastTime);
1013  lastTime = baro.time;
1014  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
1015 #else
1016  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", baro.time);
1017 #endif
1018 
1019  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", %.2fkPa", baro.bar);
1020  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", %.1fm", baro.mslBar);
1021  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", %.2fC", baro.barTemp);
1022  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", Humid. %.1f%%", baro.humidity);
1023 
1024  if (m_displayMode == DMODE_PRETTY)
1025  {
1026  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
1027  }
1028 
1029  return buf;
1030 }
1031 
1032 string cInertialSenseDisplay::DataToStringGpsPos(const gps_pos_t &gps, const p_data_hdr_t& hdr, const string didName)
1033 {
1034  (void)hdr;
1035  char buf[BUF_SIZE];
1036  char* ptr = buf;
1037  char* ptrEnd = buf + BUF_SIZE;
1038 
1039  ptr += SNPRINTF(ptr, ptrEnd - ptr, "%s:", didName.c_str());
1040 
1041 #if DISPLAY_DELTA_TIME==1
1042  static int lastTimeMs = 0;
1043  int dtMs = gps.timeOfWeekMs - lastTimeMs;
1044  lastTimeMs = gps.timeOfWeekMs;
1045  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %3dms", dtMs);
1046 #else
1047  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %dms", gps.timeOfWeekMs);
1048 #endif
1049 
1050  if (m_displayMode == DMODE_SCROLL)
1051  { // Single line format
1052  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", LLA[%12.7f,%12.7f,%7.1f], %d sats, %4.1f cno, %4.3f hAcc, %4.3f vAcc, %4.3f pDop",
1053  gps.lla[0], gps.lla[1], gps.lla[2],
1055  gps.hAcc, gps.vAcc, gps.pDop);
1056  }
1057  else
1058  { // Spacious format
1059  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\tSats: %2d, ",
1060  gps.status&GPS_STATUS_NUM_SATS_USED_MASK); // Satellites used in solution
1061  ptr += SNPRINTF(ptr, ptrEnd - ptr, "Status: 0x%08x (", gps.status);
1062  switch (gps.status&GPS_STATUS_FIX_MASK)
1063  {
1064  default:
1065  case GPS_STATUS_FIX_NONE: ptr += SNPRINTF(ptr, ptrEnd - ptr, "%d", (gps.status&GPS_STATUS_FIX_MASK)>>GPS_STATUS_FIX_BIT_OFFSET); break;
1066  case GPS_STATUS_FIX_2D: ptr += SNPRINTF(ptr, ptrEnd - ptr, "2D"); break;
1067  case GPS_STATUS_FIX_3D: ptr += SNPRINTF(ptr, ptrEnd - ptr, "3D"); break;
1068  case GPS_STATUS_FIX_RTK_SINGLE: ptr += SNPRINTF(ptr, ptrEnd - ptr, "RTK Single"); break;
1069  case GPS_STATUS_FIX_RTK_FLOAT: ptr += SNPRINTF(ptr, ptrEnd - ptr, "RTK Float"); break;
1070  case GPS_STATUS_FIX_RTK_FIX: ptr += SNPRINTF(ptr, ptrEnd - ptr, "RTK FIX"); break;
1071  }
1072  ptr += SNPRINTF(ptr, ptrEnd - ptr, "),\thAcc: %.3f m cno: %3.1f dBHz\n", gps.hAcc, gps.cnoMean); // Position accuracy
1073  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tLLA: ");
1074  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_LLA,
1075  gps.lla[0], // GPS Latitude
1076  gps.lla[1], // GPS Longitude
1077  gps.lla[2]); // GPS Ellipsoid altitude (meters)
1079  {
1081  {
1082  ptr += SNPRINTF(ptr, ptrEnd - ptr, "Compassing, ");
1083  }
1084  if (gps.status&GPS_STATUS_FLAGS_RTK_RAW_GPS_DATA_ERROR) { ptr += SNPRINTF(ptr, ptrEnd - ptr, "Raw error, "); }
1085  switch (gps.status&GPS_STATUS_FLAGS_ERROR_MASK)
1086  {
1087  case GPS_STATUS_FLAGS_RTK_BASE_DATA_MISSING: ptr += SNPRINTF(ptr, ptrEnd - ptr, "Base missing, "); break;
1088  case GPS_STATUS_FLAGS_RTK_BASE_POSITION_MOVING: ptr += SNPRINTF(ptr, ptrEnd - ptr, "Moving base, "); break;
1089  case GPS_STATUS_FLAGS_RTK_BASE_POSITION_INVALID: ptr += SNPRINTF(ptr, ptrEnd - ptr, "Moving invalid, "); break;
1090  }
1091  }
1092  }
1093 
1094  return buf;
1095 }
1096 
1097 string cInertialSenseDisplay::DataToStringRtkRel(const gps_rtk_rel_t &rel, const p_data_hdr_t& hdr, const string didName)
1098 {
1099  (void)hdr;
1100  char buf[BUF_SIZE];
1101  char* ptr = buf;
1102  char* ptrEnd = buf + BUF_SIZE;
1103 
1104  ptr += SNPRINTF(ptr, ptrEnd - ptr, "%s:", didName.c_str());
1105 
1106 #if DISPLAY_DELTA_TIME==1
1107  static int lastTimeMs = 0;
1108  int dtMs = rel.timeOfWeekMs - lastTimeMs;
1109  lastTimeMs = rel.timeOfWeekMs;
1110  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %3dms", dtMs);
1111 #else
1112  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %dms", rel.timeOfWeekMs);
1113 #endif
1114 
1115  if (m_displayMode == DMODE_SCROLL)
1116  { // Single line format
1117  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", V2B[%10.3f,%10.3f,%9.2f], %4.1f age, %4.1f arRatio, %4.3f dist, %4.2f bear",
1118  rel.baseToRoverVector[0], rel.baseToRoverVector[1], rel.baseToRoverVector[2],
1120  }
1121  else
1122  { // Spacious format
1123  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tvectorToRover: ");
1124  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_P3,
1125  rel.baseToRoverVector[0], // Vector to base in ECEF
1126  rel.baseToRoverVector[1], // Vector to base in ECEF
1127  rel.baseToRoverVector[2]); // Vector to base in ECEF
1128  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tRTK:\tdiffAge:%5.1fs arRatio: %4.1f dist:%7.2fm bear:%6.1f\n",
1130  }
1131 
1132  return buf;
1133 }
1134 
1135 string cInertialSenseDisplay::DataToStringRtkMisc(const gps_rtk_misc_t& rtk, const p_data_hdr_t& hdr, const string didName)
1136 {
1137  (void)hdr;
1138  char buf[BUF_SIZE];
1139  char* ptr = buf;
1140  char* ptrEnd = buf + BUF_SIZE;
1141  const char* terminator = (m_displayMode != DMODE_SCROLL ? "\n" : "");
1142  ptr += SNPRINTF(buf, ptrEnd - ptr, "%s: T=%d, lla[%4.7f,%4.7f,%7.3f], A[%3.3f,%3.3f,%3.3f], AR:%3.3f, dop(g,h,v)[%3.3f,%3.3f,%3.3f] %s",
1143  didName.c_str(),
1144  rtk.timeOfWeekMs, rtk.baseLla[0], rtk.baseLla[1], rtk.baseLla[2],
1145  rtk.accuracyPos[0], rtk.accuracyPos[1], rtk.accuracyPos[2],
1146  rtk.arThreshold,
1147  rtk.gDop, rtk.hDop, rtk.vDop,
1148  terminator);
1149 
1150  if (m_displayMode != DMODE_SCROLL)
1151  {
1152  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
1153  }
1154 
1155  return buf;
1156 }
1157 
1159 {
1160  (void)hdr;
1161  char buf[BUF_SIZE];
1162  char* ptr = buf;
1163  char* ptrEnd = buf + BUF_SIZE;
1164  const char* terminator = (m_displayMode != DMODE_SCROLL ? "\n" : "");
1165  ptr += SNPRINTF(buf, ptrEnd - ptr, "RAW GPS: receiverIndex=%d, type=%d, count=%d %s",
1166  raw.receiverIndex, raw.dataType, raw.obsCount, terminator);
1167 
1168  if (m_displayMode != DMODE_SCROLL)
1169  {
1170  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
1171  }
1172  return buf;
1173 }
1174 
1176 {
1177  (void)hdr;
1178  char buf[BUF_SIZE];
1179  char* ptr = buf;
1180  char* ptrEnd = buf + BUF_SIZE;
1181 // int i = 0;
1182  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_SURVEY_IN:");
1183 
1184  ptr += SNPRINTF(ptr, ptrEnd - ptr, " state: %d ", survey.state);
1185  switch (survey.state)
1186  {
1187  case SURVEY_IN_STATE_OFF: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(off)"); break;
1188  case SURVEY_IN_STATE_RUNNING_3D: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(running 3D)"); break;
1189  case SURVEY_IN_STATE_RUNNING_FLOAT: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(running Float)"); break;
1190  case SURVEY_IN_STATE_RUNNING_FIX: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(running Fix)"); break;
1191  case SURVEY_IN_STATE_SAVE_POS: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(saving pos)"); break;
1192  case SURVEY_IN_STATE_DONE: ptr += SNPRINTF(ptr, ptrEnd - ptr, "(done)"); break;
1193  }
1194 
1195  int elapsedTimeMin = survey.elapsedTimeSec / 60;
1196  int elapsedTimeSec = survey.elapsedTimeSec - (elapsedTimeMin * 60);
1197  int maxDurationMin = survey.maxDurationSec / 60;
1198  int maxDurationSec = survey.maxDurationSec - (maxDurationMin * 60);
1199 
1200  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", elapsed: %d:%02d of %2d:%02d",
1201  elapsedTimeMin, elapsedTimeSec, maxDurationMin, maxDurationSec );
1202  if (m_displayMode != DMODE_SCROLL)
1203  {
1204  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n\thAcc: %4.3f\tlla:", survey.hAccuracy);
1205  ptr += SNPRINTF(ptr, ptrEnd - ptr, PRINTV3_LLA,
1206  survey.lla[0], // latitude
1207  survey.lla[1], // longitude
1208  survey.lla[2]); // altitude
1209  }
1210  else
1211  { // Single line format
1212  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", hAcc: %4.3f ", survey.hAccuracy);
1213  ptr += SNPRINTF(ptr, ptrEnd - ptr, " lla[%12.7f,%12.7f,%7.1f]",
1214  survey.lla[0], // latitude
1215  survey.lla[1], // longitude
1216  survey.lla[2]); // altitude
1217  }
1218  return buf;
1219 }
1220 
1222 {
1223  (void)hdr;
1224  char buf[BUF_SIZE];
1225  char* ptr = buf;
1226  char* ptrEnd = buf + BUF_SIZE;
1227  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_SYS_PARAMS:");
1228 
1229 #if DISPLAY_DELTA_TIME==1
1230  static int lastTimeMs = 0;
1231  int dtMs = sys.timeOfWeekMs - lastTimeMs;
1232  lastTimeMs = sys.timeOfWeekMs;
1233  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %3dms", dtMs);
1234 #else
1235  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %dms", sys.timeOfWeekMs);
1236 #endif
1237 
1238  ptr += SNPRINTF(ptr, ptrEnd - ptr, ",%d,%d,%d\n", sys.imuPeriodMs, sys.navPeriodMs, sys.genFaultCode);
1239 
1240  if (m_displayMode == DMODE_PRETTY)
1241  {
1242  ptr = StatusToString(ptr, ptrEnd, sys.insStatus, sys.hdwStatus);
1243  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\tTemp: IMU %4.1f C\tBaro %4.1f C\tMCU %4.1f C\n", sys.imuTemp, sys.baroTemp, sys.mcuTemp);
1244  }
1245 
1246  return buf;
1247 }
1248 
1250 {
1251  (void)hdr;
1252  char buf[BUF_SIZE];
1253  char* ptr = buf;
1254  char* ptrEnd = buf + BUF_SIZE;
1255  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_SYS_SENSORS:");
1256 
1257 #if DISPLAY_DELTA_TIME==1
1258  static double lastTime = 0;
1259  double dtMs = 1000.0*(sensors.time - lastTime);
1260  lastTime = sensors.time;
1261  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
1262 #else
1263  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", sensors.time);
1264 #endif
1265 
1266  // Single line format
1267  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", %4.1fC, pqr[%5.1f,%5.1f,%5.1f], acc[%5.1f,%5.1f,%5.1f], mag[%6.2f,%6.2f,%6.2f]",
1268  sensors.temp,
1269  sensors.pqr[0] * C_RAD2DEG_F,
1270  sensors.pqr[1] * C_RAD2DEG_F,
1271  sensors.pqr[2] * C_RAD2DEG_F,
1272  sensors.acc[0], sensors.acc[1], sensors.acc[2],
1273  sensors.mag[0], sensors.mag[1], sensors.mag[2]
1274  );
1275 
1276  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", baro[%5.2fkPa, %4.1fC, %7.2fm, %3.1f%% humidity], adc[%3.1fV, %3.1fV, %3.1fV, %3.1fV]",
1277  sensors.bar, sensors.barTemp, sensors.mslBar, sensors.humidity,
1278  sensors.vin, sensors.ana1, sensors.ana3, sensors.ana4
1279  );
1280 
1281  if (m_displayMode != DMODE_SCROLL)
1282  {
1283  ptr += SNPRINTF(ptr, ptrEnd - ptr, "\n");
1284  }
1285 
1286  return buf;
1287 }
1288 
1290 {
1291  cDataCSV csv;
1292  string csvString;
1293  csv.DataToStringCSV(hdr, (const uint8_t*)&info, csvString);
1294  const char* terminator = (m_displayMode != DMODE_SCROLL ? "\n" : "");
1295  return string("RTOS: ") + csvString + terminator;
1296 }
1297 
1299 {
1300  (void)hdr;
1301  char buf[BUF_SIZE];
1302  char* ptr = buf;
1303  char* ptrEnd = buf + BUF_SIZE;
1304  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_DEV_INFO:");
1305 
1306  // Single line format
1307  ptr += SNPRINTF(ptr, ptrEnd - ptr, " SN%d, Fw %d.%d.%d.%d %c%d, %04d-%02d-%02d",
1308  info.serialNumber,
1309  info.firmwareVer[0],
1310  info.firmwareVer[1],
1311  info.firmwareVer[2],
1312  info.firmwareVer[3],
1313  info.buildDate[0],
1314  info.buildNumber,
1315  info.buildDate[1] + 2000,
1316  info.buildDate[2],
1317  info.buildDate[3]
1318  );
1319 
1320  if (m_displayMode != DMODE_SCROLL)
1321  { // Spacious format
1322  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %02d:%02d:%02d, Proto %d.%d.%d.%d\n",
1323  info.buildTime[0],
1324  info.buildTime[1],
1325  info.buildTime[2],
1326  info.protocolVer[0],
1327  info.protocolVer[1],
1328  info.protocolVer[2],
1329  info.protocolVer[3]
1330  );
1331  }
1332 
1333  return buf;
1334 }
1335 
1337  (void) hdr; // hdr is not used
1338 
1339  stringstream ss;
1340  ss << "DID_SENSORS_ADC:";
1341  ss << fixed;
1342  ss << "time " << setprecision(3) << sensorsADC.time << ", ";
1343  ss << "bar " << setprecision(2) << sensorsADC.bar << ", ";
1344  ss << "barTemp " << setprecision(2) << sensorsADC.barTemp << ", ";
1345  ss << "humidity " << setprecision(2) << sensorsADC.humidity << ", ";
1346 
1347 // ss << " ana[" << setprecision(2);
1348 // for (size_t i = 0; i < NUM_ANA_CHANNELS; ++i)
1349 // {
1350 // if (i != 0) { ss << ", "; }
1351 // ss << sensorsADC.ana[i];
1352 // }
1353 // ss << "]";
1354 
1355  if (m_displayMode != DMODE_SCROLL)
1356  { // Spacious format
1357  ss << "\n";
1358 #define SADC_WIDTH 5
1359  for (size_t i = 0; i < NUM_IMU_DEVICES; ++i)
1360  {
1361  auto &mpu = sensorsADC.mpu[i];
1362  ss << "\tmpu[" << i << "]: " << setprecision(0);
1363  ss << "pqr[" << setw(SADC_WIDTH) << mpu.pqr[0] << "," << setw(SADC_WIDTH) << mpu.pqr[1] << "," << setw(SADC_WIDTH) << mpu.pqr[2] << "], ";
1364  ss << "acc[" << setw(SADC_WIDTH) << mpu.acc[0] << "," << setw(SADC_WIDTH) << mpu.acc[1] << "," << setw(SADC_WIDTH) << mpu.acc[2] << "], ";
1365  ss << "mag[" << setw(SADC_WIDTH) << mpu.mag[0] << "," << setw(SADC_WIDTH) << mpu.mag[1] << "," << setw(SADC_WIDTH) << mpu.mag[2] << "], ";
1366  ss << "temp " << setprecision(3) << mpu.temp << ",";
1367  ss << "\n";
1368  }
1369  }
1370  else
1371  {
1372  for (size_t i = 0; i < NUM_IMU_DEVICES; ++i)
1373  {
1374  auto &mpu = sensorsADC.mpu[i];
1375  ss << "mpu[" << i << "]: " << setprecision(0);
1376  ss << "pqr[" << mpu.pqr[0] << "," << mpu.pqr[1] << "," << mpu.pqr[2] << "], ";
1377  ss << "acc[" << mpu.acc[0] << "," << mpu.acc[1] << "," << mpu.acc[2] << "], ";
1378  ss << "mag[" << mpu.mag[0] << "," << mpu.mag[1] << "," << mpu.mag[2] << "], ";
1379  ss << "temp " << setprecision(3) << mpu.temp << ",";
1380  }
1381  }
1382 
1383  return ss.str();
1384 }
1385 
1387 {
1388  (void)hdr;
1389  char buf[BUF_SIZE];
1390  char* ptr = buf;
1391  char* ptrEnd = buf + BUF_SIZE;
1392  ptr += SNPRINTF(ptr, ptrEnd - ptr, "DID_WHEEL_ENCODER:");
1393 
1394 #if DISPLAY_DELTA_TIME==1
1395  static double lastTime[2] = { 0 };
1396  double dtMs = 1000.0*(wheel.timeOfWeek - lastTime[i]);
1397  lastTime[i] = wheel.timeOfWeek;
1398  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %4.1lfms", dtMs);
1399 #else
1400  ptr += SNPRINTF(ptr, ptrEnd - ptr, " %.3lfs", wheel.timeOfWeek);
1401 #endif
1402 
1403  ptr += SNPRINTF(ptr, ptrEnd - ptr, ", [left,right] (rad) theta[%6.2f,%6.2f] omega[%5.2f,%5.2f] wrap[%d,%d]\n",
1404  wheel.theta_l, // Left wheel angle
1405  wheel.theta_r, // Right wheel angle
1406  wheel.omega_l, // Left wheel angular velocity
1407  wheel.omega_r, // Right wheel angular velocity
1408  wheel.wrap_count_l, // Left wheel angle wrap
1409  wheel.wrap_count_r // Right wheel angle wrap
1410  );
1411 
1412  return buf;
1413 }
1414 
1415 ostream& boldOn(ostream& os)
1416 {
1417 
1418 #if PLATFORM_IS_WINDOWS
1419 
1420  return os;
1421 
1422 #else
1423 
1424  return os << "\033[1m";
1425 
1426 #endif
1427 
1428 }
1429 
1430 ostream& boldOff(ostream& os)
1431 {
1432 
1433 #if PLATFORM_IS_WINDOWS
1434 
1435  return os;
1436 
1437 #else
1438 
1439  return os << "\033[0m";
1440 
1441 #endif
1442 
1443 }
1444 
1445 // Bold on with newline
1446 ostream& endlbOn(ostream& os)
1447 {
1448 
1449 #if PLATFORM_IS_WINDOWS
1450 
1451  return os << endl;
1452 
1453 #else
1454 
1455  return os << endl << boldOn;
1456 
1457 #endif
1458 
1459 }
1460 
1461 // Bold off with newline
1462 ostream& endlbOff(ostream& os)
1463 {
1464 
1465 #if PLATFORM_IS_WINDOWS
1466 
1467  return os << endl;
1468 
1469 #else
1470 
1471  return os << endl << boldOff;
1472 
1473 #endif
1474 
1475 }
d
#define DID_SURVEY_IN
Definition: data_sets.h:107
gps_pos_t gpsPos
Definition: data_sets.h:3540
#define DID_DUAL_IMU
Definition: data_sets.h:92
static const char * GetDataSetName(uint32_t dataId)
imus_t I
Definition: data_sets.h:617
float bar
Definition: data_sets.h:666
float baseToRoverVector[3]
Definition: data_sets.h:2729
float humidity
Definition: data_sets.h:675
uint32_t recalCmd
Definition: data_sets.h:1390
ins_2_t ins2
Definition: data_sets.h:3529
gps_raw_t gpsRaw
Definition: data_sets.h:3552
float vDop
Definition: data_sets.h:2767
#define PRINTV3_LLA_MSL
Definition: ISDisplay.cpp:46
string DataToStringINS1(const ins_1_t &ins1, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:605
static void signalFunction(int sig)
Definition: ISDisplay.cpp:75
double towOffset
Definition: data_sets.h:787
#define PRINTV3_P3
Definition: ISDisplay.cpp:41
is_can_ve ve
Definition: CAN_comm.h:258
ostream & boldOn(ostream &os)
Definition: ISDisplay.cpp:1415
uint32_t wrap_count_l
Definition: data_sets.h:1907
uint8_t arRatio
Definition: CAN_comm.h:232
void GoToColumnAndRow(int x, int y)
Definition: ISDisplay.cpp:186
float hAccuracy
Definition: data_sets.h:2975
float qn2b[4]
Definition: data_sets.h:534
float progress
Definition: data_sets.h:1393
float gDop
Definition: data_sets.h:2761
ins_1_t ins1
Definition: data_sets.h:3528
void ProcessData(p_data_t *data, bool enableReplay=false, double replaySpeedX=1.0)
Definition: ISDisplay.cpp:283
string DataToStringRawGPS(const gps_raw_t &raw, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1158
uint32_t elapsedTimeSec
Definition: data_sets.h:2972
float arThreshold
Definition: data_sets.h:2758
uint32_t id
Definition: ISComm.h:376
is_can_uvw uvw
Definition: CAN_comm.h:257
#define DID_INS_1
Definition: data_sets.h:38
string DataToStringSysSensors(const sys_sensors_t &sensors, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1249
string DataToStringSysParams(const sys_params_t &sys, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1221
uint32_t maxDurationSec
Definition: data_sets.h:2966
uint32_t state
Definition: data_sets.h:2963
#define DID_GPS2_RTK_CMP_REL
Definition: data_sets.h:125
float omega_r
Definition: data_sets.h:1904
void DataToStats(const p_data_t *data)
Definition: ISDisplay.cpp:472
XmlRpcServer s
float baroTemp
Definition: data_sets.h:1058
ostream & endlbOff(ostream &os)
Definition: ISDisplay.cpp:1462
#define PRINTV3_LLA
Definition: ISDisplay.cpp:45
string DataToStringSensorsADC(const sys_sensors_adc_t &sensorsADC, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1336
sys_params_t sysParams
Definition: data_sets.h:3549
float mag[3]
Definition: data_sets.h:655
uint32_t wrap_count_r
Definition: data_sets.h:1910
float theta_l
Definition: data_sets.h:1895
float timeOfWeekMs
Definition: CAN_comm.h:29
#define DID_COUNT
Definition: data_sets.h:138
#define DID_DEV_INFO
Definition: data_sets.h:35
dual_imu_t imu
Definition: data_sets.h:638
#define DID_INS_2
Definition: data_sets.h:39
float barTemp
Definition: data_sets.h:672
string DataToStringMag(const magnetometer_t &mag, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:934
char * InsStatusToSolStatusString(char *ptr, char *ptrEnd, const uint32_t insStatus)
Definition: ISDisplay.cpp:588
char * StatusToString(char *ptr, char *ptrEnd, const uint32_t insStatus, const uint32_t hdwStatus)
Definition: ISDisplay.cpp:549
#define NULL
Definition: nm_bsp.h:52
char copyDataPToStructP(void *sptr, const p_data_t *data, const unsigned int maxsize)
Definition: ISComm.c:975
#define DID_PREINTEGRATED_IMU
Definition: data_sets.h:37
bool DataToStringCSV(const p_data_hdr_t &hdr, const uint8_t *buf, string &csv)
Definition: DataCSV.cpp:184
string DataToStringPreintegratedImu(const preintegrated_imu_t &imu, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:877
float ana4
Definition: data_sets.h:1023
double baseLla[3]
Definition: data_sets.h:2770
float pqr[3]
Definition: data_sets.h:603
#define NUM_IMU_DEVICES
Definition: data_sets.h:164
#define DID_SYS_PARAMS
Definition: data_sets.h:44
ostream & endlbOn(ostream &os)
Definition: ISDisplay.cpp:1446
#define SLEEP_MS(timeMs)
Definition: ISUtilities.h:134
uint8_t receiverIndex
Definition: data_sets.h:2908
string DataToString(const p_data_t *data)
Definition: ISDisplay.cpp:500
gps_rtk_misc_t gpsRtkMisc
Definition: data_sets.h:3544
#define DID_GPS_BASE_RAW
Definition: data_sets.h:94
int16_t theta1
Definition: CAN_comm.h:48
#define DID_MAG_CAL
Definition: data_sets.h:53
mag_cal_t magCal
Definition: data_sets.h:3535
int16_t vel2
Definition: CAN_comm.h:191
ins_3_t ins3
Definition: data_sets.h:3530
unsigned long DWORD
Definition: integer.h:33
double timeOfWeek
Definition: data_sets.h:417
#define DID_MAGNETOMETER_2
Definition: data_sets.h:89
wheel_encoder_t wheelEncoder
Definition: data_sets.h:3537
float baseToRoverDistance
Definition: data_sets.h:2732
std::ostream & cout()
string DataToStringDualIMU(const dual_imu_t &imu, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:824
def hdwStatus(hstatus)
Hardware Status #####.
string DataToStringINS2(const ins_2_t &ins2, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:656
int current_timeMs()
float theta_r
Definition: data_sets.h:1898
ostream & boldOff(ostream &os)
Definition: ISDisplay.cpp:1430
float pDop
Definition: data_sets.h:781
#define printf(...)
Definition: evb_tasks.h:36
preintegrated_imu_t pImu
Definition: data_sets.h:3539
#define DID_GPS2_RAW
Definition: data_sets.h:104
#define BUF_SIZE
Definition: ISDisplay.cpp:47
uint32_t buildNumber
Definition: data_sets.h:451
string DataToStringBaro(const barometer_t &baro, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1002
float vin
Definition: data_sets.h:1014
string DataToStringINS3(const ins_3_t &ins3, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:712
uint32_t hdwStatus
Definition: CAN_comm.h:40
uint32_t cnoMean
Definition: CAN_comm.h:226
#define DID_GPS2_RTK_CMP_MISC
Definition: data_sets.h:126
float hDop
Definition: data_sets.h:2764
float mslBar
Definition: data_sets.h:669
#define DID_GPS1_RAW
Definition: data_sets.h:103
float declination
Definition: data_sets.h:1396
#define DID_GPS2_POS
Definition: data_sets.h:48
uint32_t genFaultCode
Definition: data_sets.h:1079
vector< string > m_didMsgs
Definition: ISDisplay.h:90
def quat2euler(q)
Definition: pose.py:126
#define C_RAD2DEG_F
Definition: ISConstants.h:562
ins_4_t ins4
Definition: data_sets.h:3531
static bool s_controlCWasPressed
Definition: ISDisplay.cpp:51
float baseToRoverHeading
Definition: data_sets.h:2735
uint8_t buildDate[4]
Definition: data_sets.h:463
double lla[3]
Definition: data_sets.h:511
int16_t theta2
Definition: CAN_comm.h:49
string DataToStringMagCal(const mag_cal_t &mag, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:972
p_data_hdr_t hdr
Definition: ISComm.h:389
uint32_t status
Definition: CAN_comm.h:114
sys_sensors_t sysSensors
Definition: data_sets.h:3550
#define DID_MAGNETOMETER_1
Definition: data_sets.h:86
void qe2b2EulerNedEcef(ixVector3 eul, const ixVector4 qe2b, const ixVector3d ecef)
Definition: ISPose.c:281
#define SNPRINTF
Definition: ISConstants.h:146
#define INS_STATUS_SOLUTION(insStatus)
Definition: data_sets.h:213
dev_info_t devInfo
Definition: data_sets.h:3527
USBInterfaceDescriptor data
def insStatus(istatus)
INS Status #####.
int16_t vel1
Definition: CAN_comm.h:181
uint16_t dt
Definition: CAN_comm.h:174
#define PRINTV4_P3
Definition: ISDisplay.cpp:44
string DataToStringRtkMisc(const gps_rtk_misc_t &sol, const p_data_hdr_t &hdr, const string didName)
Definition: ISDisplay.cpp:1135
float acc[3]
Definition: data_sets.h:606
uint32_t insStatus
Definition: CAN_comm.h:37
sensors_mpu_w_temp_t mpu[NUM_IMU_DEVICES]
Definition: data_sets.h:1249
#define DID_GPS1_POS
Definition: data_sets.h:47
void ShowCursor(bool visible)
Definition: ISDisplay.cpp:108
float theta[3]
Definition: data_sets.h:505
#define DID_SYS_SENSORS
Definition: data_sets.h:45
#define DID_INS_3
Definition: data_sets.h:99
uint32_t serialNumber
Definition: data_sets.h:442
#define PRINTV3_P1
Definition: ISDisplay.cpp:39
string DataToStringGpsPos(const gps_pos_t &gps, const p_data_hdr_t &hdr, const string didName)
Definition: ISDisplay.cpp:1032
float ned[3]
Definition: data_sets.h:514
barometer_t baro
Definition: data_sets.h:3536
string DataToStringINS4(const ins_4_t &ins4, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:768
gps_rtk_rel_t gpsRtkRel
Definition: data_sets.h:3543
double ecef[3]
Definition: data_sets.h:420
#define DID_WHEEL_ENCODER
Definition: data_sets.h:105
float imuTemp
Definition: data_sets.h:1055
void DataToVector(const p_data_t *data)
Definition: ISDisplay.cpp:461
#define DID_GPS1_RTK_POS
Definition: data_sets.h:88
float ana1
Definition: data_sets.h:1017
eDisplayMode m_displayMode
Definition: ISDisplay.h:91
survey_in_t surveyIn
Definition: data_sets.h:3548
rtos_info_t rtosInfo
Definition: data_sets.h:3551
float ana3
Definition: data_sets.h:1020
uint8_t buildTime[4]
Definition: data_sets.h:466
uint8_t protocolVer[4]
Definition: data_sets.h:454
string DataToStringRTOS(const rtos_info_t &info, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1289
uint8_t firmwareVer[4]
Definition: data_sets.h:448
#define DID_GPS1_RTK_POS_REL
Definition: data_sets.h:55
float hAcc
Definition: data_sets.h:775
float vAcc
Definition: data_sets.h:778
float qe2b[4]
Definition: data_sets.h:589
float mcuTemp
Definition: data_sets.h:1061
float accuracyPos[3]
Definition: data_sets.h:2752
uint8_t obsCount
Definition: data_sets.h:2914
sys_sensors_adc_t sensorsAdc
Definition: data_sets.h:3553
is_can_time time
Definition: CAN_comm.h:252
uint8_t dataType
Definition: data_sets.h:2911
#define PRINTV3_P2
Definition: ISDisplay.cpp:40
uint8_t differentialAge
Definition: CAN_comm.h:234
#define HDW_STATUS_COM_PARSE_ERROR_COUNT(hdwStatus)
Definition: data_sets.h:330
float omega_l
Definition: data_sets.h:1901
vector< sDidStats > m_didStats
Definition: ISDisplay.h:101
uint32_t imuPeriodMs
Definition: data_sets.h:1067
#define DID_INS_4
Definition: data_sets.h:100
float temp
Definition: data_sets.h:990
uint32_t navPeriodMs
Definition: data_sets.h:1070
#define DID_BAROMETER
Definition: data_sets.h:87
#define DID_RTOS_INFO
Definition: data_sets.h:72
double lla[3]
Definition: data_sets.h:2978
string DataToStringSurveyIn(const survey_in_t &survey, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1175
#define DID_INL2_STATES
Definition: data_sets.h:82
#define SADC_WIDTH
string DataToStringDevInfo(const dev_info_t &info, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1298
string Replay(double speed=1.0)
Definition: ISDisplay.cpp:212
dual_imu_t dualImu
Definition: data_sets.h:3533
#define DID_GPS1_RTK_POS_MISC
Definition: data_sets.h:56
string DataToStringRtkRel(const gps_rtk_rel_t &gps, const p_data_hdr_t &hdr, const string didName)
Definition: ISDisplay.cpp:1097
string DataToStringWheelEncoder(const wheel_encoder_t &enc, const p_data_hdr_t &hdr)
Definition: ISDisplay.cpp:1386
#define DID_SENSORS_ADC
Definition: data_sets.h:62


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57