CLI Command: genesys doctor
The genesys doctor command is a diagnostic tool that checks your local environment for common configuration problems that could prevent Genesys or ROS 2 from working correctly.
It's a good first step for troubleshooting your development environment.
Usage
genesys doctor
Checks Performed
The doctor runs the following checks in order.
1. PATH Configuration
This check ensures that you can run genesys and other Python-installed tools from any directory.
- What it does: Verifies that the directory where
pipinstalls command-line scripts is included in your system'sPATHenvironment variable. - How it works: It uses Python's
sysconfig.get_path('scripts')to find the correct local scripts directory for your environment and then checks if that directory is present in theos.environ['PATH']variable. - Why it matters: If this path is missing, you might get a "command not found" error when trying to run
genesysafter installing it. The doctor will provide the exactexportcommand needed to fix this, both for the current session and permanently by adding it to your.bashrcor.zshrcfile.
2. ROS 2 Environment
This check verifies that a ROS 2 distribution has been sourced.
- What it does: Checks if the
ROS_DISTROenvironment variable is set and if the corresponding ROS 2setup.bashscript can be found. - Why it matters: If you haven't sourced a ROS 2 distribution, most
ros2andgenesyscommands will fail because they can't find the core ROS 2 packages.
3. Missing System Dependencies
This check finds and installs missing system dependencies for the packages in your workspace.
- What it does: If run from within a workspace (i.e., a
srcdirectory is present), it will runrosdepto check for any missing system dependencies (e.g.,libopencv-dev) required by the packages insrc/. - How it works: It executes the following command:
rosdep install --from-paths src -y --ignore-src--from-paths src: Tellsrosdepto look at thepackage.xmlfiles of all packages inside thesrcdirectory.-y: Automatically answers "yes" to all prompts from the system's package manager (e.g.,apt-get), installing dependencies non-interactively.--ignore-src: Preventsrosdepfrom trying to resolve the packages in yoursrcdirectory as system packages, which is the correct behavior.
- Why it matters: This ensures that when you run
genesys build, the compilation won't fail due to missing system libraries that your ROS 2 packages depend on.