{"id":19429840,"url":"https://github.com/soraxas/sbp-env","last_synced_at":"2025-04-24T18:32:58.742Z","repository":{"id":49666469,"uuid":"171487413","full_name":"soraxas/sbp-env","owner":"soraxas","description":"Motion planning environment for Sampling-based Planners","archived":false,"fork":false,"pushed_at":"2024-01-02T05:52:36.000Z","size":16889,"stargazers_count":28,"open_issues_count":1,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-27T18:10:32.661Z","etag":null,"topics":["motion-planning","pathfinding","robotics","rrdt","rrt","rrt-star"],"latest_commit_sha":null,"homepage":"http://cs.tinyiu.com/sbp-env","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soraxas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-19T14:23:23.000Z","updated_at":"2023-12-19T08:53:08.000Z","dependencies_parsed_at":"2024-01-15T19:43:27.942Z","dependency_job_id":"d6fd4724-fb74-4f3e-a10a-c85e97a5dc86","html_url":"https://github.com/soraxas/sbp-env","commit_stats":{"total_commits":274,"total_committers":6,"mean_commits":"45.666666666666664","dds":"0.35401459854014594","last_synced_commit":"cd230449a887b770dfa162c9db822ef807c0220c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soraxas%2Fsbp-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soraxas%2Fsbp-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soraxas%2Fsbp-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soraxas%2Fsbp-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soraxas","download_url":"https://codeload.github.com/soraxas/sbp-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223962733,"owners_count":17232532,"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":["motion-planning","pathfinding","robotics","rrdt","rrt","rrt-star"],"created_at":"2024-11-10T14:21:52.417Z","updated_at":"2024-11-10T14:21:53.153Z","avatar_url":"https://github.com/soraxas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sampling-Based Motion Planners' Testing Environment\n\n[![pypi](https://img.shields.io/pypi/v/sbp-env)](https://pypi.org/project/sbp-env/)\n[![Python version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue.svg)](https://cs.tinyiu.com/sbp-env)\n[![CI](https://github.com/soraxas/sbp-env/actions/workflows/ci.yaml/badge.svg)](https://github.com/soraxas/sbp-env/actions/workflows/ci.yaml)\n[![Build docs](https://github.com/soraxas/sbp-env/actions/workflows/sphinx.yaml/badge.svg)](https://cs.tinyiu.com/sbp-env)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![License](https://img.shields.io/github/license/soraxas/sbp-env.svg)](https://github.com/soraxas/sbp-env/blob/master/LICENSE)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.03782/status.svg)](https://doi.org/10.21105/joss.03782)\n\nSampling-based motion planners' testing environment (`sbp-env`) is a full feature framework to quickly test different sampling-based algorithms for motion planning. `sbp-env` focuses on the flexibility of tinkering with different aspects of the framework, and had divided the main planning components into two categories (i) **samplers** and (ii) **planners**.\n\nThe focus of *motion planning research* had been mainly on (i) improving the sampling efficiency (with methods such as heuristic or learned distribution) and (ii) the algorithmic aspect of the planner using different routines to build a connected graph. Therefore, by separating the two components one can quickly swap out different components to test novel ideas.\n\nHave a look at the [documentations](https://cs.tinyiu.com/sbp-env) for more detail information. If you are looking for the previous code for the RRdT* paper it is now archived at [soraxas/rrdt](https://github.com/soraxas/rrdt).\n\n## Quick start with custom arbitrary environments\n\n```sh\npip install sbp-env\n```\n\n```python\nimport sbp_env\n\nfrom math import exp, sin, cos\n\nfor functor in [\n    # simple inequality\n    lambda x: (x[1] \u003c x[0] + 1) and (x[1] \u003e x[0] - 1),\n    # equation adopted from https://au.mathworks.com/help/matlab/ref/peaks.html\n    lambda x: 0\n    \u003c (\n        3 * (1 - x[0]) ** 2.0 * exp(-(x[0] ** 2) - (x[1] + 1) ** 2)\n        - 10 * (x[0] / 5 - x[0] ** 3 - x[1] ** 5) * exp(-x[0] ** 2 - x[1] ** 2)\n        - 1 / 3 * exp(-((x[0] + 1) ** 2) - x[1] ** 2)\n    ),\n    lambda x: -0.22 \u003c (cos(x[0]) * sin(x[1])),\n    lambda x: 0.05 \u003c (cos(x[0] ** 2 + x[1] ** 2)),\n]:\n    engine = sbp_env.engine.BlackBoxEngine(\n        collision_checking_functor=functor,\n        lower_limits=[-5, -5], upper_limits=[5, 5],\n        cc_epsilon=0.1,  # collision check resolution\n    )\n    planning_args = sbp_env.generate_args(\n        planner_id=\"rrt\", engine=engine,\n        start_pt=[-3, -3], goal_pt=[3, 3],\n        display=True, first_solution=True,\n    )\n\n    env = sbp_env.env.Env(args=planning_args)\n    env.run()\n    print(env.get_solution_path(as_array=True))\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/functor-engine1.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/functor-engine2.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/functor-engine3.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/functor-engine4.png\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\n#### Optional\n\nI recommend first create a virtual environment with\n\n```sh\n# assumes python3 and bash shell\npython -m venv sbp_env\nsource sbp_env/bin/activate\n```\n\n#### Install dependencies\n\nYou can install all the needed packages with pip.\n\n```sh\npip install -r requirements.txt\n```\n\nThere is also an optional dependency on [`klampt`](https://github.com/krishauser/Klampt) if you want to use the 3D simulator. Refer to its [installation guide](https://github.com/krishauser/Klampt#installation) for details.\n\n\u003cimg align=\"right\" width=\"300\" height=\"auto\" src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/klampt-simulator.png\" /\u003e\n\n## Quick Guide\n\nYou can get a detailed help message with\n\n```sh\npython main.py --help\n```\n\nbut the basic syntax is\n\n```sh\npython main.py \u003cPLANNER\u003e \u003cMAP\u003e [options]\n```\n\nIt will open a new window that display a map on it. Every white pixel is assumed to be free, and non-white pixels are obstacles. You will need to use your mouse to select two points on the map, the first will be set as the starting point and the second as the goal point.\n\n## Demos\n\n### Run maps with different available Planners\n\nThis repository contains a framework to performs quick experiments for Sampling-Based Planners (SBPs) that are implemented in Python. The followings are planners that had implemented and experimented in this framework.\n\nNote that the commands shown in the respective demos can be customised with additional options. In fact, the actual command format used for the demonstrations is\n\n```sh\npython main.py \u003cPLANNER\u003e maps/room1.png start \u003csx\u003e,\u003csy\u003e goal \u003csx\u003e,\u003csy\u003e -vv\n```\n\nto have a fix set of starting and goal points for consistent visualisation, but we omitted the start/goal options in the following commands for clarity.\n\n### RRdT*\n\n```sh\npython main.py rrdt maps/room1.png -vv\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"600\" height=\"auto\" src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/rrdt.gif\" alt=\"RRdT* Planner\" /\u003e\n\u003c/p\u003e\n\n### RRT*\n\n```sh\npython main.py rrt maps/room1.png -vv\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"600\" height=\"auto\" src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/rrt.gif\" alt=\"RRT* Planner\" /\u003e\n\u003c/p\u003e\n\n### Bi-RRT*\n\n```sh\npython main.py birrt maps/room1.png -vv\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg width=\"600\" height=\"auto\" src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/birrt.gif\" alt=\"Bi-RRT* Planner\" /\u003e\n\u003c/p\u003e\n\n### Informed RRT*\n\n```sh\npython main.py informedrrt maps/room1.png -vv\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"600\" height=\"auto\" src=\"https://raw.githubusercontent.com/soraxas/sbp-env/master/docs/images/informedrrt.gif\" alt=\"Informed RRT* Planner\" /\u003e\n\u003c/p\u003e\n\nThe red ellipse shown is the dynamic sampling area for Informed RRT*\n\n### Others\n\nThere are also some other planners included in this repository. Some are preliminary planner that inspired RRdT*, some are planners with preliminary ideas, and some are useful for debugging.\n\n## Reference to this repository\n\nYou can use the following citation if you use this repository for your research\n```bibtex\n@article{lai2021SbpEnv,\n  doi = {10.21105/joss.03782},\n  url = {https://doi.org/10.21105/joss.03782},\n  year = {2021},\n  publisher = {The Open Journal},\n  volume = {6},\n  number = {66},\n  pages = {3782},\n  author = {Tin Lai},\n  title = {sbp-env: A Python Package for Sampling-based Motion Planner and Samplers},\n  journal = {Journal of Open Source Software}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoraxas%2Fsbp-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoraxas%2Fsbp-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoraxas%2Fsbp-env/lists"}