@@ -104,6 +104,7 @@ void Costmap2DROS::init()
104104 declare_parameter (" map_vis_z" , rclcpp::ParameterValue (0.0 ));
105105 declare_parameter (" footprint_padding" , rclcpp::ParameterValue (0 .01f ));
106106 declare_parameter (" footprint" , rclcpp::ParameterValue (std::string (" []" )));
107+ declare_parameter (" footprint_topic" , rclcpp::ParameterValue (std::string (" footprint" )));
107108 declare_parameter (" global_frame" , rclcpp::ParameterValue (std::string (" map" )));
108109 declare_parameter (" height" , rclcpp::ParameterValue (5 ));
109110 declare_parameter (" width" , rclcpp::ParameterValue (5 ));
@@ -212,7 +213,7 @@ Costmap2DROS::on_configure(const rclcpp_lifecycle::State & /*state*/)
212213
213214 // Create the publishers and subscribers
214215 footprint_sub_ = create_subscription<geometry_msgs::msg::Polygon>(
215- " footprint " ,
216+ footprint_topic_ ,
216217 rclcpp::SystemDefaultsQoS (),
217218 std::bind (&Costmap2DROS::setRobotFootprintPolygon, this , std::placeholders::_1));
218219
@@ -393,6 +394,7 @@ Costmap2DROS::getParameters()
393394 get_parameter (" always_send_full_costmap" , always_send_full_costmap_);
394395 get_parameter (" map_vis_z" , map_vis_z_);
395396 get_parameter (" footprint" , footprint_);
397+ get_parameter (" footprint_topic" , footprint_topic_);
396398 get_parameter (" footprint_padding" , footprint_padding_);
397399 get_parameter (" global_frame" , global_frame_);
398400 get_parameter (" height" , map_height_meters_);
0 commit comments