Skip to content

Commit a474d23

Browse files
committed
Fix API - planners and cost calculators
1 parent 7930324 commit a474d23

19 files changed

+129
-82
lines changed

roadmap_explorer/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ add_subdirectory(comparision_scripts)
169169
########################### INSTALLATION ###########################
170170

171171
install(TARGETS
172-
# roadmap_exploration_bt
173172
${PROJECT_NAME}_frontier
174173
${PROJECT_NAME}_utils
175174
roadmap_explorer_frontier_search_plugins
176175
roadmap_explorer_information_gain_plugins
176+
roadmap_explorer_planner_plugins
177+
# roadmap_exploration_bt
177178
# roadmap_explorer_bt_plugins
178-
# roadmap_explorer_planner_plugins
179179
ARCHIVE DESTINATION lib
180180
LIBRARY DESTINATION lib
181181
RUNTIME DESTINATION bin
@@ -195,13 +195,13 @@ DESTINATION share/${PROJECT_NAME}
195195

196196
ament_export_include_directories(include ${EIGEN3_INCLUDE_DIR})
197197
ament_export_libraries(
198-
# roadmap_exploration_bt
199198
${PROJECT_NAME}_frontier
200199
${PROJECT_NAME}_utils
201200
roadmap_explorer_frontier_search_plugins
202201
roadmap_explorer_information_gain_plugins
202+
roadmap_explorer_planner_plugins
203+
# roadmap_exploration_bt
203204
# roadmap_explorer_bt_plugins
204-
# roadmap_explorer_planner_plugins
205205
)
206206
ament_export_dependencies(rosidl_default_runtime ${dependencies})
207207

roadmap_explorer/include/roadmap_explorer/CostAssigner.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ class CostAssigner
6969

7070
void recomputeNormalizationFactors(FrontierPtr & frontier);
7171

72-
std::vector<FrontierPtr> findDuplicates(const std::vector<FrontierPtr> & vec);
73-
7472
void initializePlugins(const std::string & informationGainPlugin, const std::string & plannerPlugin);
7573

7674
void processFrontier(FrontierPtr & frontier,

roadmap_explorer/include/roadmap_explorer/frontier_search/BaseFrontierSearch.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class FrontierSearchBase
4848
* @param costmap Pointer to the costmap for frontier detection.
4949
* @param node Shared pointer to the lifecycle node for parameter management
5050
*/
51-
virtual void configure(std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
51+
virtual void configure(std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
5252

5353
/**
5454
* @brief Reset the frontier search state

roadmap_explorer/include/roadmap_explorer/frontier_search/PluginBFSearch.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class FrontierBFSearch : public FrontierSearchBase
3333

3434
~FrontierBFSearch() override;
3535

36-
void configure(std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) override;
36+
void configure(std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) override;
3737

3838
void reset() override;
3939

@@ -72,6 +72,8 @@ class FrontierBFSearch : public FrontierSearchBase
7272
return (int)value < lethal_threshold_;
7373
}
7474

75+
std::vector<FrontierPtr> findDuplicates(const std::vector<FrontierPtr> & vec);
76+
7577
// Constants for geometric calculations
7678
static constexpr double DIAGONAL_FACTOR = 1.414; // sqrt(2) approximation
7779
static constexpr double CENTROID_OFFSET_MULTIPLIER = 2.0;

roadmap_explorer/include/roadmap_explorer/information_gain/BaseInformationGain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BaseInformationGain
4141
* @param explore_costmap_ros Shared pointer to the costmap ROS wrapper
4242
*/
4343
virtual void configure(
44-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
44+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
4545

4646
/**
4747
* @brief Reset the information gain calculator state

roadmap_explorer/include/roadmap_explorer/information_gain/CountBasedGain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CountBasedGain : public BaseInformationGain
4545
* @param explore_costmap_ros Shared pointer to the costmap ROS wrapper
4646
*/
4747
void configure(
48-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) override;
48+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) override;
4949

5050
/**
5151
* @brief Reset the calculator state

roadmap_explorer/include/roadmap_explorer/planners/BasePlanner.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BasePlanner
4141
* @param explore_costmap_ros Shared pointer to the costmap ROS wrapper
4242
*/
4343
virtual void configure(
44-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
44+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) = 0;
4545

4646
/**
4747
* @brief Reset the planner state

roadmap_explorer/include/roadmap_explorer/planners/EuclideanPlugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class EuclideanDistancePlugin : public BasePlanner
1616
~EuclideanDistancePlugin() override = default;
1717

1818
void configure(
19-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) override;
19+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) override;
2020

2121
void reset() override;
2222

roadmap_explorer/include/roadmap_explorer/planners/FrontierRoadmapPlugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PluginFrontierRoadmap : public BasePlanner
1818
~PluginFrontierRoadmap() override = default;
1919

2020
void configure(
21-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) override;
21+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) override;
2222

2323
void reset() override;
2424

roadmap_explorer/include/roadmap_explorer/planners/NavFnPlugin.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PluginNavFn : public BasePlanner
1818
~PluginNavFn() override = default;
1919

2020
void configure(
21-
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::shared_ptr<nav2_util::LifecycleNode> node) override;
21+
std::shared_ptr<nav2_costmap_2d::Costmap2DROS> explore_costmap_ros, std::string name, std::shared_ptr<nav2_util::LifecycleNode> node) override;
2222

2323
void reset() override;
2424

0 commit comments

Comments
 (0)