当前位置:网站首页>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 .
边栏推荐
- Blackfly S USB3工业相机:缓冲区处理
- Correct use of BigDecimal
- Metaforce force meta universe development and construction - fossage 2.0 system development
- Redis tool class redisutil (tool class III)
- npm install 编译时报“Cannot read properties of null (reading ‘pickAlgorithm‘)“
- ROS学习(二十)机器人SLAM功能包——rgbdslam的安装与测试
- Cat recycling bin
- Jacob Steinhardt, assistant professor of UC Berkeley, predicts AI benchmark performance: AI has made faster progress in fields such as mathematics than expected, but the progress of robustness benchma
- 张平安:加快云上数字创新,共建产业智慧生态
- The use of video in the wiper component causes full screen dislocation
猜你喜欢
猿桌派第三季开播在即,打开出海浪潮下的开发者新视野
一片葉子兩三萬?植物消費爆火背後的“陽謀”
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
LeetCode. Sword finger offer 62 The last remaining number in the circle
The GPG keys listed for the "MySQL 8.0 community server" repository are already ins
Cat recycling bin
激光雷达:Ouster OS产品介绍及使用方法
ROS learning (22) TF transformation
2022/0524/bookstrap
Batch delete data in SQL - set in entity
随机推荐
最近小程序开发记录
新一代云原生消息队列(一)
Curl command
C language [23] classic interview questions [Part 2]
Seconds understand the delay and timing function of wechat applet
强化学习如何用于医学影像?埃默里大学最新《强化学习医学影像分析》综述,阐述最新RL医学影像分析概念、应用、挑战与未来方向
FLIR blackfly s industrial camera: configure multiple cameras for synchronous shooting
ROS学习(二十)机器人SLAM功能包——rgbdslam的安装与测试
2022 system integration project management engineer examination knowledge point: Mobile Internet
ROS learning (25) rviz plugin
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
Blackfly s usb3 industrial camera: buffer processing
New generation cloud native message queue (I)
Threadlocalutils (tool class IV)
The foreground downloads network pictures without background processing
uva 1401 dp+Trie
ROS学习(22)TF变换
@Before, @after, @around, @afterreturning execution sequence
How to use strings as speed templates- How to use String as Velocity Template?
FLIR blackfly s industrial camera: explanation and configuration of color correction and code setting method