Skip to main content

ros2inspector doctor

Run read-only diagnostics on the installation and the workspace. Use it first when results look wrong, or as a quick health check in CI.

Usage​

ros2inspector doctor [PATH | -C PATH] [--json]

PATH defaults to the current directory.

Options​

OptionDefaultDescription
-C, --path.Workspace root (same as PATH)
--jsonfalseEmit machine-readable JSON

Checks​

The report starts with the ros2inspector and Python versions, the platform and the cache location, then runs these checks:

CheckFails or warns when
workspace_existsThe path does not exist
workspace_rootNo src/ or install/setup.bash is found above the path, so the path itself is used (a warning)
packagesNo package.xml is found
unparsable_package_xmlA manifest cannot be parsed
duplicate_package_namesTwo manifests declare the same package name
ros_distroROS_DISTRO is not set (a warning: static analysis does not need ROS 2)
offline_visualization_assetThe bundled Cytoscape.js asset for viz is missing
module_*A required module, such as jinja2 or tree_sitter_cpp, cannot be imported
cache_writableThe analysis cache directory cannot be written

Each check reports ok, warn or fail, with a hint when there is something to do. Nothing is modified.

Exit codes​

CodeMeaning
0Every check passed; warnings are informational
1At least one check failed

Examples​

ros2inspector doctor
ros2inspector doctor ~/robot_ws --json | jq '.checks[] | select(.status != "ok")'