ROS2 Debugging Assistant from RAI framework using Python virtual environments
npm install rai-debug-assistantA direct Python-based package for the ROS2 Debugging Assistant from the RAI framework.
- Node.js and npm
- Python 3.8+
- ROS 2 (Humble or later)
``bash`Install globally from npm
npm install -g rai-debug-assistant
bash
Pack the package
cd /path/to/rai-debug-npm
npm pack
Creates rai-debug-assistant-1.1.2.tgz
Install from the tarball
npm install -g ./rai-debug-assistant-1.1.2.tgz
`$3
`bash
Or install directly from the source directory
cd /path/to/rai-debug-npm
npm install -g .
`$3
`bash
Login to npm
npm loginPublish the package
npm publish
Or for scoped packages
npm publish --access public
`NOTE: For security information about API keys, review the SECURITY.md file.
Usage
`bash
Start with API key passed as argument
rai-debug --api-key YOUR_OPENAI_API_KEYStart with API key from environment variable
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
rai-debugInstall required dependencies
rai-debug --install-depsSpecify a different port (default is 8501)
rai-debug --port 8502Debug mode for more verbose output
rai-debug --debug
`If no API key is provided via arguments or environment variables, you will be prompted to enter one.
How It Works
This package:
1. Creates a Python virtual environment in your home directory (~/.rai-debug-assistant/venv)
2. Uses Streamlit to run the debugging assistant in this environment
3. Integrates directly with your local ROS 2 environment
4. Provides a web interface to interact with the assistant
The assistant:
- Shows active ROS 2 nodes, topics, and services in the sidebar
- Allows you to ask questions about your ROS 2 system
- Provides contextual help based on your ROS 2 setup
- Allows direct execution of ROS2 commands from the chat
- Includes tools for inspecting nodes, topics, and services
- Shows command history and execution results
- Displays detailed system information and resource usage
- Auto-detects and suggests ROS2 commands
- Provides a comprehensive dashboard for ROS2 debugging
Troubleshooting
- Missing Python dependencies: Run
rai-debug --install-deps to set up the virtual environment and install all required packages
- "Python not found": Make sure you have Python 3.8+ installed and available in your PATH
- "venv module not found": Install the venv module for your Python version
- "ROS 2 integration not available": Make sure ROS 2 is installed and properly set up in your environment
- "Error initializing ROS commands": Check that you have properly sourced your ROS 2 setup file
- Integration with ROS: Source your ROS 2 environment before running: source /opt/ros/humble/setup.bash && rai-debugOptions
-
-k, --api-key : OpenAI API key
- -p, --port : Port to run the server on (default: 8501)
- -i, --install-deps: Install required Python dependencies
- -d, --debug: Enable debug mode with more verbose output
- -v, --version: Show version
- -h, --help`: Show helpApache-2.0