update file voxel_layer
This commit is contained in:
@@ -46,7 +46,9 @@ void Costmap2D::deleteMaps()
|
||||
void Costmap2D::initMaps(unsigned int size_x, unsigned int size_y)
|
||||
{
|
||||
boost::unique_lock<mutex_t> lock(*access_);
|
||||
delete[] costmap_; // Xóa vùng nhớ cũ nếu có
|
||||
if (costmap_ != nullptr) {
|
||||
delete[] costmap_;
|
||||
}
|
||||
costmap_ = new unsigned char[size_x * size_y]; // Mỗi ô lưu 1 byte (0–255)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user