{"id":18770098,"url":"https://github.com/andreacasalino/mt-rrt","last_synced_at":"2025-04-13T07:32:00.400Z","repository":{"id":41355550,"uuid":"173105628","full_name":"andreacasalino/MT-RRT","owner":"andreacasalino","description":"General purpose library for multithreaded Rapidly Random exploring Trees","archived":false,"fork":false,"pushed_at":"2024-10-18T19:47:15.000Z","size":53383,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T13:59:51.236Z","etag":null,"topics":["cpp","multithreading","path-planning","pathfinding","pathfinding-algorithm","robotics","robots","rrt","rrt-connect","rrt-star"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreacasalino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-28T12:10:15.000Z","updated_at":"2024-08-29T04:33:22.000Z","dependencies_parsed_at":"2024-10-20T12:31:03.122Z","dependency_job_id":null,"html_url":"https://github.com/andreacasalino/MT-RRT","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreacasalino%2FMT-RRT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreacasalino%2FMT-RRT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreacasalino%2FMT-RRT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreacasalino%2FMT-RRT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreacasalino","download_url":"https://codeload.github.com/andreacasalino/MT-RRT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223573856,"owners_count":17167389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","multithreading","path-planning","pathfinding","pathfinding-algorithm","robotics","robots","rrt","rrt-connect","rrt-star"],"created_at":"2024-11-07T19:18:07.831Z","updated_at":"2024-11-07T19:18:09.163Z","avatar_url":"https://github.com/andreacasalino.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI tests](https://github.com/andreacasalino/MT-RRT/actions/workflows/runTests.yml/badge.svg)\n\n- [What is this library about](#intro)\n- [Content](#content)\n- [Documentation](#documentation)\n- [Usage](#usage)\n- [Samples](#samples)\n- [CMake support](#cmake-support)\n\n![MazeProblem](./img_1.png)\n![Robots](./img_2.gif)\n\n## INTRO\n\n**Multi Thread Rapidly Random exploring Trees**, aka **MT-RRT**, is a **C++** library that can be used for path or trajectory planning, implementing different multi-threaded versions of the well known **Rapidly Random exploring Trees**, aka **RRT** algorithm. Inded, **RRT** are a popular cathegory of robotic algorithms used for computing paths or trajectories in a constrained environment.\nThe multi-threaded strategies contained in this library are able to significantly speed up the normal **RRT**, **bidirectional  RRT** and **RRT* **.\n\nThe initial implementation of this work was based on the results published in this **IROS** paper:\nAndrea Casalino et al. :\"Mt-rrt: a general purpose multithreading library for path planning\", In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2019), pages 1510–1517. IEEE, 2019\neven though, it evolved much after the initial implementation.\n\nThis library was conceived to solve any kind of planning problem. The only thing you need to do when solving your specific class, is to derive a couple of objects that contain all the problem-specific information, refer to the [documentation](./doc/MT-RRT.pdf) and the [samples](#samples). \n\n**MT-RRT** is completely **cross platform**, let [CMake](#cmake-support) do all the work for you, and has no thirdy party dependency.\n\nIf you have found this library useful, please find the time to leave a **star** :).\n\n## CONTENT\n\nThis repository contains:\n  - [documentation](./doc/MT-RRT.pdf): pdf discussing generalities about **RRT** together with info explaining how to use this library\n  - [readme](./ReadMeExample.cpp): hello world example showing you how to use in a nutshell this library. Have a look also [here](#usage).\n  - [src](./src/): the sources containing the main features offered by this library. In particular:\n    - [src/core](./src/core/): containing **MT-RRT-core**, that provides basic functionalities and the classical mono-thread implementation of the **RRT** algorithm.\n    - [src/multi-threaded](./src/multi-threaded/): containing **MT-RRT-multi-threaded**, that stores the multithreaded **RRT** planners proposed by this library\n  - [problems](./problems/): explaining how to use this library through 3 concrete planning problems examples, check the [ReadMe.md](./problems/ReadMe.md) of the samples. Have a look also [here](#samples).\n\n## DOCUMENTATION\n\nIt is strongly encouraged to start from the [documentation](doc/MT-RRT.pdf).\nIndeed, the documentation provides a general background on the **RRT** algorithms and terminology in general and at the same time explains how to use and what to expect from the **RRT** planners implemented in this library.\n\n## USAGE\n\nHaven't already left a **star**? Do it now ;)!\n\nThese are the steps to follow in order to solve any planning problem (refer also to [ReadMeExample.md](./ReadMeExample.cpp)):\n- explain to **MT-RRT** how the problem you want to solve is made. In order to do this you need to:\n  - define your own **mt_rrt::Sampler**, i.e. an object having the responsability to sample random states (some default ones, which are ok for 99% of the cases, are already provided by this library). Let's say your sampler is named **MySampler**:\n  ```cpp\n  mt_rrt::SamplerPtr my_sampler = std::make_unique\u003cMySampler\u003e(...);\n  ```\n  - define your own **mt_rrt::Connector**, i.e. an object having the responsability to compute trajectories that connects pair of states.\n  In [samples](./samples/), three classes of examples were implemented in order to show you how to do this for your own problem. Let's say your connector is named **MyConnector**:\n  ```cpp\n  mt_rrt::ConnectorPtr my_connector = std::make_unique\u003cMyConnector\u003e(...);\n  ```\n- groups all the problem specific information into a special structure named **mt_rrt::ProblemDescription**:\n  ```cpp\n\tmt_rrt::ProblemDescription problem_description;\n\tproblem_description.connector = std::move(my_connector);\n\tproblem_description.sampler = std::move(my_sampler);\n  // and a couple of more ... see the samples\n  ```\n- build a planner. The planner will absorb all the problem specific information. You can opt for a standard mono-threaded planner:\n```cpp\nmt_rrt::StandardPlanner planner(std::move(problem_description));\n```\nor o multi threaded one, prescribing to use for example 4 threads:\n```cpp\nmt_rrt::MultiAgentPlanner multi_agent_planner(std::move(problem_description));\nmulti_agent_planner.setThreads(4);\n```\nThe set of multi threaded planners offered by this library is extensively discussed in the [documentation](./doc/MT-RRT.pdf).\n- now you are able to solve the first planning problem, using the **mt_rrt::Parameters** you prefer:\n```cpp\nmt_rrt::State start_state = ...;\nmt_rrt::State end_state = ...;\n\n// define the parameters\nmt_rrt::Parameters parameters;\nparameters.iterations.set(1500); // number of maximum iterations\nparameters.expansion_strategy = mt_rrt::ExpansionStrategy::Star; // set the strategy, see Section \"Background on RRT\" of the documentation\n// ... and some others\n\n// try to solve the problem\nmt_rrt::PlannerSolution solution = planner.solve(start_state, end_state, parameters);\nstd::vector\u003cmt_rrt::State\u003e found_sequence = solution.solution.value(); // access the found solution (is nullopt if no solution was found)\nauto time = solution.time; // access the time spent by the planner to find a solution\n// ... you can access in that structure also some other info\n```\n- inspect solution by:\n  - checking the found sequence of states, representing the found solution\n  - checking the obtained explored trees (yes, they are returned and you can inspect them if you want)\n-many problems of the same kind can be solved by keep using (one at a time) the same intialized planner:\n```cpp\n// solve another problem ... you don't need to build a new planner if the problem is of the same kind.\n// Indeed, you can re-use the same planner, but passing the info of this other particular problem to solve\n// IMPORTANT !! Clearly, in order to avoid data race, you can solve only 1 problem at a time per planner\nmt_rrt::State start_state = ...;\nmt_rrt::State end_state = ...;\nmt_rrt::Parameters parameters = ...;\nmt_rrt::PlannerSolution solution = planner.solve(start_state, end_state, parameters);\n```\n\n## SAMPLES\n\nHaven't already left a **star**? Do it now ;)!\n\nThree classes of samples are contained in [./problems](./problems/). These are planning problemexamples showing how to use **MT-RRT** in order to solve them.\nThe [documentation](doc/MT-RRT.pdf) extensively describes the samples and it is strongly encouraged also to have a look to the samples [ReadMe.md](./problems/ReadMe.md).\nIn particular:\n- [./problems/problem-trivial](./problems/problem-trivial) represents a 2D maze problem\n- [./problems/problem-planarRobots](./problems/problem-planarRobots) represents a planar robots planning problem\n- [./problems/problem-navigation](./problems/problem-navigation) represents a 2D moving cart problem\n\nNotice that these are just samples, but as long as you provide a connector and a sampler suitable for your specific problem, you can solve ANY kind of problem with this library!!\n\n## CMAKE SUPPORT\n\nHaven't already left a **star**? Do it now ;)!\n   \nTo consume this library you can rely on [CMake](https://cmake.org).\nMore precisely, You can fetch this package and link to the core library **MT-RRT-multi-threaded**:\n```cmake\ninclude(FetchContent)\nFetchContent_Declare(\nmt_rrt_multi_threaded\nGIT_REPOSITORY https://github.com/andreacasalino/MT-RRT\nGIT_TAG        master\n)\nFetchContent_MakeAvailable(mt_rrt_multi_threaded)\n```\n\nand then link to the **MT-RRT-multi-threaded** library:\n```cmake\ntarget_link_libraries(${TARGET_NAME} MT-RRT-multi-threaded\n)\n```\n\nIf you are only interested in the standard **RRT** implementation contained in **MT-RRT-core**, you can link just to that library:\n```cmake\ntarget_link_libraries(${TARGET_NAME} MT-RRT-core\n)\n```\n\n**MT-RRT** internally makes use of [omp](https://en.wikipedia.org/wiki/OpenMP), which should be natively supported by any kind of modern compiler. **CMake** will automatically look for the latest **omp** version installed and in case nothing is found an error will occour.\n\nSometimes is is usefull to check the progress of the solver, printing on the console the iterations done so far. This is not the default behaviour of **MT-RRT** but can be enabled turning to **ON** the **CMake** option called **MT-RRT-SHOW_PLANNER_PROGRESS**. This of course will affects the performance and should be done mostly for debugging purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreacasalino%2Fmt-rrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreacasalino%2Fmt-rrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreacasalino%2Fmt-rrt/lists"}