12.07.2015 Views

HDL-64E S2 manual_Rev C_2011 - Velodyne Lidar

HDL-64E S2 manual_Rev C_2011 - Velodyne Lidar

HDL-64E S2 manual_Rev C_2011 - Velodyne Lidar

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A P P E N DI X C : C O O R D I N AT E C A L C U L AT I O N A L G O R I T H M S A M P L E C O D E<strong>HDL</strong>-32E User’s ManuaICoordinate Calculation Algorithm Sample CodeAfter removing all the correction parameters except vertical correction,the calculation code is:firingData::computeCoords(guintl6 laserNum, boost::shared_ptr db,GLpos_t &pos){guintl6 idx = laserNum % VLS_LASER_PER_FIRING;boost::shared_ptr cal = db->getCalibration(laserNum);if (data->points[idx].distance == O) {coords[idx].setX(O.O);coords[idx].setY(O.O);coords[idx].setZ(O.O);return;}float distance = db->getDistLSB() * (float)data->points[idx].distance;II Get measured distance, distancelfloat cosVertAngle = cal->getCosVertCorrection();float sinVertAngle = cal->getSinVertCorrection();float cosRotAngle = rotCosTable[data->position];float sinRotAngle = rotSinTable[data->position];float xyDistance = distance * cosVertAngle; II Convert to X-Y planecoords[idx].setX(xyDistance * sinRotAngle + pos.getX()IVLS_DIM_SCALE);II Calculate X coordinatecoords[idx].setY(xyDistance * cosRotAngle + pos.getY()IVLS_DIM_SCALE);II Calculate Y coordinateIICalculate Z coordinatecoords[idx].setZ(distance * sinVertAngle + pos.getZ()IVLS_DIM_SCALE);}[ 22 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!