Refresh |
This website docs-old.duckietown.org/daffy/opmanual_duckiebot/draft/dbv2_tof_driver.html is currently offline. Cloudflare\'s Always Online™ shows a snapshot of this web page from the Internet Archive\'s Wayback Machine. To check for the live version, click Refresh. |
DB21
DB21M
DB21
,DB21M
start_gui_tools
, ROS tools and no-vnc
DB17
DB18
DB19
Modified 2020-03-04 by Timothy Scott
The following files are important for the ToF driver:
packages/sensor_suite/src/tof_node.py
: This is the ROS node.packages/sensor_suite/src/tof_calibration_node.py
:
This is used for calibration. See Unit E-4 - Calibration - Time-of-Flight Distance Sensorspackages/sensor_suite/include/sensor_suite/tof_driver/
: Low-level driver Python packagepackages/sensor_suite/config/tof_node/default.yaml
: Default parameters for ROS nodeModified 2020-03-04 by Timothy Scott
At startup, the ToF node will attempt to communicate with ToF sensors on all 8 ports of the front bumper. If it is unable to communicate with any, it will gracefully shut down.
The ROS node reads from the ToF sensors at a regular frequency, as set by the parameter polling_hz
.
It then takes these raw values and adjusts them per the calibration, as described below.
These calibrated values are then published to the ROS topic /duckiebot name/tof_node/tof_N
(one
topic for each sensor).
Modified 2020-03-04 by Timothy Scott
polling_hz
: This is the frequency at which to read data from the ToF sensors and publish it
as a ROS topic. The sensors are limited to 10 Hz.m
: This is the individual scaling factor applied to each sensor, as per the equation below.b
: This is the offset applied to each sensor, as per the equation below.Modified 2020-03-04 by Timothy Scott
The calibration procedure runs as a ROS node. See Unit E-4 - Calibration - Time-of-Flight Distance Sensors for more information on how to launch it.
This node should not be run at the same time as the driver node. It will ask the user to place the Duckiebot in front of some object, and to measure the distance to that object. For each sensor, it will do this twice, at two different distances. Then, it will calculate a scale and offset to apply to each sensor, according to the following formula:
reported_value = scale * measured_value + offset
The scale and offset values are stored in the file
/data/config/calibrations/sensor_suite/tof/duckiebot name.yaml
. On startup, the ToF driver
node will check this file for the parameters m
and b
. If the file or these parameters are not found, the node
will fall back on the values in default.yaml
.