Stable-Time Path Planning
1. Setup
All the tests are conducted in the Linux environment on a computer equipped with an Intel Core i7-10700 CPU and a GeForce RTX 2060 GPU. Moreover, our software is developed and tested in Ubuntu 18.04, 20.04 with ROS installed. ROS can be installed here: ROS Installation.
To build this project, ensure that you have the following dependencies installed:
-
LibTorch: We necessitate invoking models generated by PyTorch in C++, we require the utilization of LibTorch.
-
CUDA Toolkit: Required for GPU acceleration.
-
OMPL: A comprehensive library for motion planning and control.
1. LibTorch
To facilitate your workflow, we have prepared the LibTorch 2.1.0 in google drive.
Please download, unzip and put it in ~/NeuralTraj
.
Matching LibTorch and CUDA versions is imperative - mismatches will cause model inference failures. We provide pre-verified combinations below. The following combinations have been tested:
LibTorch Version | CUDA 11.8 |
---|---|
2.1.0 | ✅ Support |
2. CUDA Toolkit
1. Install CUDA Toolkit
Following the instructions in the CUDA Toolkit download archive
2. Create a Symbolic Link
stat cuda # check the original version of cuda
cd /usr/local
sudo rm -rf cuda
sudo ln -s /usr/local/cuda-11.8 /usr/local/cuda
stat cuda # check the updated version of cuda
3. Set Environment Variables of CUDA
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export PATH=$PATH:/usr/local/cuda/bin
3. OMPL
sudo apt-get install libompl-dev ompl-demos
2. Use the pre-trained model and test it in ROS.
1. Unzip the project and go to the corresponding directory.
cd ~/DPtraj/NeuralTraj
2. Compile it.
catkin_make -DCMAKE_BUILD_TYPE=Release
3. Run.
Open a new terminal window and type:
cd ~/DPtraj/NeuralTraj
source devel/setup.bash
Then, run the script:
./run.sh
4. Reproduce Results.
Use the 2D Nav Goal in RVIZ to trigger the planning. The program will read the test data from /src/plan_manage/testdata
and automatically fetch the next set of data (start and end states along with the environment) for planning every 10 seconds.
Here is an example:
If the map does not appear after waiting for several seconds, there is no need to worry. Simply trigger it using 2D Nav Goal, and the map will be reloaded.
Here, the green curve represents the path directly outputted by our method, the yellow curve denotes the path outputted by Hybrid A, and the light blue curve illustrates the path outputted by Hybrid A* integrated with Transformer. Lastly, the red curve showcases the trajectory generated by further backend optimization of the path outputted by our network.
Switching to the terminal, it will display the computation times of the various frontend path planning algorithms for this instance, along with the corresponding times for backend optimization.
Note: Due to computational performance and solver randomness, slight deviations in results may occur.
3. Contact
If you have any questions, please feel free to contact Zhichao HAN (zhichaohan@zju.edu.cn) or Mengze TIAN(mengze.tian@epfl.ch).