Why won't the /scan topic display rounded values?
Hello,
I am a student at a university of applied sciences, working on a robot that uses the Hokuyo UBG-04LX-F01 LIDAR.
The robot that I use runs on Ubuntu 12.0.4.5 with ROS Hydro Medusa.
The LIDAR of this robot supposedly has a minimum detection range of 20 millimetres and a maximum detection range of 5600 millimetres. This LIDAR is already installed on the robot and it is publishing data to the /scan topic with sensor_msgs/LaserScan messages.
However, when I echo the content of the /scan topic with the rostopic echo /scan command, it shows the following data:
seq: 75922
stamp:
secs: 1522051099
nsecs: 302610304
frame_id: laser
angle_min: -1.50330114365
angle_max: 1.49716520309
angle_increment: 0.00613592332229
time_increment: 2.44140628638e-05
scan_time: 0.0250000003725
range_min: 0.019999999553
range_max: 5.59999990463
ranges: [<omitted for readability>]
intensities: []
This output shows that the LIDAR has a minimum range of 0.019999999553 metres. Why such a strange value? Is this due to rounding errors between integers and floats? The same thing goes for other fields like the angle_min and angle_max, which are configured with an angle of -1.5 and 1.5 radians respectively.
I notice a comparable thing with the turtlebot, running in a gazebo simulation on ubuntu 16.0.4.4 with ROS Kinetic Kame, which shows a minimum range of 0.449999988079 (range_min: 0.449999988079).
Could somebody explain what is going on here? Why can't the output of the /scan topic have rounded values?
Like somebody should send a PR to round values to two decimals.