aPPendix c: coordinate caLcuLation aLGoritHM saMPLe code
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 =
if
}
float distance =
float cosVertAngle =
float cosRotAngle =
float xyDistance = distance * cosVertAngle; // Convert to
// 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 ]