Velodyne Acoustics HDL-32E user manual APPendix c coordinate caLcuLation aLGoritHM saMPLe code

Page 25

aPPendix c: coordinate caLcuLation aLGoritHM saMPLe code

HDL-32E User’s Manual

Coordinate Calculation Algorithm Sample Code

After removing all the correction parameters except vertical correction, the calculation code is:

firingData::computeCoords(guint16 laserNum, boost::shared_ptr<CalibrationDB> db, GLpos_t &pos)

{

guint16 idx = laserNum % VLS_LASER_PER_FIRING;

boost::shared_ptr<CalibrationPoint> cal = db->getCalibration(laserNum);

if (data->points[idx].distance == 0) { coords[idx].setX(0.0); coords[idx].setY(0.0); coords[idx].setZ(0.0); return;

}

float distance = db->getDistLSB() * (float)data->points[idx].distance; // Get measured distance, distance1

float cosVertAngle = cal->getCosVertCorrection(); float sinVertAngle = cal->getSinVertCorrection();

float cosRotAngle = rotCosTable[data->position]; float sinRotAngle = rotSinTable[data->position];

float xyDistance = distance * cosVertAngle; // Convert to X-Y plane coords[idx].setX(xyDistance * sinRotAngle + pos.getX()/VLS_DIM_SCALE);

// Calculate X coordinate

coords[idx].setY(xyDistance * cosRotAngle + pos.getY()/VLS_DIM_SCALE); // Calculate Y coordinate

//Calculate Z coordinate

coords[idx].setZ(distance * sinVertAngle + pos.getZ()/VLS_DIM_SCALE);

}

[ 22 ]

Image 25
Contents E R ’ S M a N U a L a N D HDL-32EHDL-32E Sample Data Packets Digital Sensor Recorder DSRCoordinate Calculation Algorithm Sample Code Calibration and OrientationPage Introduction Principles of Operation PrinciPLes of oPerationCase Contents SetuPMount Base Wiring Connect Power and ComputerOperate WeatherHDL-32 MAC ID and IP address format Mac ID UsaGeIP Address UsaGe GPS Receiver Option 1 Velodyne Supplied GPS Receiver External GPS Time SynchronizationGPS Receiver Option 2 Customer’s GPS Receiver Images below show the GPS receiver included with the HDL-32E Time Stamping Accuracy Rules Packet Format and Status Byte for GPS Time StampingLaser Timing Firing order Laser Firing SequenceVertical angle Problem Resolution TrouBLesHootinGSerVice and Maintenance SPecifications APPendix a diGitaL sensor recorder dsr InstallCalibrate Live PlaybackPlayback of Recorded files APPendix aAxis Rotation ZoomShift RotationalData Packet Format APPendix B HdL-32e saMPLe data PacKetsAPPendix B Figure B2 Positioning PacketFigure B3 Nmea Sentence Time StampEthernet Packet Example APPendix c coordinate caLcuLation aLGoritHM saMPLe code Calibration and Orientation APPendix d caLiBration and orientationLaser Spot Size Distance CalibrationAPPendix e etHernet transit tiMinG taBLe Velodyne LiDAR, Inc