Article Directory
First of all thank all the authors of the open-source sharing, then transplanted from other programs .cpp
and .h
files, how to use your own programs?
1. Migrate files
Create a new include
folder under the directory of the current function package , and move the .h
file to the include
bottom. Move the .cpp
file to the src
bottom. The structure is as follows: where the AStar.h
sum AStar.cpp
is transplanted.
djq@djq-UX410UQK:~/catkin_ws/src/LocalPlanning$ tree -L 2
.
├── CMakeLists.txt
├── include
│ └── AStar.h
├── package.xml
└── src
├── AStar.cpp
├── for_test_hy.cpp
2. Modify the CmakeLists file
Add 1:
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/AStar.cpp
)
set(HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/AStar.h
)
Add 2:
include_directories(include)
It's ok, when you use it in your own program, remember to add the header file.
#include "AStar.h"