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

Method UpdateBounds

roborts_costmap/src/static_layer.cpp:165–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void StaticLayer::UpdateBounds(double robot_x,
166 double robot_y,
167 double robot_yaw,
168 double *min_x,
169 double *min_y,
170 double *max_x,
171 double *max_y) {
172 double wx, wy;
173 if(!layered_costmap_->IsRollingWindow()) {
174 if(!map_received_ || !(has_updated_data_ || has_extra_bounds_)) {
175 return;
176 }
177 }
178 //just make sure the value is normal
179 UseExtraBounds(min_x, min_y, max_x, max_y);
180 Map2World(staic_layer_x_, staic_layer_y_, wx, wy);
181 *min_x = std::min(wx, *min_x);
182 *min_y = std::min(wy, *min_y);
183 Map2World(staic_layer_x_+ width_, staic_layer_y_ + height_, wx, wy);
184 *max_x = std::max(*max_x, wx);
185 *max_y = std::max(*max_y, wy);
186 has_updated_data_ = false;
187}
188
189void StaticLayer::UpdateCosts(Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j) {
190 if(!map_received_) {

Callers 1

UpdateMapMethod · 0.45

Calls 1

IsRollingWindowMethod · 0.80

Tested by

no test coverage detected