@@ -4,7 +4,6 @@ project(ros2_orb_slam3)
4
4
# Make sure to set this path before building the
5
5
set (ENV{PYTHONPATH} "/opt/ros/humble/lib/python3.10/site-packages/" ) # Must be set to match your installation
6
6
7
-
8
7
# Must use C++17 to make it compatible with rclcpp
9
8
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3" )
10
9
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3" )
@@ -25,7 +24,9 @@ LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) # REDUNDANT?
25
24
26
25
# find dependencies
27
26
find_package (ament_cmake REQUIRED )
27
+ find_package (ament_cmake_python REQUIRED )
28
28
find_package (rclcpp REQUIRED )
29
+ find_package (rclpy REQUIRED )
29
30
find_package (std_msgs REQUIRED )
30
31
find_package (sensor_msgs REQUIRED )
31
32
# find_package(your_custom_msg_interface REQUIRED)
@@ -36,14 +37,14 @@ find_package(Pangolin REQUIRED)
36
37
find_package (image_transport REQUIRED )
37
38
38
39
39
- # Header file locations
40
- include_directories (include ) # This package include
40
+ # Header file locations [C++ node]
41
+ include_directories (include ) # Add .hpp, .h files from include/ros2_orb_slam3
41
42
include_directories (${EIGEN3_INCLUDE_DIRS} ) # Include headers for eigen3
42
43
include_directories (${Pangolin_INCLUDE_DIRS} ) # include headers for pangolin
43
44
include_directories (${OpenCV_INCLUDE_DIRS} ) # include headers for pangolin
44
45
45
46
46
- # ORB-SLAM3 includes
47
+ # ORB-SLAM3 includes [VSLAM library]
47
48
include_directories (
48
49
${PROJECT_SOURCE_DIR}
49
50
${PROJECT_SOURCE_DIR} /orb_slam3
@@ -57,6 +58,7 @@ include_directories(
57
58
58
59
set (THIS_PACKAGE_INCLUDE_DEPENDS
59
60
rclcpp
61
+ rclpy
60
62
std_msgs
61
63
sensor_msgs
62
64
# your_custom_msg_interface
@@ -68,7 +70,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
68
70
)
69
71
70
72
#* ORB SLAM3 as a shared library
71
- # Whenever you add a new .h, .hpp or .cc, .cpp file in the orb_slam3 directory , make sure to add them here as shown below
73
+ # Whenever you add a new .h, .hpp or .cc, .cpp file in the ros2_orb_slam3/ orb_slam3/include and os2_orb_slam3/orb_slam3/src directories , make sure to add them here as shown below
72
74
add_library (orb_slam3_lib SHARED
73
75
orb_slam3/src/System.cc
74
76
orb_slam3/src/Tracking.cc
@@ -130,8 +132,7 @@ add_library(orb_slam3_lib SHARED
130
132
orb_slam3/include/Settings.h
131
133
)
132
134
133
-
134
- set_target_properties (orb_slam3_lib PROPERTIES VERSION "${orb_slam3_lib_VERSION} " )
135
+ set_target_properties (orb_slam3_lib PROPERTIES VERSION "${orb_slam3_lib_VERSION} " ) # TODO need to findout why this is required
135
136
136
137
ament_target_dependencies (orb_slam3_lib
137
138
${THIS_PACKAGE_INCLUDE_DEPENDS}
@@ -151,7 +152,7 @@ target_link_libraries(orb_slam3_lib
151
152
)
152
153
153
154
154
- # Find the .so files built inside orb_slam3/Thirdparty projects
155
+ # Find the .so files provided in ros2_orb_slam3/ orb_slam3/Thirdparty projects
155
156
set (DBoW2_PATH "${PROJECT_SOURCE_DIR} /orb_slam3/Thirdparty/DBoW2/lib/libDBoW2.so" )
156
157
set (g2o_PATH "${PROJECT_SOURCE_DIR} /orb_slam3/Thirdparty/g2o/lib/libg2o.so" )
157
158
@@ -196,4 +197,15 @@ ament_export_dependencies(
196
197
)
197
198
198
199
200
+ # Python node
201
+ # Install Python modules, submodules
202
+ ament_python_install_package (${PROJECT_NAME} ) # Install the modules in ros2_orb_slam3/ros2_orb_slam3 folder
203
+
204
+ # Install Python executibles
205
+ install (PROGRAMS
206
+ scripts/mono_driver_node.py
207
+ DESTINATION lib/${PROJECT_NAME}
208
+ )
209
+
210
+
199
211
ament_package ()
0 commit comments