diff --git a/src/DepthImageToLaserScan.cpp b/src/DepthImageToLaserScan.cpp index 4c589cd..d6f59d2 100644 --- a/src/DepthImageToLaserScan.cpp +++ b/src/DepthImageToLaserScan.cpp @@ -153,7 +153,7 @@ sensor_msgs::msg::LaserScan::UniquePtr DepthImageToLaserScan::convert_msg( // Calculate and fill the ranges uint32_t ranges_size = depth_msg->width; - scan_msg->ranges.assign(ranges_size, std::numeric_limits::quiet_NaN()); + scan_msg->ranges.assign(ranges_size, std::numeric_limits::infinity()); if (depth_msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1) { convert(depth_msg, cam_model_, scan_msg, scan_height_);