
A P P E N
[ 22 ]
:
O O R
N A
E
A L
L A
O N A L G O R
H M
A M P L E
O
E
H
D
L
-
32
E
U
s
e
r
’
s
M
a
nu
a
I
Coordinate Calculation Algorithm Sample Code
After removing all the correction parameters except vertical correction,
the calculation code is:
firingData::computeCoords(guintl6 laserNum, boost::shared_ptr<CalibrationDB> db,
GLpos_t &pos)
{
guintl6 idx = laserNum % VLS_LASER_PER_FIRING;
boost::shared_ptr<CalibrationPoint> 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, distancel
float 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 plane
coords[idx].setX(xyDistance * sinRotAngle + pos.getX()IVLS_DIM_SCALE);
II Calculate X coordinate
coords[idx].setY(xyDistance * cosRotAngle + pos.getY()IVLS_DIM_SCALE);
II Calculate Y coordinate
IICalculate Z coordinate
coords[idx].setZ(distance * sinVertAngle + pos.getZ()IVLS_DIM_SCALE);
}
Kommentare zu diesen Handbüchern