Editing Without Rebuilding
Thanks to the--symlink-install flag, you can edit certain files without rebuilding the workspace.
Files That Don’t Require Rebuilding
With symlink install, these file types can be edited and changes take effect immediately:.sdfworld files.launch.pylaunch files- Python source files (
.py)
When to Rebuild
Rebuild the workspace when you change:CMakeLists.txtorpackage.xml- C++ source files (
.cpp,.hpp) - Adding new files to a package
- Python entry points in
setup.py - Installing new directories (launch, worlds, config)
Rebuilding the Workspace
Rebuild all packages
Rebuild all packages
Rebuild specific package
Rebuild specific package
Rebuild package and dependencies
Rebuild package and dependencies
Testing Your Changes
Launch the Simulation
The primary test environment is the moon yard simulation:Verify System Behavior
Check that your changes work as expected:Check node status
Check node status
Inspect topics
Inspect topics
Monitor TF frames
Monitor TF frames
Test manual control
Test manual control
Debugging Strategies
ROS 2 Logging
Use ROS logging instead ofprint() statements:
Inspecting Gazebo State
Open visualization
Navigate to https://app.gazebosim.org/visualization
Using Foxglove Studio
For advanced debugging with sensor data visualization:Connect Foxglove Studio
Open Foxglove Studio and connect to
ws://localhost:8765Foxglove is especially useful for debugging camera feeds, LiDAR data, and complex transform trees.
Performance Optimization
Headless Simulation
The simulation runs in headless mode by default to conserve resources. Use visualization tools only when needed:| Tool | When to Use |
|---|---|
| Rviz2 | Debugging sensors and transforms |
| GZ Web | Verifying world geometry and spawning |
| Foxglove | Analyzing sensor data over time |
Resource Management
Kill stuck Gazebo instances
Kill stuck Gazebo instances
Clear Gazebo cache
Clear Gazebo cache
Code Quality Checks
Before submitting a pull request:Python Formatting
Linting
Type Checking
Working with ROS Interfaces
Creating Custom Messages
- Add
.msgfiles tolunabot_interfaces/msg/ - Update
CMakeLists.txtto include the new message - Rebuild the workspace
- Import in Python:
from lunabot_interfaces.msg import YourMessage
Creating Custom Actions
- Add
.actionfiles tolunabot_interfaces/action/ - Update
CMakeLists.txtto include the new action - Rebuild the workspace
- Import in Python:
from lunabot_interfaces.action import YourAction
Multi-Package Development
When working across multiple packages:- Make changes in multiple packages
- Rebuild dependencies first:
colcon build --symlink-install --packages-up-to lunabot_interfaces - Rebuild dependent packages:
colcon build --symlink-install --packages-select lunabot_navigation lunabot_control - Source workspace:
source install/setup.bash - Test integration: Launch the full system
Always rebuild interface packages before rebuilding packages that depend on them.