1515#ifndef NAV2_COSTMAP_2D__BOUNDED_TRACKING_ERROR_LAYER_HPP_
1616#define NAV2_COSTMAP_2D__BOUNDED_TRACKING_ERROR_LAYER_HPP_
1717
18+ #include < atomic>
1819#include < vector>
1920#include < memory>
2021#include < mutex>
2526#include " nav2_costmap_2d/layer.hpp"
2627#include " nav_msgs/msg/path.hpp"
2728#include " nav2_msgs/msg/tracking_feedback.hpp"
28- #include " nav2_costmap_2d/costmap_layer.hpp"
2929#include " nav2_util/path_utils.hpp"
3030#include " nav2_util/geometry_utils.hpp"
3131#include " nav2_util/robot_utils.hpp"
@@ -147,6 +147,22 @@ class BoundedTrackingErrorLayer : public nav2_costmap_2d::Layer
147147 rcl_interfaces::msg::SetParametersResult
148148 dynamicParametersCallback (std::vector<rclcpp::Parameter> parameters);
149149
150+ /* *
151+ * @brief Draws a wall line on the costmap using Bresenham's algorithm with thickness.
152+ * @param master_grid Reference to the costmap to draw on.
153+ * @param x0 Start x coordinate in map cells.
154+ * @param y0 Start y coordinate in map cells.
155+ * @param x1 End x coordinate in map cells.
156+ * @param y1 End y coordinate in map cells.
157+ * @param map_size_x Width of the map in cells.
158+ * @param map_size_y Height of the map in cells.
159+ */
160+ void drawWallLine (
161+ nav2_costmap_2d::Costmap2D & master_grid,
162+ unsigned int x0, unsigned int y0,
163+ unsigned int x1, unsigned int y1,
164+ unsigned int map_size_x, unsigned int map_size_y);
165+
150166 nav2_msgs::msg::TrackingFeedback last_tracking_feedback_;
151167
152168private:
@@ -156,11 +172,11 @@ class BoundedTrackingErrorLayer : public nav2_costmap_2d::Layer
156172 nav_msgs::msg::Path last_path_;
157173 rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr dyn_params_handler_;
158174
159- size_t temp_step_ ;
175+ size_t step_size_ ;
160176 int step_;
161- double width_ ;
177+ double corridor_width_ ;
162178 double look_ahead_;
163- bool enabled_;
179+ std::atomic< bool > enabled_;
164180 std::string path_topic_;
165181 std::string tracking_feedback_topic_;
166182 int wall_thickness_;
0 commit comments