Dimensional Inconsistencies in Code and ROS Messages: A Study of 5.9M Lines of Code

John-Paul Ore1, Sebastian Elbaum2, Carrick Detweiler1

  • 1University of Nebraska-Lincoln
  • 2University of Nebraska - Lincoln



10:30 - 12:00 | Mon 25 Sep | Room 223 | MoAT18

Software and Middleware

Full Text


This work presents a study of robot software using the Robot Operating System (ROS), focusing on detecting inconsistencies in physical unit manipulation. We discuss how dimensional analysis, the rules governing how physical quantities are can be combined, can be used to detect inconsistencies in robot software that are otherwise difficult to detect. Using a corpus of ROS software with 5.9M lines of code, we measure the frequency of these dimensional inconsistencies and find them in 6% (211 / 3,484) of repositories that use ROS. We find that the inconsistency type 'Assigning multiple units to a variable' accounts for 75% of inconsistencies in ROS code. We identify the ROS classes and physical units most likely to be involved with dimensional inconsistencies, and find that the ROS Message type geometry_msgs::Twist is involved in over half of all inconsistencies and is used by developers in ways contrary to Twist's intent. We further analyze the frequency of physical units used in ROS programs as a proxy for assessing how developers use ROS, and discuss the practical implications of our results including how to detect and avoid these inconsistencies.

Additional Information

No information added


No videos found