|
@@ -319,7 +319,10 @@ int lidar_bkdriver::setState(lidarAPi::DEB_PROGRM_S &program)
|
|
|
|
|
|
int lidar_bkdriver::RecvRawThread()
|
|
|
{
|
|
|
- const int MAXPACLEN = 60000;
|
|
|
+ const int MAXPACLEN = 90000;
|
|
|
+ std::shared_ptr<unsigned char> plast_ptr;
|
|
|
+ int nlast = 0;
|
|
|
+
|
|
|
while(mbRun)
|
|
|
{
|
|
|
std::shared_ptr<unsigned char> pread = std::shared_ptr<unsigned char>(new unsigned char[MAXPACLEN]);
|
|
@@ -333,6 +336,32 @@ int lidar_bkdriver::RecvRawThread()
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ if(ret%1184 != 0)
|
|
|
+ {
|
|
|
+ std::cout<<" read a not complete packet. size: "<<ret<<std::endl;
|
|
|
+ if((nlast + ret )%1184 == 0)
|
|
|
+ {
|
|
|
+ std::cout<<" now add last is ok."<<std::endl;
|
|
|
+ std::shared_ptr<unsigned char> pt1 = pread;
|
|
|
+ pread = std::shared_ptr<unsigned char>(new unsigned char[nlast + ret]);
|
|
|
+ memcpy(pread.get(),plast_ptr.get(),nlast);
|
|
|
+ memcpy(pread.get()+nlast,pt1.get(),ret);
|
|
|
+ ret = ret + nlast;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ret%1184 != 0)
|
|
|
+ {
|
|
|
+ plast_ptr = pread;
|
|
|
+ nlast = ret;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ nlast = 0;
|
|
|
+ }
|
|
|
+
|
|
|
mmutexrawdata.lock();
|
|
|
if(mvecterraw.size()>100)
|
|
|
{
|