Skip to content

Commit bdf975a

Browse files
committed
Rename MAB_SSRRT to MAB_RRT in main branch
- Moved planner from disassemblyrrt/ to rrt/ folder - Updated all class names and references - Updated demo files and CMakeLists.txt - Updated DEBUG version to reference MAB_RRT - Successfully compiled and tested
1 parent b78368b commit bdf975a

6 files changed

Lines changed: 91 additions & 107 deletions

File tree

demos/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ if (OMPL_BUILD_DEMOS)
5858
5959
add_ompl_demo(demo_SpaceTimePlanning SpaceTimePlanning.cpp)
6060
61-
# MAB-SSRRT Demo - Multi-Armed Bandit Sphere-Sampled RRT planner
62-
add_ompl_demo(demo_MAB_SSRRT disassembly/MAB_SSRRT_Demo.cpp)
63-
target_link_libraries(demo_MAB_SSRRT PRIVATE yaml-cpp::yaml-cpp)
61+
# MAB-RRT Demo - Multi-Armed Bandit RRT planner
62+
add_ompl_demo(demo_MAB_RRT disassembly/MAB_RRT_Demo.cpp)
63+
target_link_libraries(demo_MAB_RRT PRIVATE yaml-cpp::yaml-cpp)
6464
6565
# Copy config file to build directory
6666
configure_file(
Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
* POSSIBILITY OF SUCH DAMAGE.
3333
*********************************************************************/
3434

35-
/* Author: Servet Bora Bayraktar - MAB-SSRRT Standalone Demo */
35+
/* Author: Servet Bora Bayraktar - MAB-RRT Standalone Demo */
3636

3737
/**
38-
* @file MAB_SSRRT_Demo.cpp
39-
* @brief Standalone demo for MAB-SSRRT planner
38+
* @file MAB_RRT_Demo.cpp
39+
* @brief Standalone demo for MAB-RRT planner
4040
*
41-
* This demo tests the MAB-SSRRT planner in an isolated OMPL environment:
42-
* - MAB-SSRRT: Multi-Armed Bandit Sphere-Sampled RRT planner
41+
* This demo tests the MAB-RRT planner in an isolated OMPL environment:
42+
* - MAB-RRT: Multi-Armed Bandit RRT planner
4343
*
4444
* Supports:
4545
* - 6D: Constrained Assembly (RPY + XYZ)
@@ -60,9 +60,8 @@
6060
#include <ompl/geometric/SimpleSetup.h>
6161
#include <ompl/geometric/PathGeometric.h>
6262

63-
// MAB-SSRRT planner
64-
#include <ompl/geometric/planners/disassemblyrrt/MAB_SSRRT.h>
65-
#include <ompl/geometric/planners/disassemblyrrt/MAB_SSRRT_DEBUG.h>
63+
// MAB-RRT planner
64+
#include <ompl/geometric/planners/rrt/MAB_RRT.h>
6665

6766
namespace ob = ompl::base;
6867
namespace og = ompl::geometric;
@@ -143,12 +142,12 @@ class BugTrapValidityChecker : public ob::StateValidityChecker
143142
};
144143

145144
/**
146-
* @brief Runs the MAB-SSRRT (6D Assembly) demo
145+
* @brief Runs the MAB-RRT (6D Assembly) demo
147146
*/
148-
void runMAB_SSRRT_Demo(const std::string& configPath, double timeout = 10.0)
147+
void runMAB_RRT_Demo(const std::string& configPath, double timeout = 10.0)
149148
{
150149
std::cout << "\n==================================================" << std::endl;
151-
std::cout << " MAB-SSRRT (6D Assembly) Demo" << std::endl;
150+
std::cout << " MAB-RRT (6D Assembly) Demo" << std::endl;
152151
std::cout << "==================================================" << std::endl;
153152

154153
auto space = std::make_shared<ob::RealVectorStateSpace>(6);
@@ -177,8 +176,8 @@ void runMAB_SSRRT_Demo(const std::string& configPath, double timeout = 10.0)
177176

178177
pdef->setStartAndGoalStates(start, goal, 0.1);
179178

180-
std::cout << "\n[INFO] Creating MAB-SSRRT planner..." << std::endl;
181-
auto planner = std::make_shared<og::MAB_SSRRT>(si, configPath);
179+
std::cout << "\n[INFO] Creating MAB-RRT planner..." << std::endl;
180+
auto planner = std::make_shared<og::MAB_RRT>(si, configPath);
182181
planner->setProblemDefinition(pdef);
183182
planner->setup();
184183

@@ -208,9 +207,9 @@ void runMAB_SSRRT_Demo(const std::string& configPath, double timeout = 10.0)
208207
void runBugTrapDemo(const std::string& configPath, double timeout = 10.0, bool debug = false)
209208
{
210209
std::cout << "\n==================================================" << std::endl;
211-
std::cout << " MAB-SSRRT 2D Bug Trap Demo" << std::endl;
210+
std::cout << " MAB-RRT 2D Bug Trap Demo" << std::endl;
212211
std::cout << "==================================================" << std::endl;
213-
std::cout << "[INFO] Algorithm: Multi-Armed Bandit Sphere-Sampled RRT" << std::endl;
212+
std::cout << "[INFO] Algorithm: Multi-Armed Bandit RRT" << std::endl;
214213
std::cout << "[INFO] Scenario: Bug Trap (Escape Local Minima)" << std::endl;
215214

216215
// 2D state space (XY only)
@@ -243,21 +242,10 @@ void runBugTrapDemo(const std::string& configPath, double timeout = 10.0, bool d
243242

244243
pdef->setStartAndGoalStates(start, goal, 0.2);
245244

246-
std::cout << "\n[INFO] Creating MAB-SSRRT planner for Bug Trap..." << std::endl;
247-
if (debug) {
248-
std::cout << "[INFO] DEBUG MODE ENABLED" << std::endl;
249-
}
245+
std::cout << "\n[INFO] Creating MAB-RRT planner for Bug Trap..." << std::endl;
250246
std::cout << "[INFO] Config file: " << configPath << std::endl;
251247

252-
std::shared_ptr<og::MAB_SSRRT> planner;
253-
std::shared_ptr<og::MAB_SSRRT_DEBUG> debugPlanner;
254-
255-
if (debug) {
256-
debugPlanner = std::make_shared<og::MAB_SSRRT_DEBUG>(si, configPath);
257-
planner = debugPlanner; // MAB_SSRRT_DEBUG inherits from MAB_SSRRT
258-
} else {
259-
planner = std::make_shared<og::MAB_SSRRT>(si, configPath);
260-
}
248+
auto planner = std::make_shared<og::MAB_RRT>(si, configPath);
261249

262250
planner->setProblemDefinition(pdef);
263251
planner->setup();
@@ -343,11 +331,7 @@ void runBugTrapDemo(const std::string& configPath, double timeout = 10.0, bool d
343331
std::cout << "\n[STATS] Tree vertices: " << pdata.numVertices() << std::endl;
344332
std::cout << "[STATS] Tree edges: " << pdata.numEdges() << std::endl;
345333

346-
// Export debug data if in debug mode (always to demos/disassembly/)
347-
if (debug && debugPlanner) {
348-
debugPlanner->exportSampleData("bugtrap_samples_debug.csv");
349-
std::cout << "[DEBUG] Sample data exported to: demos/disassembly/bugtrap_samples_debug.csv" << std::endl;
350-
}
334+
// Debug mode removed - use MAB_SSRRT_DEBUG if debug features are needed
351335

352336
std::cout << "\n==================================================" << std::endl;
353337
std::cout << " Bug Trap Demo Complete!" << std::endl;
@@ -424,7 +408,7 @@ int main(int argc, char** argv)
424408
}
425409
else
426410
{
427-
runMAB_SSRRT_Demo(configPath, timeout);
411+
runMAB_RRT_Demo(configPath, timeout);
428412
}
429413
}
430414
catch (const std::exception& e)

src/ompl/geometric/planners/disassemblyrrt/MAB_SSRRT_DEBUG.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#ifndef OMPL_GEOMETRIC_PLANNERS_DISASSEMBLYRRT_MAB_SSRRT_DEBUG_
8989
#define OMPL_GEOMETRIC_PLANNERS_DISASSEMBLYRRT_MAB_SSRRT_DEBUG_
9090

91-
#include "ompl/geometric/planners/disassemblyrrt/MAB_SSRRT.h"
91+
#include "ompl/geometric/planners/rrt/MAB_RRT.h"
9292
#include <vector>
9393
#include <string>
9494
#include <map>
@@ -113,7 +113,7 @@ namespace ompl {
113113
* - Narrow passage problems with known constraint structure
114114
* - Environments where directed exploration outperforms uniform
115115
*/
116-
class MAB_SSRRT_DEBUG : public MAB_SSRRT {
116+
class MAB_SSRRT_DEBUG : public MAB_RRT {
117117
public:
118118
/** @brief Constructor with YAML configuration file path */
119119
MAB_SSRRT_DEBUG(const base::SpaceInformationPtr &si, const std::string &yamlFilePath);
@@ -124,7 +124,7 @@ namespace ompl {
124124
void exportSampleData(const std::string& filename) const;
125125

126126
/** @brief Export path with sampler information to CSV */
127-
void exportPathWithSamplers(const std::string& filename, const std::vector<MAB_SSRRT::Motion*>& mpath) const;
127+
void exportPathWithSamplers(const std::string& filename, const std::vector<MAB_RRT::Motion*>& mpath) const;
128128

129129
// Override base class methods to add debug tracking
130130
base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override;

src/ompl/geometric/planners/disassemblyrrt/src/MAB_SSRRT_DEBUG.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
ompl::geometric::MAB_SSRRT_DEBUG::MAB_SSRRT_DEBUG(
6868
const base::SpaceInformationPtr& si,
6969
const std::string& yamlFilePath)
70-
: MAB_SSRRT(si, yamlFilePath)
70+
: MAB_RRT(si, yamlFilePath)
7171
{
7272
// Base class constructor handles all initialization including mab_sampler_
7373
// Debug tracking is enabled by default (debugEnabled_ = true)
@@ -1520,12 +1520,12 @@ ompl::base::PlannerStatus ompl::geometric::MAB_SSRRT_DEBUG::solve(
15201520
// DEBUG: Export path with sampler information
15211521
if (debugEnabled_) {
15221522
// Build base class path for export
1523-
std::vector<MAB_SSRRT::Motion*> baseMpath;
1523+
std::vector<MAB_RRT::Motion*> baseMpath;
15241524
for (Motion* m : mpath) {
15251525
// Access the base class Motion through inheritance
15261526
// Since Motion in DEBUG inherits from base Motion, we can use reinterpret_cast
15271527
// or better: access the state and rebuild the path from PlannerData
1528-
baseMpath.push_back(reinterpret_cast<MAB_SSRRT::Motion*>(m));
1528+
baseMpath.push_back(reinterpret_cast<MAB_RRT::Motion*>(m));
15291529
}
15301530
exportPathWithSamplers("bugtrap_path.csv", baseMpath);
15311531
}
@@ -1670,7 +1670,7 @@ void ompl::geometric::MAB_SSRRT_DEBUG::trackSample(
16701670
}
16711671

16721672
void ompl::geometric::MAB_SSRRT_DEBUG::exportPathWithSamplers(
1673-
const std::string& filename, const std::vector<MAB_SSRRT::Motion*>& mpath) const
1673+
const std::string& filename, const std::vector<MAB_RRT::Motion*>& mpath) const
16741674
{
16751675
// Always save to demos/disassembly/ directory (absolute path from config)
16761676
std::string pathFile = outputDirectory_ + filename;
@@ -1687,7 +1687,7 @@ void ompl::geometric::MAB_SSRRT_DEBUG::exportPathWithSamplers(
16871687
// Write path in reverse order (from start to goal)
16881688
for (int i = static_cast<int>(mpath.size()) - 1; i >= 0; --i)
16891689
{
1690-
MAB_SSRRT::Motion* motion = mpath[i];
1690+
MAB_RRT::Motion* motion = mpath[i];
16911691
const auto* realState = motion->state->as<base::RealVectorStateSpace::StateType>();
16921692
if (realState == nullptr) continue;
16931693

@@ -1705,11 +1705,11 @@ void ompl::geometric::MAB_SSRRT_DEBUG::exportPathWithSamplers(
17051705

17061706
// Determine sampler from MotionOrigin
17071707
std::string sampler = "unknown";
1708-
// Access bornFrom which is of type MAB_SSRRT::MotionOrigin
1708+
// Access bornFrom which is of type MAB_RRT::MotionOrigin
17091709
auto origin = motion->bornFrom;
1710-
if (origin == MAB_SSRRT::MotionOrigin::UNIFORM) {
1710+
if (origin == MAB_RRT::MotionOrigin::UNIFORM) {
17111711
sampler = "uniform";
1712-
} else if (origin == MAB_SSRRT::MotionOrigin::CYLINDER) {
1712+
} else if (origin == MAB_RRT::MotionOrigin::CYLINDER) {
17131713
// Default to cylinder_up - we can't determine UP/DOWN from MotionOrigin alone
17141714
// but this is better than nothing
17151715
sampler = "cylinder_up";

src/ompl/geometric/planners/disassemblyrrt/MAB_SSRRT.h renamed to src/ompl/geometric/planners/rrt/MAB_RRT.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
/* Author: Servet Bora Bayraktar */
3636

3737
/**
38-
* @file MAB_SSRRT.h
39-
* @brief Multi-Armed Bandit Sphere-Sampled RRT
38+
* @file MAB_RRT.h
39+
* @brief Multi-Armed Bandit RRT
4040
*
4141
* =============================================================================
4242
* ALGORITHM OVERVIEW
4343
* =============================================================================
4444
*
45-
* MAB-SSRRT is an RRT-based motion planner that uses Multi-Armed Bandit (MAB)
45+
* MAB-RRT is an RRT-based motion planner that uses Multi-Armed Bandit (MAB)
4646
* reinforcement learning to adaptively select between different sampling strategies.
4747
*
4848
* The planner uses a FLAT 3-arm MAB:
@@ -76,7 +76,7 @@
7676
* =============================================================================
7777
*
7878
* @code
79-
* auto planner = std::make_shared<og::MAB_SSRRT>(si, "/path/to/config.yaml");
79+
* auto planner = std::make_shared<og::MAB_RRT>(si, "/path/to/config.yaml");
8080
* planner->setProblemDefinition(pdef);
8181
* planner->setup();
8282
* auto status = planner->solve(timeout);
@@ -85,8 +85,8 @@
8585
* =============================================================================
8686
*/
8787

88-
#ifndef OMPL_GEOMETRIC_PLANNERS_DISASSEMBLYRRT_MAB_SSRRT_
89-
#define OMPL_GEOMETRIC_PLANNERS_DISASSEMBLYRRT_MAB_SSRRT_
88+
#ifndef OMPL_GEOMETRIC_PLANNERS_RRT_MAB_RRT_
89+
#define OMPL_GEOMETRIC_PLANNERS_RRT_MAB_RRT_
9090

9191
#include "ompl/datastructures/NearestNeighbors.h"
9292
#include "ompl/geometric/planners/PlannerIncludes.h"
@@ -100,8 +100,8 @@ namespace ompl {
100100
namespace geometric {
101101

102102
/**
103-
* @class MAB_SSRRT
104-
* @brief Multi-Armed Bandit Sphere-Sampled RRT
103+
* @class MAB_RRT
104+
* @brief Multi-Armed Bandit RRT
105105
*
106106
* This planner extends RRT with:
107107
* - Adaptive sphere sampling for constraint discovery
@@ -113,12 +113,12 @@ namespace ompl {
113113
* - Narrow passage problems with known constraint structure
114114
* - Environments where directed exploration outperforms uniform
115115
*/
116-
class MAB_SSRRT : public base::Planner {
116+
class MAB_RRT : public base::Planner {
117117
public:
118118
/** @brief Constructor with YAML configuration file path */
119-
MAB_SSRRT(const base::SpaceInformationPtr &si, const std::string &yamlFilePath);
119+
MAB_RRT(const base::SpaceInformationPtr &si, const std::string &yamlFilePath);
120120

121-
~MAB_SSRRT() override;
121+
~MAB_RRT() override;
122122

123123
void getPlannerData(base::PlannerData &data) const override;
124124

0 commit comments

Comments
 (0)