ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I finally solved some of the problems that emerged after adding the ultrasound sensors. Because of the nature of the errors, and the extremely large amount of different hw/sw configurations possible, I will put here my findings, with some more general info, hoping to help others:

  • Double check the UNIT of MEASURE used in the range fields in the microcontroller code. For example, the library and examples I used and referred to had everything in cm.
    This isn't good for ROS navigation layer, the range/distance numbers passed in the messages should be in meters (min_range, max_range, range).
    HOWEVER the microcontroller code could be passing the data, and using some internal calculations or logic, in centimeters (like here 'https://www.intorobotics.com/how-to-use-sensor_msgs-range-ros-for-multiple-sensors-with-rosserial/', for example), so some changes are probably needed (also regarding the logic behind the clearing of the costmap, but that's a problem for another question).
  • A message rate of 20Hz should be ok, it should not produce missing data messages, sync errors, etc. However please note that it's possible this frequency has to be modified, depending on the hardware involved.
  • The costmap YAML parameter clear_on_max_reading behaviour depends on how the data is presented by your ultrasound sensor (or sensors) MCU code. It's a good idea to try both settings and check which one is more appropriate for your case. You can then modify the MCU code to accomodate for the library logic behind this setting (or the other way around, modifying the libraries).
  • Verify that your RVIZ configuration contains all the necessary information to visualize your ultrasound (range) sensor data (http://wiki.ros.org/rviz/DisplayTypes/Range)
  • The URDF usually gives clear messages if something related to the transforms and related data is not working, once the real problems are solved, it's possible to see the cones and axes in Rviz (IF the unit of measure isn't too small!), so it's easy to correct orientation and position errors.
  • Use check_urdf to verify the validity of the URDF file (http://wiki.ros.org/urdf#Verification), and urdf_to_graphiz to have a visual representation with some more data, that could give some clues on malfunctions or errors (http://wiki.ros.org/urdf#Visualization). Also rqt_graph with enable_statistics set to "true" can give useful clues (http://wiki.ros.org/rqt_graph).