ROS package search for robot software development: a knowledge graph-based approach

Shuo Wang, Xinjun Mao, Shuo Yang, Menghan Wu, Zhang Zhang

Introduction

The Robot Operating System (ROS) has become the "de facto" standard for robotics, boasting thousands of reusable packages. However, finding the exact package for a specific task—such as "visualize TurtleBot2 in RViz"—is surprisingly difficult. Current tools like the ROS Index, GitHub, and Google rely on syntactic matching (keyword-to-keyword). If a developer searches for "mapping" but a package description uses "SLAM," the search might fail. Furthermore, general-purpose search engines often struggle with the nuances of robotics hardware compatibility, treating different robot versions as identical despite significant software differences.

Methodology

To address these challenges, the authors propose a two-pronged approach: building a structured knowledge base and developing a specialized search algorithm.

The RPKG Pipeline

The construction of the ROS Package Knowledge Graph (RPKG) involves a multi-stage pipeline designed to extract and link information from disparate sources like the ROS Wiki and GitHub repositories.

The RPKG construction and search pipeline, illustrating the flow from data extraction to knowledge representation.

The process extracts features across multiple dimensions using three primary methods:

  • Rule-based extraction: Identifies package categories (e.g., library vs. message package) based on file structures, such as the presence of /msg or /srv folders.
  • Fuzzy matching: Links packages to specific hardware (robots and sensors) using the Levenshtein Distance algorithm against a known vocabulary.
  • NLP-based extraction: Uses Part-of-Speech (POS) tagging to pull "functions" and "characteristics" from unstructured text descriptions.

Knowledge Graph Schema

The resulting RPKG organizes package data into a structured ontology. This structure allows the search engine to understand the context of a package beyond its name or description, mapping it to specific hardware, functions, and categories.

The RPKG ontology schema, defining the relationships between a ROS Package and its multi-dimensional features.

Standard BERT models often fail on robotics jargon (e.g., splitting "rplidar" into meaningless sub-tokens). The authors fine-tuned BERT on a specialized robotics corpus to create BERT-ROS, which generates high-quality semantic embeddings for technical terms. The system then employs a Feature Fusion Search (FFS) algorithm that calculates a weighted similarity score, combining vector similarity for general concepts with fuzzy matching for specific hardware names.

Key Results

Evaluation on a benchmark of 100 subtasks derived from popular ROS tutorials showed that the RPKG-based approach outperformed the ROS Index, GitHub, Google, and ChatGPT. Specifically, it improved search accuracy by at least 21% across various "Top-K" metrics.

A critical insight from the study is that hardware context—specifically "Robot" and "Sensor" features—is the most vital dimension for search. An ablation study revealed that removing these features caused the most significant drop in accuracy, proving that robotics software search is inextricably linked to physical hardware.

Conclusion

By treating a ROS package as a multi-dimensional entity rather than a blob of text, the RPKG framework provides a more "aware" search experience. While Large Language Models (LLMs) like ChatGPT offer impressive semantic reasoning, they lack the grounded "fact-checking" capability provided by a domain-specific Knowledge Graph. Future work will explore hybrid models that combine the reasoning power of LLMs with the structured precision of the RPKG.

Summary updated

BibTeX
@article{wang2023ros,
  author = {Shuo Wang and Xinjun Mao and Shuo Yang and Menghan Wu and Zhang Zhang},
  title = {{ROS package search for robot software development: a knowledge graph-based approach}},
  journal = {Frontiers of Computer Science},
  year = {2023},
}
Figure