Skip to content

Commit

Permalink
Merge branch 'develop' into SN-6067_addRTKDgbToRmcBits
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcd249 authored Jan 6, 2025
2 parents a352778 + a5152dd commit 0f5e194
Show file tree
Hide file tree
Showing 16 changed files with 1,004 additions and 927 deletions.
2 changes: 2 additions & 0 deletions ExampleProjects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ add_subdirectory(Ascii)
add_subdirectory(Bootloader)
add_subdirectory(Communications)
add_subdirectory(IS_firmwareUpdate_v2)
# add_subdirectory(InertialSense_log_reader)
add_subdirectory(InertialSense_log_reader_RegCmp)
add_subdirectory(ISLogger_read)
add_subdirectory(ISLogger_write)
add_subdirectory(InertialSense_logger)
Expand Down
987 changes: 355 additions & 632 deletions ExampleProjects/InertialSense_log_reader_RegCmp/LogReader_RegCmp.cpp

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions ExampleProjects/InertialSense_log_reader_RegCmp/setup_debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

pushd "$(dirname "$(realpath $0)")" > /dev/null

mkdir -p build
rm -rf build/*
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j 7

popd > /dev/null
3 changes: 3 additions & 0 deletions python/inertialsense/logInspector/logInspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ def createListGps(self):
self.addListItem('GPS LLA', 'gpsLLA')
self.addListItem('GPS 1 Stats', 'gpsStats')
self.addListItem('GPS 2 Stats', 'gps2Stats')
self.addListItem('GPS Time', 'gpsTime')
self.addListItem('GPX Status', 'gpxStatus')
self.addListItem('GPX HDW Status', 'gpxHdwStatus')
self.addListItem('RTK Pos Stats', 'rtkPosStats')
self.addListItem('RTK Cmp Stats', 'rtkCmpStats')
self.addListItem('RTK Cmp BaseVector', 'rtkBaselineVector')
Expand Down
114 changes: 95 additions & 19 deletions python/inertialsense/logInspector/logPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2923,27 +2923,31 @@ def deltatime(self, fig=None, axs=None):
if np.any(timeRef):
refImuPresent = True

N = 4
N = 5
if refImuPresent:
N = N + 2
ax = fig.subplots(N, 1, sharex=True)

fig.suptitle('Timestamps - ' + os.path.basename(os.path.normpath(self.log.directory)))
self.configureSubplot(ax[0], 'INS dt', 's')
self.configureSubplot(ax[1], 'GPS dt', 's')
self.configureSubplot(ax[2], 'IMU Integration Period', 's')
self.configureSubplot(ax[3], 'IMU Delta Timestamp', 's')
self.configureSubplot(ax[1], 'GPS1 dt', 's')
self.configureSubplot(ax[2], 'GPS2 dt', 's')
self.configureSubplot(ax[3], 'IMU Integration Period', 's')
self.configureSubplot(ax[4], 'IMU Delta Timestamp', 's', xlabel = 'Message Index' if self.xAxisSample else 'Time of Week' )

for d in self.active_devs_no_ref:
dtIns = self.getData(d, DID_INS_2, 'timeOfWeek')[1:] - self.getData(d, DID_INS_2, 'timeOfWeek')[0:-1]
dtIns = dtIns / self.d
timeIns = getTimeFromGpsTow(self.getData(d, DID_INS_2, 'timeOfWeek')[1:], True)

towMsGps = self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[1:]
weekGps = self.getData(d, DID_GPS1_POS, 'week')[1:]
dtGps = 0.001*(towMsGps - self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[0:-1])
dtGps = dtGps / self.d
timeGps = getTimeFromGpsTowMs(towMsGps)
towMsGps1 = self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[1:]
towMsGps2 = self.getData(d, DID_GPS2_POS, 'timeOfWeekMs')[1:]
dtGps1 = 0.001*(towMsGps1 - self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[0:-1])
dtGps2 = 0.001*(towMsGps2 - self.getData(d, DID_GPS2_POS, 'timeOfWeekMs')[0:-1])
dtGps1 = dtGps1 / self.d
dtGps2 = dtGps2 / self.d
timeGps1 = getTimeFromGpsTowMs(towMsGps1)
timeGps2 = getTimeFromGpsTowMs(towMsGps2)

dtPimu = self.getData(d, DID_PIMU, 'dt')
if dtPimu.size:
Expand Down Expand Up @@ -2975,20 +2979,39 @@ def deltatime(self, fig=None, axs=None):
deltaTimestamp = deltaTimestamp / self.d
timeImu = getTimeFromGpsTow(timeImu3[1:] + towOffset)

<<<<<<< HEAD:python/inertialsense/logInspector/logPlotter.py
ax[0].plot(timeIns, dtIns, label=self.log.serials[d])
ax[1].plot(timeGps, dtGps)
if integrationPeriod.size:
ax[2].plot(timeImu, integrationPeriod)
ax[3].plot(timeImu, deltaTimestamp)
=======
if self.xAxisSample:
xIns = np.arange(0, np.shape(dtIns)[0])
xGps1 = np.arange(0, np.shape(dtGps1)[0])
xGps2 = np.arange(0, np.shape(dtGps2)[0])
xImu = np.arange(0, np.shape(deltaTimestamp)[0])
else:
xIns = timeIns
xGps1 = timeGps1
xGps2 = timeGps2
xImu = timeImu

ax[0].plot(xIns, dtIns, label=self.log.serials[d])
ax[1].plot(xGps1, dtGps1)
ax[2].plot(xGps2, dtGps2)
if integrationPeriod.size:
ax[3].plot(xImu, integrationPeriod)
ax[4].plot(xImu, deltaTimestamp)
>>>>>>> origin/2.2.2-rc:python/logInspector/logPlotter.py

self.setPlotYSpanMin(ax[0], 0.005)
self.setPlotYSpanMin(ax[1], 0.005)
self.setPlotYSpanMin(ax[2], 0.005)
self.setPlotYSpanMin(ax[3], 0.005)
# Don't zoom in closer than 0.005s so we can easily see that the delta time is clean
for i in range(len(ax)):
self.setPlotYSpanMin(ax[i], 0.005)

if refImuPresent:
self.configureSubplot(ax[4], 'Reference IMU Integration Period', 's')
self.configureSubplot(ax[5], 'Reference IMU Delta Timestamp', 's')
self.configureSubplot(ax[5], 'Reference IMU Integration Period', 's')
self.configureSubplot(ax[6], 'Reference IMU Delta Timestamp', 's')
for d in self.active_devs:
deltaTimestampRef = 0
timeImuRef = 0
Expand All @@ -2998,10 +3021,63 @@ def deltatime(self, fig=None, axs=None):
deltaTimestampRef = timeRef[1:] - timeRef[0:-1]
deltaTimestampRef = deltaTimestampRef / self.d
timeImuRef = getTimeFromGpsTow(timeRef[1:] + towOffset)
ax[4].plot(timeImuRef, integrationPeriodRef)
ax[5].plot(timeImuRef, deltaTimestampRef)
self.setPlotYSpanMin(ax[4], 0.005)
self.setPlotYSpanMin(ax[5], 0.005)
ax[5].plot(timeImuRef, integrationPeriodRef)
ax[6].plot(timeImuRef, deltaTimestampRef)

self.legends_add(ax[0].legend(ncol=2))
for a in ax:
a.grid(True)

self.setup_and_wire_legend()
return self.saveFigJoinAxes(ax, axs, fig, 'deltatime')

def gpsTime(self, fig=None, axs=None):
if fig is None:
fig = plt.figure()

refImuPresent = False
for d in self.active_devs:
timeRef = self.getData(d, DID_REFERENCE_PIMU, 'time')
if np.any(timeRef):
refImuPresent = True

N = 4
ax = fig.subplots(N, 1, sharex=(self.xAxisSample==0))

fig.suptitle('Timestamps - ' + os.path.basename(os.path.normpath(self.log.directory)))
self.configureSubplot(ax[0], 'GPS1 dt', 's')
self.configureSubplot(ax[1], 'GPS2 dt', 's')
self.configureSubplot(ax[2], 'GPS1 TOW Offset', 's')
self.configureSubplot(ax[3], 'GPS2 TOW Offset', 's')

for d in self.active_devs_no_ref:
towMsGps1 = self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[1:]
towMsGps2 = self.getData(d, DID_GPS2_POS, 'timeOfWeekMs')[1:]
dtGps1 = 0.001*(towMsGps1 - self.getData(d, DID_GPS1_POS, 'timeOfWeekMs')[0:-1])
dtGps2 = 0.001*(towMsGps2 - self.getData(d, DID_GPS2_POS, 'timeOfWeekMs')[0:-1])
dtGps1 = dtGps1 / self.d
dtGps2 = dtGps2 / self.d
timeGps1 = getTimeFromGpsTowMs(towMsGps1)
timeGps2 = getTimeFromGpsTowMs(towMsGps2)

towOffsetGps1 = self.getData(d, DID_GPS1_POS, 'towOffset')[1:]
towOffsetGps2 = self.getData(d, DID_GPS2_POS, 'towOffset')[1:]

if self.xAxisSample:
xGps1 = np.arange(0, np.shape(dtGps1)[0])
xGps2 = np.arange(0, np.shape(dtGps2)[0])
else:
xGps1 = timeGps1
xGps2 = timeGps2

ax[0].plot(xGps1, dtGps1)
ax[1].plot(xGps2, dtGps2)
ax[2].plot(xGps1, towOffsetGps1)
ax[3].plot(xGps2, towOffsetGps2)

# Don't zoom in closer than 0.005s so we can easily see that the delta time is clean
for i in range(len(ax)):
self.setPlotYSpanMin(ax[i], 0.005)

self.legends_add(ax[0].legend(ncol=2))
for a in ax:
Expand Down
31 changes: 19 additions & 12 deletions scripts/build_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,19 @@ def test_footer(self, exit_code):
print("")

def print_summary(self):
if self.run_clean:
action = "CLEAN"
else:
action = "BUILD"
self.print_blu(f"==========================================")
self.print_blu(f" {action} SUMMARY:")
self.print_blu(f"==========================================")
if self.build_success:
self.print_grn(f"[PASSED]: " + ", ".join(self.build_success))
if self.build_failure:
self.print_red(f"[FAILED]: " + ", ".join(self.build_failure))
print("")
if self.run_build:
if self.run_clean:
action = "CLEAN"
else:
action = "BUILD"
self.print_blu(f"==========================================")
self.print_blu(f" {action} SUMMARY:")
self.print_blu(f"==========================================")
if self.build_success:
self.print_grn(f"[PASSED]: " + ", ".join(self.build_success))
if self.build_failure:
self.print_red(f"[FAILED]: " + ", ".join(self.build_failure))
print("")
if self.run_test:
self.print_cyn(f"==========================================")
self.print_cyn(f" TEST SUMMARY:")
Expand All @@ -162,6 +163,8 @@ def print_summary(self):
self.print_release_info()

def build_callback(self, project_name, callback):
if not self.run_build:
return
result = 0
self.build_header(project_name)
result = callback(self.args)
Expand All @@ -181,6 +184,8 @@ def test_callback(self, project_name, callback):
return result

def build_script(self, project_name, script_path, args=[]):
if not self.run_build:
return
if self.is_windows:
command = ["cmd", "/c", str(script_path)]
else:
Expand All @@ -205,6 +210,8 @@ def build_script(self, project_name, script_path, args=[]):
return result

def build_cmake(self, project_name, project_dir):
if not self.run_build:
return
project_dir = Path(project_dir)

self.build_header(project_name)
Expand Down
6 changes: 5 additions & 1 deletion src/ISConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,12 @@ extern "C" {
#define _LIMIT2(x, xmin, xmax) { if ((x) < (xmin)) { (x) = (xmin); } else { if ((x) > (xmax)) { (x) = (xmax); } } }
#endif

#ifndef _ROUND_NEAREST
#define _ROUND_NEAREST(number, multiple) ((((number) + ((multiple)/2)) / (multiple)) * (multiple))
#endif

#ifndef _ROUND_CLOSEST
#define _ROUND_CLOSEST(dividend, divisor) (((dividend) + ((divisor)/2)) / (divisor))
#define _ROUND_CLOSEST(number, multiple) (((number) + ((multiple)/2)) / (multiple))
#endif

#ifndef _ROUNDUP
Expand Down
36 changes: 23 additions & 13 deletions src/data_sets.h
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,13 @@ enum eGenFaultCodes
GFC_INIT_I2C = 0x00800000,
/*! Fault: Chip erase line toggled but did not meet required hold time. This is caused by noise/transient on chip erase pin. */
GFC_CHIP_ERASE_INVALID = 0x01000000,
/*! Fault: GPS time fault */
GFC_GNSS_TIME_FAULT = 0x02000000,
/*! Fault: EKF GPS time fault */
GFC_EKF_GNSS_TIME_FAULT = 0x02000000,
/*! Fault: GPS receiver time fault */
GFC_GNSS_RECEIVER_TIME = 0x04000000,

/*! IMX GFC flags that relate to GPX status flags */
GFC_GPX_STATUS_COMMON_MASK = GFC_GNSS1_INIT | GFC_GNSS2_INIT | GFC_GNSS_TX_LIMITED | GFC_GNSS_RX_OVERRUN | GFC_GNSS_SYS_FAULT | GFC_GNSS_RECEIVER_TIME,
};


Expand Down Expand Up @@ -1603,7 +1608,7 @@ typedef struct PACKED
nmeaBroadcastMsgPair_t nmeaBroadcastMsgs[MAX_nmeaBroadcastMsgPairs];

/* Example usage:
* If you are setting message GGA (6) at 1Hz and GGL (7) at 5Hz with the default DID_FLASH_CONFIG.startupGpsDtMs = 200 (5Hz)
* If you are setting message GGA (6) at 1Hz and GGL (7) at 5Hz with the default DID_FLASH_CONFIG.startupGPSDtMs = 200 (5Hz)
* nmeaBroadcastMsgs[0].msgID = 6, nmeaBroadcastMsgs[0].msgPeriod = 5
* nmeaBroadcastMsgs[1].msgID = 7, nmeaBroadcastMsgs[1].msgPeriod = 1 */

Expand Down Expand Up @@ -1743,7 +1748,7 @@ typedef struct PACKED
#define RMC_BITS_MAGNETOMETER 0x0000000000000080 // ~10ms
// #define RMC_BITS_UNUSED 0x0000000000000100
// #define RMC_BITS_UNUSED 0x0000000000000200
#define RMC_BITS_GPS1_POS 0x0000000000000400 // DID_FLASH_CONFIG.startupGpsDtMs (200ms default)
#define RMC_BITS_GPS1_POS 0x0000000000000400 // DID_FLASH_CONFIG.startupGPSDtMs (200ms default)
#define RMC_BITS_GPS2_POS 0x0000000000000800 // "
#define RMC_BITS_GPS1_RAW 0x0000000000001000 // "
#define RMC_BITS_GPS2_RAW 0x0000000000002000 // "
Expand All @@ -1753,7 +1758,7 @@ typedef struct PACKED
#define RMC_BITS_STROBE_IN_TIME 0x0000000000020000 // On strobe input event
#define RMC_BITS_DIAGNOSTIC_MESSAGE 0x0000000000040000
#define RMC_BITS_IMU3_UNCAL 0x0000000000080000 // DID_FLASH_CONFIG.startupImuDtMs (1ms default)
#define RMC_BITS_GPS1_VEL 0x0000000000100000 // DID_FLASH_CONFIG.startupGpsDtMs (200ms default)
#define RMC_BITS_GPS1_VEL 0x0000000000100000 // DID_FLASH_CONFIG.startupGPSDtMs (200ms default)
#define RMC_BITS_GPS2_VEL 0x0000000000200000 // "
#define RMC_BITS_GPS1_UBX_POS 0x0000000000400000 // "
#define RMC_BITS_GPS1_RTK_POS 0x0000000000800000 // "
Expand All @@ -1768,7 +1773,7 @@ typedef struct PACKED
// #define RMC_BITS_UNUSED 0x0000000200000000
#define RMC_BITS_IMU_MAG 0x0000000400000000
#define RMC_BITS_PIMU_MAG 0x0000000800000000
#define RMC_BITS_GPS1_RTK_HDG_REL 0x0000001000000000 // DID_FLASH_CONFIG.startupGpsDtMs (200ms default)
#define RMC_BITS_GPS1_RTK_HDG_REL 0x0000001000000000 // DID_FLASH_CONFIG.startupGPSDtMs (200ms default)
#define RMC_BITS_GPS1_RTK_HDG_MISC 0x0000002000000000 // "
#define RMC_BITS_REFERENCE_IMU 0x0000004000000000 // DID_FLASH_CONFIG.startupNavDtMs
#define RMC_BITS_REFERENCE_PIMU 0x0000008000000000 // "
Expand Down Expand Up @@ -1815,11 +1820,13 @@ typedef struct PACKED
#define RMC_PRESET_IMX_PPD (RMC_PRESET_IMX_PPD_NO_IMU \
| RMC_BITS_PIMU \
| RMC_BITS_REFERENCE_PIMU)
#define RMC_PRESET_IMX_PPD_IMU3_RAW (RMC_PRESET_IMX_PPD_NO_IMU \
| RMC_BITS_IMU3_RAW)
#define RMC_PRESET_IMX_PPD_IMU3_UNCAL (RMC_PRESET_IMX_PPD_NO_IMU \
| RMC_BITS_IMU3_UNCAL)
#define RMC_PRESET_INS (RMC_BITS_INS2 \
| RMC_BITS_GPS1_POS \
| RMC_BITS_PRESET)
#define RMC_PRESET_IMX_PPD_IMU3 (RMC_PRESET_IMX_PPD_NO_IMU \
| RMC_BITS_IMU3_UNCAL)
#define RMC_PRESET_IMX_PPD_RTK_DBG (RMC_PRESET_IMX_PPD \
| RMC_BITS_RTK_STATE \
| RMC_BITS_RTK_CODE_RESIDUAL \
Expand Down Expand Up @@ -4475,6 +4482,9 @@ enum eGpxStatus
/** Reserved */
GPX_STATUS_RESERVED_1 = (int)0x00010000,

/** GNSS receiver time fault **/
GPX_STATUS_GNSS_RCVR_TIME_FAULT = (int)0x00100000,

/** DMA Fault detected **/
GPX_STATUS_DMA_FAULT = (int)0x00800000,

Expand Down Expand Up @@ -5040,11 +5050,11 @@ enum eEventMsgTypeID
EVENT_MSG_TYPE_ID_IMX_DMA_TX_0_CHAN = 25,
EVENT_MSG_TYPE_ID_IMX_GPIO_TX_0_REG = 26,

EVENT_MSG_TYPE_ID_DMA_RX_0_INST = 27,
EVENT_MSG_TYPE_ID_SER0_REG = 28,
EVENT_MSG_TYPE_ID_SER0_CFG = 29,
EVENT_MSG_TYPE_ID_DMA_RX_0_CHAN = 30,
EVENT_MSG_TYPE_ID_GPIO_RX_0_REG = 31,
EVENT_MSG_TYPE_ID_GPX_DMA_RX_0_INST = 27,
EVENT_MSG_TYPE_ID_GPX_SER0_REG = 28,
EVENT_MSG_TYPE_ID_GPX_SER0_CFG = 29,
EVENT_MSG_TYPE_ID_GPX_DMA_RX_0_CHAN = 30,
EVENT_MSG_TYPE_ID_GPX_GPIO_RX_0_REG = 31,

EVENT_MSG_TYPE_ID_FILTER_RESPONSE = (uint16_t)-4,
EVENT_MSG_TYPE_ID_ENA_GNSS1_FILTER = (uint16_t)-3,
Expand Down
Loading

0 comments on commit 0f5e194

Please sign in to comment.