Livox-SDK / livox_ros_driver

Livox device driver under ros, support Lidar Mid-40, Mid-70, Tele-15, Horizon, Avia.
Other
363 stars 203 forks source link

PPS 同步的时间戳问题 #85

Closed Stevenhyh1 closed 3 years ago

Stevenhyh1 commented 3 years ago

在使用PPS同步时,按照documentation点云的时间应该是从归零后重新开始计算,也就是小于一秒。但实际发布的点云时间是ros time now,导致我没有办法按照教程中的伪代码写同步程序。请问这个问题怎么解决?

Livox-SDK commented 3 years ago

pps 同步模式下,ros driver 在点云的原始时间戳基础上补偿了接收时间;将 lds.cpp 中部分代码注释掉,可以得到你想要的结果: image 具体处理方式如下:
if (raw_packet->timestamp_type == kTimestampTypePps) { //if (data_src != kSourceLvxFile) { // return (timestamp.stamp + packet->time_rcv); //} else { return timestamp.stamp; //} } else if (raw_packet->timestamp_type == kTimestampTypeNoSync) {

Stevenhyh1 commented 3 years ago

It works. Thank you!