// Applies the 'odds' specified when calling ComputeLookupTableToApplyOdds()
// to the probability of the cell at 'xy_index' if the cell has not already
// been updated. Multiple updates of the same cell will be ignored until
// StartUpdate() is called. Returns true if the cell was updated.
//
// If this is the first call to ApplyOdds() for the specified cell, its value
// will be set to probability corresponding to 'odds'.
这里就是log odds 表示 ,如果没被更新过 则更新, 多次更新相同的cell会被忽略 。如果
bool ApplyLookupTable(const Eigen::Array2i& xy_index,
const std::vector<uint16>& table) {
DCHECK_EQ(table.size(), mapping::kUpdateMarker);
const int cell_index = GetIndexOfCell(xy_index);
uint16& cell = cells_[cell_index];
if (cell >= mapping::kUpdateMarker) {
return false;
}
update_indices_.push_back(cell_index);
cell = table[cell];
DCHECK_GE(cell, mapping::kUpdateMarker);
UpdateBounds(xy_index);
return true;
}
/// xlimit * y +x 等于格子数
int GetIndexofCell(const Eigen::Array2i & xy_index)
{
return (maplimits_.Getcelllimits().num_x_cells*xy_index.y()+xy_index.x() );
}
/sensor data
这里是谷歌最难得一步
add sensor data 有trajectory builder 的
真正实现是一个collator 然后有下面的
private:
// Queue keys are a pair of trajectory ID and sensor identifier.
OrderedMultiQueue queue_;