custom ros package not detected after catkin_make
Hi guys,
I am working with openVino, and I am currently trying to integrate their sample code to ros (in a package that I called open_vino_try). So I changed the code in the cpp file, adding pub and sub, I added the essential things in the cmake and in the package.xml, and everything seems to compile fine:
-- ~~ traversing 5 packages in topological order:
-- ~~ - realsense2_description
-- ~~ - object_msgs
-- ~~ - open_vino_try
-- ~~ - opencv_tuto
-- ~~ - realsense2_camera
Scanning dependencies of target open_vino_try
[ 88%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/main.cpp.o
[ 90%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/cnn.cpp.o
[ 92%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/kuhn_munkres.cpp.o
[ 92%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/detector.cpp.o
[ 94%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/distance.cpp.o
[ 95%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/tracker.cpp.o
[ 97%] Building CXX object open_vino_try/pedestrian_tracker_demo/CMakeFiles/open_vino_try.dir/src/utils.cpp.o
[ 98%] Linking CXX executable /home/antoine/catkin_ws/devel/lib/open_vino_try/open_vino_try
[ 98%] Built target open_vino_try
But then I cannot run it through a rosrun, and actually the package does not appear anywhere, no matters the command. I obviously tried to source the devel every time but nothing changes.
The structure of my project is the following: I have my pkg (open_vino_try) which will hold many subfolders, corresponding to the different sample code from OpenVino (btw I am aware that ros packages already exist, but they didn't seem to work properly, and moreover I really want to know why it is not working). For now there is only one subfolder: pedestrian_tracker_demo. So I have a "big" CMakeLists at the root of my pkg which will call other CMakeLists in the different subfolder.
That the tree of my project:
- open_vino_try (my package)
- CMakeLists.txt
- Package.xml
- pedestrian_tracker_demo
- CMakeLists.txt
- src (folder)
- include
- main.cpp
- (Other folder denpencies)
This is my CMakeFiles in the pkg root folder:
cmake_minimum_required(VERSION 3.0.2)
project(open_vino_try)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
image_transport
roscpp
sensor_msgs
std_msgs
rospy
)
catkin_package()
option(ENABLE_PYTHON "Whether to build extension modules for Python demos" OFF)
if (CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used")
set(CMAKE_BUILD_TYPE "Release")
endif()
if (NOT(BIN_FOLDER))
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} ARCH)
if(ARCH STREQUAL "x86_64" OR ARCH STREQUAL "amd64") # Windows detects Intel's 64-bit CPU as AMD64
set(ARCH intel64)
elseif(ARCH STREQUAL "i386")
set(ARCH ia32)
endif()
set (BIN_FOLDER ${ARCH})
endif()
if (NOT(IE_MAIN_SOURCE_DIR))
# in case if samples are built out of IE repo
set (IE_MAIN_SAMPLES_DIR ${CMAKE_CURRENT_BINARY_DIR})
else()
# in case if samples are built from IE repo
set (IE_MAIN_SAMPLES_DIR ${IE_MAIN_SOURCE_DIR})
endif()
if(NOT(UNIX))
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_LIBRARY_PATH ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
#set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_DIRECTORY}) # compatibility issue: linux uses LIBRARY_OUTPUT_PATH, windows uses LIBRARY_OUTPUT_DIRECTORY
else ()
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER}/${CMAKE_BUILD_TYPE}/lib)
set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR ...
try
source ~/.bashrc
... I have to do that each time after I catkin build a new package.... otherwise it could not locate the new packageHi, sorry I forgot to say that I did it everytime, and sourcing the devel/setup.bash, but nothing changes!