Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a66ac26
Added function to check if two vectors are linearly dependent
Sep 22, 2025
8ce32f9
Minor fixes...
Sep 22, 2025
e8d75bd
Fixed a bug when more than two splines exist.
Sep 22, 2025
4501ed0
Changed a way the path is preprocessed.
Sep 22, 2025
3f0e747
Added methods for converting a path to a corresponding trajectory.
Sep 22, 2025
e90e399
Other corresponding changes...
Sep 22, 2025
de284c7
Created a file for testing 'path2traj' method.
Sep 22, 2025
2509b63
Renamed 'Splines' class to 'Trajectory' class
Sep 23, 2025
56c0245
Included 'ros_reflexxes' library within 'RPMPLv2'.
Sep 23, 2025
edd1e33
Renaming 'splines' to 'traj'
Sep 23, 2025
4e6d548
"Splines.h" -> "Trajectory.h"
Sep 24, 2025
212af70
Optimizing 'computeRegular' function.
Oct 2, 2025
6545834
Rename 'SplineConfig' to 'TrajectoryConfig'
Oct 2, 2025
695fff9
Minor updates...
Oct 2, 2025
9e44b18
'MotionValidity' class updated.
Oct 2, 2025
317612a
Therefore, 'UpdatingState' class is also modified.
Oct 2, 2025
e46425e
Default values reverted.
Oct 2, 2025
e627416
New dynamic planner is created: Real-time RGBT alongside all correspo…
Oct 2, 2025
f7025e1
Corresponding changes...
Oct 2, 2025
dc16ab4
Successfully included 'ruckig' library.
Oct 3, 2025
5964203
'TrajectoryRuckig' class is made as a bridge between Ruckig and DRGBT.
Oct 4, 2025
a6330d5
Corresponding addings due to Ruckig.
Oct 4, 2025
7ab434b
Minor changes in 'Trajectory' class.
Oct 4, 2025
31822f1
'update_v3' function introduced to update current state when Rucking …
Oct 4, 2025
f25dc9a
Finally, Ruckig is included from external folder.
Oct 5, 2025
3b26088
Some lines are commented out.
Oct 5, 2025
3bfad6f
Multiple fixes in 'TrajectoryRuckig', so it now finally works with ar…
Oct 5, 2025
0b1827d
-Werror is disabled since Ruckig cannot be built then.
Oct 5, 2025
d77507e
Minor changes...
Oct 5, 2025
764f25c
RT-RGBT adapted to operate with Ruckig.
Oct 5, 2025
58d7951
"Real" success cannot be negative.
Oct 6, 2025
745a4de
Updated rpmplv2.yaml to build with external Ruckig library.
ncovic1 Oct 6, 2025
43fea54
Adding external/ruckig folder
Oct 6, 2025
87a22b3
Merge branch 'path2traj' of https://github.com/roboticsETF/RPMPLv2 in…
Oct 6, 2025
fb69664
ReadMe updated.
Oct 16, 2025
a8683d2
'AbstractTrajectory' class is created.
Oct 18, 2025
818b6e0
A lot of corresponding changes...
Oct 18, 2025
b9f64d3
A lot of variables and methods are deleted since they are moved to 'A…
Oct 18, 2025
fc96ee6
Other corresponding changes...
Oct 18, 2025
3db012b
Console outputs commented.
Oct 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/rpmplv2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

with:
submodules: true # make sure submodules are fetched
fetch-depth: 0 # fetch full history (needed for submodules)

- name: Init submodules
run: git submodule update --init --recursive

- name: Install dependencies
run: |
sudo apt update && sudo apt upgrade && sudo apt install -y libunwind-dev apt-transport-https \
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "external/ruckig"]
path = external/ruckig
url = https://github.com/pantor/ruckig.git
branch = v0.15.3
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("------------------ Using compiler: ${CMAKE_CXX_COMPILER} ------------------")

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
add_compile_options(-Wall -Wextra -Wpedantic)# -Werror)
endif()

# Only do these if this is the main project, and not if it is included through add_subdirectory
Expand Down Expand Up @@ -62,7 +62,9 @@ find_package(yaml-cpp REQUIRED)
find_package(fcl 0.7 REQUIRED)
find_package(nanoflann REQUIRED)

set(PROJECT_LIBRARIES gtest glog gflags nanoflann::nanoflann kdl_parser orocos-kdl fcl ccd yaml-cpp)
add_subdirectory(external/ruckig)

set(PROJECT_LIBRARIES gtest glog gflags nanoflann::nanoflann kdl_parser orocos-kdl fcl ccd yaml-cpp ruckig::ruckig)

set(MAIN_PROJECT_BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build)

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ In the file ```/data/configurations/configuration_drgbt.yaml```, you can set the
- ```STATIC_PLANNER_TYPE```: Type of a static planner (for obtaining the predefined path). Available planners: "RGBMT*", "RGBT-Connect", "RBT-Connect" and "RRT-Connect";
- ```REAL_TIME_SCHEDULING```: Available real-time scheduling is "FPS" - Fixed Priority Scheduling; If you set "None", no real-time scheduling will be used;
- ```MAX_TIME_TASK1```: Maximal time in [s] which Task 1 (computing the next configuration) can take from the processor. It must be less than ```MAX_ITER_TIME```. Default: 0.020;
- ```TRAJECTORY_INTERPOLATION```: Method for interpolation of trajectory: 'None' or 'Spline'. If 'None' is used, the robot always moves at its highest speed, i.e., an advancing step for moving from 'q_current' towards 'q_next' in C-space is determined by maximal robot's velocity. On the other hand, if 'Spline' is used, then a quintic spline from 'q_current' to 'q_next' is computed in order to satisfy all constaints on robot's maximal velocity, acceleration and jerk. All configuration parameters considering splines can be set in the file ```/data/configurations/configuration_splines.yaml```.
- ```TRAJECTORY_INTERPOLATION```: Method for interpolation of trajectory: "None", "Spline" or "Ruckig". If 'None' is used, the robot always moves at its highest speed, i.e., an advancing step for moving from 'q_current' towards 'q_next' in C-space is determined by maximal robot's velocity. On the other hand, if 'Spline' is used, then a quintic spline from 'q_current' to 'q_next' is computed in order to satisfy all constaints on robot's maximal velocity, acceleration and jerk. If 'Ruckig' is used, then trajectory is generated using Ruckig library. All configuration parameters considering splines can be set in the file ```/data/configurations/configuration_trajectory.yaml```.
- ```GUARANTEED_SAFE_MOTION```: Whether robot motion is surely safe for environment. If collision eventually occurs, it will be at robot's zero velocity, meaning that an obstacle hit the robot, and not vice versa. This feature is intended to be used only for real/practical applications, thus it can be used only when ```TRAJECTORY_INTERPOLATION``` is set to 'Spline'.

Note: If any problems occur regarding which version of Ruckig is built (local version from external/ruckig folder or ros-humble-ruckig version), just type the following in terminal:
```export LD_LIBRARY_PATH=<absolute_path_to_your_build_directory>/build/rpmpl_library/external/ruckig:$LD_LIBRARY_PATH```

Finally, in the file ```/apps/test_drgbt_random_obstacles.cpp```, you can set via ```routines``` which routines' execution times should be stored during the testing. File ```/data/xarm6/scenario_random_obstacles/scenario_random_obstacles_routine_times<number>.log``` will contain all logged execution times.
Finally, in the file ```/apps/test_drgbt_random_obstacles.cpp```, you can set via ```routines``` which routines' execution times should be stored during the testing. File ```/data/xarm6/scenario_random_obstacles/DRGBT_data_<TRAJECTORY_INTERPOLATION>/results_<num_obstacles>obs_<MAX_ITER_TIME>ms.log``` will contain all logged execution times.

## 3.4 Test planners
All test files are available within the folder ```/apps```. For example, open ```test_rgbmtstar.cpp```. You can set the file path of desired scenario via ```scenario_file_path```, and maximal number of tests in ```max_num_tests```.
Expand Down
35 changes: 24 additions & 11 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ target_compile_features(test_rgbmtstar PRIVATE cxx_std_17)
target_link_libraries(test_rgbmtstar PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rgbmtstar PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_rrtx test_rrtx.cpp)
target_compile_features(test_rrtx PRIVATE cxx_std_17)
target_link_libraries(test_rrtx PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rrtx PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_rrtx_random_obstacles test_rrtx_random_obstacles.cpp)
target_compile_features(test_rrtx_random_obstacles PRIVATE cxx_std_17)
target_link_libraries(test_rrtx_random_obstacles PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rrtx_random_obstacles PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_rt_rgbt test_rt_rgbt.cpp)
target_compile_features(test_rt_rgbt PRIVATE cxx_std_17)
target_link_libraries(test_rt_rgbt PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rt_rgbt PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_trajectory test_trajectory.cpp)
target_compile_features(test_trajectory PRIVATE cxx_std_17)
target_link_libraries(test_trajectory PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_trajectory PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(generate_random_scenarios generate_random_scenarios.cpp)
target_compile_features(generate_random_scenarios PRIVATE cxx_std_17)
target_link_libraries(generate_random_scenarios PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
Expand All @@ -69,15 +89,6 @@ target_compile_features(generate_dataset PRIVATE cxx_std_17)
target_link_libraries(generate_dataset PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(generate_dataset PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_rrtx test_rrtx.cpp)
target_compile_features(test_rrtx PRIVATE cxx_std_17)
target_link_libraries(test_rrtx PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rrtx PUBLIC ${PROJECT_SOURCE_DIR}/apps)

add_executable(test_rrtx_random_obstacles test_rrtx_random_obstacles.cpp)
target_compile_features(test_rrtx_random_obstacles PRIVATE cxx_std_17)
target_link_libraries(test_rrtx_random_obstacles PUBLIC rpmpl_library ${PROJECT_LIBRARIES})
target_include_directories(test_rrtx_random_obstacles PUBLIC ${PROJECT_SOURCE_DIR}/apps)

install(TARGETS
test_nanoflann
Expand All @@ -93,8 +104,10 @@ install(TARGETS
test_drgbt
test_drgbt_random_obstacles
test_rgbmtstar
generate_random_scenarios
generate_dataset
test_rrtx
test_rrtx_random_obstacles
test_rt_rgbt
test_trajectory
generate_random_scenarios
generate_dataset
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin)
47 changes: 29 additions & 18 deletions apps/test_drgbt_random_obstacles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ int main(int argc, char **argv)
if (clp != 0) return clp;

const std::string project_path { getProjectPath() };
const std::string directory_path { project_path + scenario_file_path.substr(0, scenario_file_path.find_last_of("/\\")) + "/DRGBT_data" };
std::filesystem::create_directory(directory_path);
ConfigurationReader::initConfiguration(project_path);
const std::string directory_path { project_path + scenario_file_path.substr(0, scenario_file_path.find_last_of("/\\"))
+ "/DRGBT_data_" + planning::trajectory_interpolation_map2[DRGBTConfig::TRAJECTORY_INTERPOLATION] };
std::filesystem::create_directory(directory_path);
YAML::Node node { YAML::LoadFile(project_path + scenario_file_path) };
YAML::Node node2 { YAML::LoadFile(project_path + random_scenarios_path) };

Expand Down Expand Up @@ -64,7 +65,8 @@ int main(int argc, char **argv)
std::ofstream output_file {};
if (init_num_test == 1)
{
output_file.open(directory_path + "/results" + std::to_string(init_num_obs) + ".log", std::ofstream::out);
output_file.open(directory_path + "/results_" + std::to_string(init_num_obs) + "obs_"
+ std::to_string(size_t(DRGBTConfig::MAX_ITER_TIME * 1000)) + "ms.log", std::ofstream::out);
output_file << "Using scenario: " << scenario_file_path << std::endl;
output_file << "Dynamic planner: " << planning::PlannerType::DRGBT << std::endl;
output_file << "Static planner for replanning: " << DRGBTConfig::STATIC_PLANNER_TYPE << std::endl;
Expand Down Expand Up @@ -99,6 +101,7 @@ int main(int argc, char **argv)
std::vector<float> path_lengths {};
size_t num_test { init_num_test };
size_t num_success_tests { init_num_success_test };
float num_real_success_tests = init_num_success_test;

while (true)
{
Expand Down Expand Up @@ -158,11 +161,14 @@ int main(int argc, char **argv)

planner = std::make_unique<planning::drbt::DRGBT>(ss, scenario.getStart(), scenario.getGoal());
bool result { planner->solve() };
float real_result { std::max(0.0f, 1 - (goal - planner->getPath().back()->getCoord()).norm() / (goal - start).norm()) };
num_real_success_tests += real_result;

LOG(INFO) << planner->getPlannerType() << " planning finished with " << (result ? "SUCCESS!" : "FAILURE!");
LOG(INFO) << "Real success: " << real_result;
LOG(INFO) << "Number of iterations: " << planner->getPlannerInfo()->getNumIterations();
LOG(INFO) << "Algorithm time: " << planner->getPlannerInfo()->getPlanningTime() << " [s]";
LOG(INFO) << "Task 1 interrupted: " << (planner->getPlannerInfo()->getTask1Interrupted() ? "true" : "false");
// LOG(INFO) << "Task 1 interrupted: " << (planner->getPlannerInfo()->getTask1Interrupted() ? "true" : "false");
// LOG(INFO) << "Planner data is saved at: " << directory_path + "/test" + std::to_string(init_num_obs) + "_" + std::to_string(num_test) + ".log";
// planner->outputPlannerData(directory_path + "/test" + std::to_string(init_num_obs) + "_" + std::to_string(num_test) + ".log");

Expand All @@ -183,36 +189,40 @@ int main(int argc, char **argv)
num_success_tests++;
}

output_file.open(directory_path + "/results" + std::to_string(init_num_obs) + ".log", std::ofstream::app);
output_file.open(directory_path + "/results_" + std::to_string(init_num_obs) + "obs_"
+ std::to_string(size_t(DRGBTConfig::MAX_ITER_TIME * 1000)) + "ms.log", std::ofstream::app);
output_file << "Test number: " << num_test << std::endl;
output_file << "Number of successful tests: " << num_success_tests << " of " << num_test
<< " = " << 100.0 * num_success_tests / num_test << " %" << std::endl;
output_file << "Success:\n" << result << std::endl;
output_file << "Real success:\n" << real_result << std::endl;
output_file << "Number of iterations:\n" << planner->getPlannerInfo()->getNumIterations() << std::endl;
output_file << "Algorithm execution time [s]:\n" << planner->getPlannerInfo()->getPlanningTime() << std::endl;
output_file << "Path length [rad]:\n" << (result ? path_length : INFINITY) << std::endl;
output_file << "Task 1 interrupted:\n" << planner->getPlannerInfo()->getTask1Interrupted() << std::endl;
// output_file << "Task 1 interrupted:\n" << planner->getPlannerInfo()->getTask1Interrupted() << std::endl;

// if (result)
// {
// std::vector<std::vector<float>> routine_times { planner->getPlannerInfo()->getRoutineTimes() };
// for (size_t idx = 0; idx < routines.size(); idx++)
// {
// // LOG(INFO) << "Routine " << routines[idx];
// // LOG(INFO) << "\tAverage time: " << getMean(routine_times[idx]) << " +- " << getStd(routine_times[idx]);
// // LOG(INFO) << "\tMaximal time: " << *std::max_element(routine_times[idx].begin(), routine_times[idx].end());
// // LOG(INFO) << "\tData size: " << routine_times[idx].size();
// std::vector<std::vector<float>> routine_times { planner->getPlannerInfo()->getRoutineTimes() };
// for (size_t idx = 0; idx < routines.size(); idx++)
// {
// LOG(INFO) << "Routine " << routines[idx];
// LOG(INFO) << "\tAverage time: " << getMean(routine_times[idx]) << " +- " << getStd(routine_times[idx]);
// LOG(INFO) << "\tMaximal time: " << *std::max_element(routine_times[idx].begin(), routine_times[idx].end());
// LOG(INFO) << "\tData size: " << routine_times[idx].size();

// output_file << "Routine " << routines[idx] << " times: " << std::endl;
// for (float t : routine_times[idx])
// output_file << t << std::endl;
// }
// output_file << "Routine " << routines[idx] << " times: " << std::endl;
// for (float t : routine_times[idx])
// output_file << t << std::endl;
// }
// }

output_file << "--------------------------------------------------------------------\n";
output_file.close();
LOG(INFO) << "Number of successful tests: " << num_success_tests << " of " << num_test
LOG(INFO) << "Number of successful tests: " << num_success_tests << " of " << num_test
<< " = " << 100.0 * num_success_tests / num_test << " %";
LOG(INFO) << "Number of real successful tests: " << num_real_success_tests << " of " << num_test
<< " = " << 100.0 * num_real_success_tests / num_test << " %";
LOG(INFO) << "--------------------------------------------------------------------\n\n";
}
catch (std::exception &e)
Expand All @@ -230,6 +240,7 @@ int main(int argc, char **argv)
init_num_obs += (init_num_obs > 0) ? std::pow(10, std::floor(std::log10(init_num_obs))) : 1;

LOG(INFO) << "Success rate: " << 100.0 * num_success_tests / (num_test - 1) << " [%]";
LOG(INFO) << "Real success rate: " << 100.0 * num_real_success_tests / (num_test - 1) << " [%]";
LOG(INFO) << "Average algorithm execution time: " << getMean(alg_times) << " +- " << getStd(alg_times) << " [s]";
LOG(INFO) << "Average iteration execution time: " << getMean(iter_times) * 1e3 << " +- " << getStd(iter_times) * 1e3 << " [ms]";
LOG(INFO) << "Average number of iterations: " << getMean(num_iters) << " +- " << getStd(num_iters);
Expand Down
Loading