Overview
Theverify-setup.sh script provides comprehensive verification and diagnostics for the TurtleBot3 development environment. It checks system components, packages, environment variables, and build status.
Location: .devcontainer/verify-setup.sh
Execution: Manual (run by user when needed)
Runtime: < 10 seconds
Usage
Script structure
Header
set -e - script always runs all tests even if some fail.
Color codes
- Green: Test passed
- Red: Test failed
- Yellow: Warning
- NC: Reset to default
Test function
$1: Description of what’s being tested$2: Command to execute
- Executes command silently
- Displays color-coded result
- Returns 0 for pass, 1 for fail
Test counters
Environment sourcing
Test categories
1. System checks
- ROS2 Jazzy installation
- Gazebo Harmonic installation
- Python 3 availability
- Colcon build tool
2. ROS2 package checks
- TurtleBot3 packages presence
- Navigation2 packages presence
- Cartographer SLAM packages presence
3. Environment variables
ROS_DISTRO: Should be “jazzy” (critical)TURTLEBOT3_MODEL: Should be set (warning if not)GZ_VERSION: Should be “harmonic” (warning if not)
4. Directory structure
- Workspace directory exists
- Source directory exists
- TurtleBot3 source exists
5. Build status
- Build directory exists
- Install directory exists
Results summary
Success output
Failure output
Example output
All tests passing
With failures
Use cases
After first container creation
Verify everything is set up correctly:Troubleshooting issues
When something doesn’t work, run to identify the problem:After making changes
Verify environment is still functional:Documentation or sharing
Capture environment status:Exit codes
The script always exits with code 0, regardless of test results. Check the output for actual status.Customization
To add custom tests, use thetest_command function: