diff --git a/src/nebula_continental/nebula_continental/CMakeLists.txt b/src/nebula_continental/nebula_continental/CMakeLists.txt
index 07ee68569..62bf6e40a 100644
--- a/src/nebula_continental/nebula_continental/CMakeLists.txt
+++ b/src/nebula_continental/nebula_continental/CMakeLists.txt
@@ -6,6 +6,10 @@ find_package(message_filters REQUIRED)
find_package(tf2_ros REQUIRED)
autoware_package()
+if("$ENV{ENABLE_AGNOCAST}" AND NOT agnocast_components_FOUND)
+ message(FATAL_ERROR "agnocast_components is required when Agnocast is enabled")
+endif()
+
# # Continental
# ARS548
@@ -42,9 +46,16 @@ ament_target_dependencies(
rclcpp_components
tf2_ros)
-rclcpp_components_register_node(
- continental_ars548_ros_wrapper PLUGIN "ContinentalARS548RosWrapper"
- EXECUTABLE continental_ars548_ros_wrapper_node)
+if("$ENV{ENABLE_AGNOCAST}")
+ agnocast_components_register_node(
+ continental_ars548_ros_wrapper PLUGIN "ContinentalARS548RosWrapper"
+ EXECUTABLE continental_ars548_ros_wrapper_node
+ EXECUTOR CallbackIsolatedAgnocastExecutor)
+else()
+ rclcpp_components_register_node(
+ continental_ars548_ros_wrapper PLUGIN "ContinentalARS548RosWrapper"
+ EXECUTABLE continental_ars548_ros_wrapper_node)
+endif()
# SRR520
add_library(
@@ -79,9 +90,15 @@ ament_target_dependencies(
message_filters
tf2_ros)
-rclcpp_components_register_node(
- continental_srr520_ros_wrapper PLUGIN "ContinentalSRR520RosWrapper"
- EXECUTABLE continental_srr520_ros_wrapper_node)
+if("$ENV{ENABLE_AGNOCAST}")
+ agnocast_components_register_node(
+ continental_srr520_ros_wrapper PLUGIN "ContinentalSRR520RosWrapper"
+ EXECUTABLE continental_srr520_ros_wrapper_node)
+else()
+ rclcpp_components_register_node(
+ continental_srr520_ros_wrapper PLUGIN "ContinentalSRR520RosWrapper"
+ EXECUTABLE continental_srr520_ros_wrapper_node)
+endif()
install(
TARGETS continental_ars548_ros_wrapper
@@ -185,4 +202,8 @@ ament_export_dependencies(
visualization_msgs
yaml-cpp)
+if("$ENV{ENABLE_AGNOCAST}")
+ ament_export_dependencies(agnocast_components)
+endif()
+
ament_package()
diff --git a/src/nebula_continental/nebula_continental/package.xml b/src/nebula_continental/nebula_continental/package.xml
index 1bd13c9f1..529c34f4a 100644
--- a/src/nebula_continental/nebula_continental/package.xml
+++ b/src/nebula_continental/nebula_continental/package.xml
@@ -16,6 +16,7 @@
ros_environment
ros_testing
+ agnocast_components
autoware_sensing_msgs
continental_msgs
continental_srvs
diff --git a/src/nebula_hesai/nebula_hesai/CMakeLists.txt b/src/nebula_hesai/nebula_hesai/CMakeLists.txt
index 15aa9296c..8f2ed1804 100644
--- a/src/nebula_hesai/nebula_hesai/CMakeLists.txt
+++ b/src/nebula_hesai/nebula_hesai/CMakeLists.txt
@@ -8,6 +8,9 @@ autoware_package()
if("$ENV{ENABLE_AGNOCAST}" AND NOT agnocastlib_FOUND)
message(FATAL_ERROR "agnocastlib is required when Agnocast is enabled")
endif()
+if("$ENV{ENABLE_AGNOCAST}" AND NOT agnocast_components_FOUND)
+ message(FATAL_ERROR "agnocast_components is required when Agnocast is enabled")
+endif()
# Hesai
add_library(
@@ -46,8 +49,15 @@ if("$ENV{ENABLE_AGNOCAST}")
add_definitions(-DUSE_AGNOCAST_ENABLED)
endif()
-rclcpp_components_register_node(hesai_ros_wrapper PLUGIN "HesaiRosWrapper"
- EXECUTABLE hesai_ros_wrapper_node)
+if("$ENV{ENABLE_AGNOCAST}")
+ agnocast_components_register_node(
+ hesai_ros_wrapper PLUGIN "HesaiRosWrapper"
+ EXECUTABLE hesai_ros_wrapper_node
+ EXECUTOR CallbackIsolatedAgnocastExecutor)
+else()
+ rclcpp_components_register_node(hesai_ros_wrapper PLUGIN "HesaiRosWrapper"
+ EXECUTABLE hesai_ros_wrapper_node)
+endif()
install(
TARGETS hesai_ros_wrapper
@@ -185,6 +195,7 @@ ament_export_dependencies(
if("$ENV{ENABLE_AGNOCAST}")
ament_export_dependencies(agnocastlib)
+ ament_export_dependencies(agnocast_components)
endif()
ament_package()
diff --git a/src/nebula_hesai/nebula_hesai/package.xml b/src/nebula_hesai/nebula_hesai/package.xml
index db2a74845..0b043f565 100644
--- a/src/nebula_hesai/nebula_hesai/package.xml
+++ b/src/nebula_hesai/nebula_hesai/package.xml
@@ -14,6 +14,7 @@
ros_environment
ros_testing
+ agnocast_components
agnocastlib
autoware_internal_debug_msgs
autoware_utils_debug