From 537ad2ab54ac3b7ed256472533fc11411d4bd83b Mon Sep 17 00:00:00 2001 From: yangfuyuan Date: Wed, 18 Jul 2018 15:05:12 +0800 Subject: [PATCH] initial scan frequency to zero --- sdk/src/ydlidar_driver.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/src/ydlidar_driver.cpp b/sdk/src/ydlidar_driver.cpp index e160cfd..09b9860 100644 --- a/sdk/src/ydlidar_driver.cpp +++ b/sdk/src/ydlidar_driver.cpp @@ -472,15 +472,16 @@ namespace ydlidar{ uint32_t size = (m_intensities)?sizeof(node_package):sizeof(node_packages); uint8_t* recvBuffer = new uint8_t[size]; - uint32_t waitTime; - uint64_t ns; + uint32_t waitTime = 0; + uint64_t ns = getTime(); uint8_t *packageBuffer = (m_intensities)?(uint8_t*)&package.package_Head:(uint8_t*)&packages.package_Head; uint8_t package_Sample_Num = 0; - int32_t AngleCorrectForDistance; + int32_t AngleCorrectForDistance = 0; int package_recvPos = 0; - uint8_t package_type; - uint8_t scan_frequence; + uint8_t package_type = 0; + uint8_t scan_frequence = 0; + (*node).scan_frequence = 0; if(package_Sample_Index == 0) { recvPos = 0; while ((waitTime=getms() - startTs) <= timeout) {