Our best practice for sensor fusion is to leverage the GPS PPS input to synchronize the LiDAR (via LiDAR encoder) and the GMSL2 camera (via frame sync, also known as FSYNC). The GPS PPS signal is a standard output from GPS modules, originating from satellites. "PPS" stands for "Pulse Per Second."
In general, most mechanical LiDARs support alignment to the GPS PPS input to mark the zero-degree position. The PCIe-NPL54 also ensures that camera frame sync is aligned with the GPS PPS input. The capability to apply a phase shift to the frame sync signal derived from the PPS input is currently available as an OEM feature.
If the customer prefers to use timestamps, the most accurate one would be based on the GPS PPS input, which can be obtained from a host computer via a GPS PPS module.
For the PCIe-NPL54, the earliest available timestamp is the "Start of Frame" from the FPGA (MIPI interface) on the NPL54. However, due to the camera's dynamic exposure time, the delay between the frame sync signal and the Start of Frame is not fixed.
Enable Timestamp
Please uncomment #define ENABLE_TIMESTAMP in NPL54Capture.cpp
Then reinstall the npl54.service by ...
Using Timestamp
The timestamp is stored in the tv_sec and tv_usec fields of the timestamp member in the v4l2_buffer structure.
...
#include "ConfigManager.h"
#include <thread>
#define ENABLE_TIMESTAMP
#ifndef ENABLE_TIMESTAMP // No Timestamp
#define VDMA_UPDATE_IDX_TIMEOUT 200 // Channel Level: Maximum timeout (in ms) to wait for a new valid frame
#define VDMA_UPDATE_IDX_TIMEOUT_ELSE_COUNT 1 // VDMA_UPDATE_IDX_TIMEOUT * VDMA_UPDATE_IDX_TIMEOUT_ELSE_COUNT > 200
#define MAX_TIMEOUT 5 // Channel Level: The number of timeouts reported before issuing a retry
...
# In case you have previously installed NPL54
sudo systemctl stop npl54.service
cd NPL54_ES3/
# Please ensure you have Internet connected
sudo ./00_install_es3.sh