From 91b7e0ef64899d7189b896accbc76ceca9b038bb Mon Sep 17 00:00:00 2001 From: Max SCHMELLER Date: Tue, 19 Nov 2024 18:18:10 +0900 Subject: [PATCH] fix(hesai): warn the user if they try to use multicast with wildcard host address Signed-off-by: Max SCHMELLER --- nebula_ros/src/hesai/hesai_ros_wrapper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp index c10bcdf3..2b76a8e3 100644 --- a/nebula_ros/src/hesai/hesai_ros_wrapper.cpp +++ b/nebula_ros/src/hesai/hesai_ros_wrapper.cpp @@ -225,6 +225,13 @@ Status HesaiRosWrapper::validate_and_set_config( if (new_config->frame_id.empty()) { return Status::SENSOR_CONFIG_ERROR; } + if (!new_config->multicast_ip.empty() && new_config->host_ip == "255.255.255.255") { + RCLCPP_ERROR( + get_logger(), + "A concrete host IP must be given when multicast is enabled, otherwise the correct network " + "interface cannot be determined."); + return Status::SENSOR_CONFIG_ERROR; + } if (new_config->ptp_profile == nebula::drivers::PtpProfile::UNKNOWN_PROFILE) { RCLCPP_ERROR( get_logger(), "Invalid PTP Profile Provided. Please use '1588v2', '802.1as' or 'automotive'");