当前位置:网站首页>3D laser slam: time synchronization of livox lidar hardware
3D laser slam: time synchronization of livox lidar hardware
2022-07-07 02:14:00 【The moon shines on the silver sea like a dragon】
3D laser SLAM:Livox Lidar hardware time synchronization
Preface
In progress robot slam Often, a single sensor cannot achieve strong robustness , Many times, the fusion of multiple sensors is needed , For example, lidar + The camera +IMU+GPS+ Wheel speedometer + Millimeter wave radar and so on .
In the process of multi-sensor fusion, it involves the correspondence of data frames , If you need to use a timestamp to correspond , Then time synchronization is required . Due to different degrees of delay in the transmission and reception of data , The frequency of data generation is also different , If you only use soft synchronization , Then there must be some deviation , Resulting in inaccurate data alignment , Then it reflects the importance of hardware time synchronization .
This article mainly introduces in 3D laser SLAM in , How to Livox Lidar time hardware synchronization .
Livox Device support 3 Time synchronization :
- PTP:IEEE 1588v2.0 PTP Network protocol synchronization ;
- GPS: Second pulse +GPRMC Time data , form GPS Time synchronization mode ;
- PPS: Second pulse synchronization , The upper application needs to pass other ways ( Such as :uart) Get the time information of each pulse , And correct the point cloud time .
Synchronization principle
PTP The principle of time synchronization
The synchronization process uses IEEE 1588v2.0 PTP Of Delay request-response Mechanism (two steps),Livox Equipment as slave End , and master Clock device ptp Time synchronization .
master and slave Clock pass Sync、Follow_Up、Delay_Req、Delay_Resp The interaction of these packets , obtain t1、t2、t3、t4 Time , The transmission path delay and the offset of the two clocks are calculated as follows :
Transmission path delay :
Time migration :
GPS The principle of time synchronization
GPS Clock source PPS The port sends hardware pulses every second (PPS The signal ), Then the data port sends a time information corresponding to the rising edge of the pulse (GPRMC Format ).
Livox The device received PPS The rising edge of the signal , And by the GPRMC After the data is parsed into the correct time information , The point cloud time will be set to GPS Time , And keep this time benchmark continuously accumulating , To achieve and GPS Time synchronization of the device .
Be careful :
Livox Hub Can receive directly RS485 Level GPRMC The signal ;
Livox LiDAR Cannot receive directly GPRMC The signal , Need to put GPRMC Data port access PC, And then through sdk The protocol is sent to radar
PPS Signals and GPRMC Signal timing requirements :
PPS The principle of time synchronization
Livox LiDAR Every time I receive PPS After the rising edge of the signal , The point cloud time at the current time will be set to 0, Then start counting again until the next PPS The pulse is coming . We can use this feature , To achieve PPS Pulse pair LiDAR Synchronization of time .
GPS+PPS How to use time synchronization
In order to be compatible with other manufacturers LiDAR Hardware ,Livox The device also supports GPS Time synchronization .
because Livox There are different kinds of hardware (LiDAR/Hub), In the use of GPS When the synchronization , Hardware interfaces can be divided into 3 class :
- Use Livox Hub;
- Use Livox Converter 1.0 Connected LiDAR( Such as :Mid-40、Mid-100);
- Use Livox Converter 2.0 Connected LiDAR( Such as :Tele-15、Horizon、Avia);
The following will introduce how to use this 3 Interface GPS Time synchronization .
Livox Hub
If GPS The time signal of the module and PPS The signal is RS485 level , Connect the line directly Hub Of GPS Time synchronization port (GPS sync port) that will do .
If GPS The time signal of the module and PPS The signal is TTL level , The following level conversion is required , To connect the signal Hub Of GPS Time synchronization port (GPS sync port).
Hub Use GPS When the synchronization , There is no need for SDK Software configuration .
Livox Converter 1.0
take GPS The time signal of the module (GPRMC) adopt TTL turn usb Module access PC,PPS( Must be RS485 level ) Signal access LiDAR Synchronous port of adapter box (Sync Port).
View access PC Of usb Port name of the module ,
for example /dev/ttyUSB0,
Add to livox_lidar_config.json In file “timesync_config” Of “device_name”,
And then “enable_timesync” Configure to true,
Baud rate “baudrate_index” You can refer to Livox_ros_driver To configure specific values
"timesync_config": {
"enable_timesync": true,
"device_name": "/dev/ttyUSB0",
"comm_device_type": 0,
"baudrate_index": 2,
"parity_index": 0
}
then function launch file
Livox Converter 2.0
take GPS The time signal of the module (GPRMC) adopt TTL turn usb Module access PC,PPS( Notice that this is TTL level ) Signal access LiDAR Synchronous port of adapter box (Sync Port).
View access PC Of usb Port name of the module ,
for example /dev/ttyUSB0,
Add to livox_lidar_config.json In file “timesync_config” Of “device_name”,
And then “enable_timesync” Configure to true,
Baud rate “baudrate_index” You can refer to Livox_ros_driver To configure specific values
"timesync_config": {
"enable_timesync": true,
"device_name": "/dev/ttyUSB0",
"comm_device_type": 0,
"baudrate_index": 2,
"parity_index": 0
}
then function launch file
Status check
By viewing timestamp_type data ,
If timestamp_type by 3, It means that the equipment is in progress GPS Time synchronization :
UTC Time format :
PPS How to use time synchronization
Livox LiDAR Every time I receive PPS After the rising edge of the signal , The point cloud time at the current time will be set to 0, Then start counting again until the next PPS The pulse is coming . We can use this feature , To achieve PPS Pulse pair LiDAR Synchronization of time .
The following is the pseudocode to implement this process :
// PPS Time Synchronization
static uint64_t lidar_time_last;
static uint64_t lidar_time_real;
// 1. Read the PPS rising edge time, Unit is nanosecond.
uint64_t pps_time_ns = get_pps_rising_nsecond();
// 2. Read LiDAR point time, Unit is nanosecond.
uint64_t lidar_time = get_lidar_pack_time();
// 3. Update real time.
if (lidar_time < lidar_time_last)
{
//LiDAR time jump indicates the generation of PPS rising edge.
lidar_time_real = pps_time_ns + lidar_time%(1000000000);
}
else
{
lidar_time_real += lidar_time - lidar_time_last;
}
//Update history
lidar_time_last = lidar_time;
Obtain by other means PPS Time information of rising edge , Corresponds to... In the above code get_pps_rising_nsecond() Interface .
边栏推荐
- ROS learning (21) robot slam function package -- installation and testing of orbslam
- sql中批量删除数据---实体中的集合
- SchedulX V1.4.0及SaaS版发布,免费体验降本增效高级功能!
- uva 1401 dp+Trie
- Analyze "C language" [advanced] paid knowledge [i]
- STM32F4---PWM输出
- Schedulx v1.4.0 and SaaS versions are released, and you can experience the advanced functions of cost reduction and efficiency increase for free!
- POJ 3177 redundant paths POJ 3352 road construction (dual connection)
- 2022 system integration project management engineer examination knowledge point: Mobile Internet
- How can I code for 8 hours without getting tired.
猜你喜欢
Blue Bridge Cup 2022 13th provincial competition real topic - block painting
Time synchronization of livox lidar hardware -- PPS method
Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
阿里云中间件开源往事
ROS learning (26) dynamic parameter configuration
【唯一】的“万字配图“ | 讲透【链式存储结构】是什么?
ROS学习(23)action通信机制
2022/0524/bookstrap
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
Recommended collection!! Which is the best flutter status management plug-in? Please look at the ranking list of yard farmers on the island!
随机推荐
Halcon knowledge: segment_ contours_ XLD operator
[leetcode] day97 remove linked list elements
SchedulX V1.4.0及SaaS版发布,免费体验降本增效高级功能!
ROS learning (24) plugin
ROS学习(二十)机器人SLAM功能包——rgbdslam的安装与测试
centos8 用yum 安装MySQL 8.0.x
UC伯克利助理教授Jacob Steinhardt预测AI基准性能:AI在数学等领域的进展比预想要快,但鲁棒性基准性能进展较慢
Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module
ROS learning (25) rviz plugin
Centros 8 installation MySQL Error: The gpg Keys listed for the "MySQL 8.0 Community Server" repository are already ins
Add PDF Title floating window
Introduction to microservice architecture
【论文阅读|深读】DNGR:Deep Neural Networks for Learning Graph Representations
建議收藏!!Flutter狀態管理插件哪家强?請看島上碼農的排行榜!
STM32F4---PWM输出
Stm32f4 --- general timer update interrupt
Correct use of BigDecimal
Command injection of cisp-pte
Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror
Analyze "C language" [advanced] paid knowledge [i]