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

Method LoadParameter

roborts_costmap/src/costmap_interface.cpp:132–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void CostmapInterface::LoadParameter() {
133
134 ParaCollection ParaCollectionConfig;
135 roborts_common::ReadProtoFromTextFile(config_file_.c_str(), \
136 &ParaCollectionConfig);
137
138
139 config_file_ = ros::package::getPath("roborts_costmap") + \
140 ParaCollectionConfig.para_costmap_interface().inflation_file_path();
141
142 map_update_frequency_ = ParaCollectionConfig.para_costmap_interface().map_update_frequency();
143 global_frame_ = ParaCollectionConfig.para_costmap_interface().global_frame();
144 robot_base_frame_ = ParaCollectionConfig.para_costmap_interface().robot_base_frame();
145 footprint_padding_ = ParaCollectionConfig.para_costmap_interface().footprint_padding();
146 transform_tolerance_ = ParaCollectionConfig.para_costmap_interface().transform_tolerance();
147 is_rolling_window_ = ParaCollectionConfig.para_costmap_interface().is_rolling_window();
148 is_debug_ = ParaCollectionConfig.para_basic().is_debug();
149 is_track_unknown_ = ParaCollectionConfig.para_costmap_interface().is_tracking_unknown();
150 has_obstacle_layer_ = ParaCollectionConfig.para_costmap_interface().has_obstacle_layer();
151 has_static_layer_ = ParaCollectionConfig.para_costmap_interface().has_static_layer();
152 map_width_ = ParaCollectionConfig.para_costmap_interface().map_width();
153 map_height_ = ParaCollectionConfig.para_costmap_interface().map_height();
154 map_origin_x_ = ParaCollectionConfig.para_costmap_interface().map_origin_x();
155 map_origin_y_ = ParaCollectionConfig.para_costmap_interface().map_origin_y();
156 map_resolution_ = ParaCollectionConfig.para_costmap_interface().map_resolution();
157
158
159 config_file_inflation_ = ros::package::getPath("roborts_costmap") + \
160 ParaCollectionConfig.para_costmap_interface().inflation_file_path();
161
162 geometry_msgs::Point point;
163 for (auto i = 0; i < ParaCollectionConfig.footprint().point().size(); i++) {
164 point.x = ParaCollectionConfig.footprint().point(i).x();
165 point.y = ParaCollectionConfig.footprint().point(i).y();
166 point.z = 0.0;
167 footprint_points_.push_back(point);
168 }
169}
170
171void CostmapInterface::SetUnpaddedRobotFootprintPolygon(const geometry_msgs::Polygon &footprint) {
172 SetUnpaddedRobotFootprint(ToPointVector(footprint));

Callers

nothing calls this directly

Calls 1

ReadProtoFromTextFileFunction · 0.85

Tested by

no test coverage detected