GithubHelp home page GithubHelp logo

lu-tju / allocnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kumarrobotics/allocnet

0.0 0.0 0.0 28.69 MB

Kumar的work: A lightweight learning-based trajectory optimization framework.

License: BSD 3-Clause "New" or "Revised" License

C++ 47.60% Python 52.25% CMake 0.15%

allocnet's Introduction

AllocNet: Learning Time Allocation for Trajectory Optimization

About

AllocNet is a lightweight learning-based trajectory optimization framework.

Authors: Yuwei Wu, Xiatao Sun, Igor Spasojevic, and Vijay Kumar from the Kumar Lab.

Video Links: Youtube

Related Paper: Wu, Y., Sun, X., Spasojevic, I. and Kumar, V., 2023. Deep Learning for Optimization of Trajectories for Quadrotors. arXiv preprint arXiv:2309.15191. arxiv Preprint

If this repo helps your research, please cite our paper at:

@misc{wu2023learning,
      title={Deep Learning for Optimization of Trajectories for Quadrotors}, 
      author={Yuwei Wu and Xiatao Sun and Igor Spasojevic and Vijay Kumar},
      year={2023},
      eprint={2309.15191},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

Acknowledgements

  • Dataset: The raw point cloud dataset from M3ED
  • Front-end Path Planning: We use OMPL planning library
  • Planning Modules and Visualization: We use the module in GCOPTER

Run our pre-trained Model in Simulation

The repo has been tested on 20.04 with ros-desktop-full installation.

1. Prerequisites

1.1 ROS and OMPL

Follow the guidance to install ROS and install OMPL:

sudo apt install libompl-dev

1.2 libtorch

Download the libtorch and put it into the planner folder: GPU version, or CPU version

1.3 QP solver

We use osqp to solve quadratic programming, install by:

git clone -b release-0.6.3 https://github.com/osqp/osqp.git
cd osqp
git submodule init
git submodule update
mkdir build & cd build
cmake ..
sudo make install

cd ../..
git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build & cd build
cmake ..
sudo make install

2. Build on ROS

git clone [email protected]:yuwei-wu/AllocNet.git && cd AllocNet/src
wstool init && wstool merge utils.rosinstall && wstool update
catkin build

The default mode is set to the GPU version. To switch to the CPU, navigate to line 29 in the 'learning_planning.cpp' file and replace 'device(torch::kGPU)' with 'device(torch::kCPU)'. After making this change, recompile the code for the updates to take effect.

3. Run

source devel/setup.bash
roslaunch planner learning_planning.launch

click 2D Nav Goal to trigger planning:

Train new models

0. Folder Structure

network/
│
├── config/                - Configuration files for training and testing.
│
│
├── utils/                 - Utility functions and classes.
│   └── learning/          - Contains network classes and layers
│
└── sample_<...>.py        - Scripts for sampling data
└── train_minsnap_<...>.py - Scripts for training
└── test_minsnap_<...>.py  - Scripts for testing
└── ts_conversion_<...>.py - Scripts for converting to TorchScript

1. Pre-requisites

  • Ubuntu 20.04 / Windows 11
    • 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.
  • Python 3.8
  • CUDA 11.7

2. Setup

2.1 Install Dependencies

  • Install Ubuntu packages
    • sudo apt-get install python3-dev python3-venv
  • Create a virtual environment
    • python3 -m venv venv
  • Activate the virtual environment
    • source venv/bin/activate
  • Install the requirements
    • pip install wheel
    • pip install numpy==1.24.2
    • pip install -r requirements.txt

2.2 Setup Iris

Follow the instructions to install, and you may need to change the CMakeLists.txt in iris-distro/CMakeLists.txt

iris: https://github.com/rdeits/iris-distro

For AMD CPU, if you encounter a core dump, please refer to instructions in this link:

https://github.com/rdeits/iris-distro/issues/81
pip install -U kaleido

3. Run

  • For training, please run python train_minsnap_<model_configuration>.py
  • For testing, please run python test_minsnap_<model_configuration>.py
  • For converting the learned model to TorchScript, please run python ts_conversion_<model_configuration>.py

Maintaince

For any technical issues, please contact Yuwei Wu ([email protected], [email protected]).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.