February 2020
Intermediate to advanced
432 pages
10h 50m
English
Adopting the International System of Units (SI) is the ROS convention stated in its specification (https://www.ros.org/reps/rep-0103.html). Since the read() method provides measurements in centimeters, we only have to divide by 100 to obtain the distance in meters and feed this to the system according to the ROS standard:
read_distance = my_sensor.read()/100.0
This value will be inserted afterward into the msg_range object, which we will cover next.
Read now
Unlock full access