| 163 | } |
| 164 | |
| 165 | void 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 | |
| 189 | void StaticLayer::UpdateCosts(Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j) { |
| 190 | if(!map_received_) { |
no test coverage detected