273 {
274 Eigen::Vector2d center(trans(0), trans(1));
277
278
280
283
284 map_node_idx[0][1] = map_node_idx[0][0];
285 map_node_idx[0][1].n_ += 1;
286
287 map_node_idx[1][0] = map_node_idx[0][0];
288 map_node_idx[1][0].m_ += 1;
289
290 map_node_idx[1][1] = map_node_idx[0][0];
291 map_node_idx[1][1].n_ += 1;
292 map_node_idx[1][1].m_ += 1;
293
294
296 for (unsigned int y = 0; y < 2; ++y) {
297 for (unsigned int x = 0; x < 2; ++x) {
298 map_node[y][x] =
300 }
301 }
302
303
304 unsigned int coord_x = 0;
305 unsigned int coord_y = 0;
306 map_node[0][0]->
GetCoordinate(left_top_corner, &coord_x, &coord_y);
308
309 int coord_xi = coord_x;
310 int coord_yi = coord_y;
311 int range_xs[2][2] = {0};
312 int range_ys[2][2] = {0};
315 range_xs[0][1] = coord_xi;
316 range_xs[1][1] = coord_xi;
319 range_ys[1][0] = coord_yi;
320 range_ys[1][1] = coord_yi;
321
322 int src_xs[2][2] = {0};
323 int src_ys[2][2] = {0};
324 src_xs[0][0] = coord_xi;
325 src_xs[1][0] = coord_xi;
326 src_xs[0][1] = 0;
327 src_xs[1][1] = 0;
328 src_ys[0][0] = coord_yi;
329 src_ys[0][1] = coord_yi;
330 src_ys[1][0] = 0;
331 src_ys[1][1] = 0;
332
333 int dst_xs[2][2] = {0};
334 int dst_ys[2][2] = {0};
335 dst_xs[0][0] = 0;
336 dst_xs[1][0] = 0;
339 dst_ys[0][0] = 0;
340 dst_ys[0][1] = 0;
343
344 for (int i = 0; i < 2; ++i) {
345 for (int j = 0; j < 2; ++j) {
346 int range_x = range_xs[i][j];
347 int range_y = range_ys[i][j];
348 int src_x = src_xs[i][j];
349 int src_y = src_ys[i][j];
350 int dst_x = dst_xs[i][j];
351 int dst_y = dst_ys[i][j];
354 FloatMatrix* intensity_matrix = map_cells.GetIntensityMatrix(0);
355 FloatMatrix* intensity_var_matrix = map_cells.GetIntensityVarMatrix(0);
356 FloatMatrix* altitude_matrix = map_cells.GetAltitudeMatrix(0);
357 UIntMatrix* count_matrix = map_cells.GetCountMatrix(0);
358 for (int y = 0; y < range_y; ++y) {
360 for (int x = 0; x < range_x; ++x) {
361 int dst_idx = dst_base_x + x;
363 (*intensity_matrix)[src_y + y][src_x + x];
365 (*intensity_var_matrix)[src_y + y][src_x + x];
367 (*altitude_matrix)[src_y + y][src_x + x];
369 (*count_matrix)[src_y + y][src_x + x];
370 }
371 }
372 }
373 }
374}
apollo::localization::msf::pyramid_map::FloatMatrix FloatMatrix
apollo::localization::msf::pyramid_map::UIntMatrix UIntMatrix
apollo::localization::msf::pyramid_map::PyramidMapMatrix PyramidMapMatrix
apollo::localization::msf::pyramid_map::MapNodeIndex MapNodeIndex
apollo::localization::msf::pyramid_map::PyramidMapNode PyramidMapNode
BaseMapNode * GetMapNodeSafe(const MapNodeIndex &index)
Return the map node, if it's not in the cache, safely load it.
const BaseMapConfig & GetMapConfig() const
Get the map config.
static MapNodeIndex GetMapNodeIndex(const BaseMapConfig &option, const Eigen::Vector3d &coordinate, unsigned int resolution_id, int zone_id)
Construct a map node index, given a global coordinate, eigen version.
bool GetCoordinate(const Eigen::Vector2d &coordinate, unsigned int level, unsigned int *x, unsigned int *y) const
Given the global coordinate, get the local 2D coordinate of the map cell matrix.