当前位置:网站首页>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 .
边栏推荐
- XML to map tool class xmlmaputils (tool class V)
- 一片叶子两三万?植物消费爆火背后的“阳谋”
- 刨析《C语言》【进阶】付费知识【一】
- 新一代云原生消息队列(一)
- Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
- Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
- 猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
- freeswitch拨打分机号源代码跟踪
- CISP-PTE之命令注入篇
- Make DIY welding smoke extractor with lighting
猜你喜欢

使用Ceres进行slam必须要弄清楚的几个类和函数

刨析《C语言》【进阶】付费知识【一】

ROS学习(25)rviz plugin插件

FLIR blackfly s usb3 industrial camera: white balance setting method

张平安:加快云上数字创新,共建产业智慧生态

Blackfly S USB3工业相机:缓冲区处理

JVM memory model

Flir Blackfly S 工业相机 介绍

Errors made in the development of merging the quantity of data in the set according to attributes

Introduction to microservice architecture
随机推荐
张平安:加快云上数字创新,共建产业智慧生态
How can I code for 8 hours without getting tired.
The GPG keys listed for the "MySQL 8.0 community server" repository are already ins
Livox激光雷达硬件时间同步---PPS方法
Errors made in the development of merging the quantity of data in the set according to attributes
Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror
Time synchronization of livox lidar hardware -- PPS method
【论文阅读|深读】DNGR:Deep Neural Networks for Learning Graph Representations
Image watermarking, scaling and conversion of an input stream
大咖云集|NextArch基金会云开发Meetup来啦!
The last line of defense of cloud primary mixing department: node waterline design
Make DIY welding smoke extractor with lighting
低代码平台中的数据连接方式(上)
传感器:DS1302时钟芯片及驱动代码
激光雷达:Ouster OS产品介绍及使用方法
Date processing tool class dateutils (tool class 1)
ROS学习(26)动态参数配置
【服务器数据恢复】raid损坏导致戴尔某型号服务器崩溃的数据恢复案例
处理streamlit库上传的图片文件
MetaForce原力元宇宙开发搭建丨佛萨奇2.0系统开发