MCPcopy Create free account
hub / github.com/RoboMaster/RoboRTS / CopyCostMapWindow

Method CopyCostMapWindow

roborts_costmap/src/costmap_2d.cpp:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109bool Costmap2D::CopyCostMapWindow(const Costmap2D &map,
110 double w_origin_x,
111 double w_origin_y,
112 double w_size_x,
113 double w_size_y) {
114 if (this == &map)
115 return false;
116 DeleteMaps();
117 unsigned int lower_left_x, lower_left_y, upper_right_x, upper_right_y;
118 if (!(map.World2Map(w_origin_x, w_origin_y, lower_left_x, lower_left_y)) || !(map.World2Map(w_origin_x + w_size_x, \
119 w_origin_y + w_size_y, upper_right_x, upper_right_y)))
120 return false;
121 size_x_ = upper_right_x - lower_left_x;
122 size_y_ = upper_right_y - lower_left_y;
123 resolution_ = map.resolution_;
124 origin_x_ = w_origin_x;
125 origin_y_ = w_origin_y;
126 InitMaps(size_x_, size_y_);
127 CopyMapRegion(map.costmap_, costmap_, map.size_x_, size_x_, lower_left_x, lower_left_y, 0, 0, size_x_, size_y_);
128 return true;
129}
130
131Costmap2D &Costmap2D::operator=(const Costmap2D &map) {
132 // check for self assignement

Callers

nothing calls this directly

Calls 1

World2MapMethod · 0.80

Tested by

no test coverage detected