|
@@ -128,20 +128,25 @@ int leishen32::DecodeUDPPac(iv::lidarudppac & xpac)
|
|
|
unsigned short * pazu = reinterpret_cast<unsigned short * >(pstrpac + 2);
|
|
|
double fazu = *pazu;
|
|
|
fazu = fazu * 0.01;
|
|
|
- fazu = fazu * M_PI/180.0;
|
|
|
+
|
|
|
pcl::PointXYZI point;
|
|
|
+ // std::cout<<" fazu: "<<fazu<<std::endl;
|
|
|
|
|
|
|
|
|
if(fabs(fazu-gAngleOld)>=300)
|
|
|
{
|
|
|
gAngleTotal = gAngleTotal + fabs(fabs(fazu-gAngleOld)-360);
|
|
|
+ // std::cout<<" add : "<<fabs(fabs(fazu-gAngleOld)-360)<<std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
gAngleTotal = gAngleTotal + fabs(fabs(fazu-gAngleOld));
|
|
|
}
|
|
|
+
|
|
|
gAngleOld = fazu;
|
|
|
|
|
|
+ fazu = fazu * M_PI/180.0;
|
|
|
+
|
|
|
if(gAngleTotal>360.0)
|
|
|
{
|
|
|
gAngleTotal = 0.0;
|
|
@@ -209,8 +214,12 @@ int leishen32::DecodeDevinfo(iv::lidarudppac & xpac)
|
|
|
}
|
|
|
|
|
|
char * pstr = static_cast<char * >(xpac.mdata_ptr.get()) ;
|
|
|
- unsigned short * pmoterspeed = reinterpret_cast<unsigned short *>(pstr+8);// ( unsigned short *)(pstr+8);
|
|
|
- mdevinfo.motorspeed = *pmoterspeed;
|
|
|
+ // unsigned short * pmoterspeed = reinterpret_cast<unsigned short *>(pstr+8);// ( unsigned short *)(pstr+8);
|
|
|
+ // qDebug("%02x %02x",pstr[8],pstr[9]);
|
|
|
+ mdevinfo.motorspeed = pstr[8] * 256 + pstr[9];
|
|
|
+ // mdevinfo.motorspeed = *pmoterspeed;
|
|
|
+
|
|
|
+ std::cout<<" motor speed: "<<mdevinfo.motorspeed<<std::endl;
|
|
|
|
|
|
unsigned short * pmotorun = reinterpret_cast<unsigned short * >(pstr+40);
|
|
|
if(*pmotorun == 1)
|