当前位置:网站首页>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 .
边栏推荐
- New generation cloud native message queue (I)
- ROS learning (25) rviz plugin
- 【论文阅读|深读】DNGR:Deep Neural Networks for Learning Graph Representations
- Analyze "C language" [advanced] paid knowledge [II]
- Processing image files uploaded by streamlit Library
- ROS学习(23)action通信机制
- 张平安:加快云上数字创新,共建产业智慧生态
- 建议收藏!!Flutter状态管理插件哪家强?请看岛上码农的排行榜!
- Ros Learning (23) Action Communication Mechanism
- 组合导航:中海达iNAV2产品描述及接口描述
猜你喜欢
ROS learning (21) robot slam function package -- installation and testing of orbslam
ROS学习(21)机器人SLAM功能包——orbslam的安装与测试
Dall-E Mini的Mega版本模型发布,已开放下载
MySQL execution process and sequence
Cisp-pte practice explanation (II)
Blackfly S USB3工业相机:缓冲区处理
Analyze "C language" [advanced] paid knowledge [II]
刨析《C语言》【进阶】付费知识【二】
Flir Blackfly S USB3 工业相机:计数器和定时器的使用方法
ROS学习(22)TF变换
随机推荐
String to date object
【Unity】升级版·Excel数据解析,自动创建对应C#类,自动创建ScriptableObject生成类,自动序列化Asset文件
Flir Blackfly S USB3 工业相机:白平衡设置方法
Blue Bridge Cup 2022 13th provincial competition real topic - block painting
Batch delete data in SQL - set in entity
The last line of defense of cloud primary mixing department: node waterline design
Word wrap when flex exceeds width
FLIR blackfly s industrial camera: auto exposure configuration and code
ROS学习(十九)机器人SLAM功能包——cartographer
大咖云集|NextArch基金会云开发Meetup来啦!
Analyze "C language" [advanced] paid knowledge [i]
Modify the system time of Px4 flight control
Robot team learning method to achieve 8.8 times human return
Metaforce force meta universe development and construction - fossage 2.0 system development
Analyze "C language" [advanced] paid knowledge [End]
Halcon knowledge: segment_ contours_ XLD operator
MetaForce原力元宇宙开发搭建丨佛萨奇2.0系统开发
建议收藏!!Flutter状态管理插件哪家强?请看岛上码农的排行榜!
红外相机:巨哥红外MAG32产品介绍
centos8安裝mysql報錯:The GPG keys listed for the “MySQL 8.0 Community Server“ repository are already ins