Closed TeerapongPoom closed 2 years ago
nvm. I just add
if(r > scan_msg->range_max){
scan_msg->ranges[index] = std::numeric_limits<float>::infinity();
}
to line 208 in DepthImageToLaserScan.h and it works now.
@TeerapongPoom This is an important bug, that breaks costmaps in nav2. I think it should be reopened so it will be fixed for everyone.
I read in the wiki https://wiki.ros.org/depthimage_to_laserscan and it says ranges less than
range_min
will be output as -Inf and +Inf forrange_max
. When I try withrange_min=0.3
andrange_max=4.0
, all values not in range become nan. Here is message from rostopic echo https://drive.google.com/file/d/1YSh61ATBp4Xuy6y_YcDfNicW1LBbvW1E/view?usp=sharingBut this is the result after I increase range_max to
range_max=10.0
https://drive.google.com/file/d/1Vnczgholi2ksoAOVkHGeTYrr4JSMgLlA/view?usp=sharingMy sensor is realsense d455 and depth image encoding is 16UC1. ROS distro in noetic. This is how i call node in launch file.