-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
133 lines (107 loc) · 3.86 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
cmake_minimum_required(VERSION 3.5)
project(autodrive_iros_2024)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(slam_toolbox REQUIRED)
find_package(robot_localization REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(control_toolbox REQUIRED)
find_package(geometry_msgs REQUIRED)
# C++ executables
add_executable(frame_republisher src/frame_republisher.cpp)
ament_target_dependencies(frame_republisher rclcpp std_msgs sensor_msgs slam_toolbox robot_localization tf2_ros)
add_executable(ackermann_odometry src/ackermann_odometry.cpp)
ament_target_dependencies(ackermann_odometry rclcpp std_msgs sensor_msgs slam_toolbox robot_localization tf2_ros)
add_executable(simple_driver src/simple_driver.cpp)
ament_target_dependencies(simple_driver rclcpp std_msgs sensor_msgs slam_toolbox robot_localization tf2_ros)
add_executable(sensor_republisher src/sensor_republisher.cpp)
ament_target_dependencies(sensor_republisher rclcpp std_msgs sensor_msgs slam_toolbox robot_localization tf2_ros)
add_executable(speed_controller src/actuator_control/speed_controller.cpp)
ament_target_dependencies(speed_controller rclcpp std_msgs nav_msgs message_filters control_toolbox)
add_executable(steer_controller src/actuator_control/steer_controller.cpp)
ament_target_dependencies(steer_controller rclcpp std_msgs)
add_executable(map_transform_node src/map_transform_node.cpp)
ament_target_dependencies(map_transform_node rclcpp std_msgs geometry_msgs tf2_ros tf2 nav_msgs visualization_msgs control_toolbox)
#include "rclcpp/rclcpp.hpp"
#include "nav_msgs/msg/occupancy_grid.hpp"
#include "tf2_ros/transform_listener.h"
#include "tf2_ros/buffer.h"
#include "geometry_msgs/msg/transform_stamped.hpp"
#include "tf2/exceptions.h"
# Include node directories
target_include_directories(
frame_republisher PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
ackermann_odometry PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
simple_driver PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
sensor_republisher PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
speed_controller PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
steer_controller PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_include_directories(
map_transform_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
install(TARGETS
speed_controller
steer_controller
frame_republisher
ackermann_odometry
simple_driver
sensor_republisher
map_transform_node
DESTINATION lib/${PROJECT_NAME})
# Install directories for launch and config
install(DIRECTORY launch/
DESTINATION share/${PROJECT_NAME}/launch
)
install(DIRECTORY config/
DESTINATION share/${PROJECT_NAME}/config
)
# Install Python scripts
install(PROGRAMS
scripts/data_collector.py
DESTINATION lib/${PROJECT_NAME}
)
# If using launch files in Python
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()