{"id":18624627,"url":"https://github.com/kumarrobotics/jps3d","last_synced_at":"2025-04-06T00:07:25.236Z","repository":{"id":49354608,"uuid":"79068267","full_name":"KumarRobotics/jps3d","owner":"KumarRobotics","description":"A C++ implementation of Jump Point Search on both 2D and 3D maps","archived":false,"fork":false,"pushed_at":"2021-02-18T22:02:04.000Z","size":1959,"stargazers_count":404,"open_issues_count":7,"forks_count":120,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-03-29T23:08:10.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KumarRobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-16T00:11:09.000Z","updated_at":"2025-03-22T12:08:19.000Z","dependencies_parsed_at":"2022-09-02T02:13:00.806Z","dependency_job_id":null,"html_url":"https://github.com/KumarRobotics/jps3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2Fjps3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2Fjps3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2Fjps3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2Fjps3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KumarRobotics","download_url":"https://codeload.github.com/KumarRobotics/jps3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935388,"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":[],"created_at":"2024-11-07T04:29:47.722Z","updated_at":"2025-04-06T00:07:25.219Z","avatar_url":"https://github.com/KumarRobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MRSL Jump Point Search Planning Library v1.1\n[![wercker status](https://app.wercker.com/status/880ab5feaff25f0483e5f2c4f834b8c0/s/master \"wercker status\")](https://app.wercker.com/project/byKey/880ab5feaff25f0483e5f2c4f834b8c0)\n- - -\nJump Point Search for path planning in both 2D and 3D environments. Original jump point seach algorithm is proposed in [\"D. Harabor and A. Grastien. Online Graph Pruning for Pathfinding on Grid Maps. In National Conference on Artificial Intelligence (AAAI), 2011\"](https://www.aaai.org/ocs/index.php/AAAI/AAAI11/paper/download/3761/4007). The 3D version is proposed in [\"S. Liu, M. Watterson, K. Mohta, K. Sun, S. Bhattacharya, C.J. Taylor and V. Kumar. Planning Dynamically Feasible Trajectories for Quadrotors using Safe Flight Corridors in 3-D Complex Environments. ICRA 2017\"](http://ieeexplore.ieee.org/abstract/document/7839930/).\n\nThe distance map planner (`DMPlanner`) is also included in this repo. `DMPlanner` inflate a artificial potential field around obstacles and plan a safer path within a certain region. More detials are refered in the latter section.\n\n## Installation\n#### Required:\n - Eigen3\n - yaml-cpp\n\nSimply run following commands to install dependancy:\n```bash\n$ sudo apt update\n$ sudo apt install -y libeigen3-dev libyaml-cpp-dev libboost-dev cmake\n```\n\n#### A) Simple cmake\n```bash\n$ mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make -j4\n```\n\n#### B) Using CATKIN\n```bash\n$ mv jps3d ~/catkin_ws/src\n$ cd ~/catkin_ws \u0026 catkin_make_isolated -DCMAKE_BUILD_TYPE=Release\n```\n\n#### CTest\nRun following command in the `build` folder for testing the executables:\n```bash\n$ make test\n```\n\nIf everything works, you should see the results as:\n```bash\nRunning tests...\nTest project /home/sikang/thesis_ws/src/packages/jps3d/build\n    Start 1: test_planner_2d\n1/3 Test #1: test_planner_2d ..................   Passed    0.95 sec\n    Start 2: test_planner_3d\n2/3 Test #2: test_planner_3d ..................   Passed    0.00 sec\n    Start 3: test_distance_map_planner_2d\n3/3 Test #3: test_distance_map_planner_2d .....   Passed    1.26 sec\n\n100% tests passed, 0 tests failed out of 3\n\nTotal Test time (real) =   2.22 sec\n```\n\n#### Include in other projects\nNote that in other repository, add following commands in `CMakeLists.txt` in order to correctly link `jps3d`:\n```sh\nfind_package(jps3d REQUIRED)\ninclude_directories(${JPS3D_INCLUDE_DIRS})\n...\nadd_executable(test_xxx src/test_xxx.cpp)\ntarget_link_libraries(test_xxx ${JPS3D_LIBRARIES})\n```\n\nTwo libs will be installed: the standard `jps_lib` and a variation `dmp_lib`.\n\n## JPS Usage\nTo start a simple `JPS` planning thread:\n```c++\nJPSPlanner2D planner(false); // Declare a 2D planner\nplanner.setMapUtil(map_util); // Set collision checking function\nplanner.updateMap(); // Set map, must be called before plan\nbool valid = planner.plan(start, goal, 1); // Plan from start to goal with heuristic weight 1, using JPS\n```\n\nFirst, the collision checking util must be loaded as:\n```c++\nplanner.setMapUtil(MAP_UTIL_PTR); // Set collision checking function\n```\nThe `MAP_UTIL_PTR` can be either `JPS::OCCMapUtil` for 2D or `JPS::VoxelMapUtil` for 3D. It can be confusing to set up this util, see the example code for more details.\n\nSecond, call the function `updateMap()` to allocate the internal map:\n```\nplanner.updateMap(); // Set map, must be called before plan\n```\n\nFinally, call the function `plan` to plan a path from `start` to `goal`. The third input is the heuristic weight, the forth input indicates whether planning with `JPS` or `A*`.\nBy default, the forth input is set to be `true`, means the `JPS` is the default back-end. To use normal `A*`:\n```c++\nbool valid_astar = planner.plan(start, goal, 1, false); // Plan from start to goal with heuristic weight 1, using A*\n```\n\nTow planners are provided for 2D and 3D map:\n - ```JPSPlanner2D```\n - ```JPSPlanner3D```\n\n#### Planning Example\nAn example code for a 2D map is given in [`test/test_planner_2d.cpp`](https://github.com/sikang/jps3d/blob/master/test/test_planner_2d.cpp),\nin which we plan from start to goal using both ```A*``` and ```JPS```.\nThe results are plotted in [corridor.png](https://github.com/sikang/jps3d/blob/master/data/corridor.png).\nGreen path is from ```A*```, red path is from ```JPS```. Even though they are using two different routes and `JPS` is much faster, the distance/cost of two paths is the same.\nIn other words, `JPS` guarantees the optimality but saves a significant amount of computation time.\n\n![Visualization](./data/corridor.png)\n```bash\n$ ./build/test_planner_2d ./data/corridor.yaml\nstart: 2.5  -2\ngoal:  35 2.5\norigin:  0 -5\ndim: 799 199\nresolution: 0.05\nJPS Planner takes: 5.000000 ms\nJPS Path Distance: 35.109545\nJPS Planner takes: 5.000000 ms\nAStar Planner takes: 62.000000 ms\nAStar Path Distance: 35.109545\n```\n\nAn example in 3D map is presented in [`test/test_planner_3d.cpp`](https://github.com/sikang/jps3d/blob/master/test/test_planner_3d.cpp) with the yaml `data/simple3d.yaml`.\n\n##### Mapping Example\nTo generate map in `yaml` format which can be loaded directly in the test node, a simple executable file [`test/create_map.cpp`](https://github.com/sikang/jps3d/blob/master/test/create_map.cpp) is used.\nUser can easily change the location of blocks in the source code.\n\n## DMP Usage\n`DMPlanner` stands for distance map planner which utilizes the artificial potential field to find a safer local path around a given path. We changed the API for setting map of `DMPlanner` in v1.1.\nThe key feature of this planner is its ability to push the path away from obstacles as much as possible. An example is given in the following figure\n[example_dmp.png](https://github.com/sikang/jps3d/blob/master/data/example_dmp.png), where red path comes from `JPS` which is always attached to obstacles and blue path is derived from `DMP` which is much safer.\n\n![Visualization](./data/example_dmp.png)\n\nThe code for generating this figure is given in [`test/test_distance_map_2d.cpp`](https://github.com/sikang/jps3d/blob/master/test/test_distance_map_planner_2d.cpp).\n```bash\n$ ./build/test_distance_map_planner_2d ./data/corridor.yaml\nstart: 2.5  -2\ngoal:  35 2.5\norigin:  0 -5\ndim: 799 199\nresolution: 0.05\nJPS Planner takes: 7.000000 ms\nJPS Path Distance: 35.109545\nDMP Planner takes: 8.000000 ms\nDMP Path Distance: 37.186501\n```\n\n## Doxygen\nFor more details, please refer to [Doxygen](https://kumarrobotics.github.io/jps3d).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumarrobotics%2Fjps3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkumarrobotics%2Fjps3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumarrobotics%2Fjps3d/lists"}