Skip to content

Commit

Permalink
fix(hesai): warn the user if they try to use multicast with wildcard …
Browse files Browse the repository at this point in the history
…host address

Signed-off-by: Max SCHMELLER <[email protected]>
  • Loading branch information
mojomex committed Nov 21, 2024
1 parent 5fd3142 commit 91b7e0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nebula_ros/src/hesai/hesai_ros_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check warning on line 229 in nebula_ros/src/hesai/hesai_ros_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/hesai/hesai_ros_wrapper.cpp#L229

Added line #L229 was not covered by tests
get_logger(),
"A concrete host IP must be given when multicast is enabled, otherwise the correct network "

Check warning on line 231 in nebula_ros/src/hesai/hesai_ros_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/hesai/hesai_ros_wrapper.cpp#L231

Added line #L231 was not covered by tests
"interface cannot be determined.");
return Status::SENSOR_CONFIG_ERROR;
}

Check warning on line 234 in nebula_ros/src/hesai/hesai_ros_wrapper.cpp

View check run for this annotation

Codecov / codecov/patch

nebula_ros/src/hesai/hesai_ros_wrapper.cpp#L234

Added line #L234 was not covered by tests
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'");
Expand Down

0 comments on commit 91b7e0e

Please sign in to comment.