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

Method OnInitialize

roborts_costmap/src/inflation_layer.cpp:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void 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(), &para_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
99void InflationLayer::MatchSize() {
100 std::unique_lock<std::recursive_mutex> lock(*inflation_access_);

Callers

nothing calls this directly

Calls 2

ReadProtoFromTextFileFunction · 0.85
GetFilePathMethod · 0.80

Tested by

no test coverage detected