@@ -57,10 +57,8 @@ static const auto registration_ =
5757
5858}
5959
60- using spark_dsg::Color;
6160using spark_dsg::DynamicSceneGraph;
6261using spark_dsg::SceneGraphLayer;
63- using spark_dsg::SceneGraphNode;
6462using spark_dsg::TraversabilityNodeAttributes;
6563using spark_dsg::TraversabilityState;
6664using spark_dsg::TravNodeAttributes;
@@ -70,6 +68,7 @@ using visualization_msgs::msg::MarkerArray;
7068void declare_config (TraversabilityPlugin::Config& config) {
7169 using namespace config ;
7270 name (" TraversabilityPlugin::Config" );
71+ field (config.layer , " layer" );
7372 field (config.colors , " colors" );
7473 field (config.slice_height , " slice_height" , " m" );
7574 field (config.line_width , " line_width" , " m" );
@@ -110,11 +109,13 @@ void TraversabilityPlugin::reset(const std_msgs::msg::Header& header) {
110109void TraversabilityPlugin::fillMarkers (const std_msgs::msg::Header& header,
111110 const DynamicSceneGraph& graph,
112111 MarkerArray& msg) const {
113- auto layer = graph.findLayer (spark_dsg::DsgLayers::TRAVERSABILITY);
112+ const auto config = config_.get ();
113+ auto layer = graph.findLayer (config.layer );
114114 if (!layer) {
115115 return ;
116116 }
117- drawBoundaries (config_.get (), header, *layer, msg);
117+
118+ drawBoundaries (config, header, *layer, msg);
118119}
119120
120121void TraversabilityPlugin::drawBoundaries (const Config& config,
@@ -151,10 +152,9 @@ void TraversabilityPlugin::drawBoundaries(const Config& config,
151152 }
152153}
153154
154- void TraversabilityPlugin::drawBlockBoundary (
155- const Config& config,
156- const spark_dsg::TraversabilityNodeAttributes& attrs,
157- visualization_msgs::msg::Marker& marker) const {
155+ void TraversabilityPlugin::drawBlockBoundary (const Config& config,
156+ const TraversabilityNodeAttributes& attrs,
157+ Marker& marker) const {
158158 // Get the world frame positions of the boundary points, adjusted for the line width
159159 // for non-overlapping rendering. bot-right, bot-left, top-left, top-right
160160 std::vector<Eigen::Vector3d> pts;
@@ -205,10 +205,9 @@ void TraversabilityPlugin::drawBlockBoundary(
205205 }
206206}
207207
208- void TraversabilityPlugin::drawRegionBoundary (
209- const Config& config,
210- const TravNodeAttributes& attrs,
211- visualization_msgs::msg::Marker& marker) const {
208+ void TraversabilityPlugin::drawRegionBoundary (const Config& config,
209+ const TravNodeAttributes& attrs,
210+ Marker& marker) const {
212211 marker.type = Marker::LINE_STRIP;
213212 for (size_t i = 0 ; i < attrs.radii .size (); ++i) {
214213 tf2::convert (attrs.getBoundaryPoint (i), marker.points .emplace_back ());
0 commit comments