Part Number: TDA3
Below is a a piece of code extracted from radarDraw_priv.c in which it draws the targets on the Angle plot. We are trying to use the same plot for our LRR use case.
I have questions in the lines highlighted below. Our angles are +-3 deg and the Range goes from 0 -> 330 meters. software angle resolution are 0.1 within the +-3 deg.
Our range resolution are 1.3m. We keep width of the V the same as in the SRR vision SDK use case.
Int32 RadarDraw_drawRadarObjects(AlgorithmFxn_RadarDrawObj *pObj) { UInt32 idx; AlgorithmFxn_RadarBeamFormBuffDescriptor *pRadarOutput; RadarDraw_targetInformation target; Int32 angle; double currAzimAngle, currRange; Int32 maxVelocityBinNum, midPoint; pRadarOutput = pObj->detectedObjs; maxVelocityBinNum = pObj->algLinkCreateParams.maxVelocityBinNum[pRadarOutput->profileId]; midPoint = maxVelocityBinNum/2; for (idx = 0; idx < pRadarOutput->numDetections; idx++) { angle = (pObj->algLinkCreateParams.numHorzAngles - 1)/2; /* Create mirror image of angle */ // Khai: angleBin of 0 equals to currAzimAngle of 6 degree. That means // angleBin 0 maps to the +3 degree angle and angleBin currAzimAngle = -(((Int32)(pRadarOutput->objBuf[idx].angleBin % pObj->algLinkCreateParams.numHorzAngles) - angle)* pObj->algLinkCreateParams.azimAngleRes[pRadarOutput->profileId]); #if defined(AWR1243_METAWAVE_LRR_CONFIG) /* Current Range is in meter */ currRange = pRadarOutput->objBuf[idx].range * pObj->algLinkCreateParams.rangeRes[pRadarOutput->profileId]; #else /* Current Range is in cm */ currRange = 100 * pRadarOutput->objBuf[idx].range * pObj->algLinkCreateParams.rangeRes[pRadarOutput->profileId]; #endif
// what does this mean to check for (currRange * 2)/pObj->scale) < pObj->radius) ??? if (((currAzimAngle < angle) && (currAzimAngle > -angle)) && (((currRange * 2)/pObj->scale) < pObj->radius) && (pRadarOutput->objBuf[idx].energy > 0)) { // Khai: multiply 10 here to place the target angle in a 10x widen AoA plot target.angle = (Int32) (currAzimAngle * 2 * 10); target.distance = (Int32) ((currRange * 2)/ pObj->scale); // Khai: why * 2 and / scale ??? if (pRadarOutput->objBuf[idx].velocity >= midPoint) { target.relSpeed = ((Int32)pRadarOutput->objBuf[idx].velocity - maxVelocityBinNum)* pObj->algLinkCreateParams.velocityRes[ pRadarOutput->profileId]; } else { target.relSpeed = pRadarOutput->objBuf[idx].velocity * pObj->algLinkCreateParams.velocityRes[ pRadarOutput->profileId]; } RadarDraw_plotTarget(pObj, pObj->centerX, pObj->centerY, pObj->radius, &target); } else { //Vps_printf("RadarDrawLink: obj [%d] is out of range for display!! ", idx); } }