average a linked list of points to handle a case where we have more than one point per h, laserPos
| 128 | |
| 129 | // average a linked list of points to handle a case where we have more than one point per h, laserPos |
| 130 | PointCloudPoint PointCloud::AverageList(ListOfCloudPoints *thisList) |
| 131 | { |
| 132 | double number = double(thisList->GetCount()); |
| 133 | |
| 134 | double sumDist = 0; |
| 135 | |
| 136 | PointCloudPoint *point = NULL; |
| 137 | |
| 138 | // iterate over the list and average all values |
| 139 | for ( ListOfCloudPoints::Node *node = thisList->GetFirst(); node; node = node->GetNext() ) |
| 140 | { |
| 141 | |
| 142 | point = node->GetData(); |
| 143 | sumDist += point->dist; |
| 144 | } |
| 145 | |
| 146 | if (point == NULL) |
| 147 | { |
| 148 | return PointCloudPoint(0, 0, 0, 0, 0, 0, 0, 0, 0); |
| 149 | } |
| 150 | |
| 151 | return PointCloudPoint(sumDist/number, point->theta, point->phi, point->r, point->g, point->b, point->w, point->h, point->laserPosition); |
| 152 | |
| 153 | } |
nothing calls this directly
no test coverage detected