diff --git a/nav2_costmap_2d/CMakeLists.txt b/nav2_costmap_2d/CMakeLists.txt
index f039cf5d42b..eeb9d61703e 100644
--- a/nav2_costmap_2d/CMakeLists.txt
+++ b/nav2_costmap_2d/CMakeLists.txt
@@ -17,6 +17,7 @@ find_package(rclcpp_lifecycle REQUIRED)
find_package(rmw REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
+find_package(vision_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2 REQUIRED)
@@ -48,6 +49,7 @@ add_library(nav2_costmap_2d_core SHARED
src/footprint.cpp
src/costmap_layer.cpp
src/observation_buffer.cpp
+ src/segmentation_buffer.cpp
src/clear_costmap_service.cpp
src/footprint_collision_checker.cpp
plugins/costmap_filters/costmap_filter.cpp
@@ -67,6 +69,7 @@ set(dependencies
rclcpp_lifecycle
sensor_msgs
std_msgs
+ vision_msgs
std_srvs
tf2
tf2_geometry_msgs
@@ -87,6 +90,7 @@ add_library(layers SHARED
src/observation_buffer.cpp
plugins/voxel_layer.cpp
plugins/range_sensor_layer.cpp
+ plugins/semantic_segmentation_layer.cpp
plugins/denoise_layer.cpp
)
ament_target_dependencies(layers
diff --git a/nav2_costmap_2d/costmap_plugins.xml b/nav2_costmap_2d/costmap_plugins.xml
index 6748cd5fcae..afdde92303c 100644
--- a/nav2_costmap_2d/costmap_plugins.xml
+++ b/nav2_costmap_2d/costmap_plugins.xml
@@ -15,6 +15,9 @@
A range-sensor (sonar, IR) based obstacle layer for costmap_2d
+
+ A plugin for semantic segmentation data produced by RGBD cameras
+
Filters noise-induced freestanding obstacles or small obstacles groups
diff --git a/nav2_costmap_2d/include/nav2_costmap_2d/segmentation.hpp b/nav2_costmap_2d/include/nav2_costmap_2d/segmentation.hpp
new file mode 100644
index 00000000000..fd653d9ad24
--- /dev/null
+++ b/nav2_costmap_2d/include/nav2_costmap_2d/segmentation.hpp
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2008, 2013, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Willow Garage, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Pedro Gonzalez
+ */
+
+#ifndef NAV2_COSTMAP_2D__SEGMENTATION_HPP_
+#define NAV2_COSTMAP_2D__SEGMENTATION_HPP_
+
+#include
+#include