Skip to content

Commit

Permalink
fixed timestamp error for system high payload
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuyuan committed Sep 24, 2020
1 parent 6dc2502 commit f62446a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CYdLidar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ bool CYdLidar::doProcessSimple(LaserScan &outscan) {
uint64_t startTs = tim_scan_start;
result_t op_result = lidarPtr->grabScanData(global_nodes, count);
uint64_t tim_scan_end = getTime();
uint64_t endTs = tim_scan_end;
uint64_t sys_scan_time = tim_scan_end - tim_scan_start;
outscan.points.clear();

Expand Down Expand Up @@ -521,7 +522,8 @@ bool CYdLidar::doProcessSimple(LaserScan &outscan) {
tim_scan_end = tim_scan_start + scan_time;
}

if ((last_node_time + m_PointTime) >= tim_scan_start) {
if ((last_node_time + m_PointTime) >= tim_scan_start &&
(last_node_time + m_PointTime) < endTs - scan_time) {
tim_scan_start = last_node_time + m_PointTime;
tim_scan_end = tim_scan_start + scan_time;
}
Expand Down

0 comments on commit f62446a

Please sign in to comment.