{"id":18624625,"url":"https://github.com/kumarrobotics/allocnet","last_synced_at":"2025-10-12T13:16:34.892Z","repository":{"id":186628759,"uuid":"670794066","full_name":"KumarRobotics/AllocNet","owner":"KumarRobotics","description":"A lightweight learning-based trajectory optimization framework.","archived":false,"fork":false,"pushed_at":"2025-06-01T02:44:16.000Z","size":29395,"stargazers_count":96,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-01T12:37:10.189Z","etag":null,"topics":["motion-planning","trajectory-optimization"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-25T21:17:36.000Z","updated_at":"2025-06-01T02:44:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba81f49e-c987-4288-8912-d5a0b753a02f","html_url":"https://github.com/KumarRobotics/AllocNet","commit_stats":null,"previous_names":["yuwei-wu/allocnet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KumarRobotics/AllocNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2FAllocNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2FAllocNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2FAllocNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2FAllocNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KumarRobotics","download_url":"https://codeload.github.com/KumarRobotics/AllocNet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KumarRobotics%2FAllocNet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270268652,"owners_count":24555643,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","trajectory-optimization"],"created_at":"2024-11-07T04:29:46.020Z","updated_at":"2025-10-12T13:16:29.823Z","avatar_url":"https://github.com/KumarRobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AllocNet: Learning Time Allocation for Trajectory Optimization\n\n## About\n\nAllocNet is a lightweight learning-based trajectory optimization framework. \n\n__Authors__: [Yuwei Wu](https://github.com/yuwei-wu), [Xiatao Sun](https://github.com/M4D-SC1ENTIST), Igor Spasojevic, and Vijay Kumar from the [Kumar Lab](https://www.kumarrobotics.org/).\n\n__Video Links__:  [Youtube](https://www.youtube.com/watch?v=tA02dJz9ux8)\n\n\n__Related Paper__: Y. Wu, X. Sun, I. Spasojevic and V. Kumar, \"Deep Learning for Optimization of Trajectories for Quadrotors,\" in IEEE Robotics and Automation Letters, vol. 9, no. 3, pp. 2479-2486, March 2024\n[arxiv Preprint](https://arxiv.org/pdf/2309.15191.pdf)\n\nIf this repo helps your research, please cite our paper at:\n\n```bibtex\n@ARTICLE{10412114,\n  author={Wu, Yuwei and Sun, Xiatao and Spasojevic, Igor and Kumar, Vijay},\n  journal={IEEE Robotics and Automation Letters}, \n  title={Deep Learning for Optimization of Trajectories for Quadrotors}, \n  year={2024},\n  volume={9},\n  number={3},\n  pages={2479-2486}}\n```\n\n## Acknowledgements\n\n\n- Dataset: The raw point cloud dataset from [M3ED](https://m3ed.io/)\n- Front-end Path Planning: We use [OMPL](https://ompl.kavrakilab.org/) planning library\n- Planning Modules and Visualization: We use the module in [GCOPTER](https://github.com/ZJU-FAST-Lab/GCOPTER)\n\n\n## Run our pre-trained Model in Simulation\n\nThe repo has been tested on 20.04 with ros-desktop-full installation.\n\n### 1. Prerequisites\n\n#### 1.1 ROS and OMPL\n\nFollow the guidance to install [ROS](https://wiki.ros.org/ROS/Installation) and install OMPL:\n```\nsudo apt install libompl-dev\n```\n\n#### 1.2 libtorch\n\nDownload the libtorch and put it into the \"AllocNet/src/planner/libtorch/\" folder: [GPU version](https://download.pytorch.org/libtorch/nightly/cu117/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230301%2Bcu117.zip), or [CPU version](https://download.pytorch.org/libtorch/nightly/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0.dev20230301%2Bcpu.zip)\n\n#### 1.3 QP solver \n\nWe use osqp to solve quadratic programming, install by:\n\n```\ngit clone -b release-0.6.3 https://github.com/osqp/osqp.git\ncd osqp\ngit submodule init\ngit submodule update\nmkdir build \u0026 cd build\ncmake ..\nsudo make install\n\ncd ../..\ngit clone https://github.com/robotology/osqp-eigen.git\ncd osqp-eigen\nmkdir build \u0026 cd build\ncmake ..\nsudo make install\n```\n\n### 2. Build on ROS \n\n##### 2.1 Build\n\n```\ngit clone git@github.com:KumarRobotics/AllocNet.git \u0026\u0026 cd AllocNet/src\nwstool init \u0026\u0026 wstool merge utils.rosinstall \u0026\u0026 wstool update\ncatkin build\n```\n\n#### 2.2 Switch towards GPU and CPU\n\nThe default mode is set to the GPU version. \n\nTo switch to the CPU,\n1. navigate to line 29 in the 'learning_planning.hpp' file and replace 'device(torch::kGPU)' with 'device(torch::kCPU)'. After making this change, recompile the code for the updates to take effect.\n2. In \"AllocNet/src/planner/launch/learning_planning.launch, line 63, change the model\n   \n```\n   \u003cparam name=\"ModelPath\" value=\"$(find planner)/models/seq5_tokenthresh0_35.pt\"/\u003e\n```\nto \n\n```\n   \u003cparam name=\"ModelPath\" value=\"$(find planner)/models/seq5_tokenthresh0_35_cpu.pt\"/\u003e\n```\n\n\nYou can also check: - [Installing C++ Distributions of PyTorch](https://pytorch.org/cppdocs/installing.html)\n\n\n### 3. Run\n\n```\nsource devel/setup.bash\nroslaunch planner learning_planning.launch\n```\n\nClick 2D Nav Goal to trigger planning:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/sim_vis.gif\"/\u003e\n\u003c/p\u003e\n\n\n## Train new models\n\n### 0. Folder Structure\n\n```plaintext\nnetwork/\n│\n├── config/                - Configuration files for training and testing.\n│\n│\n├── utils/                 - Utility functions and classes.\n│   └── learning/          - Contains network classes and layers\n│\n└── train_minsnap_\u003c...\u003e.py - Scripts for training\n└── test_minsnap_\u003c...\u003e.py  - Scripts for testing\n└── ts_conversion_\u003c...\u003e.py - Scripts for converting to TorchScript\n```\n\n### 1. Pre-requisites\n- Ubuntu 20.04 / Windows 11\n  - If using WSL2 with simulation running in windows, please add `export WSL_HOST_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}')` to your `.bashrc` file to allow communication between Windows and the subsystem.\n- Python 3.8\n- CUDA 11.7\n\n### 2. Setup\n\n#### 2.1 Install Dependencies\n\n- Install Ubuntu packages\n  - `sudo apt-get install python3-dev python3-venv`\n- Create a virtual environment\n  - `python3 -m venv venv`\n- Activate the virtual environment\n  - `source venv/bin/activate`\n- Install the requirements\n  - `pip install wheel`\n  - `pip install numpy==1.24.2`\n  - `pip install -r requirements.txt`\n  \n\n#### 2.2 Setup Iris\n\nFollow the instructions to install, and you may need to change the *CMakeLists.txt* in *iris-distro/CMakeLists.txt*\n```\niris: https://github.com/rdeits/iris-distro\n```\nFor AMD CPU, if you encounter a core dump, please refer to instructions in this link:\n```\nhttps://github.com/rdeits/iris-distro/issues/81\n```\n```\npip install -U kaleido\n```\n\n### 3. Run\n- For training, please run ```python train_minsnap_\u003cmodel_configuration\u003e.py```\n- For testing, please run ```python test_minsnap_\u003cmodel_configuration\u003e.py```\n- For converting the learned model to TorchScript, please run ```python ts_conversion_\u003cmodel_configuration\u003e.py```\n\n\n## Maintaince\n\nFor any technical issues, please contact Yuwei Wu (yuweiwu@seas.upenn.edu, yuweiwu20001@outlook.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumarrobotics%2Fallocnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkumarrobotics%2Fallocnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumarrobotics%2Fallocnet/lists"}