Skip to content

Commit

Permalink
fix(hesai): handle cut at 0/360deg correctly for non-360 and 360deg FoVs
Browse files Browse the repository at this point in the history
  • Loading branch information
mojomex committed Sep 17, 2024
1 parent 0575968 commit 30450fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nebula_ros/src/hesai/hesai_ros_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ nebula::Status HesaiRosWrapper::DeclareAndGetSensorConfigParams()

{
rcl_interfaces::msg::ParameterDescriptor descriptor = param_read_write();
descriptor.floating_point_range = float_range(0, 359.99, 0.01);
descriptor.floating_point_range = float_range(0, 360, 0.01);
descriptor.description =
"At which angle to start a new scan. Cannot be equal to the start angle in a non-360 deg "
"FoV. Choose the end angle instead.";
Expand Down Expand Up @@ -240,6 +240,13 @@ Status HesaiRosWrapper::ValidateAndSetConfig(
return Status::SENSOR_CONFIG_ERROR;
}

// Handling cutting at 360deg (as opposed to 0deg) for a full 360deg FoV requires a special case
// in the cutting logic. Thus, require the user to cut at 0deg.
if (fov_is_360 && new_config->cut_angle == 360) {
RCLCPP_ERROR(get_logger(), "Cannot cut a 360deg FoV at 360deg. Cut at 0deg instead.");
return Status::SENSOR_CONFIG_ERROR;
}

if (hw_interface_wrapper_) {
hw_interface_wrapper_->OnConfigChange(new_config);
}
Expand Down

0 comments on commit 30450fa

Please sign in to comment.