| 74 | } |
| 75 | |
| 76 | void InflationLayer::OnInitialize() { |
| 77 | |
| 78 | std::unique_lock<std::recursive_mutex> lock(*inflation_access_); |
| 79 | ros::NodeHandle nh("~/" + name_), g_nh; |
| 80 | is_current_ = true; |
| 81 | if (seen_) |
| 82 | delete[] seen_; |
| 83 | seen_ = NULL; |
| 84 | seen_size_ = 0; |
| 85 | need_reinflation_ = false; |
| 86 | double inflation_radius, cost_scaling_factor; |
| 87 | ParaInflationLayer para_inflation; |
| 88 | roborts_common::ReadProtoFromTextFile(layered_costmap_->GetFilePath().c_str(), ¶_inflation); |
| 89 | inflation_radius = para_inflation.inflation_radius(); |
| 90 | cost_scaling_factor = para_inflation.cost_scaling_factor(); |
| 91 | need_reinflation_ = false; |
| 92 | SetInflationParameters(inflation_radius, cost_scaling_factor); |
| 93 | is_enabled_ = true; |
| 94 | inflate_unknown_ = false; |
| 95 | need_reinflation_ = true; |
| 96 | MatchSize(); |
| 97 | } |
| 98 | |
| 99 | void InflationLayer::MatchSize() { |
| 100 | std::unique_lock<std::recursive_mutex> lock(*inflation_access_); |
nothing calls this directly
no test coverage detected